Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

Custom SpamAssassin Rules

Discussion in 'E-mail Discussion' started by floppyfringe, Mar 26, 2015.

  1. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    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?
     
  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
    #2 cPanelMichael, Mar 26, 2015
    Last edited: May 3, 2016
  3. jols

    jols Well-Known Member

    Joined:
    Mar 13, 2004
    Messages:
    1,111
    Likes Received:
    3
    Trophy Points:
    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.
     
  4. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    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
     
    #4 floppyfringe, Apr 4, 2015
    Last edited: Apr 4, 2015
  5. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hello,

    Are there any differences between the two servers (e.g. cPanel version, OS)?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  6. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Oddly enough they are the same. For anyone else who finds this post, the following command restarts spamassassin

    /scripts/restartsrv_spamd
     
  7. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    To clarify, did restarting SpamAssassin resolve the issue (note that you must restart SpamAssassin after making changes to it's configuration)?

    Thank you.
     
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  8. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    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.
     
  9. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    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
     
  10. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    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.
     
  11. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Oh! and "F\*ckbuddy", a back slash and not forward slash, also works for the recent spams we seem to be getting loads of.
     
  12. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    51
    cPanel Access Level:
    Root Administrator
    Damn, now \* or \# isn't working? Anyone know why?
     
  13. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    44,802
    Likes Received:
    1,895
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Twitter:
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
Loading...

Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice