[Spambayes] imap filter AssertionError spamcount <= nspam

Tony Meyer tameyer at ihug.co.nz
Tue Aug 17 03:16:36 CEST 2004


> I use Outlook 2003 in Cached Exchange mode.

Is there a reason you're not using the Outlook plug-in?  (I have a vague
memory of a previous message that gave a reason for this, but google isn't
finding it for me).

> After running the filter by "sb_imapfilter.py 
> -c -t -i 4" the messages in Inbox were first doubled
> and then tripled.

IMAP is a terrible protocol in many ways.  One of the main ones is that
there is no way to alter a message, and no way to move a message to a
different folder.  To do either of these you have to create a new message
and delete the old one.  (However, you can't actually delete an individual
message, either, only mark it for deletion and delete all messages so marked
in the folder).

We need to keep track of the messages so that we only process them once.  So
each message we find we replace with a copy that has an X-Spambayes-MailId
header (this has changed in CVS, so from 1.1a1 we will rarely need to do
this).  We then need to make another copy (either the same folder or
another) with the classification headers.  (I presume from your message that
the third is the original).

> I read somewhere that imapfilter does not modify the original message,
> instead it marks it being deleted (I don't see the mark anywhere) and
> makes a copy of it.

That is correct.  With Outlook 2002 and an IMAP server I see messages marked
for deletion greyed out with a line through them.  I'm not sure what Outlook
2003 does, and I'm not familiar with Cached Exchange mode.

> Clearly this does not work in the Cached Exchange mode?

I don't know what this mode does, so I don't know.  You can set
sb_imapfilter to purge folders on exit (i.e. permanently remove the mail)
but this will also remove any other messages that you have marked for
deletion, and the messages are completely irretrievable, so ensure that
sb_imapfilter is working properly first!

> What I am trying to do... I am testing imapfilter, if we 
> could use it in server mode.

Have you read the notes at <http://spambayes.org/server_side.html>?  (I
don't know if they will help or not, since I've never done this myself).

[...]
> Someone should daily check the Unsure folder and move these
> messages first to TrainHam or TrainSpam folder, and wait
> for the imapfilter to learn these messages, and then move these
> to Inbox again, so that our application would process it from there.

There is an sb_imapfilter option to move mail out of the TrainX folder into
another user-specified folder once training is done, so this could simplify
that a bit.

> how can the user know when imapfilter has processed the message
> in TrainHam folder.

I can't think of anything other than using the 'move when trained' options
described above.  You could patch sb_imapfilter to add a 'trained' header
(like sb_mboxtrain does, IIRC).

> There seems to be no simple solution for server side processing.

sb_imapfilter (and, indeed, SpamBayes) was designed for client-side
processing, so that's not particularly surprising, really.  In some ways,
it's more surprising that people manage to get it working as a server-side
solution.

=Tony Meyer

---
Please always include the list (spambayes at python.org) in your replies
(reply-all), and please don't send me personal mail about SpamBayes. This
way, you get everyone's help, and avoid a lack of replies when I'm busy.



More information about the Spambayes mailing list