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.

What is the path that ee uses to sendmail via communicate function

November 15, 2008 8:41am

Subscribe [2]
  • #1 / Nov 15, 2008 8:41am

    Capt.Mike

    69 posts

    Hi folks,
    I am trying to trouble shoot in order to find out why I can not get sendmail to work in ee.
    I am trying to work with Media Temple support and my Media Temple DV account with Plesk control panel. They first suggest I verify the following:

    Can some one verify the path that ee uses is /usr/sbin/sendmail

    Thanks and have a GREAT day!

  • #2 / Nov 15, 2008 11:24am

    Derek Jones

    7561 posts

    Yes, if sendmail is selected, /usr/sbin/sendmail is the path used.  When you try to use it, with Email Debugging turned on, what error messages do you receive?

  • #3 / Nov 15, 2008 12:09pm

    Capt.Mike

    69 posts

    No error messages. Reports mail sent successfully. It is never received. phpmail works fine.

    I suspect this is an issue with MT, sendmail and plesk. Just trying to narrow it down to make their techs happy.

  • #4 / Nov 15, 2008 12:27pm

    Derek Jones

    7561 posts

    If it’s reporting as sent, that means that the server has accepted the handoff from ExpressionEngine, at which point it’s out of EE’s hands.  The host should really be able to provide you with more detailed information on the failure by examining their logs.  May I ask which version of ExpressionEngine you are using?

  • #5 / Nov 15, 2008 12:31pm

    Capt.Mike

    69 posts

    1.6.5 ... havent upgraded to 1.6.6 yet.

  • #6 / Nov 15, 2008 12:48pm

    Derek Jones

    7561 posts

    No changes to sendmail were made between those two versions, so you’re good there.  I’d inspect the server logs and see what’s happening after EE hands the email off to sendmail.

  • #7 / Nov 15, 2008 5:06pm

    Capt.Mike

    69 posts

    When I try to send using smtp I get the following error:
    Debugging Message
    220 realestatefanatics.com ESMTP

    hello: 250-realestatefanatics.com
    250-AUTH=LOGIN CRAM-MD5 PLAIN
    250-AUTH LOGIN CRAM-MD5 PLAIN
    250-STARTTLS
    250-PIPELINING
    250 8BITMIME
    from: 250 ok
    to: 250 ok
    to: 250 ok
    data: 354 go ahead
    451 See http://pobox.com/~djb/docs/smtplf.html.
    Failed to send SMTP email. Error: 451 See http://pobox.com/~djb/docs/smtplf.html.
    Unable to send email using SMTP

  • #8 / Nov 15, 2008 5:33pm

    Derek Jones

    7561 posts

    Well, SMTP is going to go through different systems than sendmail would, but the error message indicates that this SMTP server is using qmail, and you might have success by opening /system/core/core.email.php and changing both $newline and $crlf to “\r\n”.

  • #9 / Nov 16, 2008 10:23am

    Capt.Mike

    69 posts

    Following is the kind and thoughtful reply I got from an MT tech with regard to my inability to get sendmail to work in EE;

    Mike,

    I am sorry but this script is too complex for me to trouble shoot any further.  I am not sure why it would not work but throw no error when being sent through sent mail.  I can find nothing in the error logs that might explain what is going on.

    One interesting thing you should know is that php’s mail function also uses sendmail.  The path is set in the php.ini file. So, the issue is actually not with Sendmail itself but with how the script is using it through the “sendmail mode”. Although no error is generated it really does look like the email is never reaching the outgoing mail server.

    In the maillogs,  when an email is generated by a script the mail log will show the user that started the email was Apache.  Going through your mail logs I can see 2 instances of this today.  This would seem to imply that only twice did a script running on a website hosted on your server successfully generate an email and send it to your mail server to be delivered. Since it did work that means the general functionality of sendmail is working.

    Those two times he is referring to were when I used phpmail.

    Any ideas?
    Have a GREAT day!

  • #10 / Nov 16, 2008 1:49pm

    Greg Aker

    6022 posts

    Capt.Mike,

    Have you tried Derek’s suggestion on making the changes in core.email.php?

    -greg

  • #11 / Nov 16, 2008 5:14pm

    Capt.Mike

    69 posts

    Derek’s suggestion was with regard to smtp mail not sendmail.

  • #12 / Nov 16, 2008 6:06pm

    Derek Jones

    7561 posts

    It might be a factor with sendmail as well, Capt. Mike.  Please give it a try.  Does the host have a working script (in any scripting language) of how to use sendmail on their servers?  I can modify the core email class for you to attempt to retrieve a console error, but via popen() in PHP it’s not very reliable, so other options should be exhausted first.

  • #13 / Nov 17, 2008 10:19am

    Capt.Mike

    69 posts

    Making the following change resolved the smtp issue.

    opening /system/core/core.email.php and changing both $newline and $crlf to ā€œ\r\nā€.

    Thank you very much.

    However, when sending using sendmail it still reports mail sent successfully with no errors reported however, the email is never received at the destination email addresses.

    I have requested from MT support an example script, preferably in php that they know works on their dv hosting accounts.

    Thanks for you help and patience with this you guys.

  • #14 / Nov 17, 2008 12:40pm

    Derek Jones

    7561 posts

    Ok, let’s see if we can gain a proper status message.  Open core.email.php and on line 1308 replace:

    pclose($fp) >> 8 & 0xFF;

    With:

    $status = pclose($fp);
    
    if (version_compare(PHP_VERSION, '4.2.3') == -1)
    {
        $status = $status >> 8 & 0xFF;
    }
    
    $this->add_error_message('Status: '.$status.'.');
    
    if ($status == 0)
    {
        if ($this->get_debug())
        {
            $this->add_error_message("Unable to open a socket to Sendmail. Please check settings.");
        }
    
        return FALSE;
    }

    And then try to send an email from the Communicate page with Sendmail, and Email Debugging enabled.  Success or fail, the status message will hopefully give us a pointer towards the problem.

  • #15 / Nov 17, 2008 1:06pm

    Capt.Mike

    69 posts

    Derek,
    in my text editor(Crimson Editor) for ee 1.6.5 core.email.php the line with those values is in the /**  Send using Sendmail section and is line 1236. It reads;

          pclose($fp) >> 8 & 0xFF;

    Is that the correct line that you want me to change?

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

ExpressionEngine News!

#eecms, #events, #releases