Custom SpamAssassin Rules

floppyfringe

Active Member
Jan 21, 2010
28
0
51
cPanel Access Level
Root Administrator
I've seen some information on custom SpamAssassin rules, such as:

body LOCAL_DEMONSTRATION_RULE /test/
score LOCAL_DEMONSTRATION_RULE 0.1
describe LOCAL_DEMONSTRATION_RULE This is a simple test rule

It doesn't matter where I put it, it doesn't seem to work

Tried /etc/mail/spamassassin/ and /usr/share/spamassassin of the top of my head.

Anyone managed to write custom rules and got them to work?
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
Last edited:

jols

Well-Known Member
Mar 13, 2004
1,107
3
168
Does anyone know if this still works?

We have a set of rules in /etc/mail/spamassassin/local.cf but lately they seem to have no effect.
 

floppyfringe

Active Member
Jan 21, 2010
28
0
51
cPanel Access Level
Root Administrator
The above hasn't worked on the server I tried it on, maybe the location of local rules has changed following a SpamAssassin upgrade?

Anyone got a clue?

Update: WOW it worked on a different server :D
 
Last edited:

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,880
2,260
463
To clarify, did restarting SpamAssassin resolve the issue (note that you must restart SpamAssassin after making changes to it's configuration)?

Thank you.
 

floppyfringe

Active Member
Jan 21, 2010
28
0
51
cPanel Access Level
Root Administrator
To clarify, did restarting SpamAssassin resolve the issue (note that you must restart SpamAssassin after making changes to it's configuration)?

Thank you.
Everything is supposed to get updated across all the servers, but yes I had restarted SpamAssassin on both, but only one worked at the time. I thought it would be helpful to mention how to go about restarting SA if someone found the post.
 

floppyfringe

Active Member
Jan 21, 2010
28
0
51
cPanel Access Level
Root Administrator
Does anyone know why having a local rule for "F*ckbuddy", "F#ckFriends" or "F*ckFriends" or an American style phone number the "-", "(" or ")" seem to prevent the local rules from working, we've tried "/*" or "/#" that doesn't work either.

We're getting loads of crap and we'd love to able to kill off those spams.

Thanks
 

floppyfringe

Active Member
Jan 21, 2010
28
0
51
cPanel Access Level
Root Administrator
Just in case someone else finds this post and are wondering how to detect a specific phone number used in spams, you use \( or \) for the brackets - then it works.