The Mutt E-Mail Client

Michael Elkins

version 1.5.17cvs (2008-05-11)

Abstract

``All mail clients suck. This one just sucks less.'' -me, circa 1995


Table of Contents

1. Introduction
1. Mutt Home Page
2. Mailing Lists
3. Software Distribution Sites
4. IRC
5. USENET
6. Copyright
2. Getting Started
1. Moving Around in Menus
2. Editing Input Fields
2.1. Introduction
2.2. History
3. Reading Mail - The Index and Pager
3.1. The Message Index
3.2. The Pager
3.3. Threaded Mode
3.4. Miscellaneous Functions
4. Sending Mail
4.1. Editing the message header
4.2. Using Mutt with PGP
4.3. Sending anonymous messages via mixmaster.
4.4. Sending format=flowed messages
5. Forwarding and Bouncing Mail
6. Postponing Mail
3. Configuration
1. Syntax of Initialization Files
2. Address groups
3. Defining/Using aliases
4. Changing the default key bindings
5. Defining aliases for character sets
6. Setting variables based upon mailbox
7. Keyboard macros
8. Using color and mono video attributes
9. Ignoring (weeding) unwanted message headers
10. Alternative addresses
11. Mailing lists
12. Using Multiple spool mailboxes
13. Monitoring incoming mail
14. User defined headers
15. Defining the order of headers when viewing messages
16. Specify default save mailbox
17. Specify default Fcc: mailbox when composing
18. Specify default save filename and default Fcc: mailbox at once
19. Change settings based upon message recipients
20. Change settings before formatting a message
21. Choosing the cryptographic key of the recipient
22. Adding key sequences to the keyboard buffer
23. Executing functions
24. Message Scoring
25. Spam detection
26. Setting and Querying Variables
26.1. Commands
26.2. User-defined variables
27. Reading initialization commands from another file
28. Removing hooks
29. Format Strings
29.1. Basic usage
29.2. Filters
4. Advanced Usage
1. Regular Expressions
2. Patterns: Searching, Limiting and Tagging
2.1. Pattern Modifier
2.2. Simple Patterns
2.3. Complex Patterns
2.4. Searching by Date
3. Using Tags
4. Using Hooks
4.1. Message Matching in Hooks
5. External Address Queries
6. Mailbox Formats
7. Mailbox Shortcuts
8. Handling Mailing Lists
9. Editing threads
9.1. Linking threads
9.2. Breaking threads
10. Delivery Status Notification (DSN) Support
11. Start a WWW Browser on URLs (EXTERNAL)
5. Mutt's MIME Support
1. Using MIME in Mutt
1.1. Viewing MIME messages in the pager
1.2. The Attachment Menu
1.3. The Compose Menu
2. MIME Type configuration with mime.types
3. MIME Viewer configuration with mailcap
3.1. The Basics of the mailcap file
3.2. Secure use of mailcap
3.3. Advanced mailcap Usage
3.4. Example mailcap files
4. MIME Autoview
5. MIME Multipart/Alternative
6. Attachment Searching and Counting
7. MIME Lookup
6. Optional features
1. General notes
1.1. Enabling/disabling features
1.2. URL syntax
2. SSL/TLS Support
3. POP3 Support
4. IMAP Support
4.1. The Folder Browser
4.2. Authentication
5. SMTP Support
6. Managing multiple accounts
7. Local caching
7.1. Header caching
7.2. Body caching
7.3. Maintenance
7. Performance tuning
1. Reading and writing mailboxes
2. Reading messages from remote folders
3. Searching and limiting
8. Reference
1. Command line options
2. Configuration Commands
3. Configuration variables
3.1. abort_nosubject
3.2. abort_unmodified
3.3. alias_file
3.4. alias_format
3.5. allow_8bit
3.6. allow_ansi
3.7. arrow_cursor
3.8. ascii_chars
3.9. askbcc
3.10. askcc
3.11. assumed_charset
3.12. attach_charset
3.13. attach_format
3.14. attach_sep
3.15. attach_split
3.16. attribution
3.17. autoedit
3.18. auto_tag
3.19. beep
3.20. beep_new
3.21. bounce
3.22. bounce_delivered
3.23. braille_friendly
3.24. check_mbox_size
3.25. charset
3.26. check_new
3.27. collapse_unread
3.28. uncollapse_jump
3.29. compose_format
3.30. config_charset
3.31. confirmappend
3.32. confirmcreate
3.33. connect_timeout
3.34. content_type
3.35. copy
3.36. crypt_use_gpgme
3.37. crypt_use_pka
3.38. crypt_autopgp
3.39. crypt_autosmime
3.40. date_format
3.41. default_hook
3.42. delete
3.43. delete_untag
3.44. digest_collapse
3.45. display_filter
3.46. dotlock_program
3.47. dsn_notify
3.48. dsn_return
3.49. duplicate_threads
3.50. edit_headers
3.51. editor
3.52. encode_from
3.53. envelope_from_address
3.54. escape
3.55. fast_reply
3.56. fcc_attach
3.57. fcc_clear
3.58. folder
3.59. folder_format
3.60. followup_to
3.61. force_name
3.62. forward_decode
3.63. forward_edit
3.64. forward_format
3.65. forward_quote
3.66. from
3.67. gecos_mask
3.68. hdrs
3.69. header
3.70. help
3.71. hidden_host
3.72. hide_limited
3.73. hide_missing
3.74. hide_thread_subject
3.75. hide_top_limited
3.76. hide_top_missing
3.77. history
3.78. history_file
3.79. honor_followup_to
3.80. hostname
3.81. ignore_linear_white_space
3.82. ignore_list_reply_to
3.83. imap_authenticators
3.84. imap_check_subscribed
3.85. imap_delim_chars
3.86. imap_headers
3.87. imap_idle
3.88. imap_keepalive
3.89. imap_list_subscribed
3.90. imap_login
3.91. imap_pass
3.92. imap_passive
3.93. imap_peek
3.94. imap_servernoise
3.95. imap_user
3.96. implicit_autoview
3.97. include
3.98. include_onlyfirst
3.99. indent_string
3.100. index_format
3.101. ispell
3.102. keep_flagged
3.103. locale
3.104. mail_check
3.105. mailcap_path
3.106. mailcap_sanitize
3.107. header_cache
3.108. maildir_header_cache_verify
3.109. header_cache_pagesize
3.110. header_cache_compress
3.111. maildir_trash
3.112. mark_old
3.113. markers
3.114. mask
3.115. mbox
3.116. mbox_type
3.117. metoo
3.118. menu_context
3.119. menu_move_off
3.120. menu_scroll
3.121. meta_key
3.122. mh_purge
3.123. mh_seq_flagged
3.124. mh_seq_replied
3.125. mh_seq_unseen
3.126. mime_forward
3.127. mime_forward_decode
3.128. mime_forward_rest
3.129. mix_entry_format
3.130. mixmaster
3.131. move
3.132. message_cachedir
3.133. message_cache_clean
3.134. message_format
3.135. narrow_tree
3.136. net_inc
3.137. pager
3.138. pager_context
3.139. pager_format
3.140. pager_index_lines
3.141. pager_stop
3.142. crypt_autosign
3.143. crypt_autoencrypt
3.144. pgp_ignore_subkeys
3.145. crypt_replyencrypt
3.146. crypt_replysign
3.147. crypt_replysignencrypted
3.148. crypt_timestamp
3.149. pgp_use_gpg_agent
3.150. crypt_verify_sig
3.151. smime_is_default
3.152. smime_ask_cert_label
3.153. smime_decrypt_use_default_key
3.154. pgp_entry_format
3.155. pgp_good_sign
3.156. pgp_check_exit
3.157. pgp_long_ids
3.158. pgp_retainable_sigs
3.159. pgp_autoinline
3.160. pgp_replyinline
3.161. pgp_show_unusable
3.162. pgp_sign_as
3.163. pgp_strict_enc
3.164. pgp_timeout
3.165. pgp_sort_keys
3.166. pgp_mime_auto
3.167. pgp_auto_decode
3.168. pgp_decode_command
3.169. pgp_getkeys_command
3.170. pgp_verify_command
3.171. pgp_decrypt_command
3.172. pgp_clearsign_command
3.173. pgp_sign_command
3.174. pgp_encrypt_sign_command
3.175. pgp_encrypt_only_command
3.176. pgp_import_command
3.177. pgp_export_command
3.178. pgp_verify_key_command
3.179. pgp_list_secring_command
3.180. pgp_list_pubring_command
3.181. forward_decrypt
3.182. smime_timeout
3.183. smime_encrypt_with
3.184. smime_keys
3.185. smime_ca_location
3.186. smime_certificates
3.187. smime_decrypt_command
3.188. smime_verify_command
3.189. smime_verify_opaque_command
3.190. smime_sign_command
3.191. smime_sign_opaque_command
3.192. smime_encrypt_command
3.193. smime_pk7out_command
3.194. smime_get_cert_command
3.195. smime_get_signer_cert_command
3.196. smime_import_cert_command
3.197. smime_get_cert_email_command
3.198. smime_default_key
3.199. ssl_client_cert
3.200. ssl_force_tls
3.201. ssl_starttls
3.202. certificate_file
3.203. ssl_usesystemcerts
3.204. entropy_file
3.205. ssl_use_sslv2
3.206. ssl_use_sslv3
3.207. ssl_use_tlsv1
3.208. ssl_min_dh_prime_bits
3.209. ssl_ca_certificates_file
3.210. pipe_split
3.211. pipe_decode
3.212. pipe_sep
3.213. pop_authenticators
3.214. pop_auth_try_all
3.215. pop_checkinterval
3.216. pop_delete
3.217. pop_host
3.218. pop_last
3.219. pop_reconnect
3.220. pop_user
3.221. pop_pass
3.222. post_indent_string
3.223. postpone
3.224. postponed
3.225. preconnect
3.226. print
3.227. print_command
3.228. print_decode
3.229. print_split
3.230. prompt_after
3.231. query_command
3.232. query_format
3.233. quit
3.234. quote_regexp
3.235. read_inc
3.236. read_only
3.237. realname
3.238. recall
3.239. record
3.240. reply_regexp
3.241. reply_self
3.242. reply_to
3.243. resolve
3.244. reverse_alias
3.245. reverse_name
3.246. reverse_realname
3.247. rfc2047_parameters
3.248. save_address
3.249. save_empty
3.250. save_history
3.251. save_name
3.252. score
3.253. score_threshold_delete
3.254. score_threshold_flag
3.255. score_threshold_read
3.256. send_charset
3.257. sendmail
3.258. sendmail_wait
3.259. shell
3.260. sig_dashes
3.261. sig_on_top
3.262. signature
3.263. simple_search
3.264. smart_wrap
3.265. smileys
3.266. sleep_time
3.267. smtp_authenticators
3.268. smtp_pass
3.269. smtp_url
3.270. sort
3.271. sort_alias
3.272. sort_aux
3.273. sort_browser
3.274. sort_re
3.275. spam_separator
3.276. spoolfile
3.277. status_chars
3.278. status_format
3.279. status_on_top
3.280. strict_threads
3.281. suspend
3.282. text_flowed
3.283. thread_received
3.284. thorough_search
3.285. tilde
3.286. time_inc
3.287. timeout
3.288. tmpdir
3.289. to_chars
3.290. tunnel
3.291. use_8bitmime
3.292. use_domain
3.293. use_envelope_from
3.294. use_from
3.295. use_idn
3.296. use_ipv6
3.297. user_agent
3.298. visual
3.299. wait_key
3.300. weed
3.301. wrap
3.302. wrap_search
3.303. wrapmargin
3.304. write_inc
3.305. write_bcc
4. Functions
4.1. generic
4.2. index
4.3. pager
4.4. alias
4.5. query
4.6. attach
4.7. compose
4.8. postpone
4.9. browser
4.10. pgp
4.11. smime
4.12. mix
4.13. editor
9. Miscellany
1. Acknowledgements
2. About this document

