changeset 91820:f084b6fae1f0

* mail/smtpmail.el: Use password-cache.
author Bastien Guerry <bzg@altern.org>
date Wed, 13 Feb 2008 21:52:41 +0000
parents 76dc0b81d4c0
children 4ab3a4d4cc4e
files lisp/ChangeLog lisp/mail/smtpmail.el
diffstat 2 files changed, 18 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Wed Feb 13 21:08:59 2008 +0000
+++ b/lisp/ChangeLog	Wed Feb 13 21:52:41 2008 +0000
@@ -1,3 +1,14 @@
+2008-02-13  Bastien Guerry  <bzg@altern.org>
+
+	* mail/rmail.el (rmail-header-name): New face.
+	(rmail-font-lock-keywords): Use rmail-header-name.
+
+	* mail/smtpmail.el: Use password-cache.
+
+	* mail/rmail-spam-filter.el (rsf-definitions-alist): Allow check
+	against X-Spam-Status header field.
+	(rmail-spam-filter): Also check X-Spam-Status header field.
+
 2008-02-14  Mark A. Hershberger  <mah@everybody.org>
 
 	* progmodes/flymake.el (flymake-allowed-file-name-masks): Add
--- a/lisp/mail/smtpmail.el	Wed Feb 13 21:08:59 2008 +0000
+++ b/lisp/mail/smtpmail.el	Wed Feb 13 21:52:41 2008 +0000
@@ -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 @@
                              (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 @@
        (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)