We build. You grow.

Get best community software here

Start a social network, a fan-site, an education project with oxwall - free opensource community software

Delay in mail delivery | Forum

Topic location: Forum home » Support » General Questions
Heri Bender
Heri Bender Oct 31 '14
Why does it sometimes last up to 10 minutes until a new mail is sent to the smtp server? (not always, sometimes it is less than 1 min)


My CRON runs reliably every minute. The mail is waiting in the table ow_base_mail. When it is fetched from there (who fetches it? the CRON job?) it arrives nearly immediatly in my inbox.


What can I do in order to accelerate the mail delivery?

oxwall 1.71

ross Team
ross Nov 2 '14
It totally depends on the mail server then. Probably too many mails in the queue which is why there's a delay. Sometimes it also depends on the mail agent you use to receive e-mails. You need to contact your hosting provider to resolve your issue. 
Heri Bender
Heri Bender Nov 3 '14
No, it definitely depends on oxwalls behaviour. Since all this happens in my locally installed ubuntu VM I can watch (nearly) everything. 


A side note to the term "mail server": I assume you mean th MTA (= MailTransportAgent = Postfix in my case). This is the SMTP-service which must be configured within the mail client MUA (= MailUserAgent = Oxwall in our case). 


I can watch that the mail does not leave oxwall during the delay, although the CRON fired several times in the meantime (watched with syslog). The mail remains sitting in the DB table ow_base_mail (watched with MySQL-Workbench). When it finally gets delivered, three things happen nearly at the same time: 

1. CRON job has fired2. The entry disappears from the DB3. The MTA receives the mail, delivers it to the MDA (MailDeliveryAgent) which delivers it to my inbox (watched by maillog, and my standard mail client thunderbird makes 'pling')This behaviour is what is expected already at the first CRON job firing.

ross Team
ross Nov 4 '14
Heri, as soon as the mail entry goes out of the ow_base_mail we are not responsible how fast it's being delivered. Now it's up to the rest of the your server software to do the work. 
Durlabh Ashok
Durlabh Ashok Nov 4 '14
+1 Ross, Heri Bender I Totally Agree with Ross!
Heri Bender
Heri Bender Nov 8 '14
Please read the messages carefully. The mail does NOT leave ow_base_mail during the watched delay. As soon as it leaves the oxwall DB it lasts less than one second until it arrives in my Thunderbird client. So I am sure my mail delivery system on the server is well configured and healthy.

Why does the mail stay that long time in ow_base_mail although CRON fires several times?

tammy harris
tammy harris Nov 8 '14
test by manual run cron in browser  www.yoursite.com/0w_cron/run.php
see if a manual run pushes it out of db 
Heri Bender
Heri Bender Nov 8 '14
No it does not. I sent an invitation to heri@lamp.vm. During about 5 minutes the mail stays in the DB and gets then delivered.


 This is the output of my syslog over the last two minutes before the mail gets delivered:


