我的/var/log/maillog
展示是crontab
(与MAILTO=root
)试图同时向root
和 发送电子邮件root@my_fqdn
(my_fqdn
类似于server.something.com)。根据日志,发送到root
成功root@my_fqdn
失败,但我在中找不到消息/var/mail/root
。以下是相关/var/log/maillog
代码段:
Aug 16 17:49:02 ip-10-64-21-125 sendmail[22211]: v7GHn2Tr022211: from=root, size=742, class=0, nrcpts=1, msgid=<201708161749.v7GHn2Tr022211@my_fqdn>, relay=root@localhost
Aug 16 17:49:02 ip-10-64-21-125 sendmail[22212]: v7GHn2Ws022212: from=<root@my_fqdn>, size=1061, class=0, nrcpts=1, msgid=<201708161749.v7GHn2Tr022211@my_fqdn>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 16 17:49:02 ip-10-64-21-125 sendmail[22211]: v7GHn2Tr022211: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30742, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v7GHn2Ws022212 Message accepted for delivery)
Aug 16 17:49:02 ip-10-64-21-125 sendmail[22214]: v7GHn2Ws022212: to=<root@my_fqdn>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=121061, relay=my_fqdn. [10.0.0.1], dsn=4.0.0, stat=Deferred: Connection refused by my_fqdn.
但是,按照此提示,邮件现在显示在中/var/mail/root
。/etc/hosts
需要添加一条线my_fqdn
来解决该问题,以便将其作为域解决(请注意最后的点):
127.0.0.1 my_fqdn.
注意:现在,这种方法的工作方式是仍然无法正确接收消息,但是会以将其放回原处的方式弹回/var/mail/root
(请注意stat=Local configuration error
以下/var/log/maillog
摘录中的片段)。
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22223]: v7GHo4ZJ022223: from=root, size=742, class=0, nrcpts=1, msgid=<201708161750.v7GHo4ZJ022223@my_fqdn>, relay=root@localhost
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22224]: v7GHo4MT022224: from=<root@my_fqdn>, size=1061, class=0, nrcpts=1, msgid=<201708161750.v7GHo4ZJ022223@my_fqdn>, proto=ESMTP, daemon=MTA, relay=localhost [127.0.0.1]
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22223]: v7GHo4ZJ022223: to=root, ctladdr=root (0/0), delay=00:00:00, xdelay=00:00:00, mailer=relay, pri=30742, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (v7GHo4MT022224 Message accepted for delivery)
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MT022224: SYSERR(root): my_fqdn. config error: mail loops back to me (MX problem?)
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MT022224: to=<root@my_fqdn>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=121061, relay=my_fqdn. [127.0.0.1], dsn=5.3.5, stat=Local configuration error
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MT022224: v7GHo4MT022226: DSN: Local configuration error
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22227]: v7GHo4Ml022227: localhost [127.0.0.1] did not issue MAIL/EXPN/VRFY/ETRN during connection to MTA
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MT022226: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=62294, dsn=2.0.0, stat=Sent
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MT022226: to=<root@my_fqdn>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=62294, relay=my_fqdn., dsn=5.3.5, stat=Local configuration error
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MT022226: v7GHo4MU022226: return to sender: Local configuration error
Aug 16 17:50:04 ip-10-64-21-125 sendmail[22226]: v7GHo4MU022226: to=root, delay=00:00:00, xdelay=00:00:00, mailer=local, pri=33318, dsn=2.0.0, stat=Sent