Gnus development mailing list
 help / color / mirror / Atom feed
* spam.el: automatically resplitting ham in a spam group?
@ 2003-11-19 15:14 Lőrentey Károly
  2003-11-19 20:48 ` Ted Zlatanov
  2003-11-19 21:51 ` Kai Grossjohann
  0 siblings, 2 replies; 29+ messages in thread
From: Lőrentey Károly @ 2003-11-19 15:14 UTC (permalink / raw)



I may have missed something obvious, but is there a way to
automatically resplit the ham that I find in a spam group?  Currently
they all go to a designated mail group and then just sit there until I
remember to resplit them by hand, which kind of works, but is not very
nice.

More details:

My mail splitting is handled entirely by Gnus.  For spam filtering, I
use Bogofilter, which is run by Gnus' spam.el during the splitting.
All spam candidates discovered by spam-split are stored in a spam
group named nnml+mail:mail.spam.candidates.  This candidates group has
no spam processor, but it has a spam destination for the really
hardcore spam group, nnml+mail:mail.spam.proven, which has its spam
process set to feed all spam to Bogofilter's magical spam analysis
algorithms.  My real mail groups also move their spam to
mail.spam.proven, and that is the only mail group with a spam exit
processor.  The idea is that spam is only fed to Bogofilter if I had a
chance to look at it, either by spotting it as a false negative in a
normal mailgroup, or by leaving its spam mark set while browsing for
false positives in mail.spam.candidates.  By having two spam groups, I
can avoid ever having to deal with the same spam twice, which is
important to me.  I also like having all my spam tidily collected in a
single group, hence mail.spam.proven instead of just expiring the
messages in whatever group they first appeared in.

I think all this is not unsimilar to some previously discussed
configurations.  Does this sound all right to you, or is this setup a
perverse hack of the delicate instrument that is spam.el? :-)

My problem is what to do with false positives in mail.spam.candidates.
When I mark them as ham and exit the candidates group, I would like
to have them (1) unregistered as spam (if needed), (2) registered as
ham, and (3) re-fed to the mail split mechanism as if the message had
just arrived in my inbox.  I understand that (1) will be solved
elegantly with the registry, and I am happy to wait for it.  I have
already solved (2) by setting spam-process-ham-in-spam-groups to t,
and setting up ham exit processors for my spam groups.  But I could
not find an easy solution for (3): I have even considered setting up
an nnmaildir group, and then adding its directory to my mail-sources,
but that practice is explicitly discouraged in the manual, so I
hesitate to do that.  Could someone help me with this?

For even more details, here is my config:

        (setq spam-use-bogofilter t)

	(setq gnus-spam-process-destinations
	      '(("mail\\.spam" nil)
		("mail\\." "nnml+mail:mail.spam.proven")
		("list\\." "nnml+mail:mail.spam.proven")))

        (setq spam-split-group "mail.spam.candidates")

        ;; Process ham in spam groups (to teach Bogofilter about false positives).
	(setq spam-process-ham-in-spam-groups t)

	;; Don't ignore the spam process destination of spam groups.
	(setq spam-move-spam-nonspam-groups-only nil)

        (spam-initialize)

        ;;; ...

	(defun lk-gnus-group-split-updated-hook ()
	  (setq nnmail-split-fancy
		(list '|
                      ;; Get rid of spam.
	              '("keywords" "CERN SpamKiller Note: [12][0-9]" "mail.spam.candidates")
	              '(: spam-split)
                      ;; Put followups into the same group their parents are in.
	              (: nnmail-split-fancy-with-parent)
                      ;; Handle the rest.
                      nnmail-split-fancy)))

	(add-hook 'gnus-group-split-updated-hook
		  'lk-gnus-group-split-updated-hook)

        (gnus-group-split-setup 'auto-update)

The relevant group parameters for nnml+mail:mail.spam.candidates are:

	(spam-contents gnus-group-spam-classification-spam)
	(spam-process
	 (gnus-group-ham-exit-processor-bogofilter))
	(spam-process-destination . "nnml+mail:mail.spam.proven")
	(ham-process-destination . "nnml+mail:mail.ham.proven")

The same for nnml+mail:mail.spam.proven:

	(spam-contents gnus-group-spam-classification-spam)
	(spam-process
	 (gnus-group-spam-exit-processor-bogofilter gnus-group-ham-exit-processor-bogofilter))
	(spam-process-destination)
 	(ham-process-destination . "nnml+mail:mail.ham.proven")

(nnml+mail:mail.ham.proven is just a normal mail group without spam or
ham classification.)

-- 
Károly



^ permalink raw reply	[flat|nested] 29+ messages in thread

end of thread, other threads:[~2003-12-10 19:57 UTC | newest]

Thread overview: 29+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2003-11-19 15:14 spam.el: automatically resplitting ham in a spam group? Lőrentey Károly
2003-11-19 20:48 ` Ted Zlatanov
2003-11-19 20:57   ` Jody Klymak
2003-11-19 21:24     ` Ted Zlatanov
2003-11-19 21:48     ` Reiner Steib
2003-11-19 21:58       ` Jody Klymak
2003-11-20 11:17         ` Ted Zlatanov
2003-11-20 14:46           ` Jake Colman
2003-11-20 12:19   ` Lőrentey Károly
2003-11-20 12:48     ` Lőrentey Károly
2003-11-20 13:33       ` Ted Zlatanov
2003-11-20 15:48         ` Lőrentey Károly
2003-11-20 16:22           ` Ted Zlatanov
2003-11-20 18:20             ` Lőrentey Károly
2003-11-23  5:43               ` Ted Zlatanov
2003-12-09  2:02                 ` Lőrentey Károly
2003-12-09 22:20                   ` Ted Zlatanov
2003-12-09 22:57                     ` Lőrentey Károly
2003-12-10 19:57                       ` Ted Zlatanov
2003-11-20 13:28     ` Ted Zlatanov
2003-11-20 18:42       ` Lőrentey Károly
2003-11-19 21:51 ` Kai Grossjohann
2003-11-19 21:53   ` Kai Grossjohann
2003-11-19 22:05     ` Josh Huber
2003-11-20 20:30       ` Kai Grossjohann
2003-11-20 21:07         ` Josh Huber
2003-11-20 14:48     ` Jake Colman
2003-11-20 11:22   ` Ted Zlatanov
2003-11-20 12:31     ` Lőrentey Károly

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).