List of Tables

2.1. Most common navigation keys
2.2. Most common line editor keys
2.3. Most common message index keys
2.4. Most common pager keys
2.5. ANSI escape sequences
2.6. Color sequences
2.7. Most common thread mode keys
2.8. Most common mail sending keys
2.9. Most common compose menu keys
2.10. PGP key menu flags
2.11. Message forwarding/bouncing keys
3.1. Symbolic key names
4.1. Pattern modifiers
4.2. Simple search keywords
4.3. Date units
8.1. Command line options
8.2. Default generic function bindings
8.3. Default index function bindings
8.4. Default pager function bindings
8.5. Default alias function bindings
8.6. Default query function bindings
8.7. Default attach function bindings
8.8. Default compose function bindings
8.9. Default postpone function bindings
8.10. Default browser function bindings
8.11. Default pgp function bindings
8.12. Default smime function bindings
8.13. Default mix function bindings
8.14. Default editor function bindings

Chapter 1. Introduction

Mutt is a small but very powerful text-based MIME mail client. Mutt is highly configurable, and is well suited to the mail power user with advanced features like key bindings, keyboard macros, mail threading, regular expression searches and a powerful pattern matching language for selecting groups of messages.

1. Mutt Home Page

http://www.mutt.org/

2. Mailing Lists

