GNU bug report logs - #78996
29.4; Invalid authinfo credentials when sending mail through SMTP

Previous Next

Package: emacs;

Reported by: 8dcc <8dcc.lists <at> gmail.com>

Date: Sat, 12 Jul 2025 02:27:02 UTC

Severity: normal

Found in version 29.4

Done: Eli Zaretskii <eliz <at> gnu.org>

Bug is archived. No further changes may be made.

Full log


Message #8 received at 78996 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: 8dcc <8dcc.lists <at> gmail.com>
Cc: 78996 <at> debbugs.gnu.org
Subject: Re: bug#78996: 29.4;
 Invalid authinfo credentials when sending mail through SMTP
Date: Sat, 19 Jul 2025 11:07:57 +0300
> From: 8dcc <8dcc.lists <at> gmail.com>
> Date: Fri, 11 Jul 2025 17:58:47 +0200
> 
> I have been trying to write a simple Emacs Lisp function that lets me
> select the credentials that are used when sending mail through
> `compose-mail' with `message-send-mail-function' set to
> `smtpmail-send-it'. I tried many things, including modifying the "From:"
> field, and changing `user-mail-address' (both locally and
> globally). Although the "From" header does indeed change to the right
> value when sending the email, the credentials used when authenticating
> with the SMTP server don't change; in the case of Gmail, this "From"
> header gets overwritten and a new "X-Google-Original-From" header is
> added.
> 
> I thought that the email that was used for authentication was the one I
> had originally set as `user-mail-address', but it turns out that it
> entirely depends on the order of the entries in my '~/authinfo.gpg'
> file.
> 
> For example, if the contents of the file were:
> 
>     machine 127.0.0.1 login my-user port ssh password "****"
>     machine smtp.gmail.com login foo <at> gmail.com password "****" port 465
>     machine smtp.gmail.com login bar <at> gmail.com password "****" port 465
> 
> Then the credentials of "foo <at> gmail.com" would be used, since it's the
> first line whose "machine" value matches the value of my
> `smtpmail-smtp-server' variable.
> 
> Please let me know if you need any more information.

My reading of smtpmail.el is that you should set the value of
smtpmail-smtp-user to control the selection of credentials by login
name.  Did you try that?




This bug report was last modified 32 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.