Subject: bug#29427: Problem sending emails in message-mode after restart

From: Glenn Morris <[email-masked]>
Date: Sun, 26 Nov 2017 20:37:58 -0500

Emmanuel Boudreault wrote:

> By setting 'message-sendmail-f-is-evil', I can bypass this bit of code
> and everything works as expected. However, this is just a workaround
> and doesn't correct the fact that emacs is reading the From field
> incorrectly.

So basically your issue is that your envelope-from isn't being set
correctly, because your system doesn't have a configured mail-host-address.

(setq message-sendmail-envelope-from 'header)

would presumably fix your problem as well, and might be a more sensible
default these days.

Related observations:

sendmail-send-it (which is what you selected by choosing "transport")
doesn't pass -f to sendmail by default. However, message.el uses its own
message-send-mail-with-sendmail instead, and this does pass -f by
default. This seems like a confusing difference, as well as a confusing
duplication of code (but that's message.el for you).

I would guess that you got sendmail-send-it the first time, then
message-send-mail-with-sendmail on all future invocations, owing to how
the variable message-send-mail-function gets initialized.

It all seems Very Complicated.