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

From: Eric Abrahamsen <[email-masked]>
Date: Mon, 27 Nov 2017 15:08:45 -0800

On 11/26/17 20:37 PM, Glenn Morris wrote:
> 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.

I still think the simplest solution would be to set `user-mail-address'.
It's a reasonable thing to have set globally, and once it's set
everything else can be ignored.

> (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.

That's an understatement...