Loading...
 
Skip to main content

History: Mail Queue

Source of version: 14 (current)

Copy to clipboard
            ! {{page}}
Since ((Tiki10)) there is a feature to place all notification email messages in a queue, and send all those emails periodically through a ((Cron)) job using ./__console.php__ script with __mail-queue:send__ parameter. See also ((Console))

{SUB()}~~grey:(N.B. ''Historical note: Prior to Tiki 12.2 the command was ./__sendmail.php__'')~~{SUB}

This requires setting up mail delivery with a SMTP server instead of just sendmail, and set it to use a Queue.

{maketoc title="" levels="2,3"}

!! Settings

See __Admin home > General > General Preferences > Mail__

In some servers (email accounts set up with ((ISPConfig)) standard options), this is known to work with:
* Authentication __PLAIN__
* Security: __TLS__ 
* Port: __587__
* Local server name: __server.example.com__ 
+ (i.e., the real Fully Qualified Domain Name of the server, which is not the same as the mailname, which could be example.com or mail.example.com, or the smtp server, which usually is smtp.example.com).

{img src="display1081" link="display1081" width="600" rel="box[g]" imalign="center" desc="Click to expand" align="center" styleimage="border"}

!! Temporary storage
The messages temporarily sent to the smtp queue are stored in tiki database table __tiki_mail_queue__, which has these 3 fields:
* messageId
* message
* attempts

!! Cron
Example of cron job in a linux box, for site1.example.com on a ((Multitiki)) instance at directory __/var/www/tiki__, that will send emails from the queue every 5 minutes starting at minute 2 of each hour (see ((Console)) and ((Cron)) for more details):
{CODE(colors="shell", ln="1")}
2,7,12,17,22,27,32,37,42,47,52,57 * * * * cd /var/www/tiki/;php console.php mail-queue:send --site=site1.example.com > /dev/null 2>&1
{CODE}


Alias names of this page:
(alias(Queue)) | (alias(Email Queue)) | (alias(E-mail Queue))  | (alias(EmailQueue)) | (alias(E-mailQueue)) | (alias(MailQueue))