summaryrefslogtreecommitdiff
path: root/lisp/mail/smtpmail.el
diff options
context:
space:
mode:
authorBastien Guerry <bzg@altern.org>2008-02-13 21:52:41 +0000
committerBastien Guerry <bzg@altern.org>2008-02-13 21:52:41 +0000
commit5b5eae56a2a6324fe081bbfd1b3eec9b57492b7a (patch)
tree60a6a97179769e7368bd8c57e89c00f702483f6e /lisp/mail/smtpmail.el
parent765e147aa10b82c39cc0e139162b5dc6320219c6 (diff)
downloademacs-5b5eae56a2a6324fe081bbfd1b3eec9b57492b7a.tar.gz
* mail/smtpmail.el: Use password-cache.
Diffstat (limited to 'lisp/mail/smtpmail.el')
-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 @@
(autoload 'netrc-parse "netrc")
(autoload 'netrc-machine "netrc")
(autoload 'netrc-get "netrc")
+(autoload 'password-read "password") ; for new emacsen: "password-cache"
;;;
(defgroup smtpmail nil
@@ -546,12 +547,12 @@ This is relative to `smtpmail-queue-dir'.")
(netrc-get hostentry "password"))))
(smtpmail-find-credentials
smtpmail-auth-credentials host port)))
+ (prompt (when cred (format "SMTP password for %s:%s: "
+ (smtpmail-cred-server cred)
+ (smtpmail-cred-port cred))))
(passwd (when cred
(or (smtpmail-cred-passwd cred)
- (read-passwd
- (format "SMTP password for %s:%s: "
- (smtpmail-cred-server cred)
- (smtpmail-cred-port cred))))))
+ (password-read prompt prompt))))
ret)
(when (and cred mech)
(cond
@@ -621,9 +622,8 @@ This is relative to `smtpmail-queue-dir'.")
(t
(error "Mechanism %s not implemented" mech)))
;; Remember the password.
- (when (and (not (stringp smtpmail-auth-credentials))
- (null (smtpmail-cred-passwd cred)))
- (setcar (cdr (cdr (cdr cred))) passwd)))))
+ (when (null (smtpmail-cred-passwd cred))
+ (password-cache-add prompt passwd)))))
(defun smtpmail-via-smtp (recipient smtpmail-text-buffer)
(let ((process nil)