Hetzner sendmail 问题“返回发件人:用户未知”

Hetzner sendmail 问题“返回发件人:用户未知”

由于某种原因,我的 sendmail 无法通过 sendmail 从我位于 Hetzner 的虚拟服务器发送邮件。

在我的/etc/mail/aliases配置中看起来像:

mailer-daemon: postmaster
postmaster: root
nobody: root
hostmaster: root
usenet: root
news: root
webmaster: root
www: root
ftp: root
abuse: root
noc: root
security: root
fail2ban: root
root: hetzner

看起来没问题,因为它尝试发送邮件,但日志显示:

Aug  9 10:11:47 mydomain sm-mta[16537]: u798BllJ016535: to=<fail2ban@mydomain>, delay=00:00:00, mailer=local, pri=123469, dsn=5.1.1, stat=User unknown
Aug  9 10:11:47 mydomain sm-mta[16537]: u798BllJ016535: to=hetzner, ctladdr=root (8/0), delay=00:00:00, mailer=local, pri=123469, dsn=5.1.1, stat=User unknown
Aug  9 10:11:47 mydomain sm-mta[16537]: u798BllJ016535: u798BllJ016537: postmaster notify: User unknown
Aug  9 10:11:48 mydomain sm-mta[16537]: u798BllJ016537: to=hetzner, ctladdr=root (8/0), delay=00:00:01, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Aug  9 10:11:48 mydomain sm-mta[16537]: u798BllJ016537: to=hetzner, ctladdr=root (8/0), delay=00:00:01, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Aug  9 10:11:48 mydomain sm-mta[16537]: u798BllJ016537: u798BllK016537: return to sender: User unknown
Aug  9 10:11:48 mydomain sm-mta[16537]: u798BllK016537: to=hetzner, ctladdr=root (8/0), delay=00:00:00, mailer=local, pri=0, dsn=5.1.1, stat=User unknown
Aug  9 10:11:48 mydomain sm-mta[16537]: u798BllJ016537: Saved message in /var/lib/sendmail/dead.letter

(我在日志文件中隐藏了我的域名。但它是在/etc/mail/local-host-names和中配置的/etc/hosts

答案1

您的 sendmail 将消息发送到名为 的本地用户/邮箱hetzner。您的 sendmail 报告操作系统帐户不存在。

您可以定义非本地电子邮件地址的别名,例如

# forward message to local account/mailbox named "archive" and to non local email
hetzner: archive,[email protected]
# sendmail specific hack to deliver to local account and send a copy
user: \user,[email protected]

请参阅“男人别名”

相关内容