Clean spam from mail folders

I run a few servers that do mail processing, and part of them is ASSP ( The result of this is that spam can be sent to separate e-mail accounts/forwards whose names are (where is the original e-mail account).

Added to this the servers in question use virtual mailboxes for storing e-mail, with all mail under a common directory (name vmail, or mail, or something). The structure on our system the froxlor control panel ( is mail/client/mailaccount, thus it is pretty easy to search.

The attached Perl script will search through all subdirectories which match a regular expression (default is to contain the word 'spam' in lower case) and remove older entries. Edit the block starting with Customize Here (put it in test mode by setting $TESTING to 1) and drop it into your /etc/cron.weekly. Set it to be executable and you are ready to go.

Last update:
2012-01-01 16:56
Average rating:0 (0 Votes)

You can comment this FAQ

Chuck Norris has counted to infinity. Twice.