# ContentFilter Plugin Readme

## Overview

The content filter plugin allows admins to configure various actions based on message content. These actions include notifying the admin of content matches, notifying the sender that a message was rejected or masking the content with alternative content.

## Installation

Copy the contentfilter.jar into the plugins directory of your Jive Messenger installation. The plugin will then be automatically deployed. To upgrade to a new version, copy the new contentfilter.jar file over the existing file.

## Configuration

By default, after the plugin has been deployed all of its features are disabled. This plugin is configured via the "Content Filter" sidebar item located under the "System" tab in the Jive Messenger Admin Console.

The default comma separated patterns are "fox,dog". This will perform a case sensitive match on all words containing these strings. e.g. "fox", "firefox", "foxy", "dog", "hotdog", "dogdays" but not "Fox", "firefoX". These simple patterns can be enhanced with more complex regular expressions as required e.g.:

- for a complete word match, add boundary checks with \b e.g. \bfox\b will match against the word "fox" and nothing else.
- for case insensitive matchs add (?i) e.g. (?i)\bfox\b will match against "fox", "Fox", "foX" etc.
- it is also possible to group related patterns patterns e.g. fox|dog, this can be used to reduce the number of individual patterns to test for.

If you choose to filter your users presence status and there is a content match then:

- if you are masking content, other users will see a masked status.
- if you are rejecting content, other users not see the status change, how it affects the user with the invalid status is client dependant.

Want to know more about regular expressions in Java? This official tutorial is useful.

The default mask is "***", you can change it to anything you like including smilies!

## Using the plugin

After the plugin has been configured, nothing else needs to be done to use it.

## Trouble shooting

If the plugin behaviour is not as expected you can enable server debug logging. This will allow the plugin to start logging. Server debug logging should only be enabled temporarily, as it will generate a lot of additional logging that will both slow your server down and consume a lot of disk space.