[Spambayes] Command line .eml processing

digital tuning, inc. sales at pocketlogger.com
Tue Apr 14 19:53:30 CEST 2009


> Try this:
> 
>   python sb_filter.py < mail.eml
> 
> Depending on how you have your file extensions set up, Windows can
> fail to do redirection properly with the sort of command line you have
> there.

That didn't work, but this did:

	python c:\python26\scripts\sb_filter.py < mail.eml

Thanks! Odd since c:\python26\scripts\ is in my path env and I swear I tried
this but apparently not.

But now I see yet another problem which may make all this moot. Using a new
hammie.db, I can train and filter using the command line above.  I was using
the pop proxy before.  I assumed the hammie.db could be used directly with
sb_filter, but I get an error if I replace the new hammie.db with the old
one from the proxy setup:

Traceback (most recent call last):
  File "c:\python26\scripts\sb_filter.py", line 257, in <module>
    main()
  File "c:\python26\scripts\sb_filter.py", line 248, in main
    action(msg)
  File "c:\python26\scripts\sb_filter.py", line 179, in filter
    self.open('r')
  File "c:\python26\scripts\sb_filter.py", line 163, in open
    self.h = hammie.open(self.dbname, self.usedb, self.mode)
  File "c:\python26\Lib\site-packages\spambayes\hammie.py", line 267, in
open
    return Hammie(storage.open_storage(filename, useDB, mode))
  File "c:\python26\Lib\site-packages\spambayes\storage.py", line 710, in
open_storage
    return klass(data_source_name)
  File "c:\python26\Lib\site-packages\spambayes\storage.py", line 91, in
__init__
    self.load()
  File "c:\python26\Lib\site-packages\spambayes\storage.py", line 114, in
load
    tempbayes = pickle.load(fp)
EOFError


The SB versions might be different that the pop proxy I was using. Did
anything in the DB change structure over the past 3 years or so? Or are they
just not compatible?  I thought I had the pop proxy configured for pickle.


Thanks!
-Mike





More information about the SpamBayes mailing list