GNU bug report logs -
#66602
29.1; smtpmail-send-it fails to authenticate using auth-sources
Previous Next
Reported by: Jens Östlund <jens <at> iensu.me>
Date: Wed, 18 Oct 2023 06:30:01 UTC
Severity: normal
Found in version 29.1
Done: Eli Zaretskii <eliz <at> gnu.org>
Bug is archived. No further changes may be made.
Full log
Message #16 received at 66602 <at> debbugs.gnu.org (full text, mbox):
Eli Zaretskii <eliz <at> 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 <at> 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 <at> 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
This bug report was last modified 1 year and 214 days ago.
Previous Next
GNU bug tracking system
Copyright (C) 1999 Darren O. Benham,
1997,2003 nCipher Corporation Ltd,
1994-97 Ian Jackson.