Increasing the Spam Score for a Particular Rule Using Spam Assassin

This article will show you very briefly how to assign your own scores for Spam Assassin tests or simply influence the default rule set.

I write this article because I know some hosting providers (such as Namecheap) provide Spam Assassin as an ‘out of the box’ anti-spam solution and I know that some of the cpanel menus that support Spam Assassin aren’t as intuitive or helpful as they could be to help guide this process.

  1. connect to your host using a file transfer client such as filezilla.
  2. Browse to the following directory (your directory structure could well be different from the one I post here but it should be similar at least) /home/yourusername/.spamassassin – this directory is above the www directory so if you don’t see this then you probably don’t have access.
  3. Make a backup of user_prefs and call it something like user_prefs.bak
  4. Edit the original user_prefs and add the lines below – the rules you want to edit along with the scores will probably be different.

score SUBJ_ALL_CAPS (5)

SUBJ_ALL_CAPS is the test name which can be found in the official Spam Assassin wiki here.
In this case, the number in brackets means that the spam score should be increased by 5 from the default. So if the default scoring for the test ‘SUBJ_ALL_CAPS’ was 1, it would now be 6.
To set your own definite score, simply remove the brackets so the rule looks like:

score SUBJ_ALL_CAPS 5

This will set the score to 5 no matter what the default was.