How to create custom SpamC rules

MailCleaner Support
Added about 1 year ago


Mailcleaner uses SpamAssassin to establish a spam score for each mail.

Creating a custom rule should be done carefully. For example creating too much rules will slow down your MailCleaner server performances. Some kind of rules (regexp) may also decrease your server performance, so please be careful if you choose to add a custom rule.
Creating a custom rule allows 2 kinds of actions :
- adding rules
- overcharging an already existing rule

SpamAssassin read its configuration file in a specific order and overload a rule with its most recent version if need be.First directory is


then comes


The content is read in alpha numeric order.
Create your own file with a prefix




The fact, that the filename starts with 99 ensures it will be among the latest file to be read so that its content will override previous rules if needed

You ll need to know how to create a SpamAssassin rule in order to feed this file.

For example, overloading a score only requires you to add this line in the file

score RULE_NAME 1.00

Those actions have to be done on each servers of your cluster.

When ready, please restart your filtering engine in

Monitoring -> status

Best regards,
MailCleaner Team