Please don't use CAPS it is considered shouting.mahinder said:PLEASE PLEASE PROVIDE OPTION TO FORCE ENABLE SPAMASSASSIN AND SPAM BOX ON ALL ACCOUNTS ON SERVER. ITS JUST NOT POSSIBLE TO LOGIN TO EACH ACCOUNT AND ENABLE SPAMASSASSIN WHEN YOU HAVE 10'S OF SERVER WITH 100s of domains on each server.
Since there is no option in the WHM to enable/activate SpamAssassin for every account, you can write a shell or Perl script to do that.Mibble said:once spamassassin is upgraded on a server, each and every domain has spamassassin and the spamassassin box disabled.
is there anyway to re-enable these things globally, so i do not have to go into each and every domain?
I am sorry for using caps, i didn't knew its considered shouting, will not do this again. but, I wanted to make my point louder. You try transferring accounts from one server to another one. You will find that spamassassin get deactivate on new server. This creates huge headache for us. I am going to email cpanel and request them for this feature. I will also send them chocolates once its available in WHM for saving lots of my time and headache dealing with RBL's. :DAndyReed said:Since there is no option in the WHM to enable/activate SpamAssassin for every account, you can write a shell or Perl script to do that.
#! /bin/sh
M_FILENAME=$1
#echo $M_FILENAME
M_USERNAME=`find $M_FILENAME -printf %f`
#echo $M_USERNAME
touch /home/$M_USERNAME/.spamassassinenable
chown $M_USERNAME.$M_USERNAME /home/$M_USERNAME/.spamassassinenable
touch /home/$M_USERNAME/.spamassassinboxenable
chown $M_USERNAME.$M_USERNAME /home/$M_USERNAME/.spamassassinboxenable
echo $M_USERNAME complete
echo
Thanks for that, it's a very nice script, and works fine :Di have written this script to enable spamassassin and spambox on all users till cpanel provide this option in WHM, i have tried it on one server and seems to work fine. here is kiddy script
Now save above script and name it /root/enabless.sh and change to chmod 700. now call script like thisCode:#! /bin/sh M_FILENAME=$1 #echo $M_FILENAME M_USERNAME=`find $M_FILENAME -printf %f` #echo $M_USERNAME touch /home/$M_USERNAME/.spamassassinenable chown $M_USERNAME.$M_USERNAME /home/$M_USERNAME/.spamassassinenable touch /home/$M_USERNAME/.spamassassinboxenable chown $M_USERNAME.$M_USERNAME /home/$M_USERNAME/.spamassassinboxenable echo $M_USERNAME complete echo
find /var/cpanel/users -type f -exec /root/enabless.sh {} \;
this will create
.spamassassinenable
and
.spamassassinboxenable
file in ALL users home directory on server which will enable spamassassin and spambox for domain. works fine on my server. use code on your own risk however it should do no harm to your server.
I personally just modified the script to copy my .spamassassin directory over, and chown it. I believe it was something like:ok, the script is great,
so my question is what about the /home/username/.spamassasin directory and the files in it - files like user_prefs and so on ?
thanks
cp /home/dansoft/.spamassassin /home/$M_USERNAME/ -R
chown $M_USERNAME:$M_USERNAME /home/$M_USERNAME/.spamassassin
Urk :p I think that's the most marvellously creative use of find(1) I've seen in years of teaching shell scripting, well done!i have written this script to enable spamassassin and spambox on all users till cpanel provide this option in WHM, i have tried it on one server and seems to work fine. here is kiddy script
Now save above script and name it /root/enabless.sh and change to chmod 700. now call script like thisCode:#! /bin/sh M_FILENAME=$1 #echo $M_FILENAME M_USERNAME=`find $M_FILENAME -printf %f` #echo $M_USERNAME touch /home/$M_USERNAME/.spamassassinenable chown $M_USERNAME.$M_USERNAME /home/$M_USERNAME/.spamassassinenable touch /home/$M_USERNAME/.spamassassinboxenable chown $M_USERNAME.$M_USERNAME /home/$M_USERNAME/.spamassassinboxenable echo $M_USERNAME complete echo
find /var/cpanel/users -type f -exec /root/enabless.sh {} \;
this will create
.spamassassinenable
and
.spamassassinboxenable
file in ALL users home directory on server which will enable spamassassin and spambox for domain. works fine on my server. use code on your own risk however it should do no harm to your server.
cd /home
for user in `ls /var/cpanel/users`
do
test ! -d $user && continue
touch $user/.spamassassinenable $user/.spamassassinboxenable
chown $user.$user $user/.spamassassinenable $user/.spamassassinboxenable
echo $user complete
done
#! /bin/sh
cd /home
for user in `ls /var/cpanel/users`
do
test ! -d $user && continue
rm -rf /home/$user/.spamassassinenable
cp /master_files/SA/.spamassassinenable /home/$user/ -R
chown $user:$user /home/$user/.spamassassinenable
echo $user complete
done
we're running Ver., 3.1.7, lastest I believe.Are you running SpamAssassin under Mail Scanner or are you running SA it by itself?
What version are you using?
Steve at WebHostingGear.com hooked me up with a sweet global configuration of SA.
I don't know what he did, but my server load is averaging like .04 and we are getting very few junk mails through.
# SpamAssassin config file for version 3.x
# NOTE: NOT COMPATIBLE WITH VERSIONS 2.5 or 2.6
# See http://www.yrex.com/spam/spamconfig25.php for earlier versions
# Generated by http://www.yrex.com/spam/spamconfig.php (version 1.50)
# How many hits before a message is considered spam.
required_score 4.8
# Change the subject of suspected spam
rewrite_header subject {Spam?}
# Encapsulate spam in an attachment (0=no, 1=yes, 2=safe)
report_safe 0
# Enable the Bayes system
use_bayes 1
use_bayes_rules 1
# Enable Bayes auto-learning
bayes_auto_learn 1
bayes_min_ham_num 1000
bayes_min_spam_num 1000
bayes_learn_during_report 1
# Enable or disable network checks
skip_rbl_checks 0
razor_config /var/spool/mqueue/.razor/razor-agent.conf
dcc_home /var/dcc
use_pyzor 1
#pyzor_path /usr/local/bin/pyzor
#pyzor_max 0
#pyzor_options --homedir /etc/mail/spamassassin
# Mail using languages used in these country codes will not be marked
# as being possibly spam in a foreign language.
# ok_languages all
# Mail using locales used in these country codes will not be marked
# as being possibly spam in a foreign language.
ok_locales all
# Handle header info
add_header spam Flag _YESNOCAPS_
add_header all Status _YESBO_, score=_SCORE_ required=_REQD_ tests=_TESTS_ autolearn=_AUTOLEARN_ version=_VERSION_
# add header all Level _STARS(*)_
# add header all Checker-Version SpamAssassin _VERSION_ (_SUBVERSION_) on _HOSTNAME_