Turn on SpamAssassin™ for all accounts (i.e. with yes option to disable).
Turn on SpamAssassin™ for all accounts (i.e. with yes option to disable).
So you want to turn it on globally but still allow users to disable it if they want to do so? WHM > Exim Configuration Editor > SpamAssassin™: Forced Global ON option, but this would then not allow the users to disable it. There is not currently an option to globally enable it on all accounts but still allow disabling it.
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
So bad
Is it possible to this from SSH ??
For SpamAssassin to be enabled, you'd have to add the file .spamassassinenable to /home/username, then add the folder .spamassassin to /home/username with a user_prefs file in it. You could enable it on one account to see the file contents for the /home/username/.spamassassin/user_prefs file.
You could copy that file to /root/spamassassin/user_prefs then create a postwwwacct script for that to enable when the user account is created:
Above, replace username with the cPanel username in that above command only. Any other instances in the lines below should not be replaced but entered exactly as input.Code:mkdir /root/spamassassin cp /home/username/.spamassassin/user_prefs /root/spamassassin
In that file put the following:Code:vi /usr/local/cpanel/scripts/postwwwacct
After creating that file, ensure it can execute:Code:#!/usr/bin/perl my %OPTS = @ARGV; $ENV{USER} = “$OPTS{‘user’}”; system q(mkdir /home/$USER/.spamassassin); system q(touch /home/$USER/.spamassassinenable); system q(cp /root/spamassassin/user_prefs /home/$USER/.spamassassin/); system q(chown $USER:$USER /home/$USER/.spamassassinenable); system q(chown -R $USER:$USER /home/$USER/.spamassassin); system q(chmod 700 /home/$USER/.spamassassin);
I tested the above, and it does work for account creation. As for enabling this on all existing accounts, you could run the following commands:Code:chmod +x /usr/local/cpanel/scripts/postwwwacct
Code:for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ;do mkdir /home/$i/.spamassassin && touch /home/$i/.spamassassinenable ;done for i in `cat /etc/trueuserdomains | cut -d: -d' ' -f2-` ;do cp /root/spamassassin/user_prefs /home/$i/.spamassassin/ ;done 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
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket
This should take care of it.Code:touch /etc/global_spamassassin_enable
-Nick
cPanel Inc.
Need support? Submit a request here. Complimentary support is available to all license holders regardless of where you purchased your license.
Need a complimentary support account? Create one here.
By touching that file, it will not allow the user to disable SpamAssassin in cPanel, which was a requirement by the poster per the original request:
He would like to enable it for all accounts that exist, then to enable it on all accounts that are created, but still allow those users to turn it off after account creation or enabling if they so desire in cPanel > SpamAssassin area. The /etc/global_spamassassin_enable file forces it to be globally on without the option in cPanel > SpamAssassin area to disable it per user.Turn on SpamAssassin™ for all accounts (i.e. with yes option to disable).
cPResources: Support Options | More Support Options | Forums Search | cPanel.net Site Search | Mailing Lists(Alt) | Docs
-- Tristan, Forums Technical Analyst, cPanel Tech Support
Submit a ticket | Check an existing ticket