Want to subscribe to topics you're interested in?
Become a Member

Magento Magento Cron jobs are running but order emails are not being sent

Discussion in 'Ecommerce / Shopping cart usage' started by Afaq, Mar 19, 2017.

  1. Afaq

    Afaq Member

    42
    1
    8
    Aug 5, 2015
    Ratings:
    +2
    Local Time:
    12:53 PM
    Here is my setup:
    • INIZ VPS
    • Centmin Mod
    • Magento 1.9.1.0
    My cronjobs are running fine. I have installed AOE Scheduler which says that scheduling and cron heartbeats are working fine. However, my order emails are not being sent. In the 'List View' of AOE Scheduler the message area in front of the 'core_email_queue_send_all' job shows '---RETURN_VALUE--- Mage_Core_Model_Email_Queue'.

    I don't know if that's an error or its normal. Basically, I have no idea why the emails are not being sent despite crons being working fine. I suspect that it might be something related to Centminmod or the server which is not sending the emails. Any help in tracking down the issue will be highly appreciated.
     
  2. eva2000

    eva2000 Administrator Staff Member

    28,989
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,767
    Local Time:
    5:53 PM
    Nginx 1.13.x
    MariaDB 5.5
    Don't use Magento so can't help with specifics.
    • But do you get any server sent emails at all ?
    • Tried some mail tester like Newsletters spam test by mail-tester.com ?
    • Has email ever worked before ? or the problem just started happening ?
    • Does Magento have any mail diagnostic tools you can run ?
    • How is email in Magento configured ? option to use 3rd party smtp servers ?
     
  3. Afaq

    Afaq Member

    42
    1
    8
    Aug 5, 2015
    Ratings:
    +2
    Local Time:
    12:53 PM
    Previously, I was running same Magento installation on OVH and emails were working fine. They havent been working since I shifted to INIZ but I thought it was due to cronjobs but now crons are also working fine.

    I added my email ID in crontab to check errors and I do get those emails so I guess its not server related?

    Magento doesnt have any diagnostic tool.
     
  4. Afaq

    Afaq Member

    42
    1
    8
    Aug 5, 2015
    Ratings:
    +2
    Local Time:
    12:53 PM
    I just checked server's mail logs. This is what they say:

    Code:
    Mar 18 14:39:01 badass sendmail[31988]: v2IEd1lt031988: from=nginx, size=507, cl ass=-60, nrcpts=1, msgid=201703181439.v2IEd1lt031988@badass.domain.com, relay=nginx@localhost
    
    Mar 18 14:39:01 badass sendmail[31988]: v2IEd1lt031988: to=nginx, ctladdr=nginx (1000/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=138507, relay=[1 27.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v2IEd1JN031996 Message accepted for delivery)
    
    Mar 18 14:40:02 badass sendmail[32023]: v2IEe2DH032023: from=nginx, size=507, cl ass=-60, nrcpts=1, msgid=201703181440.v2IEe2DH032023@badass.domain.com, relay=nginx@localhost
    
    Mar 18 14:40:02 badass sendmail[32023]: v2IEe2DH032023: to=nginx, ctladdr=nginx (1000/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=138507, relay=[1 27.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v2IEe2Gl032032 Message accepted for delivery)
    
    Mar 18 14:41:01 badass sendmail[32067]: v2IEf1jQ032067: from=nginx, size=507, cl ass=-60, nrcpts=1, msgid=201703181441.v2IEf1jQ032067@badass.domain.com, relay=nginx@localhost
    
    Mar 18 14:41:01 badass sendmail[32067]: v2IEf1jQ032067: to=nginx, ctladdr=nginx (1000/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=138507, relay=[1 27.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v2IEf109032075 Message accepted for delivery)
    
    Mar 18 14:42:01 badass sendmail[32166]: v2IEg14P032166: from=nginx, size=1261, c lass=-60, nrcpts=1, msgid=201703181442.v2IEg14P032166@badass.domain.com , relay=nginx@localhost
    
    Mar 18 14:42:01 badass sendmail[32166]: v2IEg14P032166: to=nginx, ctladdr=nginx (1000/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=139261, relay=[1 27.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v2IEg1Vo032178 Message accepted for delivery)
    
    Mar 18 14:43:01 badass sendmail[32200]: v2IEh15c032200: from=nginx, size=1261, c lass=-60, nrcpts=1, msgid=201703181443.v2IEh15c032200@badass.domain.com , relay=nginx@localhost
    
    Mar 18 14:43:01 badass sendmail[32200]: v2IEh15c032200: to=nginx, ctladdr=nginx (1000/1001), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=139261, relay=[1 27.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v2IEh1XJ032212 Message accepted for delivery)
    
    It seems like the server is sending emails but the last email was around 24 hours ago. There should have been newer emails.

    And cron log has no recent errors which means crons are running fine:

    Code:
    Feb 14 08:05:01 badass CROND[6191]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode default)
    Feb 14 08:05:01 badass CROND[6192]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode default --excludeGroups groupA,groupB,groupC)
    Feb 14 08:05:01 badass CROND[6194]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode always)
    Feb 14 08:05:01 badass CROND[6193]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode always --includeGroups my_queue_jobs)
    Feb 14 08:05:01 badass CROND[6195]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode always --excludeGroups my_queue_jobs)
    Feb 14 08:05:01 badass CROND[6199]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode default --includeGroups groupC)
    Feb 14 08:05:01 badass CROND[6196]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/bash /home/nginx/domains/domain.com/public/scheduler_cron.sh --mode default --includeGroups groupA,groupB)
    Feb 14 08:05:01 badass CROND[6212]: (root) CMD (! test -e /home/nginx/domains/domain.com/public/maintenance.flag && /bin/sh /home/nginx/domains/domain.com/public/cron.sh)
    Mar 18 15:21:06 badass crond[149]: (CRON) INFO (RANDOM_DELAY will be scaled with factor 46% if used.)
    Mar 18 15:21:06 badass crond[149]: (CRON) INFO (running with inotify support)
    
    Does this mean there is an error on the Magento's end?
     
    Last edited: Mar 19, 2017
  5. eva2000

    eva2000 Administrator Staff Member

    28,989
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,767
    Local Time:
    5:53 PM
    Nginx 1.13.x
    MariaDB 5.5
  6. Afaq

    Afaq Member

    42
    1
    8
    Aug 5, 2015
    Ratings:
    +2
    Local Time:
    12:53 PM
    I have no idea why SendMail is running instead of PostFix. I didnt change anything in the Centmin Mod installation. Can you please guide how can I configure SendMail properly or go back to PostFix?
     
  7. eva2000

    eva2000 Administrator Staff Member

    28,989
    6,579
    113
    May 24, 2014
    Brisbane, Australia
    Ratings:
    +9,767
    Local Time:
    5:53 PM
    Nginx 1.13.x
    MariaDB 5.5