Importing pgnus-0.41
[elisp/gnus.git-] / lisp / nnmail.el
index f3eba42..c852ad8 100644 (file)
@@ -241,6 +241,13 @@ to be moved to."
   :group 'nnmail-retrieve
   :type 'string)
 
+(defcustom nnmail-movemail-args nil
+  "*Extra arguments to give to `nnmail-movemail-program'  to move mail from the inbox.
+The default is nil"
+  :group 'nnmail-files
+  :group 'nnmail-retrieve
+  :type 'string)
+
 (defcustom nnmail-pop-password-required nil
   "*Non-nil if a password is required when reading mail using POP."
   :group 'nnmail-retrieve
@@ -442,6 +449,11 @@ parameter.  It should return nil, `warn' or `delete'."
                 (const warn)
                 (const delete)))
 
+(defcustom nnmail-extra-headers nil
+  "*Extra headers to parse."
+  :group 'nnmail
+  :type '(repeat symbol))
+
 ;;; Internal variables.
 
 (defvar nnmail-split-history nil
@@ -597,7 +609,9 @@ parameter.  It should return nil, `warn' or `delete'."
                              nnmail-movemail-program exec-directory)
                             nil errors nil inbox tofile)
                            (when nnmail-internal-password
-                             (list nnmail-internal-password)))))))
+                             (list nnmail-internal-password))
+                           (when nnmail-movemail-args
+                             nnmail-movemail-args))))))
                (push inbox nnmail-moved-inboxes)
                (if (and (not (buffer-modified-p errors))
                         (zerop result))
@@ -794,7 +808,7 @@ is a spool.  If not using procmail, return GROUP."
          (when (and (or (bobp)
                         (save-excursion
                           (forward-line -1)
-                          (= (following-char) ?\n)))
+                          (eq (char-after) ?\n)))
                     (save-excursion
                       (forward-line 1)
                       (while (looking-at ">From \\|From ")
@@ -823,7 +837,7 @@ is a spool.  If not using procmail, return GROUP."
          (when (and (or (bobp)
                         (save-excursion
                           (forward-line -1)
-                          (= (following-char) ?\n)))
+                          (eq (char-after) ?\n)))
                     (save-excursion
                       (forward-line 1)
                       (while (looking-at ">From \\|From ")
@@ -1628,7 +1642,9 @@ See the documentation for the variable `nnmail-split-fancy' for documentation."
            ((numberp days)
             (setq days (days-to-time days))
             ;; Compare the time with the current time.
-            (time-less-p days (time-since time)))))))
+            (condition-case ()
+                (time-less-p days (time-since time))
+              (error nil)))))))
 
 (defvar nnmail-read-passwd nil)
 (defun nnmail-read-passwd (prompt &rest args)
@@ -1693,11 +1709,11 @@ If ARGS, PROMPT is used as an argument to `format'."
        (goto-char (point-min))
        (while (re-search-forward "[^ \t=]+" nil t)
          (setq name (match-string 0))
-         (if (not (= (following-char) ?=))
+         (if (not (eq (char-after) ?=))
              ;; Implied "yes".
              (setq value "yes")
            (forward-char 1)
-           (if (not (= (following-char) ?\"))
+           (if (not (eq (char-after) ?\"))
                (if (not (looking-at "[^ \t]"))
                    ;; Implied "no".
                    (setq value "no")
@@ -1760,7 +1776,11 @@ If ARGS, PROMPT is used as an argument to `format'."
 (defun nnmail-pop3-movemail (inbox crashbox)
   "Function to move mail from INBOX on a pop3 server to file CRASHBOX."
   (let ((pop3-maildrop
-         (substring inbox (match-end (string-match "^po:" inbox)))))
+         (substring inbox (match-end (string-match "^po:" inbox))))
+       (pop3-password
+        (or nnmail-pop-password
+            (nnmail-read-passwd
+             (format "Password for %s: " inbox)))))
     (pop3-movemail crashbox)))
 
 (defun nnmail-within-headers-p ()