sendmail只发不收,设置好hosts中的自己和对方mta的主机IP对应但是日志中解析不出来对方域名
帮帮忙啊,我搭了四台sendmail,都不从dns来解析,从本机的/etc/hosts中解析自己的主机名与IP,现在三台都能发送,只有一台居然发不出来,在/var/spool/mqueue/下的未发邮件内容有这样的错误提示:
Mhost map: lookup (99.com): deferred (因为我发的收件人是fate@99.com),并且99.com是我已知的一台邮件服务器,并且fate这个帐户也是肯定存在的。其它三台sendmail能发送给fate@99.com这个邮箱中。
我的hosts文件如下;
127.0.0.1 localhost.localdomain localhost
172.16.2.1 ftp2-qa.99.com sftp2-qa
172.16.21.2 ftp1-qa.99.com sftp1-qa
我的hostname如下:
hostname -f
ftp1-qa.99.com
vi /etc/sysconfig/network下是
HOSTNAME=ftp1-qa.99bill.com
telnet localhost 25是OK的
并且echo "test" |mail -s "test" 本机帐户
mail -u 本机帐户是能收到刚发送出来的test邮件的,说明25端口没问题,可以发送自己,但是呢,问题就是sendmail这台mx服务器,无法解析我要发送的fate@99.com这个99.com域名啊,为什么啊为什么啊,我的其它三台都没有设置hosts的99.com与IP对应都能发给fate@99.com,这是为什么啊,为什么啊
我的sendmail.cf贴部分如下:
Cwlocalhost
# file containing names of hosts for which we receive email
Fw/etc/mail/local-host-names
# my official domain name
# ... define this only if sendmail cannot automatically determine your domain
#Dj$w.Foo.COM
# host/domain names ending with a token in class P are canonical
CP.
# "Smart" relay host (may be null)
DS
。。。。。。。。。
。。。。。。
# service switch file (name hardwired on Solaris, Ultrix, OSF/1, others)
#O ServiceSwitchFile=/etc/mail/service.switch #因为系统中已经有/etc/nsswitch.conf,所以不开这项
# hosts file (normally /etc/hosts)
O HostsFile=/etc/hosts白纸黑字指出hosts路径
。。。。。。。。。。
。。。。。。。。。
# SMTP daemon options
O DaemonPortOptions=Port=smtp,Addr=0.0.0.0, Name=MTA 已经改成监听来自所有网口的smtp消息
。。。。。。。
。。。。。
# queue directory
O QueueDirectory=/var/spool/mqueue
。。。。。。。。
以上就是我的sendmail配置了,我不用顾及会发垃圾邮件,所以不用写access策略,因为sendmail.cf中的Cwlocalhost是自己,所以未在local-host-name中写自己的主机名(ftp1-qa.99.com)。其它三台也是这么配置,并且使用了半个月没出问题
还有,这台出问题的sendmail发信时非常慢,不论/var/spool/mqueue有没有未发的邮件,都非常慢,发一封要等五分钟才在日志中显示。
我是这么发送邮件的:
echo "test" |mail -s "test" fate@99.com -- -f me@ftp1-qa.99.com
以下是日志:
tail -f /var/log/maillog
Aug 25 16:38:51 ftp1-qa sendmail[7412]: o7P8aBDH007412: from=me@ftp1-qa.99.com, size=44, class=0, nrcpts=1, msgid=<201008250836.o7P8aBDH007412@ftp1-qa.99.com>, relay=root@localhost
Aug 25 16:38:51 ftp1-qa sendmail[7412]: o7P8aBDH007412: to=fate@99.com, delay=00:02:40, mailer=esmtp, pri=30044, dsn=4.4.3, stat=queued
Aug 25 16:38:52 sftp1-qa sendmail[7415]: o7P8aCqc007415: from=me@ftp1-qa.99.com, size=44, class=0, nrcpts=1, msgid=<201008250836.o7P8aCqc007415@ftp1-qa.99.com>, relay=root@localhost
Aug 25 16:38:52 ftp1-qa sendmail[7415]: o7P8aCqc007415: to=fate@99.com, delay=00:02:40, mailer=esmtp, pri=30044, dsn=4.4.3, stat=queued
Aug 25 16:38:52 ftp1-qa sendmail[7418]: o7P8aCUK007418: from=me@ftp1-qa.99.com, size=44, class=0, nrcpts=1, msgid=<201008250836.o7P8aCUK007418@ftp1-qa.99.com>, relay=root@localhost
Aug 25 16:38:52 ftp1-qa sendmail[7418]: o7P8aCUK007418: to=fate@99.com, delay=00:02:40, mailer=esmtp, pri=30044, dsn=4.4.3, stat=queued
查看/var/spool/mqueue/ 下的一个未发送邮件内容如下:
V8
T1282724220
K1282724380
N1
P30039
Mhost map: lookup (99.com): deferred
Fbs
$_root@localhost
${daemon_flags}c u
Sme@ftp1-qa.99.com
Ame@ftp1-qa.99.com
rRFC822; fate@99.com
RPFD:fate@99.com
H?P?Return-Path: <<81>g>
H??Received: (from root@localhost)
by ftp1-qa.99.com (8.13.1/8.13.1/Submit) id o7P8H0Nl007184
for fate@99.com; Wed, 25 Aug 2010 16:17:00 +0800
H?D?Date: Wed, 25 Aug 2010 16:17:00 +0800
H?F?From: 99 me <me@ftp1-qa.99.com>
H?x?Full-Name: 99 fate
H?M?Message-Id: <201008250817.o7P8H0Nl007184@ftp1-qa.99.com>
H??To: fate@99.com
H??Subject: test
完全没招了,谁帮我看看到底是为什么啊?