To subscribe to one of the following mailing lists, send a message with the word subscribe in the body to list-name-request@mutt.org.

Note: all messages posted to mutt-announce are automatically forwarded to mutt-users, so you do not need to be subscribed to both lists.

3. Software Distribution Sites

For a list of mirror sites, please refer to http://www.mutt.org/download.html.

4. IRC

Visit channel #mutt on irc.freenode.net to chat with other people interested in Mutt.

5. USENET

See the newsgroup comp.mail.mutt.

6. Copyright

Mutt is Copyright (C) 1996-2005 Michael R. Elkins and others

This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either version 2 of the License, or (at your option) any later version.

This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.

Chapter 2. Getting Started

This section is intended as a brief overview of how to use Mutt. There are many other features which are described elsewhere in the manual. There is even more information available in the Mutt FAQ and various web pages. See the Mutt Page for more details.

The keybindings described in this section are the defaults as distributed. Your local system administrator may have altered the defaults for your site. You can always type ``?'' in any menu to display the current bindings.

The first thing you need to do is invoke mutt, simply by typing mutt at the command line. There are various command-line options, see either the mutt man page or the reference.

1. Moving Around in Menus

Information is presented in menus, very similar to ELM, see Table 2.1, “Most common navigation keys” for common keys used to navigate menus in Mutt.

Table 2.1. Most common navigation keys

KeyFunctionDescription
j or Downnext-entrymove to the next entry
k or Upprevious-entrymove to the previous entry
z or PageDnpage-downgo to the next page
Z or PageUppage-upgo to the previous page
= or Homefirst-entryjump to the first entry
* or Endlast-entryjump to the last entry
qquitexit the current menu
?helplist all keybindings for the current menu


2. Editing Input Fields

2.1. Introduction

Mutt has a built-in line editor for inputting text, e.g. email addresses or filenames. The keys used to manipulate text input are very similar to those of Emacs. See Table 2.2, “Most common line editor keys” for a full reference of available functions, their default key bindings, and short descriptions.

Table 2.2. Most common line editor keys

KeyFunctionDescription
^A or <Home>bolmove to the start of the line
^B or <Left>backward-charmove back one char
Esc Bbackward-wordmove back one word
^D or <Delete>delete-chardelete the char under the cursor
^E or <End>eolmove to the end of the line
^F or <Right>forward-charmove forward one char
Esc Fforward-wordmove forward one word
<Tab>completecomplete filename or alias
^Tcomplete-querycomplete address with query
^Kkill-eoldelete to the end of the line
ESC dkill-eowdelete to the end ot the word
^Wkill-wordkill the word in front of the cursor
^Ukill-linedelete entire line
^Vquote-charquote the next typed key
<Up>history-uprecall previous string from history
<Down>history-downrecall next string from history
<BackSpace>backspacekill the char in front of the cursor
Esc uupcase-wordconvert word to upper case
Esc ldowncase-wordconvert word to lower case
Esc ccapitalize-wordcapitalize the word
^Gn/aabort
<Return>n/afinish editing


You can remap the editor functions using the bind command. For example, to make the Delete key delete the character in front of the cursor rather than under, you could use

bind editor <delete> backspace

2.2. History

The number of items in the built-in editor's history is controlled by the $history variable. You may cycle through them at an editor prompt by using the history-up and/or history-down commands.

Mutt maintains several distinct history lists, one for each of the following categories:

  • muttrc commands

  • addresses and aliases

  • shell commands

  • filenames

  • patterns

  • everything else

Mutt automatically filters out repeated items from the history. It also mimics the behavior of some shells by ignoring items starting with a space.

The latter feature can be useful in macros to not clobber the history's valuable entries with unwanted entries.

3. Reading Mail - The Index and Pager

Similar to many other mail clients, there are two modes in which mail is read in Mutt. The first is the index of messages in the mailbox, which is called the ``index'' in Mutt. The second mode is the display of the message contents. This is called the ``pager.''

The next few sections describe the functions provided in each of these modes.

3.1. The Message Index

Common keys used to navigate through and manage messages in the index are shown in Table 2.3, “Most common message index keys”.

Table 2.3. Most common message index keys

KeyDescription
cchange to a different mailbox
ESC cchange to a folder in read-only mode
Ccopy the current message to another mailbox
ESC Cdecode a message and copy it to a folder
ESC sdecode a message and save it to a folder
Ddelete messages matching a pattern
ddelete the current message
Fmark as important
lshow messages matching a pattern
Nmark message as new
ochange the current sort method
Oreverse sort the mailbox
qsave changes and exit
ssave-message
Ttag messages matching a pattern
ttoggle the tag on a message
ESC ttoggle tag on entire message thread
Uundelete messages matching a pattern
uundelete-message
vview-attachments
xabort changes and exit
<Return>display-message
<Tab>jump to the next new or unread message
@show the author's full e-mail address
$save changes to mailbox
/search
ESC /search-reverse
^Lclear and redraw the screen
^Tuntag messages matching a pattern


3.1.1. 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 ``flags'' may appear, which mean:

D

message is deleted (is marked for deletion)

d

message have attachments marked for deletion

K

contains a PGP public key

N

message is new

O

message is old

P

message is PGP encrypted

r

message has been replied to

S

message is signed, and the signature is successfully verified

s

message is signed

!

message is flagged

*

message is tagged

Some of the status flags can be turned on or off using

  • set-flag (default: w)

  • clear-flag (default: W)

Furthermore, the following flags reflect who the message is addressed to. They can be customized with the $to_chars variable.

