[Spambayes] can we use spambayes from a php script?
Tony Meyer
tameyer at ihug.co.nz
Tue Apr 12 02:14:20 CEST 2005
> we have a PHP script that reads the headers from several mail servers
> and it is supposed to classify the mail just as your program does.
[...]
> Can we accomplish that by calling somehow spambayes, passing the
> headers to the classification engine and receiving the resultant
> categorization?
Can the PHP script call any other program? If so, then just get it to call
sb_filter.py (or sb_bnfilter.py) with the message (the whole message would
be much better than just the headers), and parse the output (grep for
X-Spambayes-Classification:).
> Could we do the same with the training module?
It's much the same (except you can ignore the output). You just pass a
different option to sb_filter/sb_bnfilter.
=Tony.Meyer
--
Please always include the list (spambayes at python.org) in your replies
(reply-all), and please don't send me personal mail about SpamBayes.
http://www.massey.ac.nz/~tameyer/writing/reply_all.html explains this.
More information about the Spambayes
mailing list