![为什么 nullmailer 将我的主机名附加到收件人地址?](https://linux22.com/image/149805/%E4%B8%BA%E4%BB%80%E4%B9%88%20nullmailer%20%E5%B0%86%E6%88%91%E7%9A%84%E4%B8%BB%E6%9C%BA%E5%90%8D%E9%99%84%E5%8A%A0%E5%88%B0%E6%94%B6%E4%BB%B6%E4%BA%BA%E5%9C%B0%E5%9D%80%EF%BC%9F.png)
我想设置 nullmailer 将邮件中继到我的提供商的 SMTP。
由于提供商会丢弃发件人域和用户登录名不匹配的电子邮件,因此我曾经/etc/nullmailer/allmailfrom
匹配登录名/etc/nullmailer/remotes
并且它有效,我可以将电子邮件发送到完全合格的地址。
我还曾经/etc/nullmailer/adminaddr
将所有本地电子邮件重定向[user]@localhost
到[email protected]
.这是因为根据man nullmailer-queue
adminaddr If this file is not empty, all recipients to users at either "localhost" (the literal string) or the canon‐ ical host name (from /etc/mailname ) are remapped to this address. This is provided to allow local daemons to be able to send email to "somebody@localhost" and have it go somewhere sensible instead of being bounced by your relay host. To send to multiple addresses, put them all on one line separated by a comma.
现在我想附加myowndomain.net
到通用用户名 ( mail any_username
)。根据man nullmailer-inject
,
defaultdomain The content of this file is appended to any host name that does not contain a period (except localhost), including defaulthost and idhost. Defaults to the value of the /etc/mailname system file, if it exists, otherwise the literal name defauldomain. defaulthost The content of this file is appended to any address that is missing a host name. Defaults to the value of the /etc/mailname system file, if it exists, otherwise the literal name defaulthost.
据我了解,我应该使用,/etc/nullmailer/defaulthost
因为我正在向缺少主机名的地址发送电子邮件。所以我就放在那里myowndomain.net
。
但是,nullmailer 仍然附加@hostname.myprovider.net
,导致电子邮件被 SMTP 中继主机丢弃:所述域不存在。
如何配置 nullmailer 以仅添加@myprovider.net
而不是@hostname.myprovider.net
添加到缺少主机名的地址?