email delivery problem

I'm having trouble getting email delivered to my gmail and yahoo accounts using both elgg 2.3.10 and 3. I've used the test script from http://learn.elgg.org/en/2.0/appendix/faqs.html#missing-email and it gets through to my gmail and yahoo accounts but my elgg site emails don't. I'm using a godaddy vps which has to use a relay server to forward the emails. My mta gets them to the relay and they are accepted but disappear after that. Any suggestions would be greatly appreciated!

test script email that makes it through (user names are obfuscated):

Delivered-To: xxxxxxx@gmail.com
Received: by 2002:a4a:dd0e:0:0:0:0:0 with SMTP id m14csp220547oou;
        Sun, 24 Feb 2019 15:17:17 -0800 (PST)
X-Google-Smtp-Source: AHgI3IbsKgCJAc7nB6gNHq0kTV4kjRfnmyixi84kfAmCpP2mgvf/SBx4Bu6g7TbWmmt82y7kPYCG
X-Received: by 2002:a24:7649:: with SMTP id z70mr7389063itb.63.1551050237159;
        Sun, 24 Feb 2019 15:17:17 -0800 (PST)
ARC-Seal: i=1; a=rsa-sha256; t=1551050237; cv=none;
        d=google.com; s=arc-20160816;
        b=CKtNkWOMi2Gr7f47m2YjdxjmcDXw1LH6XVZVWNGNJX+eZTlaRnZY1LiuvLZSlnoSn0
         MwtrFk9aTwf6DhqGBMYhrYX2y/t83M0swQ2O/oxhY7XyZKEnHbRo3brr6nzijuglqCoL
         gFFY5PVAixjFPEAM+i3YWEen3rRTjWdfJvdRuP4k5Qj/E9KDRkqIefUuwJSfTih6bhM3
         Vk2flHECDbXv1pHWuSuHI472E+RrRlaYvHyNnyJNQMzg5wrYo6UMo7l2o0UDYom9243R
         uISkhvAWgS1I+QjfSxrx/GDOZLP9BQSrRoObcUFQldp/L8Bm2CbOPTnUQ98FLesM3eLg
         8r2g==
ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816;
        h=date:from:message-id:subject:to;
        bh=JVXUwOv9C7xKdZO+Q/bxEz/Wc0HAJfVyvlxzanRcq9w=;
        b=MekuY9puEA61xzaKO3Qd2qTwkSA/QCtH3XUUk+37W3O+OZU1AF3qcG7zZT1Yj4YcbU
         jMv23eEZL6ybu5OnnzRQ4Q946ud0CVE9HyW81qxTQTFxMObMnWCNZJITiHFzkTZVDebz
         MX8JKCSUg1yJnRHp60Vy9btMrDnQTNqNjMbkpcE62J0lezXbvug9ueObCDcKvxAr2YN9
         rxYHDxHKS8xx/AMDYUhHF7HNwpZs6XVfWz6SuZzHqFcjkszoSMG/+CGWB/hHSrPZUCVp
         s8LpT/FB4Ao5B7gjcf4+jglzq9CGsbEmOpxhe6hHWCjHzQicpTkvJGXgV3LdboFHGsoY
         do5A==
ARC-Authentication-Results: i=1; mx.google.com;
       spf=pass (google.com: best guess record for domain of xxxxxxxxx@s132-148-150-34.secureserver.net designates 208.109.80.53 as permitted sender) smtp.mailfrom=xxxxxxxxx@s132-148-150-34.secureserver.net;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=secureserver.net
