Don't log login commands.
authorLars Ingebrigtsen <larsi@gnus.org>
Mon, 14 Feb 2011 03:43:23 +0000 (19:43 -0800)
committerLars Ingebrigtsen <larsi@gnus.org>
Mon, 14 Feb 2011 03:43:23 +0000 (19:43 -0800)
lisp/ChangeLog
lisp/nnimap.el

index 7ac5b36..9d8efa2 100644 (file)
@@ -1,5 +1,8 @@
 2011-02-14  Lars Ingebrigtsen  <larsi@gnus.org>
 
+       * nnimap.el (nnimap-inhibit-logging): New variable.
+       (nnimap-log-command): Don't log login commands.
+
        * auth-source.el (auth-source-netrc-search): The asserts seem to want
        to have more parameters.
 
index b612539..a5a001f 100644 (file)
@@ -142,6 +142,8 @@ textual parts.")
 (defvar nnimap-quirks
   '(("QRESYNC" "Zimbra" "QRESYNC ")))
 
+(defvar nnimap-inhibit-logging nil)
+
 (defun nnimap-buffer ()
   (nnimap-find-process-buffer nntp-server-buffer))
 
@@ -389,8 +391,9 @@ textual parts.")
                                  nnimap-address)
                                 ports t))))
                  (setq nnimap-object nil)
-               (setq login-result
-                     (nnimap-login (car credentials) (cadr credentials)))
+               (let ((nnimap-inhibit-logging t))
+                 (setq login-result
+                       (nnimap-login (car credentials) (cadr credentials))))
                (unless (car login-result)
                  ;; If the login failed, then forget the credentials
                  ;; that are now possibly cached.
@@ -1584,7 +1587,10 @@ textual parts.")
 (defun nnimap-log-command (command)
   (with-current-buffer (get-buffer-create "*imap log*")
     (goto-char (point-max))
-    (insert (format-time-string "%H:%M:%S") " " command))
+    (insert (format-time-string "%H:%M:%S") " "
+           (if nnimap-inhibit-logging
+               "(inhibited)"
+             command)))
   command)
 
 (defun nnimap-command (&rest args)