Seb writes: > I'm using msmtp to send mail through SMTP. I have two SMTP servers > defined in ~/.msmtp, and setting the following: > > message-send-mail-function 'message-send-mail-with-sendmail > sendmail-program "/usr/bin/msmtp" > message-sendmail-extra-arguments '("-a" "gmail") > > does send mail through the "gmail" account in ~/.msmtp. Now I need to > send mail depending on the group. I assume you use different sender address too and you set it with gnus-posting-styles. If this is your case then I can recommend adding the following to your global configuration (setq message-sendmail-f-is-evil nil message-sendmail-envelope-from 'header) From now on msmtp will be started with '-f ' will choose the appropriate account. -- Miłego dnia, Łukasz Stelmach