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!

Where to add SpamAssassin Rules?

Discussion in 'E-mail Discussion' started by DWardCA, Jul 18, 2018.

  1. DWardCA

    DWardCA Member

    Joined:
    Aug 12, 2017
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Edmonton, Canada
    cPanel Access Level:
    Root Administrator
    What is the proper process for adding new scoring into cPanels' implementation of SpamAssassin. Its not clear which configuration files are actually used.

    If I look in /etc/mail/spamassassin/CPANEL.cf I see this:

    Code:
    header          CPANEL_XYZ              From =~ /\@.*?\.xyz/i
    describe        CPANEL_XYZ              .XYZ domain mostly used by spammers
    score           CPANEL_XYZ              2.1
    
    This is exactly what I want to add, but for the .date top-level domain. But I'm not sure which file to add it to .. /etc/mail/spamassassin/local.cf does not seem to be the same format as the CPANEL.cf - and I see some items in there that say they are auto-generated by cPanel which makes me believe there is another location.

    Code:
    # Emails from the .date TLD are automatically suspicious
    header          CUSTTLD_DATE              From =~ /\@.*?\.date/i
    describe        CUSTTLD_DATE              .DATE top-level domain mostly used by spammers
    score           CUSTTLD_DATE              2.1
    
     
  2. DWardCA

    DWardCA Member

    Joined:
    Aug 12, 2017
    Messages:
    11
    Likes Received:
    0
    Trophy Points:
    1
    Location:
    Edmonton, Canada
    cPanel Access Level:
    Root Administrator
    I ran

    /usr/local/cpanel/3rdparty/bin/spamassassin -D < spammsg.txt

    In the debug messages I see two things which tell me that local.cf *IS* the correct place to add custom rules, and spamassassin is picking it up.

    First, it shows:

    config: read file /etc/mail/spamassassin/local.cf

    Which verifies its local.cf file is correct....

    And in the Content analysis details it now shows my custom rule:

    2.1 CUSTTLD_DATE .date domain mostly used by spammers

    So - yay .. I've successfully added a header rule.
     
  3. cPanelLauren

    cPanelLauren Forums Analyst
    Staff Member

    Joined:
    Nov 14, 2017
    Messages:
    2,212
    Likes Received:
    159
    Trophy Points:
    143
    Location:
    Houston
    cPanel Access Level:
    DataCenter Provider
    Hi @DWardCA

    You can make customizations to the spamassassin global configuration by modifying /etc/mail/spamassassin/local.cf


    As you just found! Thanks for updating, you beat me to it!
     
    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