Community Forums
Connect with us on LinkedIn
+ Reply to Thread
Page 1 of 3 1 2 3 LastLast
Results 1 to 15 of 39
  1. #1
    Member
    Join Date
    Apr 2005
    Posts
    34

    Default spamassassin global enable anyone?

    hi there,
    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?
    thanks,

    John
    John Oligario
    TurboCash Support & Hosting
    osCommerce Support & Hosting

  2. #2
    Member
    Join Date
    Jun 2003
    Location
    matrix
    Posts
    60

    Default

    I am also looking for similar solution since last many many months. Most of users do not enable spamassassin by default and their email boxes grow to their quota limits causing bounce backs which are also caught by spamtrapps resulting in server being blacklisted by spamcop and other rbls. 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.

  3. #3
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Quote Originally Posted by mahinder
    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.
    Please don't use CAPS it is considered shouting.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  4. #4
    Member
    Join Date
    Apr 2005
    Posts
    34

    Default

    perhaps he is trying to make a point?
    John Oligario
    TurboCash Support & Hosting
    osCommerce Support & Hosting

  5. #5
    cPanel Partner NOC cPanel Partner NOC Badge AndyReed's Avatar
    Join Date
    May 2004
    Location
    Minneapolis, MN
    Posts
    2,223

    Default

    Quote Originally Posted by Mibble
    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?
    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.
    Andy Reed
    RHCE and CCNA
    ServerTune.com

  6. #6
    Member
    Join Date
    Jun 2003
    Location
    matrix
    Posts
    60

    Default

    Quote Originally Posted by AndyReed
    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.
    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.

    about the script, I tried thinking about it but it seems very difficult. I will do more research tomorrow.

    Edit: should i lowercase words in previous post?
    Last edited by mahinder; 09-22-2006 at 01:10 PM.

  7. #7
    Member
    Join Date
    Aug 2003
    Posts
    45

    Default Need this feature

    I am interested in this feature combined with a global 'Clear Spam Box'.
    I have customers who never login to cpanel only to come back with they can't receive mails.
    Thank You

  8. #8
    Member
    Join Date
    Jun 2003
    Location
    matrix
    Posts
    60

    Default

    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

    Code:
    #! /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
    Now save above script and name it /root/enabless.sh and change to chmod 700. now call script like this

    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.

  9. #9
    Member
    Join Date
    Oct 2006
    Location
    Melbourne, Australia
    Posts
    84
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mahinder View Post
    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

    Code:
    #! /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
    Now save above script and name it /root/enabless.sh and change to chmod 700. now call script like this

    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.
    Thanks for that, it's a very nice script, and works fine

  10. #10
    Member
    Join Date
    Feb 2004
    Posts
    11

    Default dumm question

    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

  11. #11
    Member
    Join Date
    Oct 2006
    Location
    Melbourne, Australia
    Posts
    84
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by gotini2004 View Post
    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
    I personally just modified the script to copy my .spamassassin directory over, and chown it. I believe it was something like:
    Code:
    cp /home/dansoft/.spamassassin /home/$M_USERNAME/ -R
    chown $M_USERNAME:$M_USERNAME /home/$M_USERNAME/.spamassassin
    Right above the echo $M_USERNAME complete line (with /home/dansoft/.spamassassin being an existing spamassassin directory).

    But, I've removed this now, and I'm just using MailScanner server-wide

  12. #12
    Member brianoz's Avatar
    Join Date
    Mar 2004
    Location
    Melbourne, Australia
    Posts
    1,117
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by mahinder View Post
    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

    Code:
    #! /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
    Now save above script and name it /root/enabless.sh and change to chmod 700. now call script like this

    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.
    Urk I think that's the most marvellously creative use of find(1) I've seen in years of teaching shell scripting, well done!

    Purely from a scripting point of view, a far simpler form of this would be:

    Code:
    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
    Save it in a file and run it once as a shell script.

  13. #13
    Member d-woo's Avatar
    Join Date
    Aug 2003
    Posts
    86

    Default Enabling Spamassassin for All Accounts

    I have Spam Assassin 3.1.7

    I have just migrated about 75 sites to a new server...all secured by ramprage (great job at WebhostingGear.com)

    The default setting for all accounts in cPanel is SpamAssasin (SA) disabled.

    I want to do both of these:
    ---------------------------------
    a. setup the skeleton directory (/root/cpanel3-skel/) to have all future added accounts SA enabled.
    b. SA enable all current accounts (located in /var/cpanel/users)

    What I am seeing is that an account that has never had an email account or been SA enabled looks like this (screenshots from using WinSCP):
    Pic01


    and that the same account after turning on SA looks like this:
    Pic02



    It appears that I need to have:
    1. the file .spamassassinenable
    and
    2. the folder .spamassassin

    No Problem.

    Now, my question is around the contents of the folder, .spamassassin

    On a newly enabled account, it looks like this:
    Pic03


    But on an account that has been around the block for a while, the contents of the folder, .spamassassin looks like this:
    Pic04


    2 Questions:
    1. If I am writing a script to enable all accounts in /var/cpanel/users to be SA enabled, what files should be in the folder, .spamassassin?

    2. Will the bayes files and the auto-whitelist file get added/written automatically to the .spamassassin folder as that email account is used?
    The bayes files could be older data from my old server when I used to run MailScanner....not sure.

    I need to know this, so I will determine which files go in the master .spamassassin folder that I will be copying from to all users.
    Last edited by d-woo; 12-04-2006 at 07:16 PM.

  14. #14
    Member d-woo's Avatar
    Join Date
    Aug 2003
    Posts
    86

    Default

    It turns out that my SpamAssassin (3.1.7) is configured for the entire server.

    So, all I need to do is add the file .spamassassinenable to each /home/<user> directory

    I placed a copy of that file in /master_files/SA/.spamassassinenable

    Here is the script: /my_scripts/SA_enable_all

    Code:
    #! /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
    chmod it as 700
    [/#] chmod 700 /my_scripts/SA_enable_all

    run the script
    [/#] cd /my_scripts
    [/#] ./SA_enable_all


    All existing accounts are now enabled


    New Accounts

    place a copy of /master_files/SA/.spamassassinenable in /root/cpanel3-skel
    [/#] cp /master_files/SA/.spamassassinenable /root/cpanel3-skel/

    Any new accounts will be SA enabled
    Last edited by d-woo; 12-05-2006 at 12:35 PM.

  15. #15
    Member mickalo's Avatar
    Join Date
    Apr 2002
    Location
    N.W. Iowa
    Posts
    753

    Default

    Handy little scripts.

    Now if they could come up with a way to trim the memory usage by spamd, that would be great! It is a real memory hog!!

    Thx's
    Mickalo

    Thunder Rain Internet Publishing

    Providing Internet Solutions that work!
    Custom Perl and Database Programming

Similar Threads & Tags
Similar threads

  1. SpamAssassin: How to set up global filters?
    By SuperBaby in forum E-mail Discussions
    Replies: 0
    Last Post: 10-01-2010, 01:58 AM
  2. Questions about new Global SpamAssassin setup
    By sneader in forum cPanel and WHM Discussions
    Replies: 2
    Last Post: 02-07-2008, 10:56 PM
  3. Turn on SpamAssassin for all accounts (Global ON)
    By hploh in forum E-mail Discussions
    Replies: 0
    Last Post: 09-14-2007, 04:35 AM
  4. SpamAssassin (Global ON) Question
    By bsasninja in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 07-17-2007, 10:06 AM
  5. Global Spamassassin Setup How To?¿
    By bsasninja in forum cPanel and WHM Discussions
    Replies: 0
    Last Post: 06-27-2006, 05:58 PM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube