» Do it. Now.

Spamassassin Body Rule

Last we get rid of some Spam in our Postmaster Inbox. So i decided to write a own body rule.

It's really very simple. You just have to create a file /var/lib/spamassassin/[spamassassin_version]/my_rules.cf

But some stuff like this here in your file and there is much less spam in your INBOX.

/var/lib/spamassassin/[spamassassin_version]/my_rules.cf
body SPACES_LIVE_COM_RULE   /http:\/\/.*\.spaces\.live\.com/ 
score SPACES_LIVE_COM_RULE 5 
describe SPACES_LIVE_COM_RULE Scores 5 for http://*.spaces.live.com

To test the whole thing just run this command (we are using mimedefang so i can be a litte different to your setup):

spamassassin -D -p /etc/mail/sa-mimedefang.cf -t < /var/spool/cyrus/mail/p/user/postmaster/Junk/1. &> ~/spam.log

The -D stands for Debug.
The -p part is the configuration to be used. In our case it is the mimedefang config.
As you can see the -t part is a mail in the Junk folder in the postmaster INBOX in a cyrus setup.
At the end of the command i pipe the hole debug in a file cause spamassassin makes a lot of noise and so it ist much easier to read it.

If your rule is working you can see it at the end of the debug file. A line with your description should be in the Content analysis details.
In this case:

5.0 SPACES_LIVE_COM_RULE  BODY: Scores 5 for http://*.spaces.live.com 
setup/spamassassin-own-rules.txt · Last modified: 2010/02/08 02:54 by tonke