[Spambayes] IMAP script problem

Tony Meyer tameyer at ihug.co.nz
Thu Oct 14 06:13:01 CEST 2004


> In looking a bit more closely at my results, I see that all 
> the messages classified as spam are *copied* rather than
> moved to the suspect folder.

It is impossible to move a message with IMAP (a large flaw of the protocol,
IMO).  What you have to do is add a copy of the message to the new folder,
and delete the one in the original.  This is what sb_imapfilter does.

To delete the message, sb_imapfilter marks the \Deleted flag.  It's possible
that your mailer will still show you these messages, although it really
ought to indicate that it's marked for deletion.  To actually delete the
message permanently, you have to 'expunge' the folder.  However, this
removes *all* messages in that folder marked for deletion, not just one
(again, something not possible with IMAP).  sb_imapfilter doesn't want to
remove messages that you've manually marked as \Deleted, so it doesn't do
the expunge by default.

> How can I get SB to delete the spam messages once they've 
> been copied to suspect?

If you add:

"""
[imap]
expunge:True
"""

(without the quotes) to your configuration file, then sb_imapfilter will
expunge messages as it goes, removing all the (apparent) duplicates.
Remember that it'll also (permanently) remove any other messages with the
\Deleted flag, though.

[If, however, the \Deleted flag isn't being set, then this must be as a
result of a bug of some sort.  In that case, run with -i4, remove your
username/password from the output, and send a copy to the list so we can
figure out what's going wrong.]

=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