Subject: Re: bug#78996: 29.4; Invalid authinfo credentials when sending mail through SMTP

From: 8dcc <[email-masked]>
Date: Sun, 20 Jul 2025 00:07:09 +0200

> Probably because smtpmail uses a different buffer for accessing the
> authinfo?  (That's a guess.)

It seems that `smtpmail-send-queued-mail' uses `with-temp-buffer' before
reading `smtpmail-smtp-user'. Not sure if this is necessary, and if it
could be improved.

> But I don't understand why you cannot set the value globally.  It
> isn't like you need to send mail using several different credentials
> at the same time, is it?

I understand what you mean, but permanently modifying a global variable
because I want to send a specific mail from a specific buffer doesn't
seem right to me. For example, some other mode that uses SMTP could ends
up accessing that same value, and since it's not hooked, it could end up
using the email address from that one mail that I sent an hour ago,
which is not my main one (i.e. what used to be the global value of
`smtpmail-smtp-user').

I could perhaps save the old value in my own variable, and then restore
it in another hook, but that's very hacky and doesn't feel right at all.