notmuch-mua-send + msmtp IS sending perfectly... but Emacs says it failed! Why?!

Aren Tyr aren.tyr at
Sat Oct 26 15:07:32 PDT 2019

> I also have msmtp and here is my set of .emacs configs
>   (setq sendmail-program "/usr/bin/msmtp")
>   (setq mail-specify-envelope-from t)
>   (setq message-sendmail-envelope-from 'header)
>   (setq mail-envelope-from 'header)
>   (setq send-mail-function 'message-send-mail-with-sendmail)
> There is a line for it in my .mailrc:
>   set sendmail="/usr/bin/msmtp"
> I /think/ that's all I have about the sending of mails and it works
> fine. (plus the msmtp configs of course).
> Best regards
> --
> Tomas

Hi Tomas

Thanks for the response. Unfortunately even with these settings it
doesn't fix the issue. I even tried creating ~/.mailrc with your set
sendmail line as above. It's strange. The mail /is/ getting sent just

The error message doesn't really make any sense/is deeply ambiguous:

Sending via mail...
message-send-mail-with-sendmail: Sending...failed to gpg: Signature
made Wed 09 Oct 2019 12:50:15 BST; gpg:

I'm not sure what it means by "failed to gpg" in this context, seeing
as it correctly decrypts my password via gpg and the sends it via
mstmp. And to be clear, I'm definitely not attempting to PGP sign or
encrypt the e-mail either...

Is it expecting some return value from the gpg (or sendmail/msmtp)
command to confirm all is OK, and is perhaps not getting that value?

I'm using this:

passwordeval   gpg2 --no-tty -q -d ~/.mail/passwords/gmail-main.gpg

And I've also used/tried:

passwordeval   "gpg2 -q --for-your-eyes-only --no-tty -d

Both variants worked perfectly from the point of view of actually
decrypting the password and sending the e-mail, so there doesn't seem
to be a difference between the two in practice. Do I need another
switch to gpg in order to generate a return value to satisfy emacs?



More information about the notmuch mailing list