unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: John Kehayias via "Bug reports for GNU Emacs, the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org>
To: Robert Pluim <rpluim@gmail.com>
Cc: 57373@debbugs.gnu.org
Subject: bug#57373: 28.1; authinfo keyword smtp-auth does not work
Date: Wed, 24 Aug 2022 15:20:48 +0000	[thread overview]
Message-ID: <87v8qhzn08.fsf@protonmail.com> (raw)
In-Reply-To: <87y1veyong.fsf@gmail.com>

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 will 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 servers. 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 for GNU Emacs,
> the Swiss army knife of text editors" <bug-gnu-emacs@gnu.org> 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> <https://lists.gnu.org/archive/html/emacs-devel/2020-09/msg00002.html>
>     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 that 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
>  		         (smtpmail-try-auth-method
> -                          process (pop mechs) user password))))
> +                          process (intern-soft (pop mechs)) user password))))
>          ;; 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 redefinition of smtpmail-try-auth-methods with (intern-soft mech) in the call to smtpmail-try-auth-method. So I didn't backport the full changes to that function 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






  parent reply	other threads:[~2022-08-24 15:20 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-08-23 22:01 bug#57373: 28.1; authinfo keyword smtp-auth does not work John Kehayias via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-24  9:30 ` Robert Pluim
2022-08-24 11:46   ` Lars Ingebrigtsen
2022-08-25  7:59     ` Robert Pluim
2022-08-25 11:20       ` Lars Ingebrigtsen
2022-08-25 13:27         ` Robert Pluim
2022-08-25 21:28           ` John Kehayias via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-08-26  7:52             ` Robert Pluim
2022-08-24 15:20   ` John Kehayias via Bug reports for GNU Emacs, the Swiss army knife of text editors [this message]
2022-08-25  9:47     ` Robert Pluim

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

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87v8qhzn08.fsf@protonmail.com \
    --to=bug-gnu-emacs@gnu.org \
    --cc=57373@debbugs.gnu.org \
    --cc=john.kehayias@protonmail.com \
    --cc=rpluim@gmail.com \
    /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 public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).