[Spambayes] How well does sb_imapfilter.py work?

Jen Wu jennyw at colorfulexpressions.com
Wed Aug 18 08:14:40 CEST 2004


I've heard a few good things about Spam Bayes, and wanted to give it a try.
For my setup, the easiest would be the IMAP filter, but I'm having trouble
with it.

I tried running sb_imapfilter.py -b and setup my configuration. I then ran
sb_imapfilter.py -t to train. It took a very long time ... and then it just
died. I looked at the stats and it showed that about 600 of each type (spam
and ham) had been trained, though, so I figured I could try running it
against my inbox using sb_imapfilter.py -c. I noticed after a while that it
hadn't moved any messages to the spam or unsure folders, but that there were
a lot of messages being duplicated in the inbox (so I stopped it).

So, before I continue with my experiments ... has anyone had any luck with
the IMAP filter? Does my experience sound familiar to anyone? I tried this
on Windows XP with ActiveState Python 2.3.3. My IMAP server is Courier, and
it's on the local network so the speed should be pretty fast. I also tried
running the script in Linux, but it doesn't seem to like to run unless
you're root, and the Web server isn't loading. I'm trying to figure out
where it's looking for the config file now so hopefully I can avoid the Web
interface altogether.

Also, out of curiosity, has anyone compared the efficacy of Spam Bayes with
DSPAM? That's the other software package I'm going to be trying out.

Thanks!

Jen

P.S. This is what I got when training:

SpamBayes IMAP Filter Version 0.4 (May 2004)
and engine SpamBayes Engine Version 0.3 (January 2004).

Traceback (most recent call last):
  File "sb_imapfilter.py", line 928, in ?
    run()
  File "sb_imapfilter.py", line 914, in run
    imap_filter.Train()
  File "sb_imapfilter.py", line 760, in Train
    num_spam_trained = folder.Train(self.classifier, True)
  File "sb_imapfilter.py", line 667, in Train
    for msg in self:
  File "sb_imapfilter.py", line 594, in __iter__
    yield self[key]
  File "sb_imapfilter.py", line 643, in __getitem__
    msg.Save()
  File "sb_imapfilter.py", line 504, in Save
    self.as_string())
  File "sb_imapfilter.py", line 472, in as_string
    return message.SBHeaderMessage.as_string(self, unixfrom)
  File "C:\Python23\Lib\site-packages\spambayes\message.py", line 287, in
as_str
ing
    parts.append(email.Message.Message.as_string(part, unixfrom))
  File "C:\Python23\lib\email\Message.py", line 130, in as_string
    g.flatten(self, unixfrom=unixfrom)
  File "C:\Python23\lib\email\Generator.py", line 103, in flatten
    self._write(msg)
  File "C:\Python23\lib\email\Generator.py", line 131, in _write
    self._dispatch(msg)
  File "C:\Python23\lib\email\Generator.py", line 157, in _dispatch
    meth(msg)
  File "C:\Python23\lib\email\Generator.py", line 298, in _handle_message
    g.flatten(msg.get_payload(0), unixfrom=False)
  File "C:\Python23\lib\email\Generator.py", line 103, in flatten
    self._write(msg)
  File "C:\Python23\lib\email\Generator.py", line 131, in _write
    self._dispatch(msg)
  File "C:\Python23\lib\email\Generator.py", line 157, in _dispatch
    meth(msg)
  File "C:\Python23\lib\email\Generator.py", line 200, in _handle_text
    raise TypeError, 'string payload expected: %s' % type(payload)
TypeError: string payload expected: <type 'list'>





More information about the Spambayes mailing list