The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

very large file auto-whitelist how I autodelete ?

Discussion in 'General Discussion' started by sirswatch, May 24, 2006.

  1. sirswatch

    sirswatch Member

    Joined:
    Nov 5, 2003
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    In some account I have a very large (more thant 30 MB !) file auto-whitelist.
    I know this file is used by spamassassin but this file is owned by domain account and the space calculated under quota.

    I have read with check_whitelist program I can clean this file but on my server this file is not present and I don't want to reinstall spamassassing from and rpm because I risk a system crash !

    Any idea on how I can clean these files with a cron ?
     
  2. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Hi, I don't like to revive old threads, but I'm at the same situation:
    I wanted to use check_whitelist but I found that it is not bundled with the SA install in cPanel.
    Is there any reason for that?
     
  3. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    Basically in a nutshell ...
    Code:
    #!/bin/bash
    IFS="$"
    
    cd /home
    
    find ./*/.spamassassin -maxdepth 1 -type 'f' -name 'auto-whitelist' -size +10M | xargs rm -f
    
    The above basic shell script code performs a search for any "auto-whitelist"
    files stored in the spamassassin settings folders for each account and
    displays only those that are larger than 10 Megabytes (+10M) and that
    list is piped into the 'xargs' which executes 'rm -f' against each file found.
     
  4. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Good for you, but we wanted to delete unuseful data, not to fully erase it :)

    I wonder if sa-learn does a similar job than check_whitelist after learning. Or it only applies on email files?
     
  5. Spiral

    Spiral BANNED

    Joined:
    Jun 24, 2005
    Messages:
    2,023
    Likes Received:
    7
    Trophy Points:
    0
    How would you determine what is meaningful and what is not?

    Incidentally, when the bayes auto whitelisting databases grow that large,
    they are often by their very nature filled with a lot of data that should
    not be whitelisted in the first place which is incidentally the reason
    I generally leave autowhitelisting (which is based on huristtics) disabled
    on Spamassassin and instead manually whitelist those addresses that
    appear in my email account address book as valid contacts.

    I then try to configure the mail rules (/usr/share/spamassassin) to
    be as accurate as possible and hit the most spam possible without
    false positives being triggered in legitimate mail.
     
  6. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Good point. I thought check_whitelist may determine that, but in the end you're right: Heuristics results don't deserve great attention. The script worked fine, thanks!

    In regards of disabling autowhitelisting, I didn't knew it may be done if using cPanel. Is it a persistent config or will it be reset every time you upgrade cPanel again?

    And about editing your own rules, it goes beyond my knowledge about SA. Although I'm up to learn :)
     
  7. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    All in all: all this didn't answered my question: why isn't the check_whitelist script bundled in the SpamAssassin installation even if it's supposed to be present. :)
     
  8. trevHCS

    trevHCS Well-Known Member

    Joined:
    Nov 1, 2003
    Messages:
    69
    Likes Received:
    1
    Trophy Points:
    8
    Just a little tweak to this. On Cenros 4.7 at least the -size 10M returns an error about M not being a valid option. In that case it would need to be this I guess as it only goes to kilobytes.

    Code:
    #!/bin/bash
    IFS="$"
    
    cd /home
    
    find ./*/.spamassassin -maxdepth 1 -type 'f' -name 'auto-whitelist' -size +10240k | xargs rm -f
    Runs without an error anyway so think it worked. :)

    Trev
     
  9. Kent Brockman

    Kent Brockman Well-Known Member

    Joined:
    Jan 20, 2008
    Messages:
    1,130
    Likes Received:
    3
    Trophy Points:
    38
    Location:
    Buenos Aires, Argentina
    cPanel Access Level:
    Root Administrator
    Twitter:
    Exactly. Me too. I forgot to comment about that -size parameter.
    It will be great if more SA mantainance tips may be shared as there are not so much elsewhere.
     
Loading...

Share This Page