Email-SpamRules
Jump To: Support > KB > NetManager > Email > SpamRules
Defining your own spam filtering rules
You can define your own rules that match against regular expressions in the body and headers of emails. These are defined in /etc/netmanager/spam.rules
.
The format for a body rule is:
SCORE body=TEXT TO MATCHAn example is:
10 body=c@ck
This will add 10 to the spam score (effectively rejecting it) if the body of the message contains c@ck (even if it is in the middle of word). To match a word break use \b, e.g. body=\bc@ck\b
The format for a header rule is:
SCORE header:HEADERNAME=TEXT TO MATCHAn example is:
10 header:X-PHP-Originating-Script=eval..'d codeThis will add 10 to the spam score (effectively rejecting it) if it contained a header line like:
X-PHP-Originating-Script: 516:db24.php(1965) : eval()'d code
When the /etc/netmanager/spam.rules
file has been saved, run the spamassassin build script.
If you add the -v flag to the build script (i.e. /usr/libexec/build/spamassassin -v), it will run a detailed rule check.
To check the rules yourself, run spamassassin --lint