Thursday, November 24, 2011

How to block the mails by subject in exim


Suppose you want to block the mails having subject job
Open the file /etc/mail/spamassassin/local.cf
And add the following lines.

header   JOB_SUBJECT Subject =~ /job/i
header   JOB_FROM    From =~ /job/i
meta     JOB_HEADER JOB_FROM && JOB_SUBJECT
score    JOB_HEADER 10.0
describe JOB_HEADER Block Mails with job in subject

save the file and restart the exim service if needed.

How to block mails by body content in exim

open the file /etc/mail/spamassassin/local.cf

and add the following lines.


rawbody  RULE_NAME  /CONTENT_WORD/i
score RULE_NAME 100

Restart the exim service if needed.