+2004-10-14 Teodor Zlatanov <tzz@lifelogs.com>
+
+ * spam.el (spam-register-routine): move comment
+ (spam-verify-bogofilter): we use 'unknown for the initial
+ spam-bogofilter-valid state, not 'never
+
+ * netrc.el (netrc-machine-user-or-password): convenience wrapper
+ for netrc-machine
+
+ * nnimap.el (nnimap-open-connection): use
+ netrc-machine-user-or-password
+
+
2004-10-13 Katsumi Yamaoka <yamaoka@jpl.org>
* message.el (message-tokenize-header): Fix 2004-09-06 change
(pop result))
(car result))))
+(defun netrc-machine-user-or-password (mode authinfo-file-or-list machines ports defaults)
+ "Get the user name or password according to MODE from AUTHINFO-FILE-OR-LIST.
+Matches a machine from MACHINES and a port from PORTS, giving
+default ports DEFAULTS to `netrc-machine'.
+
+MODE can be \"login\" or \"password\", suitable for passing to
+`netrc-get'."
+ (let ((authinfo-list (if (stringp authinfo-file-or-list)
+ (netrc-parse authinfo-file-or-list)
+ authinfo-file-or-list))
+ (ports (or ports '(nil)))
+ (defaults (or defaults '(nil)))
+ info)
+ (dolist (machine machines)
+ (dolist (default defaults)
+ (dolist (port ports)
+ (let ((alist (netrc-machine authinfo-list machine port default)))
+ (setq info (or (netrc-get alist mode) info))))))
+ info))
+
(defun netrc-get (alist type)
"Return the value of token TYPE from ALIST."
(cdr (assoc type alist)))
(imap-close nnimap-server-buffer)
(nnheader-report 'nnimap "Server %s is not IMAP4 compliant" server))
(let* ((list (netrc-parse nnimap-authinfo-file))
- (port (if nnimap-server-port
- (int-to-string nnimap-server-port)
- "imap"))
- (alist (or (netrc-machine list server port "imap")
- (netrc-machine list
- (or nnimap-server-address
- nnimap-address)
- port "imap")
- (netrc-machine list server port "imaps")
- (netrc-machine list
- (or nnimap-server-address
- nnimap-address)
- port "imaps")))
- (user (netrc-get alist "login"))
- (passwd (netrc-get alist "password")))
+ (port (if nnimap-server-port
+ (int-to-string nnimap-server-port)
+ "imap"))
+ (user (netrc-machine-user-or-password
+ "login"
+ list
+ (list server
+ (or nnimap-server-address
+ nnimap-address))
+ (list port)
+ (list "imap" "imaps")))
+ (passwd (netrc-machine-user-or-password
+ "password"
+ list
+ (list server
+ (or nnimap-server-address
+ nnimap-address))
+ (list port)
+ (list "imap" "imaps"))))
(if (imap-authenticate user passwd nnimap-server-buffer)
(prog1
(push (list server nnimap-server-buffer)
classification
backend
gnus-newsgroup-name))))
- (length articles)))) ;return the number of articles processed
+ ;; return the number of articles processed
+ (length articles))))
;;; log a ham- or spam-processor invocation to the registry
(defun spam-log-processing-to-registry (id type classification backend group)
(defun spam-verify-bogofilter ()
"Verify the Bogofilter version is sufficient."
- (when (eq spam-bogofilter-valid 'never)
+ (when (eq spam-bogofilter-valid 'unknown)
(setq spam-bogofilter-valid
(not (string-match "^bogofilter version 0\\.\\([0-9]\\|1[01]\\)\\."
(shell-command-to-string