* spam.el (spam-split): allow a particular check as a parameter,
e.g. (: spam-split 'spam-use-bogofilter)
+ (spam-mark-only-unseen-as-spam): new parameter, see doc
+ (spam-mark-junk-as-spam-routine): use
+ spam-mark-only-unseen-as-spam, simplify routine to take advantage
+ of gnus-newsgroup-unread as well as gnus-newsgroup-unseen
2003-04-17 Teodor Zlatanov <tzz@lifelogs.com>
When nil, only ham and unclassified groups will have their spam moved
to the spam-process-destination. When t, spam will also be moved from
spam groups."
+ :type 'repeat (choice
+ :group 'spam)
+
+(defcustom spam-mark-only-unseen-as-spam t
+ "Whether only unseen articles should be marked as spam in spam
+groups. When nil, all unread articles in a spam group are marked as
+spam. Set this if you want to leave an article unread in a spam group
+without losing it to the automatic spam-marking process."
:type 'boolean
:group 'spam)
;; check the global list of group names spam-junk-mailgroups and the
;; group parameters
(when (spam-group-spam-contents-p gnus-newsgroup-name)
- (gnus-message 5 "Marking unread articles as spam")
- (let ((articles gnus-newsgroup-articles)
- article)
- (while articles
- (setq article (pop articles))
- (when (eq (gnus-summary-article-mark article) gnus-unread-mark)
- (gnus-summary-mark-article article gnus-spam-mark))))))
+ (gnus-message 5 "Marking %s articles as spam"
+ (if spam-mark-only-unseen-as-spam
+ "unseen"
+ "unread"))
+ (let ((articles (if spam-mark-only-unseen-as-spam
+ gnus-newsgroup-unseen
+ gnus-newsgroup-unreads)))
+ (dolist (article articles)
+ (gnus-summary-mark-article article gnus-spam-mark)))))
(defun spam-mark-spam-as-expired-and-move-routine (&optional group)
(gnus-summary-kill-process-mark)