From 5e68f8614fa019ae831a6d48de01322202880274 Mon Sep 17 00:00:00 2001 From: Teodor Zlatanov Date: Fri, 22 Apr 2011 01:01:32 +0000 Subject: [PATCH] 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. --- lisp/gnus/ChangeLog | 7 ++++++- lisp/gnus/nnimap.el | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/gnus/ChangeLog b/lisp/gnus/ChangeLog index 57182504331..4a8311f6e0a 100644 --- a/lisp/gnus/ChangeLog +++ b/lisp/gnus/ChangeLog @@ -1,4 +1,9 @@ -2011-04-21 Teodor Zlatanov +2011-04-22 Teodor Zlatanov + + * 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. diff --git a/lisp/gnus/nnimap.el b/lisp/gnus/nnimap.el index afdea185dd3..f819c17afe8 100644 --- a/lisp/gnus/nnimap.el +++ b/lisp/gnus/nnimap.el @@ -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 -- 2.39.2