[Spambayes] sb_imapfilter.py not adding headers / moving messages

Tony Meyer tameyer at ihug.co.nz
Sun Apr 25 21:54:24 EDT 2004


> Unfortunately I don't know anything about the IMAP protocol 
> ... but looking 
> through the output I saw this:
> 
> 09:01.29 > DMNB21 APPEND INBOX.SPAM (\Seen \Deleted)
> 
> This looks like where it might be trying to put the message 
> in the proper directory after classification - but it looks
> like it might be setting the deleted flag?  Is it simply
> deleting the wrong message (the new copy, not the original)?

Ah, I see the problem now - I had missed that second APPEND.  What's
happening is that the message is being saved in the INBOX (which occurs so
that the message has the SpamBayes ID header; removing this would be nice,
but finding the time to implement an alternative method is a wee way off,
for me at least), and then SpamBayes searches for the message's new IMAP UID
so that it can move it.

The search comes back empty, and so SpamBayes falls back on using the most
recent ID, which should be the one just added.  Unfortunately, this is
actually the one just deleted (72 not 73 in the example), so it copies this
instead (including the flags, which means the /Deleted flag, too).

The question is *why* is the IMAP server failing to find the newly appended
message, both in the SEARCH command and in the RECENT list?  Maybe it needs
to wait for a bit so the server can catch up?  Try adding in a line
"time.sleep(1)" just after the "# We need to update the uid, as it will have
changed." comment (about line 511).  If this works, then I guess that is the
problem, and I'll have to figure out a nicer solution (at the very least, we
should check that the message we're using is not /Deleted).

=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