Ubuntu 上的 Postfix 无法向一些地址发送邮件

Ubuntu 上的 Postfix 无法向一些地址发送邮件

在我的 ubuntu 服务器上,我的 WordPress 安装使用 wp_mail(反过来使用 php mail()..)以正常方式发送电子邮件。

服务器设置了 Postfix 来进行传送。

最近出现了一些地址无法接收从服务器发送的电子邮件的问题。

假设服务器本身使用的域server.com也用于 Google 应用电子邮件。该域具有适当的 SPF 记录集。

<my-username>@server.com发送至和的电子邮件<my-username>@hotmail.com均已<my-username>@gmail.com成功送达。

但是,发送的电子邮件<my-username>@<my-own-google-app-domain>.com并未送达。它们甚至没有进入垃圾邮件文件夹。

这是我认为可能相关的邮件日志(电子邮件地址已替换,以与上面的地址相对应):

Sep  3 10:39:00 vps postfix/pickup[20267]: B991F2A11: uid=33 from=<www-data>
Sep  3 10:39:00 vps postfix/cleanup[20354]: B991F2A11: message-id=<[email protected]>
Sep  3 10:39:00 vps postfix/qmgr[20268]: B991F2A11: from=<[email protected]>, size=730, nrcpt=1 (queue active)
Sep  3 10:39:01 vps postfix/smtp[20356]: B991F2A11: to=<<my-username@<my-custom-ga-domain>.com>, relay=ASPMX.L.GOOGLE.COM[2a00:1450:400c:c0a::1b]:25, delay=0.4, delays=0.05/0.01/0.05/0.28, dsn=2.0.0, status=sent (250 2.0.0 OK 1441269756 li14si9718740wic.1 - gsmtp)
Sep  3 10:39:01 vps postfix/qmgr[20268]: B991F2A11: removed
Sep  3 10:40:01 vps postfix/pickup[20267]: DFD2E2A39: uid=105 from=<smmsp>
Sep  3 10:40:01 vps postfix/cleanup[20354]: DFD2E2A39: message-id=<[email protected]>
Sep  3 10:40:01 vps postfix/qmgr[20268]: DFD2E2A39: from=<[email protected]>, size=708, nrcpt=1 (queue active)
Sep  3 10:40:02 vps postfix/smtp[20356]: DFD2E2A39: to=<[email protected]>, orig_to=<root>, relay=aspmx.l.google.com[64.233.166.27]:25, delay=0.21, delays=0.03/0/0.03/0.15, dsn=5.1.1, status=bounced (host aspmx.l.google.com[64.233.166.27] said: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1  https://support.google.com/mail/answer/6596 w4si45121598wju.16 - gsmtp (in reply to RCPT TO command))
Sep  3 10:40:02 vps postfix/cleanup[20354]: 1DABA2A37: message-id=<[email protected]>
Sep  3 10:40:02 vps postfix/bounce[20389]: DFD2E2A39: sender non-delivery notification: 1DABA2A37
Sep  3 10:40:02 vps postfix/qmgr[20268]: 1DABA2A37: from=<>, size=3181, nrcpt=1 (queue active)
Sep  3 10:40:02 vps postfix/qmgr[20268]: DFD2E2A39: removed
Sep  3 10:40:02 vps postfix/smtp[20356]: 1DABA2A37: to=<[email protected]>, relay=aspmx.l.google.com[2a00:1450:400c:c0a::1b]:25, delay=0.29, delays=0/0/0.16/0.13, dsn=5.1.1, status=bounced (host aspmx.l.google.com[2a00:1450:400c:c0a::1b] said: 550-5.1.1 The email account that you tried to reach does not exist. Please try 550-5.1.1 double-checking the recipient's email address for typos or 550-5.1.1 unnecessary spaces. Learn more at 550 5.1.1  https://support.google.com/mail/answer/6596 d4si33273494wjn.153 - gsmtp (in reply to RCPT TO command))
Sep  3 10:40:02 vps postfix/qmgr[20268]: 1DABA2A37: removed

知道这里发生什么事了吗?

编辑:

以下是输出postconf | grep '^mydomain\|^myhostname'

mydomain = server.com
myhostname = vps.server.com
mydestination = vps.server.com, localhost.server.com, localhost

(其中 server.com 实际上是我的服务器的域名)

编辑2:

从 postfix 下的服务器发送的邮件似乎有错误的时间:例如

Date: Thu, 3 Sep 2015 13:45:16 +0000

尽管时区应该是“欧洲/伦敦”,但目前是英国夏令时,这比实际时间晚了 1 小时。

服务器日期正确,只是后缀(邮件头和日志条目)不正确。

我认为这可能会导致一些电子邮件被标记为垃圾邮件

答案1

冒着太明显的风险,似乎“server.com”的 (Google) 邮件服务器无法识别[email protected][email protected]作为有效收件人。

您尝试联系的电子邮件帐户不存在。请尝试 550-5.1.1 仔细检查收件人的电子邮件地址是否有拼写错误或 550-5.1.1 不必要的空格。了解更多信息,请访问 550 5.1.1 https://support.google.com/mail/answer/6596w4si45121598wju.16 - gsmtp(回复 RCPT TO 命令)

短信服务

仔细查看日志文件后,我注意到第一封邮件已从 发送至wwww-data<my-username@<my-custom-ga-domain>.com>有一封邮件正从 发送smmsproot。此次发送尝试失败,记录的第三封邮件消息是尝试将 DSN 发送回。<[email protected]>

在搜索网络后,我偶然发现了这个链接,Postfix/Sendmail:smmsp 向 root 频繁发送电子邮件这表明 smmsp 是Sendmail 消息提交程序。这篇文章表明 sendmail 可能没有从系统中完全删除。对于基于 Debian 的系统,发帖者通过运行dpkg -l | grep send然后删除 sendmail 包来验证了这一点:

aptitude remove sendmail-bin sendmail-cf sendmail-doc

如果您的系统上安装了 sendmail 程序,最好将其删除(因为它们会与 Postfix 冲突),然后重新尝试发送邮件测试。

目标域

可能影响您的另一个问题是,虚拟服务器上的 Postfix 看到应该投递的邮件,因此它认为此类邮件应该在本地投递。<[email protected]>

您已配置mydomainserver.com,如果没有另行设置,Postfix 将使用其为其提供传送的域的$myhostname, localhost.$mydomain, localhost默认设置。mydestination

编辑:看到更新的 Postfix 配置设置后,这似乎不是这里的问题。

相关内容