diff options
author | Andrew G Cohen <cohen@andy.bu.edu> | 2020-08-29 12:22:40 +0800 |
---|---|---|
committer | Andrew G Cohen <cohen@andy.bu.edu> | 2020-08-29 12:22:40 +0800 |
commit | 726b758005ead50e9c98ef50a59304646652b994 (patch) | |
tree | 126b59b53cad8e2556021d19f3b2908c585c12d1 /lisp/mail/smtpmail.el | |
parent | a811a618e0ef1f0018c1f98ec5096b4df48656fa (diff) | |
download | emacs-726b758005ead50e9c98ef50a59304646652b994.tar.gz emacs-726b758005ead50e9c98ef50a59304646652b994.tar.bz2 emacs-726b758005ead50e9c98ef50a59304646652b994.zip |
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.
Diffstat (limited to 'lisp/mail/smtpmail.el')
-rw-r--r-- | lisp/mail/smtpmail.el | 6 |
1 files changed, 4 insertions, 2 deletions
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 |