Educational ICT Virtualisation Specialist

Twitter LinkedIn E-mail
Precedence Technologies Ltd
Technology House, 36a Union Lane
Cambridge, CB4 1QB, United Kingdom
T: +44 (0)8456 446 800 / +44 (0)1223 359900
E: enquiries@precedence.co.uk
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 MATCH
An 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 MATCH
An example is:
10 header:X-PHP-Originating-Script=eval..'d code
This 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

© Copyright Precedence Technologies 1999-2024
Page last modified on February 02, 2016, at 01:04 PM by sborrill