mantisbt:setting_up_mail_queuing
Differences
This shows you the differences between two versions of the page.
| Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
| mantisbt:setting_up_mail_queuing [2008/07/02 02:50] – Added the part about windows task scheduler Ellerbrok | mantisbt:setting_up_mail_queuing [2013/10/04 12:15] (current) – http://www.mantisbt.org/bugs/view.php?id=16450 mahindra | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====== Setting up Mail Queuing ====== | ||
| + | |||
| + | ===== Introduction ===== | ||
| + | |||
| + | Up to Mantis 1.0.x releases, emails were always sent synchronously. | ||
| + | |||
| + | ===== Why email queuing ===== | ||
| + | |||
| + | * Flaky Email Servers: Sometimes email servers go down, this used to cause an error message to be prompted to the user and the notification to be lost. With email queueing the messages remain in the queue until they are sent successfully. | ||
| + | * Bad configuration: | ||
| + | * Performance: | ||
| + | * Different users may have different access levels and hence see different portions of the data. | ||
| + | * Different users may have different language preference and hence need to get the emails in their preferred language. | ||
| + | * Email addresses of users must not be disclosed (this can be achieved through bcc, but if emails are only sent to bcc, sometimes anti-spam don't like it). | ||
| + | |||
| + | ===== Requirements ===== | ||
| + | |||
| + | The requirements to this feature were: | ||
| + | |||
| + | * Improve performance by queuing emails and send them at a later time. | ||
| + | * Provide a script can be executed from a cronjob to send the queued emails. | ||
| + | * If email notifications fail, they should remain in the queue and must not be lost. | ||
| + | * Emails targetted to invalid addresses must not be kept in the queue. | ||
| + | * By default, the old behaviour for handling emails should be kept. Hence, users must configure queuing, otherwise all messages will be sent synchronously. | ||
| + | |||
| + | ===== Configuring Queuing ===== | ||
| + | |||
| + | * Set ' | ||
| + | |||
| + | |||
| + | |||
| + | ===== Sending the Emails ===== | ||
| + | |||
| + | Now that the emails are queued, we need to run the ' | ||
| + | |||
| + | Following is the command line we need to execute: | ||
| + | < | ||
| + | php / | ||
| + | </ | ||
| + | |||
| + | Following are the settings that determine how often it the script should run. In this case it's every minute: | ||
| + | < | ||
| + | Minute = *, Hour = *, Day = *, Month = *, Weekday = * | ||
| + | </ | ||
| + | |||
| + | For hosted environments offering cPanel, the above information will be set after clicking "Cron jobs", " | ||
| + | |||
| + | In shared environments that supports cron jobs only with lynx, the check " | ||
| + | Bearing in mind that this change basically allows anyone knowing the URL to execute the script, which could potentially lead to DOS attacks move the script to a non-standard location | ||
| + | or try to secure it so it can externally eg only be run from localhost or with .htaccess parameters. | ||
| + | |||
| + | ===== Using the Windows Task Scheduler ===== | ||
| + | |||
| + | Using the windows task scheduler is just as easy as using cron jobs. Just add a new task that is executing < | ||
| + | |||
| + | |||
| + | |||
| + | ===== Questions ===== | ||
| + | |||
| + | Please add any comments or questions in this sections. | ||
| + | |||
