The Problem
I am running several Linux servers and thereon are a few cron jobs. I like to configure these cornjobs to send me an email with the result as soon as they are finished. (Which can be done by prepending a MAILTO=“recipient@adress.tld“ in the crontab)
However, if there are jobs which are running frequently then you may get a lot of emails in your local inbox. Since i am using mutt (a local command line email client) for checking my mails.
You see - 14440 new messages. If you want to delete them by pressing d for each message then this will take a time till you have paged through all messages. There must be a better solution ...
The Solution
Mutt lets you delete messages by a regex pattern. Here is how you do it:
- Press D (capital letter) -> This enters the mode where you can enter your regex
- Enter your regular expression: ~s .*
- Press q to quit mutt and accept that you want to delete the messages.
E voila - the messages are gone.