[Top][All Lists]

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

Re: nnimap-user setting?

From: Ted Zlatanov
Subject: Re: nnimap-user setting?
Date: Thu, 14 Apr 2011 10:05:39 -0500
User-agent: Gnus/5.110016 (No Gnus v0.16) Emacs/24.0.50 (gnu/linux)

On Wed, 13 Apr 2011 14:22:47 -0300 Stefan Monnier <address@hidden> wrote: 

SM> I'm apparently among the very few users who resist the temptation to
SM> save their IMAP password into the authinfo file, but I find that in such
SM> a case it is annoying to have to confirm the user name each and
SM> every time.

SM> So I think a patch like the one below would make sense (tho re-using
SM> nnimap-authenticator to store the user name would work as well).

Maybe it's better to use this new `nnimap-user' backend variable
directly.  IOW, if it's set, it should override anything from
auth-source, and the auth-source search should not use `nnimap-user',
just the host and the ports.  WDYT?


diff --git a/lisp/nnimap.el b/lisp/nnimap.el
index afdea18..1cf275d 100644
--- a/lisp/nnimap.el
+++ b/lisp/nnimap.el
@@ -55,6 +55,9 @@
 (nnoo-declare nnimap)
+(defvoo nnimap-user nil
+  "Username to use for authentication to the IMAP server.  Overrides the 
username obtained from auth-source-search.")
 (defvoo nnimap-address nil
   "The address of the IMAP server.")
@@ -412,7 +415,8 @@ textual parts.")
                  (setq nnimap-object nil)
                (let ((nnimap-inhibit-logging t))
                  (setq login-result
-                       (nnimap-login (car credentials) (cadr credentials))))
+                       (nnimap-login (or nnimap-user (car credentials))
+                                      (cadr credentials))))
                (if (car login-result)
                     ;; Save the credentials if a save function exists

reply via email to

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