Friday, March 12, 2010

spamassassin block all Viagra emails{KeyWord}

SkyHi @ Friday, March 12, 2010

Well, you can try these kind of simple rules:

header   VIAGRA_SUBJECT Subject =~ /viagra/i
header VIAGRA_FROM
From =~ /viagra/i
meta VIAGRA_HEADER VIAGRA_FROM
&& VIAGRA_SUBJECT
score VIAGRA_HEADER
10.0
describe VIAGRA_HEADER
Block Mails with Viagra in subject

body VIAGRA_BODY
/viagra/i
score VIAGRA_BODY
10.0
describe VIAGRA_BODY
Block Mails with Viagra in body


===============================================

Put into your local.cf:

body BODY_VIAGRA /viagra/i
describe BODY_VIAGRA Something about viagra
score BODY_VIAGRA 2

Some explanations:
body BODY_VIAGRA /viagra/i
body - search for specified word/phrase in email's body (you can put here 'header' to search headers instead of body).
BODY_VIAGRA - rule name (can be anything you want)
/viagra/i - regex pattern to match your word/phrase. ending 'i' flag means case insensitive

describe BODY_VIAGRA Something about viagra
This line is description for rule BODY_VIAGRA, and description is: "Something about viagra".

score BODY_VIAGRA 2
Give 2 additional points every email which matches BODY_VIAGRA rule.


REFERENCES
http://stackoverflow.com/questions/2246294/local-cf-spamassassin
http://74.125.155.132/search?q=cache:BDvTLmfyqHQJ:www.experts-exchange.com/OS/Linux/Administration/Q_24144658.html+spamassassin+block+viagra&cd=10&hl=en&ct=clnk&gl=ca