very large file auto-whitelist how I autodelete ?

sirswatch

Member
Nov 5, 2003
9
0
151
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 ?
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
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?
 

Spiral

BANNED
Jun 24, 2005
2,020
8
193
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 ?
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.
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
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?
 

Spiral

BANNED
Jun 24, 2005
2,020
8
193
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.
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
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 :)
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
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. :)
 

trevHCS

Well-Known Member
Nov 1, 2003
69
1
158
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
 

Kent Brockman

Well-Known Member
Jan 20, 2008
1,222
39
178
Buenos Aires, Argentina
cPanel Access Level
Root Administrator
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.