Subject: bug#52205: Allow configuring multiple mail accounts for smtpmail.el

From: Philip Kaludercic <[email-masked]>
Date: Wed, 01 Dec 2021 09:01:39 +0000

Lars Ingebrigtsen <[email-masked]> writes:

> Philip Kaludercic <[email-masked]> writes:
>
>> the below patch should allow for multiple mail accounts being configured
>> for smtpmail.el, without having to use tricks like
>> X-Message-SMTP-Method, that only work when the MUA also inserts them at
>> the right time.
>
> The problem is that there's no limit to how people want to configure
> their outgoing mail.

That might be the case, but this is certainly one popular use-case, at
least going by the activity seen on
https://www.emacswiki.org/emacs/MultipleSMTPAccounts.

>> +         (server (alist-get envelope-from smtpmail-smtp-server-alist
>> +                            (list smtpmail-smtp-server)
>> +                            nil #'string=))
>
> And using just the envelope-from might be correct for your use case, but
> it's not, in general, very useful.

Would it be better if a function were to be provided?  E.g. it would be
evaluated in the buffer and return the from address?

> If we want to add something like this to smtpmail, it has to allow a
> full range of customisations for how to determine the server...  and
> that's best done in the MUA, in my opinion.  Which is why it's
> implemented via a header so the MUA can do this.

The issue is that I am not writing using a MUA.  Sometimes I just open
C-x m directly or click on an email address, without Gnus being opened.
Sure, I can hook message-setup-hook to check from and insert
X-Message-SMTP-Method, but that's something everyone has to do for
themselves, over and over again.

-- 
	Philip Kaludercic