From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: John Kehayias via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#57373: 28.1; authinfo keyword smtp-auth does not work Date: Wed, 24 Aug 2022 15:20:48 +0000 Message-ID: <87v8qhzn08.fsf@protonmail.com> References: <87wnay8vs3.fsf@protonmail.com> <87y1veyong.fsf@gmail.com> Reply-To: John Kehayias 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="36209"; mail-complaints-to="usenet@ciao.gmane.io" Cc: 57373@debbugs.gnu.org To: Robert Pluim Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Aug 24 17:23:42 2022 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 1oQsEH-0009IX-Qf for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Aug 2022 17:23:41 +0200 Original-Received: from localhost ([::1]:38046 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1oQsEG-0004r3-IF for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 24 Aug 2022 11:23:40 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36606) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1oQsBj-0002iJ-7w for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 11:21:19 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:57933) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1oQsBi-0005F8-CU for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 11:21:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1oQsBi-00008A-9F for bug-gnu-emacs@gnu.org; Wed, 24 Aug 2022 11:21:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: John Kehayias Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 24 Aug 2022 15:21:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 57373 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: moreinfo Original-Received: via spool by 57373-submit@debbugs.gnu.org id=B57373.1661354461477 (code B ref 57373); Wed, 24 Aug 2022 15:21:02 +0000 Original-Received: (at 57373) by debbugs.gnu.org; 24 Aug 2022 15:21:01 +0000 Original-Received: from localhost ([127.0.0.1]:47682 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQsBh-00007c-2q for submit@debbugs.gnu.org; Wed, 24 Aug 2022 11:21:01 -0400 Original-Received: from mail-40133.protonmail.ch ([185.70.40.133]:45377) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1oQsBf-00007Q-A3 for 57373@debbugs.gnu.org; Wed, 24 Aug 2022 11:21:00 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=protonmail.com; s=protonmail3; t=1661354453; x=1661613653; bh=fK8iZmjeYfoUUBFm72CZrvXDmmlcsEswHnR8gWkgjIk=; h=Date:To:From:Cc:Reply-To:Subject:Message-ID:In-Reply-To: References:Feedback-ID:From:To:Cc:Date:Subject:Reply-To: Feedback-ID:Message-ID; b=CKAvKKEKz6QPS3aQcApXYUazlpZ6+mHUuQkTUItTlXk0N82EvuNIXWZ7Ic0U220MM hRfpoeBpSoCk5lwPYVsOJmwKnXJKRfWZTmGE76/QjHEa0V7hG3i4ONB5wTl1w5O5ge ZIi4jC8COJSGTXj+EXMtbYvg1G7YoJYtNTpBIlIs/6FoKGZvChSBpmw62zmzZOEKGV P2EFRCNgKZhO+d3INTN5ELxXVZpb4Ulls22UfGxPgkoh+PCD9l3FRaFEZiydn2zjRB OiiSAl9F7CzhZLgMlI7kYJgncPY76+f+cZURn+bwaMQ3PJrZ7ITe1p6Q6/nWSeswEP 2KTG64jqpDipw== In-Reply-To: <87y1veyong.fsf@gmail.com> Feedback-ID: 7805494:user:proton 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" X-ACL-Warn: , John Kehayias Xref: news.gmane.io gmane.emacs.bugs:240638 Archived-At: Hello Robert, Thanks for such a quick response and fix! Let me just add my use case being= that some SMTP servers I use have different authentication methods, but wi= ll try and fail with the others. I could work around this by modifying the = ordering in smtpmail-auth-supported, at least for my current sent of server= s. Anyway, was happy to see this feature for exactly this reason. On Wed, Aug 24, 2022 at 11:30 AM, Robert Pluim wrote: >>>>>> On Tue, 23 Aug 2022 22:01:10 +0000, John Kehayias via "Bug reports f= or GNU Emacs, > the Swiss army knife of text editors" said: > > John> I believe the problem is that in smtpmail-try-auth-methods > John> the smtp-auth keyword is read in by auth-source-search as a > John> string, while the call to smtpmail-try-auth-method that uses > John> it all match with eql, eg. as (eql 'plain). > > Yep. > > John> I have tried different ways to get the smtp-auth value read > John> differently in my authinfo, to no avail. Looking back at the > John> devel mailing list, there was some confusion that this > John> feature needed plstore, but in the end did not: > John> > John> I can confirm that reading the authinfo does provide the > John> smtp-auth keyword, it just won't match any method to call. > > John> Perhaps there is a different format for specifying smtp-auth th= at I didn't find? > > auth-source search always returns a plist containg strings as the key > values. Does the following work for you Understood, just wanted to be sure I wasn't missing something obvious. > > diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el > index c2f8f27377..8573532eac 100644 > --- a/lisp/mail/smtpmail.el > +++ b/lisp/mail/smtpmail.el > @@ -577,7 +577,7 @@ smtpmail-try-auth-methods > (stringp result)) > (setq result (catch 'done > =09=09 (smtpmail-try-auth-method > - process (pop mechs) user password)))) > + process (intern-soft (pop mechs)) user passwor= d)))) > ;; A string result is an error. > (if (stringp result) > (progn > Yes that works for me! Note that I am not on Emacs 29, nor my Guix machine = where I could easily rebuild with a patch, so I just did a local redefiniti= on of smtpmail-try-auth-methods with (intern-soft mech) in the call to smtp= mail-try-auth-method. So I didn't backport the full changes to that functio= n I see. I can certainly try that later, but wanted to a quick check. I was= able to send mail with smtp-auth specified in my authinfo. Thanks! John