summary on spamassassin custom rule

spamassassin is a good free software to reduce spam. useful link for spamassassin rules :
1. http://www.rulesemporium.com
2. http://daryl.dostech.ca

if you’d like to write your own rules, there are things to remember when creating spamassassin custom rules :

1. rules should be stored in /etc/mail/spamassassin/local.cf for site-wide use
2. spamassassin rules is written with perl regular expressions
3. use phrase rather than word
4. after writing rules, always check for errors with command spamassassin –lint -D
5. rule components are : rule, score, description
example :

body SAMPLE_RULE /the word/
score SAMPLE_RULE 1
describe SAMPLE_RULE it’s an example rule

to match any combination of upper or lower case,put character i at the end of rule :

body SAMPLE_RULE /the word/i
score SAMPLE_RULE 1
describe SAMPLE_RULE it’s an example rule

6. instead of body, we can also use rawbody or header :

rawbody SAMPLE_RULE /the word/i
score SAMPLE_RULE 1
describe SAMPLE_RULE it’s an example rule

header SAMPLE_RULE Subject =~ /the word/i
score SAMPLE_RULE 1
describe SAMPLE_RULE it’s an example rule

header SAMPLE_RULE From =~ /the word/i
score SAMPLE_RULE 1
describe SAMPLE_RULE it’s an example rule

to check all header, use ALL :

header SAMPLE_RULE ALL =~ /the word/i
score SAMPLE_RULE 1
describe SAMPLE_RULE it’s an example rule .

Latest posts by gregor (see all)

Leave a Reply

Your email address will not be published. Required fields are marked *


*