Nov  8 12:16:01 ubuntu CRON[27397]: (www-data) CMD (  curl http://192.168.99.1/oxwall/ow_cron/run.php)Nov  8 12:16:01 ubuntu CRON[27398]: (www-data) CMD (  curl http://192.168.99.1/oxwall17/ow_cron/run.php)Nov  8 12:16:01 ubuntu postfix/pickup[26971]: B25CC86997: uid=33 from=<www-data>Nov  8 12:16:01 ubuntu postfix/cleanup[26972]: B25CC86997: message-id=<20141108111601.B25CC86997@ubuntu>Nov  8 12:16:01 ubuntu postfix/qmgr[1067]: B25CC86997: from=<www-data@ubuntu>, size=876, nrcpt=1 (queue active)Nov  8 12:16:01 ubuntu postfix/local[26973]: B25CC86997: to=<www-data@ubuntu>, orig_to=<www-data>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)Nov  8 12:16:01 ubuntu postfix/qmgr[1067]: B25CC86997: removedNov  8 12:16:01 ubuntu postfix/pickup[26971]: B533886997: uid=33 from=<www-data>Nov  8 12:16:01 ubuntu postfix/cleanup[26974]: B533886997: message-id=<20141108111601.B533886997@ubuntu>Nov  8 12:16:01 ubuntu postfix/qmgr[1067]: B533886997: from=<www-data@ubuntu>, size=878, nrcpt=1 (queue active)Nov  8 12:16:01 ubuntu postfix/local[26975]: B533886997: to=<www-data@ubuntu>, orig_to=<www-data>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)Nov  8 12:16:01 ubuntu postfix/qmgr[1067]: B533886997: removedNov  8 12:17:01 ubuntu CRON[27410]: (www-data) CMD (  curl http://192.168.99.1/oxwall/ow_cron/run.php)Nov  8 12:17:01 ubuntu CRON[27411]: (www-data) CMD (  curl http://192.168.99.1/oxwall17/ow_cron/run.php)Nov  8 12:17:01 ubuntu postfix/pickup[26971]: D5B9186997: uid=33 from=<www-data>Nov  8 12:17:01 ubuntu postfix/cleanup[26972]: D5B9186997: message-id=<20141108111701.D5B9186997@ubuntu>Nov  8 12:17:01 ubuntu postfix/qmgr[1067]: D5B9186997: from=<www-data@ubuntu>, size=878, nrcpt=1 (queue active)Nov  8 12:17:01 ubuntu postfix/local[26973]: D5B9186997: to=<www-data@ubuntu>, orig_to=<www-data>, relay=local, delay=0.02, delays=0.02/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)Nov  8 12:17:01 ubuntu postfix/qmgr[1067]: D5B9186997: removedNov  8 12:17:02 ubuntu postfix/smtpd[27417]: connect from localhost[::1]Nov  8 12:17:02 ubuntu postfix/smtpd[27417]: 51C4F85CA7: client=localhost[::1], sasl_method=LOGIN, sasl_username=heriNov  8 12:17:02 ubuntu postfix/cleanup[26974]: 51C4F85CA7: message-id=<cef301fb57359087fd640e67a9005f12@192.168.99.1>Nov  8 12:17:02 ubuntu postfix/qmgr[1067]: 51C4F85CA7: from=<oxwall-admin@lamp.vm>, size=1187, nrcpt=1 (queue active)Nov  8 12:17:02 ubuntu postfix/smtpd[27417]: disconnect from localhost[::1]Nov  8 12:17:02 ubuntu postfix/local[26975]: 51C4F85CA7: to=<heri@lamp.vm>, relay=local, delay=0.09, delays=0.07/0/0/0.03, dsn=2.0.0, status=sent (delivered to mailbox)Nov  8 12:17:02 ubuntu postfix/qmgr[1067]: 51C4F85CA7: removedNov  8 12:17:02 ubuntu postfix/pickup[26971]: 6718C86997: uid=33 from=<www-data>Nov  8 12:17:02 ubuntu postfix/cleanup[26972]: 6718C86997: message-id=<20141108111702.6718C86997@ubuntu>Nov  8 12:17:02 ubuntu postfix/qmgr[1067]: 6718C86997: from=<www-data@ubuntu>, size=955, nrcpt=1 (queue active)Nov  8 12:17:02 ubuntu postfix/local[26973]: 6718C86997: to=<www-data@ubuntu>, orig_to=<www-data>, relay=local, delay=0.01, delays=0/0/0/0, dsn=2.0.0, status=sent (delivered to mailbox)Nov  8 12:17:02 ubuntu postfix/qmgr[1067]: 6718C86997: removedNov  8 12:17:14 ubuntu dovecot: imap-login: Login: user=<heri>, method=PLAIN, rip=192.168.99.110, lip=192.168.99.1, mpid=27426, TLS, session=<FgJYElcHWgDAqGNu>


The CRON fired two times (seen in lines with "ubuntu CRON". Note that I have two instances running, oxwall and oxwall17). The following lines show that the MTA postfix is triggered in some way by www-data, which is the system user under whose account my apache instance runs. The first lines of postfix entries do not remarkably differ from run to run. At timestamp 12:17:02 my mail client logs in and fetches the mail to heri@lamp.vm.


During the delay the CRON has fired about five times, and I have manually triggered it through browser three times. 

The Forum post is edited by Heri Bender Nov 8 '14
ross Team
ross Nov 10 '14
You can change this 5 minute period in ow_system_plugins/base/cron.php


line 37: 

$this->addJob('mailQueueProcess', 5);


Also, it does not matter how often you run the cron manually, it still will run in one minute and it will be triggered by your server crond. 

Heri Bender
Heri Bender Nov 13 '14
Oh, thank you. That did it. Now I have a maximal delay of 1:59 (Cron-Job interval plus the hard-coded interval in cron.php).


I think, these values should be configurable. Because I do not like changing source files which will be overridden at next product update. Where can I put a ticket for doing this?

ross Team
ross Nov 13 '14
Heri, we did that for a reason. As some hosting providers have limits, in order to prevent spam mailing. And they limit the mailing to 200 mails per hour. But it's not the main reason. We did that to take the load off the server as the methods for collecting, queuing, sending and deleting messages from and to database are resource-consuming;and we want to make sure our software works properly both on the shared and vps/dedicated servers. 
Bernd Eckenfels
Bernd Eckenfels Aug 5 '15
I think processing the mail queue less often does not prevent you from exceeding limits (in fact it generates bigger bursts) and it does not reduce impact of mail processing on the overall infrastructure.

I prefer to even out such work. But I guess most sites wont have so many users anyway and the others can tune the settings to their likes (unfortunatelly not in the local config, so it requires always custom modifications...)

Greetings
Bernd
tammy harris
tammy harris Aug 6 '15
maybe oxwall needs a hosting tick box thing in admin
tick shared hosting
tick dedicated hosting 
that changes this mail setting and maybe a few other things 
Heri Bender
Heri Bender Aug 6 '15
Why not simply a integer configuration value "MailSendInterval"?
Taissa Team
Taissa Aug 7 '15
Guys, thank you for this ideas for improvement. For these goals we use our suggest board to show our product designers what features are the most essential.
It would be better if you make a suggestion on uservoice: http://oxwall.uservoice.com/forums/13756-ideas-for-oxwall.

Heri Bender
Heri Bender Aug 12 '15
Thanks Bernd. I voted up.
The Forum post is edited by Heri Bender Aug 12 '15