The SpamFilter is a JSPWiki filter that can be used to block questionable edits. This filter is available since JSPWiki 2.1.117 as a CoreFilter. http://doc.jspwiki.org/2.4/wiki/SpamFilter
contains the most up-to- date instructions.
Parameters
- wordlist
- The name of the WikiPage on which the word list resides. Default is "SpamFilterWordList".
- errorpage
- The name of the page to which the user is redirected, if the edit contains a matched word. On that page, the variable [{$msg}] is available, telling the reason. Default is RejectedMessage.
- blacklist
- Name of the attachment that contains a blacklist, where each line is interpreted as a pattern to check against. Any lines starting with "#" are ignored as comments. (Since 2.3.98)
The word list
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...
Example
Put the following in your filters.xml file (See PageFilter Configuration for more information):
<filter>
<class>com.ecyrd.jspwiki.filters.SpamFilter</class>
</filter>
to start the filter. Create a page called "SpamFilterWordList" and put the following on it:
[{SET spamwords='vaigra money'}]
to prevent anyone from saving a page that contains either the word "vaigra" or "money". In a bit more complicated example:
[{SET spamwords='[vV][aA][iI][gG][rR][aA]'}]
would block the words "vaigra", "Vaigra", "vAIGra" and so on.
(The word "vaigra" is misspelled on purpose, because otherwise it would be caught in the spam trap...)
Q. Would it be possible to remove the changes in SpamWordFilterList from the RecentChanges page and RSS feeds?
Not to be picky, but by including those pages you are doing "spamming by side-effect"... :-) -- NascifAbousalhNeto
Nascif, we might look into including an exclude parameter on the RecentChangesPlugin. You might submit that as an idea to keep it visible.
Q. How do you set the Captcha which is available in 2.6. I have searched around and cannot see much to help with this.
--Elrond