关于sendmail发的邮件都被本地root接收的问题
本帖最后由 ethan_lu 于 2011-05-10 10:58 编辑
我的服务器绑定域名:a.org
当我向 xx@a.org 发送的所有邮件都被发到了服务器root用户那里去了。
发向其它域的邮件都能正常接收到。求解
参照老外设置
这是在无名邮件列表堆里找到的:
May 10 10:07:48 chinasb sendmail[24224]: p4A27kn0024224: from=root, size=0, class=0, nrcpts=1, msgid=<201105100207.p4A27kn0024224@chinasb.org>, relay=root@localhost
May 10 10:07:48 chinasb sendmail[24225]: p4A27mZ9024225: from=<root@chinasb.org>, size=267, class=0, nrcpts=1, msgid=<201105100207.p4A27kn0024224@chinasb.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
May 10 10:07:48 chinasb sendmail[24224]: p4A27kn0024224: to=mail@chinasb.org, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30000, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p4A27mZ9024225 Message accepted for delivery)
May 10 10:07:48 chinasb sendmail[24226]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-SHA, bits=128/128
May 10 10:07:50 chinasb sendmail[24226]: p4A27mZ9024225: to=root, ctladdr=<root@chinasb.org> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30476, relay=aspmx.l.google.com. [74.125.127.27], dsn=2.0.0, stat=Sent (OK 1304993058 wt16si18366654icb.139)
经过了新一轮的排查,还有vpser大饼博士的热心帮助,问题终于解决啦。说一下过程
首先检查向指定用户发信
root... deliverable: mailer relay, host chinasb.org., user mail@chinasb.org
mails... deliverable: mailer relay, host chinasb.org., user mails@chinasb.org
看到这里那个郁闷呢,幸好还是大饼博士知识渊博,马上提醒了邮件别名设置。
马上检查/etc/aliases
# General redirections for pseudo accounts.
bin: root
daemon: root
adm: root
lp: root
sync: root
shutdown: root
halt: root
mail: root
.....
果然,被别名了,注释掉保存重启。
mail... deliverable: mailer relay, host chinasb.org., user mail@chinasb.org
显示正常,邮件收发正常。这一次sendmail安装记录又学到了不少东西哈....
我的服务器绑定域名:a.org
当我向 xx@a.org 发送的所有邮件都被发到了服务器root用户那里去了。
发向其它域的邮件都能正常接收到。求解
参照老外设置
- vim /etc/mail/sendmail.mc
- define(`MAIL_HUB', `example.com.')dnl
- define(`LOCAL_RELAY', `example.com.')dnl
- m4 /usr/share/sendmail-cf/m4/cf.m4 sendmail.mc > sendmail.cf
- service sendmail restart
这是在无名邮件列表堆里找到的:
mail.jpg (17.24 KB, 下载次数: 74)
May 10 10:07:48 chinasb sendmail[24224]: p4A27kn0024224: from=root, size=0, class=0, nrcpts=1, msgid=<201105100207.p4A27kn0024224@chinasb.org>, relay=root@localhost
May 10 10:07:48 chinasb sendmail[24225]: p4A27mZ9024225: from=<root@chinasb.org>, size=267, class=0, nrcpts=1, msgid=<201105100207.p4A27kn0024224@chinasb.org>, proto=ESMTP, daemon=MTA, relay=localhost.localdomain [127.0.0.1]
May 10 10:07:48 chinasb sendmail[24224]: p4A27kn0024224: to=mail@chinasb.org, ctladdr=root (0/0), delay=00:00:02, xdelay=00:00:00, mailer=relay, pri=30000, relay=[127.0.0.1] [127.0.0.1], dsn=2.0.0, stat=Sent (p4A27mZ9024225 Message accepted for delivery)
May 10 10:07:48 chinasb sendmail[24226]: STARTTLS=client, relay=aspmx.l.google.com., version=TLSv1/SSLv3, verify=FAIL, cipher=RC4-SHA, bits=128/128
May 10 10:07:50 chinasb sendmail[24226]: p4A27mZ9024225: to=root, ctladdr=<root@chinasb.org> (0/0), delay=00:00:02, xdelay=00:00:02, mailer=relay, pri=30476, relay=aspmx.l.google.com. [74.125.127.27], dsn=2.0.0, stat=Sent (OK 1304993058 wt16si18366654icb.139)
经过了新一轮的排查,还有vpser大饼博士的热心帮助,问题终于解决啦。说一下过程
首先检查向指定用户发信
- sendmail -bv mail
root... deliverable: mailer relay, host chinasb.org., user mail@chinasb.org
- sendmail -bv mails
mails... deliverable: mailer relay, host chinasb.org., user mails@chinasb.org
看到这里那个郁闷呢,幸好还是大饼博士知识渊博,马上提醒了邮件别名设置。
马上检查/etc/aliases
- cat /etc/aliases
# General redirections for pseudo accounts.
bin: root
daemon: root
adm: root
lp: root
sync: root
shutdown: root
halt: root
mail: root
.....
果然,被别名了,注释掉保存重启。
- sendmail -bv mail
mail... deliverable: mailer relay, host chinasb.org., user mail@chinasb.org
显示正常,邮件收发正常。这一次sendmail安装记录又学到了不少东西哈....
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(5)
有没有做relay?
如何做relay,请教楼上。谢谢
本帖最后由 ethan_lu 于 2011-05-10 10:08 编辑
顶起来
发送账号有 .forward 吗
mark一下。