Sendmail

Hetzner sendmail 問題“返回發件人:使用者未知”

  • August 9, 2016

由於某種原因,我的 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

您的 sendmail 將消息發送到名為 的本地使用者/郵箱hetzner。您的 sendmail 報告作業系統帳戶不存在。

您可以為非本地電子郵件地址定義別名,例如

# forward message to local account/mailbox named "archive" and to non local email
hetzner: archive,john.doe@example.net
# sendmail specific hack to deliver to local account and send a copy
user: \user,jane.doe@example.org

見“男人別名”

引用自:https://unix.stackexchange.com/questions/302235