[Spambayes] Training spambayes on a large set of mailbox files

Neale Pickett neale at woozle.org
Wed Feb 19 16:56:42 EST 2003

Edward Muller <edwardam at interlix.com> writes:

> Is there an easy way to train spambayes on a large set of mailbox files?
> It would be a read pain in the but to have to use multiple options on
> the command line for each mailbox file....

Sure.  Do it from python:

>>> import mboxtrain
>>> h = hammie.open('/path/to/your/database', True, 'c')
>>> for m in ('hambox1', 'hambox2', 'hambox3'):
...     mboxtrain.train(h, m, False, False)

(I haven't tested this, so back up your mailboxes before you do it.)

If you're in unix, just do this:

$ for i in hambox1 hambox2 hambox3; do
>  mboxtrain.py -g $i
> done

Although maybe this should be yet another option to mboxtrain.


More information about the Spambayes mailing list