maillog“没有路由到主机”的错误

我有一个CentOS服务器。 它安装了sendmail,但不用于邮件服务器。 我将根邮件转发到另一个电子邮件地址。 但是,我不断收到maillog中的错误:

Dec 6 08:49:16 server1 sm-msp-queue[16191]: qB6601et005433: to=root, ctladdr=root (0/0), delay=08:49:15, xdelay=00:00:00, mailer=relay, pri=883224, relay=[127.0.0.1], dsn=4.0.0, stat=Deferred: [127.0.0.1]: No route to host Dec 6 08:49:16 server1 sendmail[16190]: qB39nDfQ014062: to=<[email protected]>, delay=3+05:00:02, xdelay=00:00:00, mailer=esmtp, pri=6965048, relay=subdomain.example.com., dsn=4.0.0, stat=Deferred: subdomain.example.com.: No route to host Dec 6 08:49:16 server1 sendmail[16190]: qB39nDfR014062: to=<[email protected]>, delay=3+05:00:02, xdelay=00:00:00, mailer=esmtp, pri=7004959, relay=subdomain.example.com., dsn=4.0.0, stat=Deferred: subdomain.example.com.: No route to host 

在转发的电子邮件地址,我收到通知“它不能发送电子邮件到[email protected]

subdoamin.example.com确实有一个MXlogging,我不想添加一个。

有没有我可以改变的configuration来防止这个错误? 我想要所有的电子邮件到根被转发到转发地址。

你可以ping(通过主机名或IP)subdomain.example.com? 这个错误对我说的是,你根本就没有到那个主机的IP连接 – 解决这个问题,并且(假设主机正在接受你的邮件),sendmail会很高兴。

你有没有取消注释强制sendmail仅侦听/etc/mail/sendmail.mc中的环回或本地接口的行? 如果不是,请尝试取消注释该行 –

改变这一点

 DAEMON_OPTIONS(`Port=smtp, Addr=127.0.0.1, Name=MTA')dnl 

对此

 DAEMON_OPTIONS(`Port=smtp, Name=MTA')dnl 

在我的情况下,我不得不添加一个relayhost到我的sendmail.cf文件。 我将DS更改为DS relayhost.example.com并重新启动了sendmail。