Announcements and discussions for Gnus, the GNU Emacs Usenet newsreader
 help / color / mirror / Atom feed
* Spam configuation and bogofilter
@ 2007-07-16 18:15 isoboroff
  2007-07-17  9:09 ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: isoboroff @ 2007-07-16 18:15 UTC (permalink / raw)
  To: info-gnus-english

To quote the Gnus manual, "all those variables, they make my head
swim."

I'm moving to spam.el from ifile-gnus.  For some unknown reason, ifile
was not being run at all, so in a fit of desperation I switched to
bogofilter.  Classification of incoming mail is working fine, but I
don't think my database is being updated when I mark messages as spam.

My setup:

(spam-initialize)
(gnus-registry-initialize)
(setq spam-split-group "mail.spamgate"
      spam-use-spamassassin-headers t
      spam-use-bogofilter t

      gnus-spam-newsgroup-contents
      '(("mail.spamgate" gnus-group-spam-classification-spam)
	("mail.spam.expired" gnus-group-spam-classification-spam))
      spam-mark-only-unseen-as-spam t
      spam-mark-ham-unread-before-move-spam-from-group t
      gnus-ham-process-destinations '(("mail\\..*" "mail.inbox"))
      gnus-spam-process-destinations '(("mail\\..*" "mail.spamgate"))
      spam-log-to-registry t
      gnus-registry-max-entries 4000)

The behavior I want is as follows.  I have two spam groups, 'spamgate'
and 'spam.expired'.  When incoming mail is classified as spam, it is
sent to spamgate where I manually check things periodically.  If its
really spam, I mark it expirable, otherwise I move it to mail.inbox or
wherever it belongs.  Expiry moves the spam eventually to spam.expired
for later archiving or deletion.

When I mark a spam message in my inbox as spam with M-s, it gets the $
mark, and when I exit the group the message is moved to spamgate.  So
far, so good.  However, the timestamp on my bogofilter database
doesn't change, so I suspect that no training has occurred.

If I go to spamgate, and then leave the group without changing the
marks on the moved spam, the messages are moved _again_ to spamgate,
and no training occurs.  If I mark them expirable, then the don't get
moved, but still no training occurs.

Can someone help me sort out my setup?  Please, no group parameters...
I like to keep as much as possible in my .gnus.el so I can see it all
at once and not have to wonder where some option is.  Also no 'custom'
please for the same reason.

Thanks,
Ian

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

* Re: Spam configuation and bogofilter
  2007-07-16 18:15 Spam configuation and bogofilter isoboroff
@ 2007-07-17  9:09 ` Ted Zlatanov
  2007-07-17 12:08   ` isoboroff
  0 siblings, 1 reply; 4+ messages in thread
From: Ted Zlatanov @ 2007-07-17  9:09 UTC (permalink / raw)
  To: info-gnus-english

On Mon, 16 Jul 2007 18:15:47 -0000 isoboroff@gmail.com wrote: 

i> When I mark a spam message in my inbox as spam with M-s, it gets the $
i> mark, and when I exit the group the message is moved to spamgate.  So
i> far, so good.  However, the timestamp on my bogofilter database
i> doesn't change, so I suspect that no training has occurred.

Start with evaluating 

(executable-find "bogofilter")

and make sure it returns something valid.  

If that's fine, you need to set the spam-process group/topic parameter.
There is a global variable if you don't want to use the group/topic
parameter facility: gnus-spam-process-newsgroups.  I would recommend
using Customize on it at least the first time, so you get the format
right, even if you won't use Customize later.

i> If I go to spamgate, and then leave the group without changing the
i> marks on the moved spam, the messages are moved _again_ to spamgate,
i> and no training occurs.  If I mark them expirable, then the don't get
i> moved, but still no training occurs.

Well, your settings are:

...
      gnus-spam-newsgroup-contents
      '(("mail.spamgate" gnus-group-spam-classification-spam)
	("mail.spam.expired" gnus-group-spam-classification-spam))
...
      gnus-spam-process-destinations '(("mail\\..*" "mail.spamgate"))
...

so 'unseen' messages in spamgate (which moved messages become) are
marked as spam and moved back into spamgate, just as you specified.  I
would suggest a different workflow:

1) make "spamgate" your split destination when spam is detected, and
keep it as a spam group

2) make "spam.expired" your global spam-process-destination and remove
it from the spam groups

