LinuxSir.cn,穿越时空的Linuxsir!

 找回密码
 注册
搜索
热搜: shell linux mysql
查看: 595|回复: 1

大家能不能帮我看看sendmail做域MX服务器的问题

[复制链接]
发表于 2007-1-9 21:11:20 | 显示全部楼层 |阅读模式
在两个不同域之间进行smtp转发时遇到了问题

两台电脑
A:
192.168.1.11  
属于example.com域
FQDN主机名为station11.example.com

B:
192.168.1.20
属于test.com域
FQDN主机名为station20.test.com
并担任test.com的MX服务器
test.com中另有一台主机station30.test.com

A同时负责example.com和test.com两个域的DNS解析,其中针对test.com的zone文件如下:

$TTL        86400
@        IN SOA        ns.test.com. root.ns.test.com. (
                                        2007010900        ; serial
                                        3H                ; refresh
                                        5M                ; retry
                                        1W                ; expiry
                                        1H )                ; minimum

@                IN NS              ns.test.com.

ns                  IN A            192.168.1.11
station20       IN A            192.168.1.20
station30       IN A           192.168.1.30
mail              IN A            192.168.1.20   #B的IP地址

pop             IN CNAME        mail
imap            IN CNAME        mail

@               IN MX           5  mail.test.com  #指向B



在A上,向test.com域发送邮件,目的地为mail@test.com

在B上,这个地址被做了重定向,定向到了test.com的另外一台主机station30
/etc/mail/virtusertable
mail@test.com       root@station30.test.com

并且B上的/etc/mail/local-host-names加入了B的2个主机名称
mail.test.com  
station20.test.com

B的RELAY规则如下
/etc/mail/access
localhost.localdomain                RELAY
localhost                        RELAY
127.0.0.1                        RELAY
192.168.1                                RELAY

B的sendmail.mc没有做过其他改动,只是在DAEMON_OPTION里注释掉了
DAEMON_OPTIONS(`Port=smtp,Addr=127.0.0.1, Name=MTA')dnl


现在从A向mail@test.com发送邮件
#echo “test mail” | mail -s  test mail@test.com

但到此就失败了,查看B上的日志

/var/log/maillog

Jan  9 17:53:24 station20 sendmail[4437]: l099rO54004437: from=<root@station11.example.com>, size=533, class=0, nrcpts=1, msgid=<200701090955.l099tSfc007237@station11.example.com>, proto=ESMTP, daemon=MTA, relay=[192.168.1.11]

Jan  9 17:53:24 station20 sendmail[4439]: l099rO54004437: SYSERR(root): MX list for test.com. points back to station20.test.com

Jan  9 17:53:24 station20 sendmail[4439]: l099rO54004437: to=<mail@test.com>, delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120533, relay=test.com., dsn=5.3.5, stat=Local configuration error

Jan  9 17:53:24 station20 sendmail[4439]: l099rO54004437: l099rO54004439: DSN: Local configuration error

Jan  9 17:53:25 station20 sendmail[4439]: l099rO54004439: to=root, delay=00:00:01, xdelay=00:00:01, mailer=local, pri=61741, dsn=2.0.0, stat=Sent

Jan  9 17:53:25 station20 sendmail[4439]: l099rO54004439: to=<root@station11.example.com>, delay=00:00:01, xdelay=00:00:00, mailer=esmtp, pri=61741, relay=station11.example.com. [192.168.1.11], dsn=2.0.0, stat=Sent (l099tTr3007241 Message accepted for delivery)


看起来是B不承认自己作为test.com的MX主机?但是我已经在local-host-names中做了定义。自己研究了1天多没什么头绪。
 楼主| 发表于 2007-1-10 18:43:12 | 显示全部楼层
貌似是local-host-names的问题
这个文件里应该填B服务的域名test.com,而不该填B的FQDN主机名
我改动过后,就可以做test.com的relay了

但是这个文件的注释说请把本机的所有名称填进来,很迷惑人

求证一下各位大虾,我的理解是否正确
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

快速回复 返回顶部 返回列表