在我的Ubuntu服务器上,我的WordPress安装使用wp_mail(反过来使用php mail()..)以正常的方式发送电子邮件。
服务器设置为Postfix进行传送。
最近有一些地址没有收到从服务器发送的电子邮件的问题。
假设服务器本身使用也用于Google应用程序电子邮件的域server.com 。 该域具有适当的SPFlogging集。
发送到<my-username>@server.com , <my-username>@hotmail.com和<my-username>@gmail.com都可以正常传送。
但是,发送到<my-username>@<my-own-google-app-domain>.com电子邮件不交付。 他们甚至不打垃圾邮件文件夹。
这是一个我认为可能相关的邮件日志(电子邮件地址被replace为与上面相对应):
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'的输出 postconf | grep '^mydomain\|^myhostname' :
mydomain = server.com myhostname = vps.server.com mydestination = vps.server.com, localhost.server.com, localhost
(其中server.com实际上是我的服务器的域名)
EDIT2:
在postfix下从服务器发送的邮件似乎有错误的时间:例如
Date: Thu, 3 Sep 2015 13:45:16 +0000
尽pipe时区应该是“欧洲/伦敦”,现在是BST,但是这应该是1小时。
服务器date是正确的,只是后缀(邮件标题和日志条目)不正确。
我想这可能会使一些电子邮件被标记为垃圾邮件
冒着太明显的风险,似乎“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/6596 w4si45121598wju.16 – gsmtp(回复RCPT TO命令))
在仔细查看日志文件后 ,我注意到第一封邮件从wwww-data发送到<my-username@<my-custom-ga-domain>.com> ,有一条消息从smmsp发送到root 。 这种尝试发送失败,第三封邮件被logging的结果是将DSN发送回<[email protected]> 。
search网页后,我发现这个链接, Postfix / Sendmail:从smmsp频繁的电子邮件到根 ,这表明smmsp是Sendmail邮件提交程序 。 这篇文章build议sendmail可能不会完全从系统中删除。 对于基于Debian的系统,海报通过运行dpkg -l | grep sendvalidation dpkg -l | grep send ,然后使用以下命令删除sendmail软件包:
aptitude remove sendmail-bin sendmail-cf sendmail-doc
如果系统上安装了sendmail程序,最好将其删除(因为它们会与Postfix冲突),然后重新尝试发送邮件testing。
另一个可能会影响到你的问题是,你的虚拟服务器上的Postfix会看到一个邮件应该被发送到<[email protected]>所以它认为这些邮件应该在本地交付。
你已经configuration了mydomain为server.com ,如果没有设置其他的话,Postfix使用$myhostname, localhost.$mydomain, localhost作为默认设置。
编辑:看到更新的Postfixconfiguration设置,这似乎不是这里的问题。