aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/mail
diff options
context:
space:
mode:
authorBastien Guerry2008-02-13 21:52:41 +0000
committerBastien Guerry2008-02-13 21:52:41 +0000
commit5b5eae56a2a6324fe081bbfd1b3eec9b57492b7a (patch)
tree60a6a97179769e7368bd8c57e89c00f702483f6e /lisp/mail
parent765e147aa10b82c39cc0e139162b5dc6320219c6 (diff)
downloademacs-5b5eae56a2a6324fe081bbfd1b3eec9b57492b7a.tar.gz
emacs-5b5eae56a2a6324fe081bbfd1b3eec9b57492b7a.zip
* mail/smtpmail.el: Use password-cache.
Diffstat (limited to 'lisp/mail')
-rw-r--r--lisp/mail/smtpmail.el14
1 files changed, 7 insertions, 7 deletions
diff --git a/lisp/mail/smtpmail.el b/lisp/mail/smtpmail.el
index 57d06c08dfc..a8d95cf1420 100644
--- a/lisp/mail/smtpmail.el
+++ b/lisp/mail/smtpmail.el
@@ -78,6 +78,7 @@
78(autoload 'netrc-parse "netrc") 78(autoload 'netrc-parse "netrc")
79(autoload 'netrc-machine "netrc") 79(autoload 'netrc-machine "netrc")
80(autoload 'netrc-get "netrc") 80(autoload 'netrc-get "netrc")
81(autoload 'password-read "password") ; for new emacsen: "password-cache"
81 82
82;;; 83;;;
83(defgroup smtpmail nil 84(defgroup smtpmail nil
@@ -546,12 +547,12 @@ This is relative to `smtpmail-queue-dir'.")
546 (netrc-get hostentry "password")))) 547 (netrc-get hostentry "password"))))
547 (smtpmail-find-credentials 548 (smtpmail-find-credentials
548 smtpmail-auth-credentials host port))) 549 smtpmail-auth-credentials host port)))
550 (prompt (when cred (format "SMTP password for %s:%s: "
551 (smtpmail-cred-server cred)
552 (smtpmail-cred-port cred))))
549 (passwd (when cred 553 (passwd (when cred
550 (or (smtpmail-cred-passwd cred) 554 (or (smtpmail-cred-passwd cred)
551 (read-passwd 555 (password-read prompt prompt))))
552 (format "SMTP password for %s:%s: "
553 (smtpmail-cred-server cred)
554 (smtpmail-cred-port cred))))))
555 ret) 556 ret)
556 (when (and cred mech) 557 (when (and cred mech)
557 (cond 558 (cond
@@ -621,9 +622,8 @@ This is relative to `smtpmail-queue-dir'.")
621 (t 622 (t
622 (error "Mechanism %s not implemented" mech))) 623 (error "Mechanism %s not implemented" mech)))
623 ;; Remember the password. 624 ;; Remember the password.
624 (when (and (not (stringp smtpmail-auth-credentials)) 625 (when (null (smtpmail-cred-passwd cred))
625 (null (smtpmail-cred-passwd cred))) 626 (password-cache-add prompt passwd)))))
626 (setcar (cdr (cdr (cdr cred))) passwd)))))
627 627
628(defun smtpmail-via-smtp (recipient smtpmail-text-buffer) 628(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)
629 (let ((process nil) 629 (let ((process nil)