为什么 nullmailer 将我的主机名附加到收件人地址?

为什么 nullmailer 将我的主机名附加到收件人地址?

我想设置 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添加到缺少主机名的地址?

相关内容