History: Mail Queue
Source of version: 15 (current)
Copy to clipboard
{syntax type="markdown" editor="wysiwyg"} # {{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()}{HTML()}<span style="color:grey">(N.B. ''Historical note: Prior to Tiki 12.2 the command was ./__sendmail.php__'')</span>{HTML}{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))