[Spambayes] IMAPFilter training issues (WAS imapfiltermanglingheaders!)

Oliver Maunder lists at olivermaunder.co.uk
Wed Apr 23 11:15:33 EDT 2003

Meyer, Tony wrote:

>I've checked in a fix for this; if people could check it that would be
>great.  It should now handle any ordering (as long as the message number
>is there at the start, which is is meant to be).
Getting closer ;-)

The new _extract_fetch_data doesn't like messages with multiple FLAGs. 
In that case it fails to pick up tthe UID, which means the message 
doesn't get added to the list. But at least it's trying to add the 
message to the list, which is an improvement on yesterday.

Here's the output, with a bit of extra debugging info.

Loading database hammie.db... Done.
   Training ham folder INBOX.spambayes.ham-train

Response: 1 (FLAGS (\Seen) UID 1)
Key: FLAGS, Val: \Seen
Key: UID, Val: 1

Response: 2 (FLAGS (\Seen) UID 2)
Key: FLAGS, Val: \Seen
Key: UID, Val: 2

Response: 3 (FLAGS (\Seen $MDNSent) UID 3)
Key: FLAGS, Val: \Seen
Traceback (most recent call last):
  File "C:\Development\SpamBayes\spambayes\imapfilter.py", line 567, in ?
  File "C:\Development\SpamBayes\spambayes\imapfilter.py", line 553, in run
  File "C:\Development\SpamBayes\spambayes\imapfilter.py", line 405, in 
    num_ham_trained = folder.Train(self.classifier, False)
  File "C:\Development\SpamBayes\spambayes\imapfilter.py", line 350, in 
    for msg in self:
  File "C:\Development\SpamBayes\spambayes\imapfilter.py", line 273, in 

    for key in self.keys():
  File "C:\Development\SpamBayes\spambayes\imapfilter.py", line 303, in keys
KeyError: UID


More information about the Spambayes mailing list