我有一个新安装的 CentOS 6.7 机器,用于设置 sendmail。它似乎可以发送电子邮件,但实际上却不能,不知道问题出在哪里。
我做了什么:
yum install sendmail sendmail-cf sendmail-doc sendmail-devel telnet
service sendmail start
chkconfig sendmail on
chkconfig --list sendmail
ls -l /etc/mail
telnet localhost 25
chkconfig --level 25 sendmail
service iptables stop
telnet 连接成功,iptables 已停止以减少任何复杂性。
测试sendmail:
mail -v -s 'testing sendmail' [email protected] < /etc/passwd
2.1.0 <[email protected]>... Sender ok </br>
2.1.5 <[email protected]>... Recipient ok
Enter mail, end with "." on a line by itself
2.0.0 tA4Bud7a006235 Message accepted for delivery </br>
[email protected]... Sent (tA4Bud7a006235 Message accepted for delivery)
Closing connection to [127.0.0.1]
QUIT
2.0.0 localhost.localdomain closing connection
现在显示消息已成功发送,但我在收件箱中看不到任何电子邮件,如果)检查/var/log/maillog
:
Nov 4 15:48:03 localhost sendmail[6852]: tA3HPSF2002371: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=22:22:35, xdelay=00:00:00, mailer=esmtp, pri=2732098, relay=mail.myDomain.com., dsn=4.0.0, stat=Deferred: Connection refused by mail.mydomain.com.
有任何想法吗?
答案1
正如maillog
所述:
您尝试发送邮件至myDomain.com
,sendmail 认为它的工作不是处理该域的邮件,因此它将邮件转发至mail.mydomain.com
(取自该域的 MX 记录),而 25 端口上似乎没有邮件服务器。
关于域和涉及的配置的更多细节可能会有所帮助。