1

Delete all emails in mutt

 2 years ago
source link: https://www.bytebang.at/Blog/Delete+all+emails+in+mutt?language=en
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

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=“[email protected]“ 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.

14440_messages_in_mutt.png

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:

  1. Press D (capital letter) -> This enters the mode where you can enter your regex
  2. Enter your regular expression: ~s .*
  3. Press q to quit mutt and accept that you want to delete the messages.

delete_all_messages_in_mutt.png

E voila - the messages are gone.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK