X-Git-Url: https://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fnnmail.el;h=68991bd08510c5c5325fd766a97a98e6d4f00785;hb=d5bf0fbeacfb5d3828b4f3c3f4fb1c0d43dc9f83;hp=90ad6ab98718a1c2fe5a3c6e232cb6c1aba6b5b8;hpb=61d56bb2d28fd4989b51fcb5935880dbda7cf812;p=gnus diff --git a/lisp/nnmail.el b/lisp/nnmail.el index 90ad6ab98..68991bd08 100644 --- a/lisp/nnmail.el +++ b/lisp/nnmail.el @@ -112,7 +112,9 @@ If nil, the first match found will be used." ;; Added by gord@enci.ucalgary.ca (Gordon Matzigkeit). (defcustom nnmail-keep-last-article nil - "If non-nil, nnmail will never delete the last expired article in a directory. + "If non-nil, nnmail will never delete/move a group's last article. +It can be marked expirable, so it will be deleted when it is no longer last. + You may need to set this variable if other programs are putting new mail into folder numbers that Gnus has marked as expired." :group 'nnmail-procmail @@ -395,7 +397,9 @@ Example: '((any . "from\\|to\\|cc\\|sender\\|apparently-to\\|resent-from\\|resent-to\\|resent-cc") (mail . "mailer-daemon\\|postmaster\\|uucp") (to . "to\\|cc\\|apparently-to\\|resent-to\\|resent-cc") - (from . "from\\|sender\\|resent-from")) + (from . "from\\|sender\\|resent-from") + (nato . "to\\|cc\\|resent-to\\|resent-cc") + (naany . "from\\|to\\|cc\\|sender\\|resent-from\\|resent-to\\|resent-cc")) "Alist of abbreviations allowed in `nnmail-split-fancy'." :group 'nnmail-split :type '(repeat (cons :format "%v" symbol regexp))) @@ -537,18 +541,17 @@ parameter. It should return nil, `warn' or `delete'." (defun nnmail-move-inbox (inbox) "Move INBOX to `nnmail-crash-box'." (if (not (file-writable-p nnmail-crash-box)) - (gnus-error 1 "Can't write to crash box %s. Not moving mail." + (gnus-error 1 "Can't write to crash box %s. Not moving mail" nnmail-crash-box) ;; If the crash box exists and is empty, we delete it. (when (and (file-exists-p nnmail-crash-box) (zerop (nnheader-file-size (file-truename nnmail-crash-box)))) (delete-file nnmail-crash-box)) - (let ((inbox (file-truename (expand-file-name inbox))) - (tofile (file-truename (expand-file-name nnmail-crash-box))) - movemail popmail errors result) - (if (setq popmail (string-match - "^po:" (file-name-nondirectory inbox))) - (setq inbox (file-name-nondirectory inbox)) + (let ((tofile (file-truename (expand-file-name nnmail-crash-box))) + (popmail (string-match "^po:" inbox)) + movemail errors result) + (unless popmail + (setq inbox (file-truename (expand-file-name inbox))) (setq movemail t) ;; On some systems, /usr/spool/mail/foo is a directory ;; and the actual inbox is /usr/spool/mail/foo/foo. @@ -568,7 +571,7 @@ parameter. It should return nil, `warn' or `delete'." (nnmail-read-passwd (format "Password for %s: " (substring inbox (+ popmail 3)))))) - (message "Getting mail from post office ...")) + (message "Getting mail from the post office...")) (when (or (and (file-exists-p tofile) (/= 0 (nnheader-file-size tofile))) (and (file-exists-p inbox) @@ -803,7 +806,7 @@ is a spool. If not using procmail, return GROUP." (= (following-char) ?\n))) (save-excursion (forward-line 1) - (while (looking-at ">From ") + (while (looking-at ">From \\|From ") (forward-line 1)) (looking-at "[^ \n\t:]+[ \n\t]*:"))) (setq found 'yes))))) @@ -832,7 +835,7 @@ is a spool. If not using procmail, return GROUP." (= (following-char) ?\n))) (save-excursion (forward-line 1) - (while (looking-at ">From ") + (while (looking-at ">From \\|From ") (forward-line 1)) (looking-at "[^ \n\t:]+[ \n\t]*:"))) (setq found 'yes))))) @@ -1041,6 +1044,9 @@ FUNC will be called with the group name to determine the article number." (fboundp nnmail-split-methods)) (let ((split (condition-case nil + ;; `nnmail-split-methods' is a function, so we + ;; just call this function here and use the + ;; result. (or (funcall nnmail-split-methods) '("bogus")) (error @@ -1048,9 +1054,13 @@ FUNC will be called with the group name to determine the article number." "Error in `nnmail-split-methods'; using `bogus' mail group") (sit-for 1) '("bogus"))))) - (unless (equal split '(junk)) - ;; `nnmail-split-methods' is a function, so we just call - ;; this function here and use the result. + ;; The article may be "cross-posted" to `junk'. What + ;; to do? Just remove the `junk' spec. Don't really + ;; see anything else to do... + (let (elem) + (while (setq elem (car (memq 'junk split))) + (setq split (delq elem split)))) + (when split (setq group-art (mapcar (lambda (group) (cons group (funcall func group))) @@ -1081,7 +1091,13 @@ FUNC will be called with the group name to determine the article number." ;; See whether the split methods returned `junk'. (if (equal group-art '(junk)) nil - (nreverse (delq 'junk group-art))))))) + ;; The article may be "cross-posted" to `junk'. What + ;; to do? Just remove the `junk' spec. Don't really + ;; see anything else to do... + (let (elem) + (while (setq elem (car (memq 'junk group-art))) + (setq group-art (delq elem group-art))) + (nreverse group-art))))))) (defun nnmail-insert-lines () "Insert how many lines there are in the body of the mail.