From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#66602: 29.1; smtpmail-send-it fails to authenticate using auth-sources Date: Wed, 18 Oct 2023 14:55:06 +0300 Message-ID: <838r80no11.fsf@gnu.org> References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32796"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 66602@debbugs.gnu.org To: Jens =?UTF-8?Q?=C3=96stlund?= Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Oct 18 13:56:53 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 1qt5AT-0008Io-Gg for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 18 Oct 2023 13:56:53 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qt59O-0007SI-QI; Wed, 18 Oct 2023 07:55:46 -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 1qt59E-0007Nn-Ey for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 07:55:39 -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 1qt59E-0001ln-79 for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 07:55:36 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qt59e-0005Fu-4a for bug-gnu-emacs@gnu.org; Wed, 18 Oct 2023 07:56:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 18 Oct 2023 11:56: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.169763015120174 (code B ref 66602); Wed, 18 Oct 2023 11:56:02 +0000 Original-Received: (at 66602) by debbugs.gnu.org; 18 Oct 2023 11:55:51 +0000 Original-Received: from localhost ([127.0.0.1]:33386 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt59T-0005FK-5v for submit@debbugs.gnu.org; Wed, 18 Oct 2023 07:55:51 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:42300) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qt59Q-0005F2-OG for 66602@debbugs.gnu.org; Wed, 18 Oct 2023 07:55:50 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1qt58u-0001d4-WD; Wed, 18 Oct 2023 07:55:17 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=MIME-version:References:Subject:In-Reply-To:To:From: Date; bh=SZmtIrneGDHuT7yefipzvpt8XDZgAaP2xHXSC8iV6GQ=; b=REB/StIJiKzD5rnADrBO 09KDbgDwq5mJursaUKeJS4JXTf6tdIqrV3VdrK9Sh7kCeGUQJVLvJA6u0CMrxvcMoS8hMh3mVGWou 8HgotAWsZxzAAlSmFVoKnRcgwvKg8HbhbQA2zS2sNkSBEMkmvZTrPq7DKtT4RqAzLym1M97ZWb2Tf YgUTxHXEIeki/+pHWxJDCNdCIkzJsExJAYvJG5BZVm6HtcDJ1WqwGwySpr+6A/6gYX/Pm3SmnxZ7p NTb2XG2X5acK6+hXAA8W9/tERtAPKXvCbVehRDhI7VEJ80sm025Bhktplg/3Dgf0UsrECnlTLj3Bz xHqi8tAQLzbpdw==; In-Reply-To: (bug-gnu-emacs@gnu.org) 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:272650 Archived-At: > 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" > > 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: 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?