[Spambayes] imap4 filter

Neal Stoughton nmstough at uci.edu
Tue Dec 30 19:38:35 EST 2003

----- Original Message ----- 
From: "Tony Meyer" <tameyer at ihug.co.nz>
To: "'Tony Meyer'" <tameyer at ihug.co.nz>; "'Neal Stoughton'" 
<nmstough at uci.edu>; <spambayes at python.org>
Sent: Monday, December 29, 2003 18:20
Subject: RE: [Spambayes] imap4 filter

>> > I dont think any have "<" or ">" characters.
>> > They do have "-" though.
>> Hmm.  With so many, no doubt this is the problem.
> Not the "-", that is.  But there is probably a "<", ">" or "&" there
> somewhere.
I "searched" through the list of folders and found sever that had "&" in the 

> Anyway, I don't know what I was thinking.  My fix was wrong :)  This is 
> the
> right one:
> 1. After line 44 ("import re") add the line "import cgi"
> 2. Somewhere around line 268 is the line
>  "        for folder in available_folders:".
> After this line add the line
>  "            folder = cgi.escape(folder)".
I didnt find any line with "available_folders"; I did find a line with 
"all_folders" which was 262 after the addition of the "import cgi" line.

After entering the 'training' configuration folders manually as instructed, 
I ran "python scripts\sb_imapfilter.py -t" in order to 'train' the filter. 
After about 40 minutes training the program bombed with the following 

Traceback (most recent call last):
  File "scripts\sb_imapfilter.py", line 827, in ?
  File "scripts\sb_imapfilter.py", line 813, in run
  File "scripts\sb_imapfilter.py", line 635, in Train
    num_ham_trained = folder.Train(self.classifier, False)
  File "scripts\sb_imapfilter.py", line 560, in Train
    for msg in self:
  File "scripts\sb_imapfilter.py", line 487, in __iter__
    yield self[key]
  File "scripts\sb_imapfilter.py", line 535, in __getitem__
  File "scripts\sb_imapfilter.py", line 353, in get_substance
    response = imap.uid("FETCH", self.uid, self.rfc822_command)
  File "C:\Python23\lib\imaplib.py", line 697, in uid
    typ, dat = self._simple_command(name, command, *args)
  File "C:\Python23\lib\imaplib.py", line 1000, in _simple_command
    return self._command_complete(name, self._command(name, *args))
  File "C:\Python23\lib\imaplib.py", line 830, in _command_complete
    typ, data = self._get_tagged_response(tag)
  File "C:\Python23\lib\imaplib.py", line 931, in _get_tagged_response
  File "C:\Python23\lib\imaplib.py", line 893, in _get_response
    data = self.read(size)
  File "C:\Python23\lib\imaplib.py", line 231, in read
    return self.file.read(size)
  File "c:\python23\lib\socket.py", line 301, in read
    data = self._sock.recv(recv_size)

More information about the Spambayes mailing list