How can I search and delete mail?

Hi,

I'd like to delete emails on one of my Linux boxes using a criteria and I don't really know where to start. Any suggestions?

The emails I'd like to delete have all the following sub-string: checkdefunct.sh.sh

I have more than 187.000 emails and 90% of them I'd like to get rid of.

Thank you,

Fabio

This depends on what format you use to store those mails. In the "mbox" format on *nix, used by - amongst others - thunderbird as well, every mail eintry starts with the word From , to be distinguished from From: which shows up a few lines down.
So - first make a backup of your mail file, and then check with trial and error if you can locate your search string between two From s and print the entry if not. Check also if the result file is interpretable by your mail program.

1 Like