The SpamFilter is a JSPWiki filter that can be used to block questionable edits. It is powered by "Herb", the JSPWiki spam engine.
The SpamFilter looks at the WikiVariable called 'spamwords' on the wordlist page. This must contain a space-separated list of words not allowed in a page. In fact, each word is a full Perl5 regular expression, so you can do pretty complex matches as well.
Of course, it is a good idea to allow only trusted users to edit the wordlist page. Otherwise a spammer can remove the list...
Put the following in your filters.xml file (See PageFilter Configuration for more information):
<filter> <class>org.apache.wiki.filters.SpamFilter</class> </filter>
to start the filter. Create a page called "SpamFilterWordList" and put the following on it:
[{SET spamwords='viagra money'}]to prevent anyone from saving a page that contains either the word "viagra" or "money". In a bit more complicated example:
[{SET spamwords='[vV][iI][aA][gG][rR][aA]'}]would block the words "viagra", "Viagra", "viAGra" and so on.
This is how you use parameters. Assume that your Akismet API key is "1234567890", you would like to extend the ban time to 2 hours (120 minutes), and would like to limit page changes per minute to value of 5 changes/minutes. You can tell it to the SpamFilter like this:
<filter> <class>org.apache.wiki.filters.SpamFilter</class> <param> <name>bantime</name> <value>120</value> </param> <param> <name>pagechangesinminute</name> <value>5</value> </param> <param> <name>akismet-apikey</name> <value>1234567890</value> </param> </filter>