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...

  • Team,

    can u please help me out to send email by gmail account .We are also planing to send email but not have hosting server yet.

    Want to test the things by gmail prior to this.

    pls help