How can I enable SpamAssassin on all cPanel accounts?

The "Apache SpamAssassin: Forced Global ON" option in WHM's Exim Configuration manager does not actually enable SpamAssassin the way you think it does. It creates the SpamAssassin module/option in the cPanel accounts, however, if no configurations are set by the end user it's not really doing any good.

The article will cover how to enable SpamAssassin for every cPanel account on your server with a few steps.

This article requires common knowledge of SSH / Terminal usage.

Enable SpamAssassin on all cPanel accounts

  1. Log in to your server via SSH terminal as the root user.
  2. Make sure the Global SpamAssassin Enable file exists, otherwise create it.
  • touch /etc/global_spamassassin_enable
  1. Create a 'default' or 'blanket' configuration for user preferences. Reference SA Configuration Manual for specifics on creating configuration files. For this example, we're using a simple configuration containing the rule "required_score 3". The default configuration file will be located in /root/support/spamassassin/
  • touch /root/support/spamassassin/user_prefs && echo "required_score 3" » /root/support/spamassassin/user_prefs
  1. Once that's completed, continue with these loops to create the proper files/folders.
    1. Create the "enable" files for each user:
      • for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ;do mkdir /home/$i/.spamassassin && touch /home/$i/.spamassassinenable ;done
    2. Copy the default configuration we created in step 3 to all cPanel accounts:
      • for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ;do cp /root/support/spamassassin/user_prefs /home/$i/.spamassassin/ ;done
    3. Correct the permissions and ownership of the files/folders just created:
      • for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ;do chown $i:$i /home/$i/.spamassassinenable && chown -R $i:$i /home/$i/.spamassassin ;done
  2. That's it! All cPanel accounts have SpamAssassin enabled with user preferences.
  • 0 Bu dökümanı faydalı bulan kullanıcılar:
Bu cevap yeterince yardımcı oldu mu?

İlgili diğer dökümanlar

I'm unsure what to put as IP for the resolver configuration in WHM

Please leave default IPs in resolver configuration to give your VPS the best DNS performance...

Is there a way to limit bandwidth for a sub domain or cPanel account for one of our domains?

CPanel allows you to set the bandwidth limit for each account, once you reach the bandwidth...

Powered by WHMCompleteSolution