[TriLUG] command line: delete all mail in a folder
mhrivnak at triad.rr.com
Tue Sep 30 01:07:40 EDT 2003
I am looking for the best way to delete all the mail in an mbox folder
from the command line.
I have spamassassin scan all incoming mail, which is then stored on an
imap server. Tagged spam gets filtered by the client and moved to a
holding directory. I can then glance over the spam before moving it
into the confirmed spam directory.
Once I make sure that it's all spam, I use "spamassassin -r" paired with
formail to report each message to Razor2 and run it through the bayesian
filters. I want to create a cron job to periodically report all the
confirmed spam and then delete it. This way I can continue to dump spam
into the confirmed folder throughout the day and let the server dispose
of it automatically. Reporting I can do; deleting is a little trickier.
I've considered just deleting the entire file and using "touch" to
recreate an empty mbox folder, but there must be a more elegant and safe
Thanks for your advice!
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the TriLUG