SMTP issues with AWS Linux Server

amazon-web-servicessendmailsmtp

I have little experience with SMTPs and have come across some trouble getting my Drupal site to send out emails. The only change that had been made prior to the error was adding a CloudFront to instance. Then months later we changed the email recipient and it stopped working.

Log error from var/log/maillog:

Feb  1 20:27:43 ip-10-0-0-127: from=apache, size=860, class=0, nrcpts=3, msgid=<2017@ip-10-0-0-127>, relay=apache@localhost

Feb  1 20:27:44 ip-10-0-0-127: from=<apache@ip-10-0-0-127>, size=1043, class=0, nrcpts=3, msgid=<2017@ip-10-0-0-127>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]

Feb  1 20:27:44 ip-10-0-0-127: to=l@columbia.edu,j@columbia.edu,r@columbia.edu, ctladdr=apache (48/48), delay=00:00:01, xdelay=00:00:01, mailer=relay, pri=90860, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (Message accepted for delivery)

Feb  1 20:27:49 ip-10-0-0-127: STARTTLS=client, relay=mail-in.cc.l.columbia.edu., version=TLSv1/SSLv3, verify=FAIL, cipher=, bits=256/256

Feb  1 20:27:49 ip-10-0-0-127: to=<r@columbia.edu>,<j@columbia.edu>,<l@columbia.edu>, ctladdr=<apache@ip-10-0-0-127> (48/48), delay=00:00:06, xdelay=00:00:05, mailer=esmtp, pri=181043, relay=mail-in.cc.l.columbia.edu. [128.00.000.000], dsn=5.6.0, stat=Data format error

Feb  1 20:27:49 ip-10-0-0-127: DSN: Data format error

Feb  1 20:27:49 ip-10-0-0-127: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=32235, dsn=2.0.0, stat=Sent

And the following after removing the Throttle from port 25:

to=<apache@site.school.edu>, delay=00:16:00, xdelay=00:16:00, mailer=esmtp, pri=34406, relay=xxxxxxx.cloudfront.net. [54.192.19.124], dsn=4.0.0, stat=Deferred: Connection timed out with xxxxxxx.cloudfront.net.

adsl-static.isp.belgacom.be [81.xxx.xx.xx] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

Fems.dsrtg.gov.tw [117.xx.xxx.xxx] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA

On AWS's Security Group I opened up ports for SMTP 25 and SMTPS 465:

netstat -ntlp | grep sendmail
tcp        0      0 127.0.0.1:25                0.0.0.0:*                   LISTEN      
2180/sendmail

Reference: http://www.golinuxhub.com/2013/06/statdeferred-connection-timed-out.html

Changed my sendmail.mc fileto the following:

DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl

Copied over the changes and restarted the mail service using:

m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

Changed my ect/host file to:

127.0.0.1 localhost
54.192.37.15 site.school.edu site

Reference: https://www.drupal.org/node/1155

One last thing I forgot to mention! The domain name is pointing to the site.cloudfront.net domain name. Hope this helps.

Is there anything else I'm missing that could help with the issue?

Thanks,

Best Answer

Cloudfront has no bearing on SMTP.

Amazon throttles outgoing SMTP as part of spam blocking: https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/

You can request to have the throttle lifted off of a link from that page.

Related Topic