+

message is to you and you only

T

message is to you, but also to or cc'ed to others

C

message is cc'ed to you

F

message is from you

L

message is sent to a subscribed mailing list

3.2. The Pager

By default, Mutt uses its builtin pager to display the body of messages. The pager is very similar to the Unix program less though not nearly as featureful.

Table 2.4. Most common pager keys

KeyDescription
<Return>go down one line
<Space>display the next page (or next message if at the end of a message)
-go back to the previous page
nsearch for next match
Sskip beyond quoted text
Ttoggle display of quoted text
?show keybindings
/search for a regular expression (pattern)
ESC /search backwards for a regular expression
\toggle search pattern coloring
^jump to the top of the message


In addition to key bindings in Table 2.4, “Most common pager keys”, many of the functions from the index are available in the pager, such as delete-message or copy-message (this is one advantage over using an external pager to view messages).

Also, the internal pager supports a couple other advanced features. For one, it will accept and translate the ``standard'' nroff sequences for bold and underline. These sequences are a series of either the letter, backspace (^H), the letter again for bold or the letter, backspace, ``_'' for denoting underline. Mutt will attempt to display these in bold and underline respectively if your terminal supports them. If not, you can use the bold and underline color objects to specify a color or mono attribute for them.

Additionally, the internal pager supports the ANSI escape sequences for character attributes. Mutt translates them into the correct color and character settings. The sequences Mutt supports are '\e[Ps;Ps;..Ps;m' where Ps can be one of the codes shown in Table 2.5, “ANSI escape sequences”.

Table 2.5. ANSI escape sequences

Escape codeDescription
0All Attributes Off
1Bold on
4Underline on
5Blink on
7Reverse video on
3<color>Foreground color is <color> (see Table 2.6, “Color sequences”)
4<color>Background color is <color> (see Table 2.6, “Color sequences”)

Table 2.6. Color sequences

Color codeColor
0Black
1Red
2Green
3Yellow
4Blue
5Magenta
6Cyan
7White

Mutt uses these attributes for handling text/enriched messages, and they can also be used by an external autoview script for highlighting purposes. Note: If you change the colors for your display, for example by changing the color associated with color2 for your xterm, then that color will be used instead of green.

3.3. Threaded Mode

When the mailbox is sorted by threads, there are a few additional functions available in the index and pager modes as shown in Table 2.7, “Most common thread mode keys”.

Table 2.7. Most common thread mode keys

KeyFunctionDescription
^Ddelete-threaddelete all messages in the current thread
^Uundelete-threadundelete all messages in the current thread
^Nnext-threadjump to the start of the next thread
^Pprevious-threadjump to the start of the previous thread
^Rread-threadmark the current thread as read
ESC ddelete-subthreaddelete all messages in the current subthread
ESC uundelete-subthreadundelete all messages in the current subthread
ESC nnext-subthreadjump to the start of the next subthread
ESC pprevious-subthreadjump to the start of the previous subthread
ESC rread-subthreadmark the current subthread as read
ESC ttag-threadtoggle the tag on the current thread
ESC vcollapse-threadtoggle collapse for the current thread
ESC Vcollapse-alltoggle collapse for all threads
Pparent-messagejump to parent message in thread


Note: Collapsing a thread displays only the first message in the thread and hides the others. This is useful when threads contain so many messages that you can only see a handful of threads on the screen. See %M in $index_format. For example, you could use "%?M?(#%03M)&(%4l)?" in $index_format to optionally display the number of hidden messages if the thread is collapsed.

See also: $strict_threads.

3.4. Miscellaneous Functions

create-alias (default: a)

Creates a new alias based upon the current message (or prompts for a new one). Once editing is complete, an alias command is added to the file specified by the $alias_file variable for future use. Note: Specifying an $alias_file does not add the aliases specified there-in, you must also source the file.

check-traditional-pgp (default: ESC P)

This function will search the current message for content signed or encrypted with PGP the "traditional" way, that is, without proper MIME tagging. Technically, this function will temporarily change the MIME content types of the body parts containing PGP data; this is similar to the edit-type function's effect.

display-toggle-weed (default: h)

Toggles the weeding of message header fields specified by ignore commands.

edit (default: e)

This command (available in the ``index'' and ``pager'') allows you to edit the raw current message as it's present in the mail folder. After you have finished editing, the changed message will be appended to the current folder, and the original message will be marked for deletion.

edit-type (default: ^E on the attachment menu, and in the pager and index menus; ^T on the compose menu)

This command is used to temporarily edit an attachment's content type to fix, for instance, bogus character set parameters. When invoked from the index or from the pager, you'll have the opportunity to edit the top-level attachment's content type. On the attachment menu, you can change any attachment's content type. These changes are not persistent, and get lost upon changing folders.

Note that this command is also available on the compose menu. There, it's used to fine-tune the properties of attachments you are going to send.

enter-command (default: ``:'')

This command is used to execute any command you would normally put in a configuration file. A common use is to check the settings of variables, or in conjunction with macros to change settings on the fly.

extract-keys (default: ^K)

This command extracts PGP public keys from the current or tagged message(s) and adds them to your PGP public key ring.

forget-passphrase (default: ^F)

This command wipes the passphrase(s) from memory. It is useful, if you misspelled the passphrase.

list-reply (default: L)

Reply to the current or tagged message(s) by extracting any addresses which match the regular expressions given by the lists or subscribe commands, but also honor any Mail-Followup-To header(s) if the $honor_followup_to configuration variable is set. Using this when replying to messages posted to mailing lists helps avoid duplicate copies being sent to the author of the message you are replying to.

pipe-message (default: |)

Asks for an external Unix command and pipes the current or tagged message(s) to it. The variables $pipe_decode, $pipe_split, $pipe_sep and $wait_key control the exact behavior of this function.

resend-message (default: ESC e)

With resend-message, mutt takes the current message as a template for a new message. This function is best described as "recall from arbitrary folders". It can conveniently be used to forward MIME messages while preserving the original mail structure. Note that the amount of headers included here depends on the value of the $weed variable.

This function is also available from the attachment menu. You can use this to easily resend a message which was included with a bounce message as a message/rfc822 body part.

shell-escape (default: !)

