msmtp sendmail substitutions don't work (%U etc.)

I'm running msmtp 1.8.3-1 on Debian buster, and it's configured and everything works except the sendmail substitutions.

I have a from %[email protected] line in my /etc/msmtprc file but I can't seem to get it to work.

The documents talk about sendmail mode: how do I tell if that's enabled? My system has a symlink from /sbin/sendmail to ../bin/msmtp and running /sbin/sendmail does get an email out as expected. But there's no difference in how that works vs. msmtp from the command-line.


I had the exact same problem with msmtp version 1.8.3 on Debian 10 (Buster).

My workaround was to set the obsolete configuration settings:

auto_from on
maildomain myhost.mydomain.com

in /etc/msmtprc

https://marlam.de/msmtp/msmtp.html#Commands-specific-to-sendmail-mode

This is more or less the same as from %[email protected].