Use auth-sources to query and store the password instead of netrc.
authorLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 18 Sep 2010 01:20:56 +0000 (03:20 +0200)
committerLars Magne Ingebrigtsen <larsi@quimbies.gnus.org>
Sat, 18 Sep 2010 01:20:56 +0000 (03:20 +0200)
lisp/ChangeLog
lisp/nnimap.el

index 4268e13..313b3a4 100644 (file)
@@ -1,5 +1,8 @@
 2010-09-18  Lars Magne Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-open-connection): Use auth-sources to query and
+       store the password instead of netrc.
+
        * auth-source.el (auth-source-create): In the password prompt, say what
        we're querying for.  Also prompt for user name if that hasn't been
        given.
index ee869a0..dec7071 100644 (file)
@@ -211,19 +211,25 @@ not done by default on servers that doesn't support that command.")
                                       (if (netrc-find-service-number "imap")
                                           "imap"
                                         "143")))
-             (netrc-credentials nnimap-address "imap"))
+             (auth-source-user-or-password
+              '("login" "password") nnimap-address "imap" nil t))
             ((eq nnimap-stream 'stream)
              (nnimap-open-shell-stream
               "*nnimap*" (current-buffer) nnimap-address
               (or nnimap-server-port "imap"))
-             (netrc-credentials nnimap-address "imap"))
+             (auth-source-user-or-password
+              '("login" "password") nnimap-address "imap" nil t))
             ((eq nnimap-stream 'ssl)
              (open-tls-stream "*nnimap*" (current-buffer) nnimap-address
                               (or nnimap-server-port
                                   (if (netrc-find-service-number "imaps")
                                       "imaps"
                                     "993")))
-             (netrc-credentials nnimap-address "imaps" "imap")))))
+             (or
+              (auth-source-user-or-password
+               '("login" "password") nnimap-address "imap")
+              (auth-source-user-or-password
+               '("login" "password") nnimap-address "imaps" nil t))))))
       (setf (nnimap-process nnimap-object)
            (get-buffer-process (current-buffer)))
       (unless credentials