Mutt

Enjoy this cheat sheet at its fullest within Dash, the macOS documentation browser.

Mutt is a highly configurable, terminal-based MUA (mail user agent) for those with a lot of email. A MUA is a program like Outlook or Thunderbird that only handles mailboxes, without actually sending or receiving messages on its own (instead, it relies on third party programs, known as MTAs (mail transfer agents) to handle the network communication.

This cheatsheet is a guide to the most commonly used commands to get you up and running. For a more exhaustive guide, check out the Mutt manual.

Unless otherwise specified, all commands apply to the currently highlighted message.

Sending & Replying To Mail

m

Compose new message

r

Reply to sender only

g

Reply to all ("group")

f

Forward message

b

Bounce message

Bouncing sends a copy of the message to an alternate address as if they were the original addressee. Not all mail servers will allow this to work.

Composing Messages

Once you enter a compose command and fill out the to, subject, etc. fields, you will be brought into your regular system text editor to compose your message. Once you are done, save the file and exit the editor. You will then be brought to another screen giving you a chance to add attachments or perform other operations on your message. Note that your message will appear on-screen as if it were an attachment on its own - this is normal.

The following commands only work in this pre-sending screen:

a

Attach file

A

Attach message

This will allow you to forward a message as an attachment. After this command, you will be brought back to the index to select a message.

s

Edit subject field

t

Edit to: field

p

PGP commands

P

Postpone message

This will save the message into a postponed (think: drafts) area for later work. You will be prompted if you want to recall a postponed message when you attempt composing a new message.

i

Check spelling

This will invoke ispell, if available on your system.

ESC + k

Attach PGP key

q

Abort

D

Detach file

y

Send message

Status Flags

In addition to who sent the message and the subject, a short summary of the disposition of each message is printed beside the message number. Zero or more of the following characters may appear.

D

Message is deleted (marked for deletion). Actual removal will happen when the mailbox is synced, or mutt is exited.

d

Message has attachments marked for deletion. Like message deletion, the files are not actually removed until sync or exist.

K

Message contains a PGP public key.

N

Message is new (unread).

O

Message is old.

P

Message is PGP encrypted.

r

Message has been replied to.

S

Message is PGP signed, AND the signature has been verified.

s

Message is PGP signed, but without verification. Verification problems will be visible when you open the message.

!

Message is flagged (equivalent to starred in Gmail or red flagged in Outlook).

*

Message is tagged (selected for a multiple-message operation).

+

Message is addressed to you, and only you.

T

Message is addressed to you, but also others (either in the to or cc lines).

C

Message is CC'ed to you (your address is in the cc line).

F

Message is from you.

L

Message is from a mailing list you're subscribed to.

Handling Messages

t

Tag message

Think of tagging as doing a multi-select for a later action, such as a move or delete.

d

Delete message

This will mark the message as deleted, but not immediately purge it from the index. This gives you a chance to undelete the message if you change your mind.

D

Delete messages matching a pattern

This will mark the messages as deleted, but not immediately purge them from the index. This gives you a chance to undelete the message if you change your mind. THIS IS POTENTIALLY DANGEROUS - It is recomended you do a limit (L) search to see what your search syntax will target, tag them, then delete them (T, enter, ;, d). This command does those operations in a single step, and is not recommended unless you are very comfortable with the search syntax.

u

Undelete message

Normally the selection bar will skip deleted messages. To undelete a message, place the selection bar "above" the message to undelete. Be aware that once a message has been removed from the index (either manually, or by exiting mutt with a message marked for deletion), the message is permanently gone.

;

Apply next command to tagged messages

This requires that you have tagged messages using the T or t commands. After keying ;, use another valid message handling command to apply that command to all tagged messages.

$

Synchronize pending actions

If messages are pending deletion, this will immediately and irreversibly purge them.

Searching Messages

Search and limit

The main two ways to bring up specific messages in mutt is by limiting and searching. Limiting hides all messages that do not match a pattern, while regular searching jumps to matching messages in the index.

l

Limit display to subsequently entered pattern

Run the command again, with All or ~A as the pattern to return to the full display.

/

Search visible display

Search Pattern Syntax

When entering a search or limit command, the following syntax can be used.

Note that all searches can be considered to be POSIX Extended Regular Expressions, with extra patterns as shown below. As usual, if you want to search for a literal piece of text that's covered by one of these patterns or a ERE reserved character, it must be escaped by a \ (backslash).

Also, note that searches containing spaces must be enclosed in single or double quotation marks.

Aliases

Aliases allow you to save short names for later use in searches, To/CC lines, etc. For example, you could alias Tom Fubar <tom.fubar@example.com> to TFubar, and then later, if you want to send a message to Tom, you could just enter TFubar and his full name/address will be expanded transparently by mutt.

a

Add alias

Adds an alias for the sender of the highlighted message. After this command, you will receive 3 prompts. The first, Alias As: prompts for the name you want to use later to recall this person. Using our Tom example, this would be tfubar. Second, you'll be prompted for an Address. This will be pre-filled with the address of the selected sender, but you can set it as whatever you wish. Finally, you'll be prompted for a Personal name:- this is the "real" name of the person.