我对 SMTP 的使用经验很少,在让我的 Drupal 网站发送电子邮件时遇到了一些麻烦。发生错误之前所做的唯一更改是将 CloudFront 添加到实例。几个月后,我们更改了电子邮件收件人,它就停止工作了。
来自 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: [email protected],[email protected],[email protected], 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=<[email protected]>,<[email protected]>,<[email protected]>, 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
从端口 25 移除节流阀后,情况如下:
to=<[email protected]>, 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
在 AWS 的安全组中,我打开了 SMTP 25 和 SMTPS 465 端口:
netstat -ntlp | grep sendmail
tcp 0 0 127.0.0.1:25 0.0.0.0:* LISTEN
2180/sendmail
参考:http://www.golinuxhub.com/2013/06/statdeferred-connection-timed-out.html
将我的 sendmail.mc 文件更改为以下内容:
DAEMON_OPTIONS(`Port=smtp,Addr=0.0.0.0, Name=MTA')dnl
复制更改并使用以下命令重新启动邮件服务:
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart
将我的 ect/host 文件更改为:
127.0.0.1 localhost
54.192.37.15 site.school.edu site
参考:https://www.drupal.org/node/1155
最后还有一件事我忘了提!域名指向 site.cloudfront.net 域名。希望这能有所帮助。
还有什么我遗漏的可以帮助解决这个问题的东西吗?
谢谢,
答案1
Cloudfront 与 SMTP 无关。
作为垃圾邮件阻止的一部分,Amazon 会限制传出 SMTP:https://aws.amazon.com/premiumsupport/knowledge-center/ec2-port-25-throttle/
您可以请求解除该页面上链接的限制。