Asks for an external Unix command and executes it. The $wait_key can be used to control whether Mutt will wait for a key to be pressed when the command returns (presumably to let the user read the output of the command), based on the return status of the named command.

toggle-quoted (default: T)

The pager uses the $quote_regexp variable to detect quoted text when displaying the body of the message. This function toggles the display of the quoted material in the message. It is particularly useful when are interested in just the response and there is a large amount of quoted text in the way.

skip-quoted (default: S)

This function will go to the next line of non-quoted text which come after a line of quoted text in the internal pager.

4. Sending Mail

The bindings shown in Table 2.8, “Most common mail sending keys” are available in the index for sending messages.

Table 2.8. Most common mail sending keys

KeyFunctionDescription
mcomposecompose a new message
rreplyreply to sender
ggroup-replyreply to all recipients
Llist-replyreply to mailing list address
fforwardforward message
bbouncebounce (remail) message
ESC kmail-keymail a PGP public key to someone


Bouncing a message sends the message as is to the recipient you specify. Forwarding a message allows you to add comments or modify the message you are forwarding. These items are discussed in greater detail in the next chapter ``Forwarding and Bouncing Mail.''

Mutt will then enter the compose menu and prompt you for the recipients to place on the ``To:'' header field. Next, it will ask you for the ``Subject:'' field for the message, providing a default if you are replying to or forwarding a message. See also $askcc, $askbcc, $autoedit, $bounce, $fast_reply, and $include for changing how Mutt asks these questions.

Mutt will then automatically start your $editor on the message body. If the $edit_headers variable is set, the headers will be at the top of the message in your editor. Any messages you are replying to will be added in sort order to the message, with appropriate $attribution, $indent_string and $post_indent_string. When forwarding a message, if the $mime_forward variable is unset, a copy of the forwarded message will be included. If you have specified a $signature, it will be appended to the message.

Once you have finished editing the body of your mail message, you are returned to the compose menu providing the functions show in Table 2.9, “Most common compose menu keys”.

Table 2.9. Most common compose menu keys

KeyFunctionDescription
aattach-fileattach a file
Aattach-messageattach message(s) to the message
ESC kattach-keyattach a PGP public key
dedit-descriptionedit description on attachment
Ddetach-filedetach a file
tedit-toedit the To field
ESC fedit-fromedit the From field
redit-reply-toedit the Reply-To field
cedit-ccedit the Cc field
bedit-bccedit the Bcc field
ysend-messagesend the message
sedit-subjectedit the Subject
Ssmime-menuselect S/MIME options
fedit-fccspecify an ``Fcc'' mailbox
ppgp-menuselect PGP options
Ppostpone-messagepostpone this message until later
qquitquit (abort) sending the message
wwrite-fccwrite the message to a folder
iispellcheck spelling (if available on your system)
^Fforget-passphrasewipe passphrase(s) from memory


Note: The attach-message function will prompt you for a folder to attach messages from. You can now tag messages in that folder and they will be attached to the message you are sending. Note that certain operations like composing a new mail, replying, forwarding, etc. are not permitted when you are in that folder. The %r in $status_format will change to a 'A' to indicate that you are in attach-message mode.

4.1. Editing the message header

When editing the header of your outgoing message, there are a couple of special features available.

If you specify Fcc: filename Mutt will pick up filename just as if you had used the edit-fcc function in the compose menu.

You can also attach files to your message by specifying Attach: filename [ description ] where filename is the file to attach and description is an optional string to use as the description of the attached file.

When replying to messages, if you remove the In-Reply-To: field from the header field, Mutt will not generate a References: field, which allows you to create a new message thread.

Also see $edit_headers.

4.2. Using Mutt with PGP

If you want to use PGP, you can specify

Pgp: [ E | S | S<id> ]

``E'' encrypts, ``S'' signs and ``S<id>'' signs with the given key, setting $pgp_sign_as permanently.

If you have told mutt to PGP encrypt a message, it will guide you through a key selection process when you try to send the message. Mutt will not ask you any questions about keys which have a certified user ID matching one of the message recipients' mail addresses. However, there may be situations in which there are several keys, weakly certified user ID fields, or where no matching keys can be found.

In these cases, you are dropped into a menu with a list of keys from which you can select one. When you quit this menu, or mutt can't find any matching keys, you are prompted for a user ID. You can, as usually, abort this prompt using ^G. When you do so, mutt will return to the compose screen.

Once you have successfully finished the key selection, the message will be encrypted using the selected public keys, and sent out.

Most fields of the entries in the key selection menu (see also $pgp_entry_format) have obvious meanings. But some explanations on the capabilities, flags, and validity fields are in order.

The flags sequence (%f) will expand to one of the flags in Table 2.10, “PGP key menu flags”.

Table 2.10. PGP key menu flags

FlagDescription
RThe key has been revoked and can't be used.
XThe key is expired and can't be used.
dYou have marked the key as disabled.
cThere are unknown critical self-signature packets.


The capabilities field (%c) expands to a two-character sequence representing a key's capabilities. The first character gives the key's encryption capabilities: A minus sign (-) means that the key cannot be used for encryption. A dot (.) means that it's marked as a signature key in one of the user IDs, but may also be used for encryption. The letter e indicates that this key can be used for encryption.

The second character indicates the key's signing capabilities. Once again, a ``-'' implies ``not for signing'', ``.'' implies that the key is marked as an encryption key in one of the user-ids, and ``s'' denotes a key which can be used for signing.

Finally, the validity field (%t) indicates how well-certified a user-id is. A question mark (?) indicates undefined validity, a minus character (-) marks an untrusted association, a space character means a partially trusted association, and a plus character (+) indicates complete validity.

4.3. Sending anonymous messages via mixmaster.

You may also have configured mutt to co-operate with Mixmaster, an anonymous remailer. Mixmaster permits you to send your messages anonymously using a chain of remailers. Mixmaster support in mutt is for mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03. It does not support earlier versions or the later so-called version 3 betas, of which the latest appears to be called 2.9b23.

To use it, you'll have to obey certain restrictions. Most important, you cannot use the Cc and Bcc headers. To tell Mutt to use mixmaster, you have to select a remailer chain, using the mix function on the compose menu.

The chain selection screen is divided into two parts. In the (larger) upper part, you get a list of remailers you may use. In the lower part, you see the currently selected chain of remailers.

