comparison lisp/mail/rmail.el @ 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 aa85e6f55862
children de90332b77e9
comparison
equal deleted inserted replaced
88137:cb307edb1d27 88138:824f9f6f0df3
1488 ;; Make the first unseen message the current message 1488 ;; Make the first unseen message the current message
1489 ;; and update the summary buffer, if one exists. 1489 ;; and update the summary buffer, if one exists.
1490 (setq current-message (rmail-first-unseen-message)) 1490 (setq current-message (rmail-first-unseen-message))
1491 (if (rmail-summary-exists) 1491 (if (rmail-summary-exists)
1492 (with-current-buffer rmail-summary-buffer 1492 (with-current-buffer rmail-summary-buffer
1493 (rmail-update-summary) 1493 (rmail-update-summary)))
1494
1495 ;; Process the new messages for spam using the
1496 ;; integrated spam filter. The spam filter can mark
1497 ;; messages for deletion and can output a message.
1498 (if rmail-use-spam-filter
1499 ;; Loop through the new messages processing each
1500 ;; message for spam.
1501 (save-excursion
1502 (while (<= current-message rmail-total-messages)
1503 (narrow-to-region
1504 (rmail-desc-get-start current-message)
1505 (rmail-desc-get-end current-message))
1506 (rmail-spam-filter current-message)
1507 (setq current-message (1+ current-message)))))
1508
1509 ;; Position the mail cursor again.
1510 (setq current-message (rmail-first-unseen-message))
1511 (if (rmail-summary-exists)
1512 (with-current-buffer rmail-summary-buffer
1494 (rmail-summary-goto-msg current-message)) 1513 (rmail-summary-goto-msg current-message))
1495 (rmail-show-message current-message)) 1514 (rmail-show-message current-message))
1515
1516 ;; Run the after get new mail hook.
1496 (run-hooks 'rmail-after-get-new-mail-hook) 1517 (run-hooks 'rmail-after-get-new-mail-hook)
1497 (message "%d new message%s read" 1518 (message "%d new message%s read"
1498 new-messages (if (= 1 new-messages) "" "s")) 1519 new-messages (if (= 1 new-messages) "" "s"))
1499 (setq found t)))) 1520 (setq found t))))
1500 found) 1521 found)