Closed LaXiS96 closed 7 months ago
The -t
option tells msmtp to read recipients from the mail, so it in this example it uses whatever is in the To
header.
You could use aliases /etc/aliases
in your configuration file with the following contents in /etc/aliases
:
root: root@icecream.example.org
Hello, I am running v1.8.23 on Debian 11 (built from Debian 12 sources, since Debian 11 only has v1.8.11 and that doesn't support
allow_from_override
).I have noticed that running a simple test command like
echo test | mail root
would not work on Debian 11, while it would on Debian 12. The difference is that on 11, themail
command sets theTo:
header to the full address including the hostname/mailname, while on 12 it does not.When the recipient is specified as a full address containing the hostname/mailname, msmtp will forward mail without rewriting the recipient to the one specified by the aliases. This can result in undelivered mail (depending on the recipient the caller sets), since the local host clearly cannot receive mail.
Here is the behavior on Debian 11 (
icecream.example.org
is the local FQDN and also/etc/mailname
):While on Debian 12:
/etc/msmtprc
:/etc/aliases
:Is there already some configuration option to correctly treat addresses with the domain part matching the local hostname (FQDN or not) or mailname? If the answer is no, would it be a good idea to add it? Thank you