You can navigate in the chain using the chain-prev and chain-next functions, which are by default bound to the left and right arrows and to the h and l keys (think vi keyboard bindings). To insert a remailer at the current chain position, use the insert function. To append a remailer behind the current chain position, use select-entry or append. You can also delete entries from the chain, using the corresponding function. Finally, to abandon your changes, leave the menu, or accept them pressing (by default) the Return key.

Note that different remailers do have different capabilities, indicated in the %c entry of the remailer menu lines (see $mix_entry_format). Most important is the ``middleman'' capability, indicated by a capital ``M'': This means that the remailer in question cannot be used as the final element of a chain, but will only forward messages to other mixmaster remailers. For details on the other capabilities, please have a look at the mixmaster documentation.

4.4. Sending format=flowed messages

4.4.1. Concept

format=flowed-style messages (or f=f for short) are text/plain messages that consist of paragraphs which a receiver's mail client may reformat to its own needs which mostly means to customize line lengths regardless of what the sender sent. Technically this is achieved by letting lines of a ``flowable'' paragraph end in spaces.

While for text-mode clients like mutt it's the best way to assume only a standard 80x25 character cell terminal, it may be desired to let the receiver decide completely how to view a message.

4.4.2. Mutt support

Mutt only supports setting the required format=flowed MIME parameter on outgoing messages if the $text_flowed variable is set. It does not add the trailing spaces nor does it provide any other feature related to composing f=f messages (like reformatting non-f=f parts of a reply to f=f before calling the editor).

After editing the initial message text and before entering the compose menu, mutt properly space-stuffes the message. Space-stuffing is required by RfC3676 defining format=flowed and means to prepend a space to:

  • all lines starting with a space

  • lines starting with the word ``From'' followed by space

  • all lines starting with ``>'' which is not intended to be a quote character

All leading spaces are to be removed by receiving clients to restore the original message.

Note that mutt only support space-stuffing for the first two types of lines but not for the third: It is impossible to safely detect whether a leading > character starts a quote or not.

4.4.3. Editor considerations

As mutt provides no additional features to compose f=f messages, it's completely up to the user and his editor to produce proper messages. Please consider your editor's documentation if you intend to send f=f messages.

Please note that when editing messages from the compose menu several times before really sending a mail, it's up to the user to ensure that the message is properly space-stuffed.

For example, vim provides the w flag for its formatoptions setting to assist in creating f=f messages, see :help fo-table for details.

5. Forwarding and Bouncing Mail

Bouncing and forwarding let you send an existing message to recipients that you specify. Bouncing a message uses the $sendmail command to send a copy to alternative addresses as if they were the message's original recipients. Forwarding a message, on the other hand, allows you to modify the message before it is resent (for example, by adding your own comments). The default key bindings are shown in Table 2.11, “Message forwarding/bouncing keys”.

Table 2.11. Message forwarding/bouncing keys

KeyFunctionDescription
fforwardforward message
bbouncebounce (remail) message


Forwarding can be done by including the original message in the new message's body (surrounded by indicating lines) or including it as a MIME attachment, depending on the value of the $mime_forward variable. Decoding of attachments, like in the pager, can be controlled by the $forward_decode and $mime_forward_decode variables, respectively. The desired forwarding format may depend on the content, therefore $mime_forward is a quadoption which, for example, can be set to ``ask-no''.

The inclusion of headers is controlled by the current setting of the $weed variable, unless $mime_forward is set.

Editing the message to forward follows the same procedure as sending or replying to a message does.

6. Postponing Mail

At times it is desirable to delay sending a message that you have already begun to compose. When the postpone-message function is used in the compose menu, the body of your message and attachments are stored in the mailbox specified by the $postponed variable. This means that you can recall the message even if you exit Mutt and then restart it at a later time.

Once a message is postponed, there are several ways to resume it. From the command line you can use the ``-p'' option, or if you compose a new message from the index or pager you will be prompted if postponed messages exist. If multiple messages are currently postponed, the postponed menu will pop up and you can select which message you would like to resume.

Note: If you postpone a reply to a message, the reply setting of the message is only updated when you actually finish the message and send it. Also, you must be in the same folder with the message you replied to for the status of the message to be updated.

See also the $postpone quad-option.

Chapter 3. Configuration

While the default configuration (or ``preferences'') make Mutt usable right out of the box, it is often desirable to tailor Mutt to suit your own tastes. When Mutt is first invoked, it will attempt to read the ``system'' configuration file (defaults set by your local system administrator), unless the ``-n'' command line option is specified. This file is typically /usr/local/share/mutt/Muttrc or /etc/Muttrc. Mutt will next look for a file named .muttrc in your home directory. If this file does not exist and your home directory has a subdirectory named .mutt, mutt try to load a file named .mutt/muttrc.

.muttrc is the file where you will usually place your commands to configure Mutt.

In addition, mutt supports version specific configuration files that are parsed instead of the default files as explained above. For instance, if your system has a Muttrc-0.88 file in the system configuration directory, and you are running version 0.88 of mutt, this file will be sourced instead of the Muttrc file. The same is true of the user configuration file, if you have a file .muttrc-0.88.6 in your home directory, when you run mutt version 0.88.6, it will source this file instead of the default .muttrc file. The version number is the same which is visible using the ``-v'' command line switch or using the show-version key (default: V) from the index menu.

1. Syntax of Initialization Files

An initialization file consists of a series of commands. Each line of the file may contain one or more commands. When multiple commands are used, they must be separated by a semicolon (;).

set realname='Mutt user' ; ignore x-

