I want to set up nullmailer to relay mail to my provider's SMTP.
Since the provider drops email with mismatching sender's domain and user login, I used /etc/nullmailer/allmailfrom
to match the login from /etc/nullmailer/remotes
and it works, I can send email to fully qualified addresses.
I also used /etc/nullmailer/adminaddr
to redirect all local emails [user]@localhost
to default@myowndomain.net
. This is because according to 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.
Now I want to have myowndomain.net
appended to generic usernames (mail any_username
). According to 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.
From what I understood, I should use /etc/nullmailer/defaulthost
because I am sending emails to addresses missing a host name. Therefore I placed there myowndomain.net
.
However, nullmailer still appends @hostname.myprovider.net
, resulting in emails dropped by the SMTP relay host: said domain does not exist.
How can I configure nullmailer to just add @myprovider.net
instead of @hostname.myprovider.net
to addresses missing a hostname?