From: "Jens Östlund via Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Eli Zaretskii <eliz@gnu.org>
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:51:27 +0200 [thread overview]
Message-ID: <m2cyxcay8k.fsf@fabriken.lan> (raw)
In-Reply-To: <838r80no11.fsf@gnu.org>
Eli Zaretskii <eliz@gnu.org> writes:
>> 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?
Indeed seem to have been a stale auth-sources.elc file. I recompiled the file and now everything works as expected. Thank you for your quick response, and sorry for taking up your time!
Cheers,
Jens
next prev parent reply other threads:[~2023-10-18 12:51 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
2023-10-18 12:51 ` Jens Östlund via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
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
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=m2cyxcay8k.fsf@fabriken.lan \
--to=bug-gnu-emacs@gnu.org \
--cc=66602@debbugs.gnu.org \
--cc=eliz@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 external index
https://git.savannah.gnu.org/cgit/emacs.git
https://git.savannah.gnu.org/cgit/emacs/org-mode.git
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.