3) give every group the spam-use-bogofilter backend through
gnus-spam-process-newsgroups, and make the spam-process-destination
"spam.expired"

This way, when you mark something as spam, it will be processed and sent
to "spam.expired".  When you visit "spamgate" unseen articles in it will
be marked as spam, and when you exit the group, any articles still
marked as spam will be processed as spam.  

I would also put a ham-process rule on "spamgate" to register ham (which
can only be created by your manual command, since all unseen articles
will be spam) with the gnus-ham-process-newsgroups variable, which is
analogous to gnus-spam-process-newsgroups, and move the ham back to your
main mailbox with gnus-ham-process-destinations.

Ted

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

* Re: Spam configuation and bogofilter
  2007-07-17  9:09 ` Ted Zlatanov
@ 2007-07-17 12:08   ` isoboroff
  2007-07-17 18:24     ` Ted Zlatanov
  0 siblings, 1 reply; 4+ messages in thread
From: isoboroff @ 2007-07-17 12:08 UTC (permalink / raw)
  To: info-gnus-english

On Jul 17, 5:09 am, Ted Zlatanov <t...@lifelogs.com> wrote:

> If that's fine, you need to set the spam-process group/topic parameter.
> There is a global variable if you don't want to use the group/topic
> parameter facility: gnus-spam-process-newsgroups.  I would recommend
> using Customize on it at least the first time, so you get the format
> right, even if you won't use Customize later.

Some places in the Gnus manual aren't shy about giving the
syntax.  ;-)
Also, maybe I just read the documentation wrong, but it seemed to me
that
that was the point of (setq gnus-use-bogofilter t).  Why do I do this
at all?

At any rate, I think this was the key problem.  Now misclassified
messages
are getting passed to bogofilter for training.

> I would suggest a different workflow:

Here's my implementation of your suggestion, which I think is right:

(spam-initialize)
(gnus-registry-initialize)
(setq spam-split-group "mail.spamgate"
      spam-use-spamassassin-headers t
      spam-use-bogofilter t

      gnus-spam-process-newsgroups
      '(("mail\\.*" ((spam spam-use-bogofilter))))

      gnus-spam-newsgroup-contents
      '(("mail.spamgate" gnus-group-spam-classification-spam))

      spam-mark-only-unseen-as-spam t
      spam-mark-ham-unread-before-move-spam-from-group t
      gnus-ham-process-destinations '(("mail\\.spamgate"
"mail.inbox"))
      gnus-spam-process-destinations '(("mail\\..*"
"mail.spam.expired"))
      spam-log-to-registry t
      gnus-registry-max-entries 4000)

Thank you very much for your help!
Ian

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

* Re: Spam configuation and bogofilter
  2007-07-17 12:08   ` isoboroff
@ 2007-07-17 18:24     ` Ted Zlatanov
  0 siblings, 0 replies; 4+ messages in thread
From: Ted Zlatanov @ 2007-07-17 18:24 UTC (permalink / raw)
  To: info-gnus-english

On Tue, 17 Jul 2007 12:08:43 -0000 "isoboroff@gmail.com" <isoboroff@gmail.com> wrote: 

ic> On Jul 17, 5:09 am, Ted Zlatanov <t...@lifelogs.com> wrote:
>> If that's fine, you need to set the spam-process group/topic parameter.
>> There is a global variable if you don't want to use the group/topic
>> parameter facility: gnus-spam-process-newsgroups.  I would recommend
>> using Customize on it at least the first time, so you get the format
>> right, even if you won't use Customize later.

ic> Also, maybe I just read the documentation wrong, but it seemed to me
ic> that that was the point of (setq gnus-use-bogofilter t).  Why do I
ic> do this at all?

This enables the backend for spam splitting.  It also tells spam.el
whether the hooks it uses will be installed (all the spam-use-*
variables are OR-ed together to determine this).

You can keep it all on one line with

(spam-initialize 'spam-use-bogofilter)

instead of setting it separately.  It will be set by spam-initialize
this way to the same effect.

Ted

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

end of thread, other threads:[~2007-07-17 18:24 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2007-07-16 18:15 Spam configuation and bogofilter isoboroff
2007-07-17  9:09 ` Ted Zlatanov
2007-07-17 12:08   ` isoboroff
2007-07-17 18:24     ` Ted Zlatanov

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).