我正在尝试使用 Postfix(默认 Debian 设置)将邮件发送到我的测试 GMail 帐户,但失败了(“/var/log/mail.log”):
Sep 26 16:13:43 sugarmailer postfix/smtpd[1473]: connect from localhost[127.0.0.1]
Sep 26 16:13:44 sugarmailer postfix/smtpd[1473]: 07C8C3C04BE: client=localhost[127.0.0.1]
Sep 26 16:13:44 sugarmailer postfix/cleanup[1478]: 07C8C3C04BE: message-id=<20110926141344.07C8C3C04BE@sugarmailer>
Sep 26 16:13:44 sugarmailer postfix/qmgr[1446]: 07C8C3C04BE: from=<wena@sugarmailer>, size=356, nrcpt=1 (queue active)
Sep 26 16:13:44 sugarmailer postfix/smtpd[1473]: disconnect from localhost[127.0.0.1]
Sep 26 16:13:52 sugarmailer postfix/smtp[1479]: 07C8C3C04BE: to=<[email protected]>, relay=gmail-smtp-in.l.google.com[209.85.227.26]:25, delay=8.4, delays=0.07/0.03/0.73/7.6, dsn=5.7.1, status=bounced (host gmail-smtp-in.l.google.com[209.85.227.26] said: 550 5.7.1 smtp-proxy1.wa.co.za Message marked as SPAM, denied [7.600000] (in reply to end of DATA command))
Sep 26 16:13:52 sugarmailer postfix/cleanup[1478]: 822113C04D3: message-id=<20110926141352.822113C04D3@sugarmailer>
Sep 26 16:13:52 sugarmailer postfix/qmgr[1446]: 822113C04D3: from=<>, size=2334, nrcpt=1 (queue active)
Sep 26 16:13:52 sugarmailer postfix/bounce[1480]: 07C8C3C04BE: sender non-delivery notification: 822113C04D3
Sep 26 16:13:52 sugarmailer postfix/qmgr[1446]: 07C8C3C04BE: removed
Sep 26 16:13:52 sugarmailer postfix/local[1482]: 822113C04D3: to=<wena@sugarmailer>, relay=local, delay=0.08, delays=0.03/0.03/0/0.02, dsn=2.0.0, status=sent (delivered to mailbox)
Sep 26 16:13:52 sugarmailer postfix/qmgr[1446]: 822113C04D3: removed
Gmail 认为这可能是垃圾邮件,因此无法送达。具体消息如下:
<[email protected]>: host gmail-smtp-in.l.google.com[209.85.229.26] said:
550 5.7.1 smtp-proxy1.wa.co.za Message marked as SPAM, denied [7.600000]
(in reply to end of DATA command)
请注意,exim4 可以工作(使用internet site
debconf 设置,但其他一切保留默认值),尽管 Gmail 将邮件放入垃圾邮件文件夹(“/var/log/exim4/mainlog”):
2011-09-26 16:20:24 1R8C2i-0000cr-QV <= wena@sugarmailer H=localhost ([127.0.1.1]) [127.0.0.1] P=esmtp S=370
2011-09-26 16:20:25 1R8C2i-0000cr-QV ** [email protected] R=nonlocal: Mailing to remote domains not supported
2011-09-26 16:20:25 1R8C2j-0000ct-H4 <= <> R=1R8C2i-0000cr-QV U=Debian-exim P=local S=1189
2011-09-26 16:20:25 1R8C2i-0000cr-QV Completed
2011-09-26 16:20:26 1R8C2j-0000ct-H4 => wena <wena@sugarmailer> R=local_user T=mail_spool
2011-09-26 16:20:26 1R8C2j-0000ct-H4 Completed
另一件值得注意的事情是,本地交付工作没有问题。
那么问题来了,Exim4 中是什么让它能够在 Postfix 失败的情况下通过 Gmail 服务器呢?
答案1
Gmail 要求您拥有 SASL 身份验证和 SLS 加密才能向其发送邮件。当我第一次开始使用 postfix 时,我花了很多时间试图让它工作。 OpenSSL 特别无趣。
http://souptonuts.sourceforge.net/postfix_tutorial.html有一个配置所有这些的演练。