From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Jens =?UTF-8?Q?=C3=96stlund?= via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66602: 29.1; smtpmail-send-it fails to authenticate using auth-sources Date: Wed, 18 Oct 2023 14:51:27 +0200 Message-ID: References: <838r80no11.fsf@gnu.org> Reply-To: Jens =?UTF-8?Q?=C3=96stlund?= Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25182"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66602@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 18 15:27:06 2023 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1qt6Zl-0006Kw-5i for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Oct 2023 15:27:05 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt6ZT-0003op-Fc; Wed, 18 Oct 2023 09:26:47 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt6ZM-0003jm-6E for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 09:26:40 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1qt6ZI-0003rR-JJ for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 09:26:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qt6Zi-0008JG-9v for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 09:27:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jens =?UTF-8?Q?=C3=96stlund?= Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Oct 2023 13:27:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66602 X-GNU-PR-Package: emacs Original-Received: via spool by 66602-submit@debbugs.gnu.org id=B66602.169763562031935 (code B ref 66602); Wed, 18 Oct 2023 13:27:02 +0000 Original-Received: (at 66602) by debbugs.gnu.org; 18 Oct 2023 13:27:00 +0000 Original-Received: from localhost ([127.0.0.1]:33461 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt6Zf-0008J0-IJ for submit@debbugs.gnu.org; Wed, 18 Oct 2023 09:27:00 -0400 Original-Received: from out-196.mta0.migadu.com ([2001:41d0:1004:224b::c4]:55286) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt63G-0007Js-0n for 66602@debbugs.gnu.org; Wed, 18 Oct 2023 08:53:34 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=iensu.me; s=key1; t=1697633581; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=64PRw+dPDc0CeMOJmTnkbhedMXC5AqxzuytT9QFDWaI=; b=TIUXDAzVvOQqfA5AQ1gFvdwGo31AHNOdR2uLcFhEetMPQzft+H153G/lHdeDAuJNevye5G ajfUofOfnH4ZJNZ0wLS4RekbOFAZb1GdzOcvsSfg8tMVuyQwTizRRRiu7I9POZ5xkiTq2W q46APrY2ivPZiRmFAHV9YULtTvLeyLM= X-Report-Abuse: Please report any abuse attempt to abuse@migadu.com and include these headers. In-reply-to: <838r80no11.fsf@gnu.org> X-Migadu-Flow: FLOW_OUT X-Mailman-Approved-At: Wed, 18 Oct 2023 09:26:58 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:272652 Archived-At: Eli Zaretskii writes: >> Date: Wed, 18 Oct 2023 08:17:07 +0200 >> From: Jens =C3=96stlund via "Bug reports for GNU Emacs, >> the Swiss army knife of text editors" >> >> 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 st= ring (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 f= ails 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 tur= ned into a string, sending the email works as expected. Maybe the best solu= tion 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: SIZE=3D322 >> 550 5.7.1 [M1] Authentication required (431ff6c7-6d37-11ee-accc-23968f46= 2fbe) >> QUIT >> 221 2.0.0 Bye >> >> Process smtpmail connection broken by remote peer=E2=80=99 > > 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 fi= le and now everything works as expected. Thank you for your quick response,= and sorry for taking up your time! Cheers, Jens