emacs-devel
[Top][All Lists]
Advanced

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

nnimap-user setting?


From: Stefan Monnier
Subject: nnimap-user setting?
Date: Wed, 13 Apr 2011 14:22:47 -0300
User-agent: Gnus/5.13 (Gnus v5.13) Emacs/24.0.50 (gnu/linux)

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

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


        Stefan


--- lisp/gnus/nnimap.el 2011-04-02 23:41:03 +0000
+++ lisp/gnus/nnimap.el 2011-04-12 13:43:13 +0000
@@ -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 @@
     (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 address@hidden: ")))
          (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 @@
                                 (list
                                  nnimap-address
                                  (nnoo-current-server 'nnimap)))
-                                ports))))
+                                ports
+                                nnimap-user))))
                  (setq nnimap-object nil)
                (let ((nnimap-inhibit-logging t))
                  (setq login-result




reply via email to

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