diff options
Diffstat (limited to 'lisp/mail/smtpmail.el')
-rw-r--r-- | lisp/mail/smtpmail.el | 15 |
1 files changed, 9 insertions, 6 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el index 58a517ba836..b1685067c08 100644 --- a/lisp/mail/smtpmail.el +++ b/lisp/mail/smtpmail.el @@ -483,12 +483,15 @@ The list is in preference order.") '((user . "SMTP user at %h: ") (secret . "SMTP password for %u@%h: "))) (auth-info (car - (auth-source-search :max 1 - :host host - :port (if port - (format "%s" port) - "smtp") - :create ask-for-password))) + (auth-source-search + :max 1 + :host host + :port (if port + (format "%s" port) + "smtp") + :require (and ask-for-password + '(:user :secret)) + :create ask-for-password))) (user (plist-get auth-info :user)) (password (plist-get auth-info :secret)) (save-function (and ask-for-password |