Roundup Wiki

Fighting Spam with SpamBayes

Requirements

You need access to a SpamBayes XMLRPC Server, version 1.1a4 or later. Install the SpamBayes server according to the documentation on http://spambayes.sf.net, and then run it, loading the XMLRPC module. "This mailing list post":http://mail.python.org/pipermail/tracker-discuss/2007-June/000930.html has some details (although on the core_server.py commandline example, you need to replace "-m" with "-P", making the commandline look like this
  • BAYESCUSTOMIZE=$SBDIR/bayescustomize.ini core_server.py -P XMLRPCPlugin

Theory of Operation

Get the Code

Begin by checking out http://svn.python.org/projects/tracker/instances/spambayes_integration
This gives you two python files: detectors/spambayes.py and extensions/spambayes.py. The former is the auditor which scores msg and file instances when they are created. The latter is an extension for doing the classification from the web interface.
Symlink these two files into your instance's detectors and extensions directory
  • cd /home/of/my/tracker ln -s /path/to/spambayes_integration/detectors/spambayes.py detectors/spambayes.py ln -s /path/to/spambayes_integration/extensions/spambayes.py extensions/spambayes.py
Copy /path/to/spambayes/integration/detectors/config.ini.template

into detectors/config.ini, and adjust the uri to your spambayes server as well as the spam_cutoff value, if needed.

Modify Schema

'msg' classes respectively. If your schema is based on the classic template, here's your new 'file' and 'msg' definitions::

Modify Templates

to display the content if this is not allowed, instead displaying a message that the content has been classified as spam. There's also buttons for reclassifications, if the current user is permitted to do reclassification.

displaying content from 'msg' instances marked as spam to users without permission to see the content.

Setup Permissions

'schema.py' as usual.

allowed to reclassify messages, training SpamBayes. Then we create two new permissions, and assign one of them to the 'Coordinator' role::

as follows::

An Example Instance

and has the integration described in this document already built in. Check out as follows::

Credits

SpamBayes integration as well as this document.