[Spambayes] New user, issues with command line use

Tony Meyer tameyer at ihug.co.nz
Tue Feb 15 05:13:03 CET 2005


> when I run it from the script with the following command line:
> /usr/bin/sb_filter.py -d ~greg/.hammiedb -s
> 
> The file does not seem to be updated:
> [root at server bin]# ls -l ~greg/.hammiedb
> -rw-rw----    1 greg     mail       684032 Feb 10 11:36 
> /home/greg/.hammiedb
> 
> The file is RW to group mail since it will be run as user "mail"
> I get the following traceback:
> 
> Traceback (most recent call last):
[...]
>    File 
> "/usr/lib/python2.2/site-packages/spambayes/dbmstorage.py", line 
> 20, in open_dbhash
>      return bsddb.hashopen(*args)
> bsddb.error: (2, 'No such file or directory')

I see in your ls that ~greg/ gets expanded into /home/greg/ (I'm not
familiar with a shell that lets you do this).  I suspect that if you use
~/greg/.hammie.db (i.e. have the extra slash), like this:

/usr/bin/sb_filter.py -d ~/greg/.hammedb -s

it may work.

> Yeah, there are only a few so I can probably do that.  It would be 
> REALLY nice to have a Mozilla Mail plug-in to do the reporting in the 
> proper format.

You could write one, of course <0.5 wink>.

>> Are you wanting to train individual databases for each 
>> user, or one global one?
> 
> Ideally I'd like one for each user.

I think sb_imapfilter.py could work here.  Something like (the command line
options could be in configuration files instead):

/usr/bin/sb_imapfilter.py -d /home/user1/.hammiedb -o imap:server:localhost
-o imap:username:user1 -o imap:password:pass1 -o
imap:spam_train_folders:INBOX.TrainSpam -o
imap:ham_train_folders:INBOX.TrainHam

Multiplied by the number of users, and put into a batch file to be run with
cron or something.  (The users would just put a copy of any mail to be
trained in the TrainSpam/TrainHam folders).

If the imap mail is stored somewhere in something like mbox then
sb_filter/sb_mboxtrain would be simpler and work as well, though.

=Tony.Meyer



More information about the Spambayes mailing list