The hash mark, or pound sign (``#''), is used as a ``comment'' character. You can use it to annotate your initialization file. All text after the comment character to the end of the line is ignored. For example,

my_hdr X-Disclaimer: Why are you listening to me? # This is a comment

Single quotes (') and double quotes (") can be used to quote strings which contain spaces or other special characters. The difference between the two types of quotes is similar to that of many popular shell programs, namely that a single quote is used to specify a literal string (one that is not interpreted for shell variables or quoting with a backslash [see next paragraph]), while double quotes indicate a string for which should be evaluated. For example, backtics are evaluated inside of double quotes, but not for single quotes.

\ quotes the next character, just as in shells such as bash and zsh. For example, if want to put quotes ``"'' inside of a string, you can use ``\'' to force the next character to be a literal instead of interpreted character.

set realname="Michael \"MuttDude\" Elkins"

``\\'' means to insert a literal ``\'' into the line. ``\n'' and ``\r'' have their usual C meanings of linefeed and carriage-return, respectively.

A \ at the end of a line can be used to split commands over multiple lines, provided that the split points don't appear in the middle of command names.

It is also possible to substitute the output of a Unix command in an initialization file. This is accomplished by enclosing the command in backquotes (``). For example,

my_hdr X-Operating-System: `uname -a`

The output of the Unix command ``uname -a'' will be substituted before the line is parsed. Note that since initialization files are line oriented, only the first line of output from the Unix command will be substituted.

Both environment variables and mutt variables can be accessed by prepending ``$'' to the name of the variable. For example,

set record=+sent_on_$HOSTNAME

will cause mutt to save outgoing messages to a folder named ``sent_on_kremvax'' if the environment variable HOSTNAME is set to ``kremvax.'' (See $record for details.)

Mutt expands the variable when it is assigned, not when it is used. If the value of a variable on the right-hand side of an assignment changes after the assignment, the variable on the left-hand side will not be affected.

The commands understood by mutt are explained in the next paragraphs. For a complete list, see the command reference.

2. Address groups

Usage: group [ -group name [ ... ] ] [ -rx EXPR [ ... ] ] [ -addr EXPR [ ... ] ]

group is used to directly add either addresses or regular expressions to the specified group or groups. The different categories of arguments to the group command can be in any order. The flags -rx and -addr specify what the following strings (that cannot begin with a hyphen) should be interpreted as: either a regular expression or an email address, respectively.

These address groups can also be created implicitely by the alias, lists, subscribe and alternates commands by specifying the optional -group option.

Once defined, these address groups can be used in patterns to search for and limit the display to messages matching a group.

Usage: ungroup [ -group name [ ... ] ] [ * | [ [ -rx EXPR [ ... ] ] [ -addr EXPR [ ... ] ] ]

ungroup is used to remove addresses or regular expressions from the specified group or groups. The syntax is similar to the group command, however the special character * can be used to empty a group of all of its contents.

3. Defining/Using aliases

Usage: alias [ -group name [ ... ] ] key address [ , address, ... ]

It's usually very cumbersome to remember or type out the address of someone you are communicating with. Mutt allows you to create ``aliases'' which map a short string to a full address.

Note: if you want to create an alias for more than one address, you must separate the addresses with a comma (``,'').

The optional -group argument to alias causes the aliased address(es) to be added to the named group.

To remove an alias or aliases (``*'' means all aliases):

unalias [ * | key ... ]

alias muttdude me@cs.hmc.edu (Michael Elkins)
alias theguys manny, moe, jack

Unlike other mailers, Mutt doesn't require aliases to be defined in a special file. The alias command can appear anywhere in a configuration file, as long as this file is sourced. Consequently, you can have multiple alias files, or you can have all aliases defined in your muttrc.

On the other hand, the create-alias function can use only one file, the one pointed to by the $alias_file variable (which is ˜/.muttrc by default). This file is not special either, in the sense that Mutt will happily append aliases to any file, but in order for the new aliases to take effect you need to explicitly source this file too.

For example:

source /usr/local/share/Mutt.aliases
source ~/.mail_aliases
set alias_file=~/.mail_aliases

To use aliases, you merely use the alias at any place in mutt where mutt prompts for addresses, such as the To: or Cc: prompt. You can also enter aliases in your editor at the appropriate headers if you have the $edit_headers variable set.

In addition, at the various address prompts, you can use the tab character to expand a partial alias to the full alias. If there are multiple matches, mutt will bring up a menu with the matching aliases. In order to be presented with the full list of aliases, you must hit tab with out a partial alias, such as at the beginning of the prompt or after a comma denoting multiple addresses.

In the alias menu, you can select as many aliases as you want with the select-entry key (default: RET), and use the exit key (default: q) to return to the address prompt.

4. Changing the default key bindings

Usage: bind map key function

This command allows you to change the default key bindings (operation invoked when pressing a key).

map specifies in which menu the binding belongs. Multiple maps may be specified by separating them with commas (no additional whitespace is allowed). The currently defined maps are:

generic

This is not a real menu, but is used as a fallback for all of the other menus except for the pager and editor modes. If a key is not defined in another menu, Mutt will look for a binding to use in this menu. This allows you to bind a key to a certain function in multiple menus instead of having multiple bind statements to accomplish the same task.

alias

The alias menu is the list of your personal aliases as defined in your muttrc. It is the mapping from a short alias name to the full email address(es) of the recipient(s).

attach

The attachment menu is used to access the attachments on received messages.

browser

The browser is used for both browsing the local directory structure, and for listing all of your incoming mailboxes.

editor

The editor is the line-based editor the user enters text data.

index

The index is the list of messages contained in a mailbox.

compose

The compose menu is the screen used when sending a new message.

pager

The pager is the mode used to display message/attachment data, and help listings.

pgp

The pgp menu is used to select the OpenPGP keys used for encrypting outgoing messages.

postpone

The postpone menu is similar to the index menu, except is used when recalling a message the user was composing, but saved until later.

key is the key (or key sequence) you wish to bind. To specify a control character, use the sequence \Cx, where x is the letter of the control character (for example, to specify control-A use ``\Ca''). Note that the case of x as well as \C is ignored, so that \CA, \Ca, \cA and \ca are all equivalent. An alternative form is to specify the key as a three digit octal number prefixed with a ``\'' (for example \177 is equivalent to \c?). In addition, key may be a symbolic name as shown in Table 3.1, “Symbolic key names”.

Table 3.1. Symbolic key names

Symbolic nameMeaning
\ttab
<tab>tab
<backtab>backtab / shift-tab
\rcarriage return
\nnewline
\eescape
<esc>escape
<up>up arrow
<down>down arrow
<left>left arrow
<right>right arrow
<pageup>Page Up
<pagedown>Page Down
<backspace>Backspace
<delete>Delete
<insert>Insert
<enter>Enter
<return>Return
<home>Home
<end>End
<space>Space bar
<f1>function key 1
<f10>function key 10


key does not need to be enclosed in quotes unless it contains a space (`` '').

function specifies which action to take when key is pressed. For a complete list of functions, see the reference. The special function noop unbinds the specified key sequence.

5. Defining aliases for character sets


Usage: charset-hook alias charset
Usage: iconv-hook charset local-charset

The charset-hook command defines an alias for a character set. This is useful to properly display messages which are tagged with a character set name not known to mutt.

The iconv-hook command defines a system-specific name for a character set. This is helpful when your systems character conversion library insists on using strange, system-specific names for character sets.

6. Setting variables based upon mailbox

Usage: folder-hook [!]regexp command

It is often desirable to change settings based on which mailbox you are reading. The folder-hook command provides a method by which you can execute any configuration command. regexp is a regular expression specifying in which mailboxes to execute command before loading. If a mailbox matches multiple folder-hook's, they are executed in the order given in the muttrc.

Note: if you use the ``!'' shortcut for $spoolfile at the beginning of the pattern, you must place it inside of double or single quotes in order to distinguish it from the logical not operator for the expression.

Note that the settings are not restored when you leave the mailbox. For example, a command action to perform is to change the sorting method based upon the mailbox being read:

folder-hook mutt set sort=threads

However, the sorting method is not restored to its previous value when reading a different mailbox. To specify a default command, use the pattern ``.'':

folder-hook . set sort=date-sent

7. Keyboard macros

Usage: macro menu key sequence [ description ]

Macros are useful when you would like a single key to perform a series of actions. When you press key in menu menu, Mutt will behave as if you had typed sequence. So if you have a common sequence of commands you type, you can create a macro to execute those commands with a single key.

menu is the map which the macro will be bound. Multiple maps may be specified by separating multiple menu arguments by commas. Whitespace may not be used in between the menu arguments and the commas separating them.

key and sequence are expanded by the same rules as the key bindings. There are some additions however. The first is that control characters in sequence can also be specified as ^x. In order to get a caret (`^'') you need to use ^^. Secondly, to specify a certain key such as up or to invoke a function directly, you can use the format <key name> and <function name>. For a listing of key names see the section on key bindings. Functions are listed in the reference.

The advantage with using function names directly is that the macros will work regardless of the current key bindings, so they are not dependent on the user having particular key definitions. This makes them more robust and portable, and also facilitates defining of macros in files used by more than one user (e.g., the system Muttrc).

Optionally you can specify a descriptive text after sequence, which is shown in the help screens.

Note: Macro definitions (if any) listed in the help screen(s), are silently truncated at the screen width, and are not wrapped.

8. Using color and mono video attributes


Usage: color object foreground background [ regexp ]
Usage: color index foreground background pattern
Usage: uncolor index pattern [ pattern ...  ]

If your terminal supports color, you can spice up Mutt by creating your own color scheme. To define the color of an object (type of information), you must specify both a foreground color and a background color (it is not possible to only specify one or the other).

object can be one of:

  • attachment

  • body (match regexp in the body of messages)

  • bold (hiliting bold patterns in the body of messages)

  • error (error messages printed by Mutt)

  • header (match regexp in the message header)

  • hdrdefault (default color of the message header in the pager)

  • index (match pattern in the message index)

  • indicator (arrow or bar used to indicate the current item in a menu)

  • markers (the ``+'' markers at the beginning of wrapped lines in the pager)

  • message (informational messages)

  • normal

  • quoted (text matching $quote_regexp in the body of a message)

  • quoted1, quoted2, ..., quotedN (higher levels of quoting)

  • search (hiliting of words in the pager)

  • signature

  • status (mode lines used to display info about the mailbox or message)

  • tilde (the ``˜'' used to pad blank lines in the pager)

  • tree (thread tree drawn in the message index and attachment menu)

  • underline (hiliting underlined patterns in the body of messages)

foreground and background can be one of the following:

  • white

  • black

  • green

  • magenta

  • blue

  • cyan

  • yellow

  • red

  • default

  • colorx

foreground can optionally be prefixed with the keyword bright to make the foreground color boldfaced (e.g., brightred).

If your terminal supports it, the special keyword default can be used as a transparent color. The value brightdefault is also valid. If Mutt is linked against the S-Lang library, you also need to set the COLORFGBG environment variable to the default colors of your terminal for this to work; for example (for Bourne-like shells):

set COLORFGBG="green;black"
export COLORFGBG

Note: The S-Lang library requires you to use the lightgray and brown keywords instead of white and yellow when setting this variable.

Note: The uncolor command can be applied to the index object only. It removes entries from the list. You must specify the same pattern specified in the color command for it to be removed. The pattern ``*'' is a special token which means to clear the color index list of all entries.

Mutt also recognizes the keywords color0, color1, …, colorN-1 (N being the number of colors supported by your terminal). This is useful when you remap the colors for your display (for example by changing the color associated with color2 for your xterm), since color names may then lose their normal meaning.

If your terminal does not support color, it is still possible change the video attributes through the use of the ``mono'' command:


Usage: mono <object> <attribute> [ regexp ]
Usage: mono index attribute pattern
Usage: unmono index pattern [ pattern ...  ]

where attribute is one of the following:

  • none

  • bold

  • underline

  • reverse

  • standout

9. Ignoring (weeding) unwanted message headers

Usage: [un]ignore pattern [ pattern ... ]

Messages often have many header fields added by automatic processing systems, or which may not seem useful to display on the screen. This command allows you to specify header fields which you don't normally want to see.

You do not need to specify the full header field name. For example, ``ignore content-'' will ignore all header fields that begin with the pattern ``content-''. ``ignore *'' will ignore all headers.

To remove a previously added token from the list, use the ``unignore'' command. The ``unignore'' command will make Mutt display headers with the given pattern. For example, if you do ``ignore x-'' it is possible to ``unignore x-mailer''.

``unignore *'' will remove all tokens from the ignore list.

For example:

# Sven's draconian header weeding
ignore *
unignore from date subject to cc
unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
unignore posted-to:

10. Alternative addresses

Usage: [un]alternates [ -group name [ ... ] ] regexp [ regexp ... ]

With various functions, mutt will treat messages differently, depending on whether you sent them or whether you received them from someone else. For instance, when replying to a message that you sent to a different party, mutt will automatically suggest to send the response to the original message's recipients -- responding to yourself won't make much sense in many cases. (See $reply_to.)

Many users receive e-mail under a number of different addresses. To fully use mutt's features here, the program must be able to recognize wh