确定sendmail无法发送的原因

我在一个网页上有一个表单,在同一台服务器上使用sendmail发送一封电子邮件。 收件人是使用Google Apps进行电子邮件的客户端。 在表格中,我input我的电子邮件地址。 如果我input*@aol.com*@yahoo.com (其中“*”是任何内容,当然不是字面星号),则电子邮件无法在/var/log/mail.log使用以下转储进行发送:

 Sep 22 14:01:12 localhost sendmail[16522]: t8ME1CSU016522: Authentication-Warning: localhost.local: www-data set sender to [email protected] using -f Sep 22 14:01:12 localhost sendmail[16522]: t8ME1CSU016522: [email protected], size=1099, class=0, nrcpts=1, msgid=<[email protected]>, relay=www-data@localhost Sep 22 14:01:12 localhost sm-mta[16523]: t8ME1CIi016523: from=<[email protected]>, size=1418, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost.local [127.0.0.1] Sep 22 14:01:12 localhost sendmail[16522]: t8ME1CSU016522: [email protected], [email protected] (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31099, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (t8ME1CIi016523 Message accepted for delivery) Sep 22 14:01:12 localhost sendmail[16527]: t8ME1CjK016527: Authentication-Warning: localhost.local: www-data set sender to [email protected] using -f Sep 22 14:01:12 localhost sendmail[16527]: t8ME1CjK016527: [email protected], size=1224, class=0, nrcpts=1, msgid=<[email protected]>, relay=www-data@localhost Sep 22 14:01:12 localhost sm-mta[16528]: t8ME1CK4016528: from=<[email protected]>, size=1543, class=0, nrcpts=1, msgid=<[email protected]>, proto=ESMTP, daemon=MTA-v4, relay=localhost.local [127.0.0.1] Sep 22 14:01:12 localhost sendmail[16527]: t8ME1CjK016527: [email protected], [email protected] (33/33), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=31224, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (t8ME1CK4016528 Message accepted for delivery) Sep 22 14:01:13 localhost sm-mta[16530]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128 Sep 22 14:01:13 localhost sm-mta[16525]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=ECDHE-RSA-AES128-GCM-SHA256, bits=128/128 Sep 22 14:01:13 localhost sm-mta[16530]: t8ME1CK4016528: to=<[email protected]>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=121543, relay=aspmx.l.google.com. [173.194.205.27], dsn=5.0.0, stat=Service unavailable Sep 22 14:01:13 localhost sm-mta[16530]: t8ME1CK4016528: t8ME1DK4016530: DSN: Service unavailable Sep 22 14:01:13 localhost sm-mta[16530]: t8ME1DK4016530: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30000, relay=aspmx.l.google.com. [173.194.205.27], dsn=5.1.1, stat=User unknown Sep 22 14:01:13 localhost sm-mta[16530]: t8ME1DK4016530: t8ME1DK5016530: return to sender: User unknown Sep 22 14:01:13 localhost sm-mta[16530]: t8ME1DK5016530: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent Sep 22 14:01:13 localhost sm-mta[16525]: t8ME1CIi016523: to=<[email protected]>, delay=00:00:01, xdelay=00:00:01, mailer=esmtp, pri=121418, relay=aspmx.l.google.com. [173.194.205.27], dsn=5.0.0, stat=Service unavailable Sep 22 14:01:13 localhost sm-mta[16525]: t8ME1CIi016523: t8ME1DIi016525: DSN: Service unavailable Sep 22 14:01:13 localhost sm-mta[16525]: t8ME1DIi016525: to=<[email protected]>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=30000, relay=aspmx.l.google.com. [173.194.205.27], dsn=5.1.1, stat=User unknown Sep 22 14:01:13 localhost sm-mta[16525]: t8ME1DIi016525: t8ME1DIj016525: return to sender: User unknown Sep 22 14:01:13 localhost sm-mta[16525]: t8ME1DIj016525: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=30000, dsn=2.0.0, stat=Sent 

我试过的每个其他的电子邮件地址似乎工作正常,日志表明成功。 这两个似乎连接到接力,但失败之后就解体了。

我可以看到一个服务不可用,但我不完全确定哪一个,也不确定为什么只有当我input这些地址时才可用 – 特别是当发件人被强制为no_reply电子邮件地址时。 为什么我在表格上input的价值呢? 我显然缺less一些东西。

我不是一个系统pipe理员,我当然也不熟悉电子邮件的故障排除,所以我希望有人能帮我理解我在这里看到的东西。 什么可能导致这些失败?

Sendmail:发送testing邮件与完整的SMTP抄本

你可以让sendmail发送带有SMTP会话完整脚本的testing消息。
通常它提供了更多的线索为什么交付失败。

更改SENDER和RECIPIENT后,以root身份执行以下脚本。

 #!/bin/sh [email protected] ENVELOPE_SENDER=$SENDER [email protected] /usr/sbin/sendmail -i -v -f$ENVELOPE_SENDER -- $RECIPIENT <<END from: $SENDER to: $RECIPIENT subject: delivery test Delivery test -- ignore it. END 

反馈循环注册并从aol和雅虎找出,也确保你是投诉。

确保你尊重NDR(我看到一些),你也可以使用像sendgrid这样的智能主机来帮助你。