The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Custom SpamAssassin Rules

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

  1. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    671
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    #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:
    2
    Trophy Points:
    38
    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:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    671
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
    Hello,

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

    Thank you.
     
  6. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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 Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,811
    Likes Received:
    671
    Trophy Points:
    113
    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.
     
  8. floppyfringe

    floppyfringe Active Member

    Joined:
    Jan 21, 2010
    Messages:
    28
    Likes Received:
    0
    Trophy Points:
    1
    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:
    1
    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:
    1
    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:
    1
    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:
    1
    cPanel Access Level:
    Root Administrator
    Damn, now \* or \# isn't working? Anyone know why?
     
Loading...

Share This Page