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

To reply to this bug, email your comments to 78996 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#78996; Package emacs. (Sat, 12 Jul 2025 02:27:02 GMT) Full text and rfc822 format available.

Acknowledgement sent to 8dcc <8dcc.lists <at> gmail.com>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Sat, 12 Jul 2025 02:27:02 GMT) Full text and rfc822 format available.

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

From: 8dcc <8dcc.lists <at> gmail.com>
To: bug-gnu-emacs <at> gnu.org
Subject: 29.4; Invalid authinfo credentials when sending mail through SMTP
Date: Fri, 11 Jul 2025 17:58:47 +0200
Hello,

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.

Thank you,
8dcc.




This bug report was last modified 5 days ago.

Previous Next


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