The Mutt Mail User Agent
t - tag (mark) a message T - tag messages with regex ; - tag prefix, run next command with tagged messages b - bounce a mail ;b - bounce all tagged messages
Move around in mutt:
j or Down next-entry move to the next entry k or Up previous-entry move to the previous entry z or PageDn page-down go to the next page Z or PageUp page-up go to the previous page = or Home first-entry jump to the first entry * or End last-entry jump to the last entry
Howto delete mails older than X
First make sure you are in the right inbox. Then use the `D` command to delete messages by regular expression. When prompted to delete messages, enter
~d >30d. This will delete messages older than 30 days.
Other options are:
- d for days
- m for months
- y for years
Once the desired messages are marked for deletion simply quit mutt to purge or enter
$ to avoid quitting mutt.
Many of Mutt's commands allow you to specify a pattern to match (limit, tag-pattern, delete-pattern, etc.). There are several ways to select messages:
~A all messages ~b EXPR messages which contain EXPR in the message body ~B EXPR messages which contain EXPR in the whole message ~c USER messages carbon-copied to USER ~C EXPR message is either to: or cc: EXPR ~D deleted messages ~d [MIN]-[MAX] messages with ``date-sent'' in a Date range ~E expired messages ~e EXPR message which contains EXPR in the ``Sender'' field ~F flagged messages ~f USER messages originating from USER ~g PGP signed messages ~G PGP encrypted messages ~h EXPR messages which contain EXPR in the message header ~k message contains PGP key material ~i ID message which match ID in the ``Message-ID'' field ~L EXPR message is either originated or received by EXPR ~l message is addressed to a known mailing list ~m [MIN]-[MAX] message in the range MIN to MAX *) ~n [MIN]-[MAX] messages with a score in the range MIN to MAX *) ~N new messages ~O old messages ~p message is addressed to you (consults $alternates) ~P message is from you (consults $alternates) ~Q messages which have been replied to ~R read messages ~r [MIN]-[MAX] messages with ``date-received'' in a Date range ~S superseded messages ~s SUBJECT messages having SUBJECT in the ``Subject'' field. ~T tagged messages ~t USER messages addressed to USER ~U unread messages ~v message is part of a collapsed thread. ~x EXPR messages which contain EXPR in the `References' field ~y EXPR messages which contain EXPR in the `X-Label' field ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
To delete messages matching a pattern in the subject of the mail enter:
D ~s "text within subject" $
c change to a different mailbox ESC c change to a folder in read-only mode C copy the current message to another mailbox ESC C decode a message and copy it to a folder ESC s decode a message and save it to a folder D delete messages matching a pattern d delete the current message F mark as important l show messages matching a pattern N mark message as new o change the current sort method O reverse sort the mailbox q save changes and exit s save-message T tag messages matching a pattern t toggle the tag on a message ESC t toggle tag on entire message thread U undelete messages matching a pattern u undelete-message v view-attachments x abort changes and exit <Return> display-message <Tab> jump to the next new message @ show the author's full e-mail address $ save changes to mailbox / search ESC / search-reverse ^L clear and redraw the screen ^T untag messages matching a pattern
the muttrc config file
[...] # # Headers to ignore # ignore * unignore From Message-ID Date User-Agent To Cc Bcc Subject unignore Delivery-date unignore x-mailer x-url unignore X-Delivered-to Delivered-To unignore x-spam-score authentication-results hdr_order date from to cc subject # # Index format # set index_format="%4C %[%a %Y-%m-%d %X] %-15.15F %Z (%4c) %s"