changeset 88138:824f9f6f0df3

(rmail-get-new-mail): Integrate the rmail spam filter into rmail.
author Paul Reilly <pmr@pajato.com>
date Fri, 21 Feb 2003 18:44:45 +0000
parents cb307edb1d27
children de90332b77e9
files lisp/mail/rmail.el
diffstat 1 files changed, 22 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/mail/rmail.el	Tue Feb 18 18:41:20 2003 +0000
+++ b/lisp/mail/rmail.el	Fri Feb 21 18:44:45 2003 +0000
@@ -1490,9 +1490,30 @@
 		(setq current-message (rmail-first-unseen-message))
 		(if (rmail-summary-exists)
 		    (with-current-buffer rmail-summary-buffer
-                      (rmail-update-summary)
+                      (rmail-update-summary)))
+
+                ;; Process the new messages for spam using the
+                ;; integrated spam filter.  The spam filter can mark
+                ;; messages for deletion and can output a message.
+                (if rmail-use-spam-filter
+                    ;; Loop through the new messages processing each
+                    ;; message for spam.
+                    (save-excursion
+                      (while (<= current-message rmail-total-messages)
+                        (narrow-to-region
+                         (rmail-desc-get-start current-message)
+                         (rmail-desc-get-end current-message))
+                        (rmail-spam-filter current-message)
+                        (setq current-message (1+ current-message)))))
+          
+                ;; Position the mail cursor again.
+		(setq current-message (rmail-first-unseen-message))
+		(if (rmail-summary-exists)
+		    (with-current-buffer rmail-summary-buffer
                       (rmail-summary-goto-msg current-message))
                   (rmail-show-message current-message))
+
+                ;; Run the after get new mail hook.
 		(run-hooks 'rmail-after-get-new-mail-hook)
 		(message "%d new message%s read"
 			 new-messages (if (= 1 new-messages) "" "s"))