hi all,
spamassassin is greate. However most customer don never empty there spambox so a lot of space will be used. Is there any script that can empty the spambox afther x days automatically?
Thanks a lot
hi all,
spamassassin is greate. However most customer don never empty there spambox so a lot of space will be used. Is there any script that can empty the spambox afther x days automatically?
Thanks a lot
Under the spamassasin options in cpanel you can already do this. However, you must visit each accounts cpanel.
I run RELEASE build.
I once made a script which trims the spambox to the last 30 days only. PM me if you want the code as I don't have it to hand.
If you find it, can you post it here? So we don't all pester you individually.
Yes, thanks!Originally Posted by payne
I empty all spamboxes every 2 hours with this command on crontab:
This command find all files named "spam" with group "mail" on /usr/home (my homes directory), then truncate it at zero byte.find /usr/home -name "spam" -group mail -exec truncate -s 0 {} \;
The command "truncate" works fine on FreeBSD (i don't know on Linux).
It's brutal, but works.
There's unlikely to be a truncate command on Linux. However, you could simply replace the truncate function with cat /dev/null > filename
That said, user education is probably better![]()
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
Each to his own and this may well suit your needs but the above approach defeats the purpose of having a spambox.Originally Posted by daniele81
Pass me an Axe!
I think we'll run this weekly. That way, they have a spam box, but it doesn't get out of hand, especially for those folks who never check it (it is on or off for the entire account).
so, I can't get it to work. I'm trying:
and it isn't working. I've tried them separately, the find works and the cat /dev/null works when I replace the {} with a filename... they just don't work together like this. What am I missing?Code:find /home -name "spam" -group mail -exec cat /dev/null > {} \;
I use the following on several linux boxes
$ find /home -name "spam" -group mail -follow | xargs -i -t rm -f {}
Use the following code:
We are using this code and it works well. It remove the SpamBox only if the inbox over 1 Mb.find /home*/*/mail/ -name "spam" -group mail -size +1024k | xargs -i rm -f {}
Reliable web-hosting, good resellers plans, web-design.
ISProHosting.com
Thanks guys! I added find /home*/*/mail/ -name "spam" -group mail -size +1024k | xargs -i rm -f {} to the cron
===========================================
And now for something totally different! -Monty Python
find /home/*/mail/ -name "spam" -size +1024k | xargs -i sh -c "cat /dev/null > {}"
I am trying to add this to a site to test it out, but when I add it to the crontab using standard mode it cuts it off at
And when I add it via the unix mode, it doesn't even add it to the crontab.Code:find /home/*/mail/
Any hints?
cPanel Build 10.9.1-STABLE 14304
Theme cPanel X v2.6.0