PDA

View Full Version : Empty SPAMBOX for all users via Shell



netdynamix
10-22-2008, 04:43 AM
Hi Everybody,

Is there a command which can be executed or cron'd which will automagically empty the SPAMBOX for ALL users on your box?

Thanks in advance,

Chris

floyd
10-22-2008, 05:06 AM
You could something like:

echo "" > /home/*/path to spambox

The star represents the usernames. Then you have to specify the path to the spambox. I don't know the complete path since I do not believe in using them.

gaw
10-22-2008, 06:35 AM
If your are using the standard maildir setup, something like:

ls -R /home/*/Maildir/.INBOX.spam/*

should list the contents of the spam boxes. For unread stuff use something like:

grep Subject: -R /home/*/Maildir/.INBOX.spam/new/*

rm -Rf /home/*/Maildir/.INBOX.spam/new/*

etc....