To Add a Custom Rule
- Navigate to Warden -> Rules -> Click on Add to add a custom rule.
- Select the Template select list if you want to use one of the prebuilt templates. More information about rules can be found here.
- Enter the name of the rule you want to add name field ( names must be less than 22 chars) and the new score you want to use in the score field (positive and negative values are supported).
- Click the Update button to save your settings.
Using the Command Line Interface
Admins can also use the Warden command line interface to add custom rules. You can view the available options using:
warden --task=antispam:rules --help
Example:
warden --task=antispam:rules --oper=rule_add --name=TEST --description='some description' --type=header --value='Subject =~ viagra' --score=100
Verifying Custom Rules
Go to Logs -> Message Log where you can see a breakdown of any matched rules under the Tests: line when clicking on the plus icon for a message entry in the message log (Amavis must be in verbose mode under Settings -> Content Filter Settings -> Filter Settings). Any matched custom rules will be in the list.
Admins can also go to Tools -> Spam Report to paste in the full source of a message. This will also give you a breakdown of any rules that were matched by the message. Any matched custom rules will be in the list.