Hi,
A more mutt-like solution could be to use send-hooks to set the $sendmail variable every time the From: header of an email changes. msmtp accepts the account to be used on the command line as -a $account,send-hook "~f o...@example.com" 'set sendmail = "/usr/bin/msmtp -a a"' send-hook "~f t...@example.com" 'set sendmail = "/usr/bin/msmtp -a b"'
Having just been looking at a similar problem it might better to use set sendmail = "/usr/bin/msmtp --read-envelope-from"Which removes the need to specify an account completely with msmtp so long as it can find a matching from address in you msmtp config.
Regards, spaceman
signature.asc
Description: PGP signature