From: Eli Zaretskii <eliz@gnu.org>
To: "Jens Östlund" <jens@iensu.me>
Cc: 66602@debbugs.gnu.org
Subject: bug#66602: 29.1; smtpmail-send-it fails to authenticate using auth-sources
Date: Wed, 18 Oct 2023 14:55:06 +0300 [thread overview]
Message-ID: <838r80no11.fsf@gnu.org> (raw)
In-Reply-To: <D5E88203-53F4-4A37-9982-5F32DEC580DA@iensu.me> (bug-gnu-emacs@gnu.org)
> Date: Wed, 18 Oct 2023 08:17:07 +0200
> From: Jens Östlund via "Bug reports for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
>
> When sending an email with 'smtpmail-send-it' the function 'smtpmail-try-auth-methods' fails to find the matching entry. Using 'edebug' I've found that the reason is this piece of code where the 'port' is converted to a string (smtpmail.el.gz:533-536):
>
> '(setq port
> (if port
> (format "%s" port)
> "smtp"))'
>
> When the 'port' is later passed to 'auth-source-search' on line 541 it fails to find any matching entries since ':port' is matched as a number, not a string. If I remove the above piece of code, so that 'port' is never turned into a string, sending the email works as expected. Maybe the best solution is to make 'auth-source-search' match both numeric and string values, at least for the ':port' argument.
>
> SMTP session trace:
>
> '220 mailrelay6 ESMTP
> 250-mailrelay6
> 250-PIPELINING
> 250-CHUNKING
> 250-SIZE 104857600
> 250-AUTH LOGIN PLAIN
> 250-ENHANCEDSTATUSCODES
> 250 8BITMIME
> MAIL FROM:<xxxxxxx@xxxxxx.xx> SIZE=322
> 550 5.7.1 [M1] Authentication required (431ff6c7-6d37-11ee-accc-23968f462fbe)
> QUIT
> 221 2.0.0 Bye
>
> Process smtpmail connection broken by remote peer’
Thanks.
I guess I'm missing something, because I use smtpmail with
authentication and a specific port all the time without any trouble.
So maybe show the entry from your ~/.authinfo?
Also, can you point me to the place where you see that port is matched
as a number? See also bug#55199, where a similar problem was fixed,
and the fix should be in Emacs 29.1. Maybe you have a stale
auth-sources.elc?
next prev parent reply other threads:[~2023-10-18 11:55 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-18 6:17 bug#66602: 29.1; smtpmail-send-it fails to authenticate using auth-sources Jens Östlund via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-18 11:55 ` Eli Zaretskii [this message]
2023-10-18 12:51 ` Jens Östlund via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-18 13:15 ` Eli Zaretskii
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
List information: https://www.gnu.org/software/emacs/
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=838r80no11.fsf@gnu.org \
--to=eliz@gnu.org \
--cc=66602@debbugs.gnu.org \
--cc=jens@iensu.me \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.savannah.gnu.org/cgit/emacs.git
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).