ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Sendmail / PHP Mail Problem

August 31, 2011 11:11am

Subscribe [2]
  • #1 / Aug 31, 2011 11:11am

    Bluebloc

    111 posts

    Hiya

    I’m having an issue sending any mails from EE (notification, communicate etc.)

    The problem is that the any attempt to send notification / communicate emails takes at least 2 minutes to submit be it in a Safecracker form or the Communicate tab.

    This is happening with both PHP Mail and Sendmail. The emails are eventually sent but the Safecracker form does not submit until after the emails sent. The delay is close to 2 mins.

    Any ideas what I can do to stop this? I have checked our server firewall and port 113 is open to traffic.

    I have also setup debugging and get the following responses:

    Loading Time: Base Classes 0.0107
    Total Execution Time     120.1473
    Controller Execution Time ( Tools Communicate / Send Email )    120.1368

    Thanks for any pointers / help you might have.

  • #2 / Aug 31, 2011 10:54pm

    Dan Decker

    7338 posts

    Bluebloc,

    A couple of things come to mind. First, have you been in contact with your hosting provider about this? They may have some rules in effect that could be causing this. Second, is this process generating a large number of emails or only a few?

    Cheers,

  • #3 / Sep 01, 2011 6:40am

    Bluebloc

    111 posts

    Hiya Dan,

    I’m just started running my own dedicated server so I asked myself those questions and finally found the answer. It should hopefully help out anyone who has the same issue on a linux server.

    Cause: sendmail always waits for 60+ seconds when your hostname is not a FQHN (fully qualified host name). In my case, it was simply Ubuntu-1004-lucid-64-minimal. Sendmail will asume a temporary DNS lookup failure and try again (while actually sending out the mail, strangely enough).

    Solution:
    * first, in /etc/hostname, change your hostname from whatever to a FQDN like whatever.one-of-your-hosted-domain-names.com
    * then, in /etc/hosts, add a host entry like:

    99.123.45.67 whatever.mysite.com

    Reboot and try to send a mail to yourself again. Sendmail wil not delay at all.
    Thank you, googleweb.

  • #4 / Sep 01, 2011 11:06pm

    Dan Decker

    7338 posts

    Bluebloc,

    Thank you for sharing your solution, it will surely help others if they encounter this issue 😊

    Thank you for using ExpressionEngine and let us know if we can be of assistance in the future.

    Cheers!

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases