我发现我没有收到一段时间的电子邮件。 当我检查日志,我看到这样的错误消息:
1 Mar 7 03:37:32 ip-179-45-37-216 postfix/smtpd[24969]: connect from localhost[127.0.0.1] 2 Mar 7 03:37:32 ip-179-45-37-216 postfix/smtpd[24969]: 92963C1550: client=localhost[127.0.0.1] 3 Mar 7 03:37:32 ip-179-45-37-216 postfix/cleanup[24972]: 92963C1550: message-id=<[email protected]> 4 Mar 7 03:37:32 ip-179-45-37-216 postfix/qmgr[23814]: 92963C1550: from=<[email protected]>, size=1398, nrcpt=1 (queue active) 5 Mar 7 03:37:32 ip-179-45-37-216 postfix/smtpd[24969]: disconnect from localhost[127.0.0.1] 6 Mar 7 03:37:32 ip-179-45-37-216 postfix/smtp[24973]: connect to ASPMX.L.GOOGLE.com[2607:f8b0:400e:c02::1b]:25: Network is unreachable 7 Mar 7 03:37:34 ip-179-45-37-216 postfix/smtp[24973]: 92963C1550: to=<[email protected]>, relay=ASPMX.L.GOOGLE.com[74.125.28.27]:25, delay=1.8, delays=0.09/0/0.17/1.5, dsn =2.0.0, status=sent (250 2.0.0 OK 1425699441 md9si17726259pdb.104 - gsmtp) 8 Mar 7 03:37:34 ip-179-45-37-216 postfix/qmgr[23814]: 92963C1550: removed
域名work.com托pipe在谷歌Gmail上。 我怎样才能找出什么是错的?
我没有在这个aws ec2实例使用的安全组中设置任何出站规则。
这个日志有两条重要的路线
Mar 7 03:37:32 ip-179-45-37-216 postfix/smtp[24973]: connect to ASPMX.L.GOOGLE.com[2607:f8b0:400e:c02::1b]:25: Network is unreachable Mar 7 03:37:34 ip-179-45-37-216 postfix/smtp[24973]: 92963C1550: to=<[email protected]>, relay=ASPMX.L.GOOGLE.com[74.125.28.27]:25, delay=1.8, delays=0.09/0/0.17/1.5, dsn =2.0.0, status=sent (250 2.0.0 OK 1425699441 md9si17726259pdb.104 - gsmtp)
第一行告诉我们你的服务器试图通过IPv6连接Gmail服务器,但是它不能,因为你的环境中的IPv6networking被破坏了。 第二行告诉我们 ,在IPv6失败后,postfix将回退到IPv4模式并通过IPv4地址(74.125.28.27)发送您的电子邮件。
您可以通过main.cf这个参数强制postfix在后缀中禁用IPv6
inet_protocols = ipv4
参考文献: Postfix文档