Return-Path: <xxxxxxxxx@s132-148-150-34.secureserver.net>
Received: from p3plsmtpout003.prod.phx3.secureserver.net (p3plsmtpout003.prod.phx3.secureserver.net. [208.109.80.53])
        by mx.google.com with ESMTPS id o10si3470804ito.45.2019.02.24.15.17.16
        for <xxxxxxx@gmail.com>
        (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
        Sun, 24 Feb 2019 15:17:16 -0800 (PST)
Received-SPF: pass (google.com: best guess record for domain of xxxxxxxxx@s132-148-150-34.secureserver.net designates 208.109.80.53 as permitted sender) client-ip=208.109.80.53;
Authentication-Results: mx.google.com;
       spf=pass (google.com: best guess record for domain of xxxxxxxxx@s132-148-150-34.secureserver.net designates 208.109.80.53 as permitted sender) smtp.mailfrom=xxxxxxxxx@s132-148-150-34.secureserver.net;
       dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=secureserver.net
Received: from s132-148-150-34.secureserver.net ([132.148.150.34]) by : HOSTING RELAY : with ESMTP id y30JgzJsvEdBdy30Jgu6UT; Sun, 24 Feb 2019 16:16:15 -0700
x-originating-ip: 132.148.150.34
Received: from xxxxxxxxx by s132-148-150-34.secureserver.net with local (Exim 4.91) (envelope-from <xxxxxxxxx@s132-148-150-34.secureserver.net>) id 1gy30E-0001cX-0G for xxxxxxx@gmail.com; Sun, 24 Feb 2019 18:16:10 -0500
To: xxxxxxx@gmail.com
Subject: Test email.
X-PHP-Script: thenudeme.com/test_email.php for 199.16.223.149
X-PHP-Originating-Script: 501:test_email.php
Message-Id: <E1gy30E-0001cX-0G@s132-148-150-34.secureserver.net>
From: xxxxxxxxx@s132-148-150-34.secureserver.net
Date: Sun, 24 Feb 2019 18:16:10 -0500
X-CMAE-Envelope: MS4wfK5ZlFkfaA6DnbB+mTm+CrX0xmbGiRwPPOXZXyXMnftKDbqcS8xvhdbH6L1OAneq+/aALHWyRPZWal7EhacRoUpJ4GopmoqUzVk7ih2C2DckeUGhGHBv hexdJbr2DsOiEgURS+acXBBQXfH3+rl71ygcJRv8bvBBRtdgk6PlexPDlmLG05cLE/dDUZLZmd2nJgkNHdXEQC8na5sAJyh/Jb4ilWF2odPTlRVrSMYhZYzQ

If you can read this, your email is working.


test script log from my server:

2019-02-24 18:16:10 cwd=/home/thenudeme/public_html 3 args: /usr/sbin/sendmail -t -i
2019-02-24 18:16:10 1gy30E-0001cX-0G <= xxxxxxxxx@s132-148-150-34.secureserver.net U=xxxxxxxxx P=local S=571 T="Test email." for xxxxxxx@gmail.com
2019-02-24 18:16:10 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1gy30E-0001cX-0G
2019-02-24 18:16:15 1gy30E-0001cX-0G => xxxxxxx@gmail.com R=send_to_smart_host T=remote_smtp H=dedrelay.secureserver.net [208.109.80.54] C="250 2.0.0 y30JgzJsvEdBd mail accepted for delivery"
2019-02-24 18:16:15 1gy30E-0001cX-0G Completed
2019-02-24 18:21:16 SMTP connection from [127.0.0.1]:53518 (TCP/IP connection count = 1)
2019-02-24 18:21:16 SMTP connection from (localhost) [127.0.0.1]:53518 closed by QUIT


log from elgg sending email that doesn't get received by gmail:

2019-02-24 18:31:51 cwd=/home/thenudeme/public_html 4 args: /usr/sbin/sendmail -t -i -fxxxxxxx@thenudeme.com
2019-02-24 18:31:51 1gy3FP-0001gk-Tf <= xxxxxxx@thenudeme.com U=thenudeme P=local S=1027 id=/.entity.42.1551051111.8929@www.thenudeme.com T="Test please confirm your email address for The Nude Me!" for xxxxxxx@gmail.com
2019-02-24 18:31:51 cwd=/var/spool/exim 3 args: /usr/sbin/exim -Mc 1gy3FP-0001gk-Tf
2019-02-24 18:31:57 1gy3FP-0001gk-Tf => xxxxxxx@gmail.com R=send_to_smart_host T=remote_smtp H=dedrelay.secureserver.net [208.109.80.54] C="250 2.0.0 y3FVgzSO1EdBd mail accepted for delivery"
2019-02-24 18:31:57 1gy3FP-0001gk-Tf Completed

  • In elgg-config/settings.php there's the config option $CONFIG->broken_mta. You could try if it works with setting it to true. But I'm not sure it helps. As you say yourself, the MTA on your server seems to forward the mails correctly to the relay server. So, the problem might be rather a config issue on the relay server or restrictions regarding the from email address allowed.

    Looking at the log I think you do the test wth a @gmail email address while the emails sent from the Elgg site are NOT from a @gmail address (site email apparently is not a gmail address). I would think the problem is that the relay server (google/gmail?) is not accepting to forward any non-gmail addresses. I don't know if you could change this in the gmail account settings. The other options would be to use a gmail address as site email address which might then be accepted with regards forwarding the mails on the replay server. Or try getting a proper mail server set up on your VPS that doesn't require the relay server but sends the mails directly. Last option would be using a plugin that would send mails from Elgg via SMTP. Unfortunately, there might not be a plugin available that works on Elgg 2.x versions of Elgg (the existing plugins like https://elgg.org/plugins/2420835 and https://elgg.org/plugins/384769 haven't been updated since quite a long time). Maybe https://elgg.org/plugins/709492 also has the functionality of sending mails via SMTP included but that would be something you have to try yourself.

  • Thank you for the reply. Setting broken_mta=true didn't help and godaddy requires using a relay for all outbound mail. I have set up an account with sendgrid so I'll see if I can't get a plugin to work with that. Thank you.

  • So, because I know soooo many people suffer from this I thought I'd share that progress has been made. I have successfully set up sendgrid to relay my emails from my godaddy vps to my gmail test addresses. However, they are deposited into the spam folder and my yahoo tests don't show up at all. I've setup spf, dkim, and dmarc in my dns to hopefully make it to the inbox but even that doesn't seem to be working - still in gmail spam folder and no sign of emails in yahoo. I figure I need to make my emails CAN-SPAM compliant which means I'll need to alter the information sent in them. Can someone point me in the direction of what I need to do to accomplish this? I don't see a plugin for 2.x and I would prefer to use 3 as this is just a hobby site.

  • Have you tried to add your domain to Postmaster ?

  • If you get the mails at least in the spam folder of gmail check the full email header to find out why it got marked as spam. With some luck the reason is noted in the header. I have to admit I can't completely comprehend the problem not knowing about what setup is necessary to be able to send mails from a godaddy VPS instead of just using the an on-server MTA like any VPS on any other webhoster would probably offer. Maybe the problem with all the validation methods (SPF etc.) not working is that the email address domain (FROM) does not match the domain sending the mail violating the origin policy. Or the IP address of the sending server is just blacklisted (check for example at spamhaus) as this seems not unusual for IP addresses used by godaddy...

  • Thanks for the suggestion RvR, looks very helpful. It still seems odd that I was able to use the test_email.php script and the email could go through godaddy's relay and land in my inbox while the emails constructed by elgg ended up not being delivered at all. I just ran the script again through sendgrid and the test script email landed in spam. There are so many variables with this email stuff but I'm learning alot and determined to get this working. Next stop - Postmaster Tools...

  • My servers are currently struggling with this same exact Elgg user verification email sending problem on Goddady...

    If you can give some more details on your solution then please share that info.

    Let me try sorting through these posts for any and all potential answers.

     

  • Posting some current research information:

    PHPMailer: https://elgg.org/plugins/781631

    Features

    • SMTP support - including authentication and SSL
    • HTML email
    • File attachments
    • BCCs
    • Additional functionality is easy to add using PHPmailer class

    Summary: This plugin has the option to override the default elgg email notification handler and email sending code with PHPMailer. It currently provides support for using the php mail function or a smtp server. See the included readme.txt for more information.

    Thanks for being part of GoDaddy Community! The following PHP settings should help you begin to send emails. Our SMTP server doesn't currently support SSL, so you won't be able to use the port you're trying to use. You'll also have to specify a different host:

    $mail->Host       = "relay-hosting.secureserver.net";
    $mail->Port       = 25;                   
    $mail->SMTPDebug  = 0;
    $mail->SMTPSecure = "none";                 
    $mail->SMTPAuth   = false;
    $mail->Username   = "";
    $mail->Password   = "";

    One of the most important parts of the connection is what is entered for the host. If you're sending email from any of our shared hosting servers, the server you must use is  relay-hosting.secureserver.net. You won't be able to send using any other mail server. Also, there's no need to enter a username or password in this situation. Feel free to give that a try. 

    I think the ultimate problem here is GoDaddy's failure to keep their CPanel screens and documentation consistent with ongoing changes in their hosting networks.  The following settings worked for me. Note three important settings:

    1. The SMTP host must be the GoDaddy server host name not  a derivative of your domain name as reported by the Configure Email Client screen. The SSL certificate for the SMTP servers still uses GoDaddy's secureserver.net domain, so you have to use a host on that domain to pass the server SSL security check.  The Configure Email Client screen used to display the GoDaddy host, but it's part of every CPanel link URL. Just copy it from your browser address bar when you're in CPanel. In the example below, you want the part in red. Don't use the host name in the example because your host may be different!
      https://a2plcpnl0426.prod.iad2.secureserver.net:2083/cpsess9928686537/frontend/gl_paper_lantern/index.html
    2. Even with the correct host name, the ssl encryption setting (with port 465)  will not work. You must set $mail->SMTPSecure to tls.
    3. With TLS port 587 must be used.

    $mail->isSMTP(); 
    $mail->Host = 'a2plcpnl0426.prod.iad2.secureserver.net';    // Must be GoDaddy host name
    $mail->SMTPAuth = true; 
    $mail->Username = 'guy@mydomain.com';
    $mail->Password = 'guyPassword';
    $mail->SMTPSecure = 'tls';   // ssl will no longer work on GoDaddy CPanel SMTP
    $mail->Port = 587;    // Must use port 587 with TLS

     

    I hope this helps someone.

    I setup a test and was able to successfully send using both TLS and SSL settings.  Despite previous failures, these settings worked for me:

    $phpmailer->isSMTP();     
    $phpmailer->Host = 'a2plcpnl0105.prod.iad2.secureserver.net';
    $phpmailer->SMTPAuth = true;
    $phpmailer->SMTPSecure = "ssl";
    $phpmailer->Port = 465;
    $phpmailer->Username = 'user@somedomain.com';
    $phpmailer->Password = 'password';
    // I was also able to send successfully with SMTPSecure to "tls" and Port to 587

    There may be something peculiar about your host (sg3plcpnl0046.prod.sin3.secureserver.net), but if your log file indicates the send was successful, it probably was. Check your spam folder.  If you do not find your email message there, I would be happy to examine your log file for any clues you may have missed. Let's keep the thread concise; click on my user name and send the log via private message.  We can share any success or useful findings here.

    GoDaddy has several limitations for its shared-hosting plans.

    If you're trying to send emails from the GoDaddy host, you'll need to use the following SMTP server:

    relay-hosting.secureserver.net

    Also, keep in mind that the GoDaddy SMTP servers are very busy, which means it might take some time until your email sent to its recipient.

    Don't waste your time and try to configure other SMTP servers (Gmail etc) to handle your outgoing emails. GoDaddy has blocked this option and limited it only to the mentioned server above.

     

    If you want to use your website to send form mail, like submissions to a contact us form, you'll need to connect to our mail relay server.

    Sending mail through other providers isn't allowed, so you'll need to use the following settings:

    Port: 25
    SMTP Authentication: False or none
    SSL or Secure Connection: None
    Server or Host: The relay server you need to use depends on the type of hosting and script you use. What type of hosting account do I have?

    Linux (cPanel)

     

    Use localhost unless:

    • You use PHP script and the mail() function.
    • You use Perl script and the /usr/lib/sendmail binary.

     

    In those cases, you do not need to specify a relay server.

     

    "I haven't tried using relay-hosting.secureserver.net as the address, but after a lot of frustration I found that leaving "localhost" as the host and port 25 as the default port in my PHPMailer config, mail went through, and quickly at that. Yes, this is on a live, production website hosted by GoDaddy."

     

    Personally so annoyed with this SMTP email drama right about now...

  • passes this test:

    <?php
    $address = "your_email@your_host.com";
    
    $subject = 'Test email.';
    
    $body = 'If you can read this, your email is working.';
    
    echo "Attempting to email $address...<br />";
    
    if (mail($address, $subject, $body)) {
            echo 'SUCCESS!  PHP successfully delivered email to your MTA.  If you don\'t see the email in your inbox in a few minutes, there is a problem with your MTA.';
    } else {
            echo 'ERROR!  PHP could not deliver email to your MTA.  Check that your PHP settings are correct for your MTA and your MTA will deliver email.';

    yet verification emails are still going into the void despite multiple suggested settings...

    http://learn.elgg.org/en/2.0/appendix/faqs.html#missing-email

  • There is also the suggested workaround using https://sendgrid.com