[Spambayes] Command line .eml processing

digital tuning, inc. sales at pocketlogger.com
Tue Apr 14 18:14:06 CEST 2009

> Ok, then I think I can state that sb_filter does work with such files.  I
> took an mbox file containing a single spam message, stripped it of its
> line and fed it to sb_filter.py on stdin.  Worked as intended:
>     % sb_filter.py < spam.1.eml | egrep Spam
>     X-Spambayes-Classification: spam; 0.93
>     X-Spambayes-Evidence: '*H*': 0.01; '*S*': 0.88; 'response.': 0.09;
> Was there more you needed it to do?

Well I know most of you guys are probably *nix people...I'm on windoze.
Maybe my command line syntax isn't right

As I said in the OP, if I run sb_filter and paste the text of the email in,
it works.  If I type

	sb_filter < mail.eml

I get:

Z:\>sb_filter.py < mail.eml

DeprecationWarning: the sets module is deprecated
  from sets import Set
Traceback (most recent call last):
  File "c:\python26\scripts\sb_filter.py", line 257, in <module>
  File "c:\python26\scripts\sb_filter.py", line 245, in main
    mbox = mboxutils.getmbox(fname)
  File "c:\python26\Lib\site-packages\spambayes\mboxutils.py", line 66, in
    return [get_message(sys.stdin)]
  File "c:\python26\Lib\site-packages\spambayes\mboxutils.py", line 127, in
    obj = obj.read()
IOError: [Errno 9] Bad file descriptor

The python scripts directory is in the path variable. Mail.eml is in the
current directory, and it makes no difference if I supply the full path to

Thanks for any help.  I love spambayes, It's been working awesome for years,
but hate MS Exchange. I'd really love to get this working with hMailServer
as I've built a great hammie.db that catches 99% of spam.  I wrote the
script needed to integrate SB with the hMailServer, but I can't seem to get
this command line working.  Once I do that I'll be home free and spam free
once again. 


More information about the SpamBayes mailing list