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!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Setting Server wide Spam Assassin settings

Discussion in 'E-mail Discussions' started by martin MHC, Apr 6, 2017.

Tags:
  1. martin MHC

    martin MHC Active Member

    Joined:
    Sep 14, 2016
    Messages:
    43
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    I apologise for ths question being seemingly easy to answer, but I can't find the info. I'm lookin for.

    I have been reading about Spam Assassin on here and across the web for the last few days, and I'm sure I've already come across the info. I'm looking for (but I didn't want it before), and I now I do want it, I can't find it!!

    Anyhow; I want to do three things:

    1) I want to set Apache Spam Assassin (3.4.1) rules to effect all accounts on my server. Which file in the spamassassin folder (I believe /var/lib/spamassassin/ but not certain) do I edit for this, I think it's local.cf but am not sure and can't find any clarification. FIXED

    2) Can someone please provide a quick syntax example of setting custom rules in the local.cf file (or whichever file is appropriate). The local.cf itself doesn't give examples given on the documentation ( Apache SpamAssassin - Documentation - cPanel Documentation ) only relates to the CPanel interface, as far as I can see. FIXED

    3) Is there a way for the SpamAssassin to delete/remove/ingore previously set account-specific rules in one fell swoop? Such as deleting account specific files (even better, if you can direct me to these account specific files I can then use the syntax (if valid) to update the server-wide rule set.

    Many thanks, and sorry for the probable obviousness of this question, I can't see the info and have been going round in circles looking!

    Cheers
     
    #1 martin MHC, Apr 6, 2017
    Last edited: Apr 6, 2017
  2. martin MHC

    martin MHC Active Member

    Joined:
    Sep 14, 2016
    Messages:
    43
    Likes Received:
    6
    Trophy Points:
    8
    Location:
    UK
    cPanel Access Level:
    Root Administrator
    UPDATE:

    I have found This page ( SpamAssassin: Tests Performed: v3.3.x ) which lists Spam Assassin Rules as well as this Config file details about how to update ( Mail::SpamAssassin::Conf - SpamAssassin configuration file )

    the conclusion I reach from these is:

    - 1) Log in to your server and find /etc/mail/spamassassin/local.cf and download,
    - 2) Edit the file to add/adjust the scores needed
    - 3) Reupload the file
    - 4) On the command line run: /scripts/restartsrv_spamd

    This *should* update and restart Apache Spam Assassin on the server, and apply the scores/rules specified in the links above to all accounts on the server.

    I have not yet found a neat way of clearing all account-specific rules.
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    This is the correct method of modifying the default SpamAssassin rules/configuration values. To clear the custom configuration values implemented in an individual account, you'd need to manually remove the following file:

    Code:
    /home/$username/.spamassassin/user_prefs
    Thank you.
     
  4. Monto

    Monto Member

    Joined:
    Jul 5, 2017
    Messages:
    7
    Likes Received:
    2
    Trophy Points:
    3
    Location:
    Australia
    cPanel Access Level:
    Root Administrator
    Hello,

    Changing the score required in local.cf doesn't change the value in existing accounts, not for me anyway. Does this mean that because of the user_prefs files that lock in the default, that essentially the score cannot be changed server-wide, but needs to be done per account?
     
  5. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    38,658
    Likes Received:
    1,427
    Trophy Points:
    363
    cPanel Access Level:
    Root Administrator
    Hello,

    Yes, the values in the user_prefs file for individual accounts takes precedence over the global values. You'd have to remove or modify the existing "/home/$username/.spamassassin/user_prefs" files for each account to ensure they are using the default global values.

    Thank you.
     
Loading...

Share This Page