(smtpmail-auth-supported): Mention that list is

in preference order.
(smtpmail-try-auth-methods): Improve which authentication
mechanism to use, so that the locally most preferred and mutually
supported mechanism is used.
This commit is contained in:
Simon Josefsson 2009-03-03 16:28:17 +00:00
parent 7bbab3e051
commit 9927d25059
2 changed files with 11 additions and 2 deletions

View file

@ -218,7 +218,8 @@ This is relative to `smtpmail-queue-dir'."
(defvar smtpmail-read-point)
(defconst smtpmail-auth-supported '(cram-md5 plain login)
"List of supported SMTP AUTH mechanisms.")
"List of supported SMTP AUTH mechanisms.
The list is in preference order.")
(defvar smtpmail-mail-address nil
"Value to use for envelope-from address for mail from ambient buffer.")
@ -534,7 +535,7 @@ This is relative to `smtpmail-queue-dir'."
(defun smtpmail-try-auth-methods (process supported-extensions host port)
(let* ((mechs (cdr-safe (assoc 'auth supported-extensions)))
(mech (car (smtpmail-intersection smtpmail-auth-supported mechs)))
(mech (car (smtpmail-intersection mechs smtpmail-auth-supported)))
(auth-user (auth-source-user-or-password
"login" host (or port "smtp")))
(auth-pass (auth-source-user-or-password