From ef9104456fa7e844c795c4bf130c4b8c97cc34b9 Mon Sep 17 00:00:00 2001 From: Ted Zlatanov Date: Thu, 21 Apr 2011 19:37:56 -0500 Subject: [PATCH] Add nnimap-user to nnimap.el. * 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/ChangeLog | 7 ++++++- lisp/nnimap.el | 9 +++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 19f07e45c..04fa72f5b 100644 --- a/lisp/ChangeLog +++ b/lisp/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/nnimap.el b/lisp/nnimap.el index afdea185d..f819c17af 100644 --- a/lisp/nnimap.el +++ b/lisp/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.25.1