sendmail 不使用 mailertable

sendmail 不使用 mailertable

我无法让我的邮件表正常工作......

/etc/mail/sendmail.mc contains this line
FEATURE(`mailertable', `hash -o /etc/mail/mailertable.db')dnl

/etc/mail/mailertable contains this line
domain1.com        esmtp:[10.210.5.22]

我运行这些来“重新编译”设置......

makemap hash /etc/mail/mailertable.db < /etc/mail/mailertable
m4 /etc/mail/sendmail.mc > /etc/mail/sendmail.cf
service sendmail restart

然后尝试发送测试

$ mail -s "test email" [email protected]


$ tail -f /var/log/maillog
May  9 10:03:14 npsetl005 sendmail[27779]: p49E3EG0027777: to=<[email protected]>, ctladdr=<[email protected]> (0/0), delay=00:00:00, xdelay=00:00:00, mailer=esmtp, pri=120350, relay=www.domain1.com. [172.16.1.47], dsn=4.0.0, stat=Deferred: Connection refused by www.domain1.com.

mailertable.db 文件的内容

root@npsetl005:/etc/mail$ strings mailertable.db
esmtp:[10.210.5.22]
domain1.com

我们的内部网络上存在这个愚蠢的问题,其中 DNS 和 MX 记录并未真正 100% 正确设置。获得更改它的许可并对其进行测试远远超出了这个问题的范围;所以我只是想让 sendmail 忽略 DNS 中的内容并将消息直接发送到我们的内部中继服务器(适用于数十个其他客户端) - 但它并没有这样做。您可以看到它正在将地址重写为[电子邮件受保护]因为父 *.domain1.com 是 www.domain1.com 的 cname(有人将其作为穷人重定向)。因此,如果用户尝试访问不存在的子域,他们会转到根网站... 我知道我知道。)

我错过了什么?

答案1

你没有提到你的sendmail版本。 Sendmail 坏了...抱歉,在 8.14 版本中改变了 mailertable 的工作方式。当使用 sendmail-8.14 升级到 RHEL6 时,我的所有邮件中心都崩溃了。我仍在尝试确切地了解他们改变了什么,以及他们为什么改变它。但到目前为止我已经掌握了两个技巧:

1) 如果您想使用 virtusertable,并在 virtusertable 条目的 RHS 上使用 mailertable,则 LHS 需要位于新的 VirtHost 类中。有 VIRTUSER_DOMAIN_FILE 和 VIRTUSER_DOMAIN 宏可以帮助解决这个问题。

2) 如果 LHS 域出现在 local-hosts-name 中,则永远不会使用 mailertable。

我不确定这些信息有多准确,但是关于这一巨大且未记录的变化的信息很少,也许这会对处于我位置的人有所帮助。

答案2

您已发送到,[email protected]但 sendmail 将其重写为[email protected]。 mailertable 条目不涵盖子域。

快速解决:
添加 mailertable 条目www.domain1.com

您是否使用domain1.com 的CNAME 记录?
Sendmail 将 CNAME(DNS 别名)重写为其“真实”名称。

相关内容