nnimap.el (nnimap-user): New backend variable.
authorTeodor Zlatanov <tzz@lifelogs.com>
Fri, 22 Apr 2011 01:01:32 +0000 (01:01 +0000)
committerKatsumi Yamaoka <yamaoka@jpl.org>
Fri, 22 Apr 2011 01:01:32 +0000 (01:01 +0000)
 (nnimap-open-connection-1): Use it.
 (nnimap-credentials): Accept user parameter so it's explicit what user name is desired.

lisp/gnus/ChangeLog
lisp/gnus/nnimap.el

index 5718250..4a8311f 100644 (file)
@@ -1,4 +1,9 @@
-2011-04-21  Teodor Zlatanov  <tzz@lifelogs.com>
+2011-04-22  Teodor Zlatanov  <tzz@lifelogs.com>
+
+       * nnimap.el (nnimap-user): New backend variable.
+       (nnimap-open-connection-1): Use it.
+       (nnimap-credentials): Accept user parameter so it's explicit what user
+       name is desired.
 
        * gnus-sum.el (gnus-extra-headers): Add Keywords, Cc, and Gcc to
        default.
index afdea18..f819c17 100644 (file)
@@ -58,6 +58,9 @@
 (defvoo nnimap-address nil
   "The address of the IMAP server.")
 
+(defvoo nnimap-user nil
+  "Username to use for authentication to the IMAP server.")
+
 (defvoo nnimap-server-port nil
   "The IMAP port used.
 If nnimap-stream is `ssl', this will default to `imaps'.  If not,
@@ -283,13 +286,14 @@ textual parts.")
     (push (current-buffer) nnimap-process-buffers)
     (current-buffer)))
 
-(defun nnimap-credentials (address ports)
+(defun nnimap-credentials (address ports user)
   (let* ((auth-source-creation-prompts
           '((user  . "IMAP user at %h: ")
             (secret . "IMAP password for %u@%h: ")))
          (found (nth 0 (auth-source-search :max 1
                                            :host address
                                            :port ports
+                                           :user user
                                            :require '(:user :secret)
                                            :create t))))
     (if found
@@ -408,7 +412,8 @@ textual parts.")
                                 (list
                                  nnimap-address
                                  (nnoo-current-server 'nnimap)))
-                                ports))))
+                                ports
+                                nnimap-user))))
                  (setq nnimap-object nil)
                (let ((nnimap-inhibit-logging t))
                  (setq login-result