【发布时间】:2015-03-11 10:01:52
【问题描述】:
我在使用 php mail() 函数向谷歌商业应用程序 (gmail) 发送电子邮件时遇到问题。其他电子邮件工作正常。我在 Debian 上安装了 nginx 和 postfix。
我已添加 SPF 记录
TXT "v=spf1 包括:_spf.google.com ~all"
/var/log/mail.log looks like this:
Jan 13 16:58:12 pluto postfix/pickup[26804]: 42FD82169E: uid=33 from=<www-data>
Jan 13 16:58:12 pluto postfix/cleanup[26826]: 42FD82169E: message-id=<20150113145812.42FD82169E@mydomain.com>
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 42FD82169E: from=<www-data@info@mydomain.com>, size=594, nrcpt=1 (queue active)
Jan 13 16:58:12 pluto postfix/smtp[26828]: 42FD82169E: to=<recepient@mydomain.com>, relay=aspmx.l.google.com[173.194.78.26]:25, delay=0.23, delays=0.06/0.01/0.06/0.11, dsn=5.7.1, status=bounced (host aspmx.l.google.com[173.194.78.26] said: 550-5.7.1 [83.136.252.16 12] Our system has detected that this message is 550-5.7.1 likely unsolicited mail. To reduce the amount of spam sent to Gmail, 550-5.7.1 this message has been blocked. Please visit 550-5.7.1 http://support.google.com/mail/bin/answer.py?hl=en&answer=188131 for 550 5.7.1 more information. ey11si9440622wid.49 - gsmtp (in reply to end of DATA command))
Jan 13 16:58:12 pluto postfix/cleanup[26826]: 768962179F: message-id=<20150113145812.768962179F@mydomain.com>
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 768962179F: from=, size=3127, nrcpt=1 (queue active)
Jan 13 16:58:12 pluto postfix/bounce[26829]: 42FD82169E: sender non-delivery notification: 768962179F
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 42FD82169E: removed
Jan 13 16:58:12 pluto postfix/smtp[26828]: 768962179F: to=<www-data@info@mydomain.com>, relay=aspmx.l.google.com[173.194.78.26]:25, delay=0.09, delays=0.01/0/0.04/0.04, dsn=5.1.1, status=bounced (host aspmx.l.google.com[173.194.78.26] 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 http://support.google.com/mail/bin/answer.py?answer=6596 l10si41320730wjz.98 - gsmtp (in reply to RCPT TO command))
Jan 13 16:58:12 pluto postfix/qmgr[26805]: 768962179F: removed
/etc/postfix/main.cf looks like this:
myhostname = mydomain.com
smtpd_banner = $myhostname ESMTP $mail_name (Debian/GNU)
biff = no
append_dot_mydomain = no
readme_directory = no
myorigin = /etc/mailname
mydestination =
relayhost =
mynetworks = 127.0.0.0/8 83.136.252.0/22 10.2.0.0/22 [::1]/128 [fe80::]/64
mailbox_command = procmail -a "$EXTENSION"
mailbox_size_limit = 0
recipient_delimiter = +
inet_interfaces = all
inet_protocols = ipv4
milter_protocol = 2
milter_default_action = accept
【问题讨论】:
-
www-data@info@mydomain.com看起来确实不太有效。 -
我认为您的 SPF 记录中缺少某些内容,我猜您的服务器在域 mydomain.com 上有自己的后缀服务器,但您没有在 SPF 记录中指定这一点。也许您也应该添加 A 或 MX 记录。
标签: php email nginx postfix-mta