emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el,v


From: Bastien Guerry
Subject: [Emacs-diffs] Changes to emacs/lisp/mail/smtpmail.el,v
Date: Wed, 13 Feb 2008 21:52:42 +0000

CVSROOT:        /sources/emacs
Module name:    emacs
Changes by:     Bastien Guerry <bastien1>       08/02/13 21:52:41

Index: mail/smtpmail.el
===================================================================
RCS file: /sources/emacs/emacs/lisp/mail/smtpmail.el,v
retrieving revision 1.97
retrieving revision 1.98
diff -u -b -r1.97 -r1.98
--- mail/smtpmail.el    8 Jan 2008 20:45:06 -0000       1.97
+++ mail/smtpmail.el    13 Feb 2008 21:52:41 -0000      1.98
@@ -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)




reply via email to

[Prev in Thread] Current Thread [Next in Thread]