From: Andrew G Cohen Date: Sat, 29 Aug 2020 04:22:40 +0000 (+0800) Subject: Allow direct choice of smtp authentication method X-Git-Tag: emacs-28.0.90~6334 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=726b758005ead50e9c98ef50a59304646652b994;p=emacs.git Allow direct choice of smtp authentication method * lisp/mail/smtpmail.el (smtpmail-try-auth-methods): Let the authorization credentials have an entry with key :smtp-auth containing a preferred authentication mechanism. --- diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 666395e0b9e..1786608dd67 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -512,8 +512,9 @@ for `smtpmail-try-auth-method'.") (if port (format "%s" port) "smtp")) - (let* ((mechs (cdr-safe (assoc 'auth supported-extensions))) - (mech (car (smtpmail-intersection mechs smtpmail-auth-supported))) + (let* ((mechs (smtpmail-intersection + (cdr-safe (assoc 'auth supported-extensions)) + smtpmail-auth-supported)) (auth-source-creation-prompts '((user . "SMTP user name for %h: ") (secret . "SMTP password for %u@%h: "))) @@ -526,6 +527,7 @@ for `smtpmail-try-auth-method'.") :require (and ask-for-password '(:user :secret)) :create ask-for-password))) + (mech (or (plist-get auth-info :smtp-auth) (car mechs))) (user (plist-get auth-info :user)) (password (plist-get auth-info :secret)) (save-function (and ask-for-password