Posted by jpluimers on 2013/06/28
When the webmail doesn’t do what I want, I fall back on mutt on the Linux command line prompt.
It is an immensely strong and stable text based mail client, but – beyond the basics – has a steep learning curve.
In fact it is so stable, that the CVS repository rarely gets commits
So below a few notes that I used to clean up truckloads of mail.
- Read Real Programmers: Jump Start: Mutt — by hackers, for hackers. It is a very short introduction with the most powerful.
- Read My first mutt : Searching mail (the best article on My first mutt), and My first mutt : mutt overview. They why limit is far more useful than search, and the basic UI concept of mutt.
- The mutt documentation has a text based man page.
- But there is both a html manual and text manual
(the devel doc branch has both html manual and text manual too).
- A lot of actions in mutt depends on patterns which are based on regular expressions.
For me the most powerful combination of steps is this:
- Limit the message view to a search pattern of messages you are looking for
- Tag the (groups of) messages you want to operate on
- Use the semicolon tag-prefix command to operate only on the tagged messages
A few more details are below.
Moving around: PgUp/PgDn/Start/End
Keys Z/z/=/*; See http://www.mutt.org/doc/manual/manual-2.html.
The indexer page and patterns
Limit the view to mail from linked in that contains an opening square bracket [
As mutt is a bit picky about escaping special characters (not yet archived at the WayBack machine), you need to prepend the [ not with one, but two or three backslashes as this example shows:
~f linkedin ~s \\[
~f linkedin ~s \\\[
Some users need three backslashes per escape, but for me two work fine.
The above pattern is probably a bit to wide, as it matches [ anywhere in the subject.
I want to match messages coming from email@example.com that have [number] at the start of the subject, which results in either of these two patterns:
~f firstname.lastname@example.org ~s ^\\[([A-Za-z0-9\ ]+)\\]
~f email@example.com ~s ^\\\[([A-Za-z0-9\ ]+)\\\]
The result was about a thousand messages per month, good for a big cleanup (:
This was good for about 100 messages per month:
~f linkedin ~s "^New comment"