The Mutt E-Mail Client

Michael Elkins

version 1.5.23 (2014-03-12)

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. Getting Mutt
4. Mutt Online Resources
5. Contributing to Mutt
6. Typographical Conventions
7. Copyright
2. Getting Started
1. Core Concepts
2. Screens and Menus
2.1. Index
2.2. Pager
2.3. File Browser
2.4. Help
2.5. Compose Menu
2.6. Alias Menu
2.7. Attachment Menu
3. Moving Around in Menus
4. Editing Input Fields
4.1. Introduction
4.2. History
5. Reading Mail
5.1. The Message Index
5.2. The Pager
5.3. Threaded Mode
5.4. Miscellaneous Functions
6. Sending Mail
6.1. Introduction
6.2. Editing the Message Header
6.3. Sending Cryptographically Signed/Encrypted Messages
6.4. Sending Format=Flowed Messages
7. Forwarding and Bouncing Mail
8. Postponing Mail
3. Configuration
1. Location of Initialization Files
2. Syntax of Initialization Files
3. Address Groups
4. Defining/Using Aliases
5. Changing the Default Key Bindings
6. Defining Aliases for Character Sets
7. Setting Variables Based Upon Mailbox
8. Keyboard Macros
9. Using Color and Mono Video Attributes
10. Message Header Display
10.1. Header Display
10.2. Selecting Headers
10.3. Ordering Displayed Headers
11. Alternative Addresses
12. Mailing Lists
13. Using Multiple Spool Mailboxes
14. Monitoring Incoming Mail
15. User-Defined Headers
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. Variable Types
26.2. Commands
26.3. User-Defined Variables
26.4. Type Conversions
27. Reading Initialization Commands From Another File
28. Configuring features conditionally
29. Removing Hooks
30. Format Strings
30.1. Basic usage
30.2. Conditionals
30.3. Filters
30.4. Padding
4. Advanced Usage
1. Character Set Handling
2. Regular Expressions
3. Patterns: Searching, Limiting and Tagging
3.1. Pattern Modifier
3.2. Simple Searches
3.3. Nesting and Boolean Operators
3.4. Searching by Date
4. Using Tags
5. Using Hooks
5.1. Message Matching in Hooks
6. External Address Queries
7. Mailbox Formats
8. Mailbox Shortcuts
9. Handling Mailing Lists
10. New Mail Detection
10.1. How New Mail Detection Works
10.2. Polling For New Mail
11. Editing Threads
11.1. Linking Threads
11.2. Breaking Threads
12. Delivery Status Notification (DSN) Support
13. Start a WWW Browser on URLs
14. Miscellany
5. Mutt's MIME Support
1. Using MIME in Mutt
1.1. MIME Overview
1.2. Viewing MIME Messages in the Pager
1.3. The Attachment Menu
1.4. 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 IMAP 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. Cache Directories
7.4. Maintenance
8. Exact Address Generation
9. Sending Anonymous Messages via Mixmaster
7. Security Considerations
1. Passwords
2. Temporary Files
3. Information Leaks
3.1. Message-Id: headers
3.2. mailto:-style Links
4. External Applications
8. Performance Tuning
1. Reading and Writing Mailboxes
2. Reading Messages from Remote Folders
3. Searching and Limiting
9. 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. auto_tag
3.18. autoedit
3.19. beep
3.20. beep_new
3.21. bounce
3.22. bounce_delivered
3.23. braille_friendly
3.24. certificate_file
3.25. charset
3.26. check_mbox_size
3.27. check_new
3.28. collapse_unread
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_autoencrypt
3.37. crypt_autopgp
3.38. crypt_autosign
3.39. crypt_autosmime
3.40. crypt_replyencrypt
3.41. crypt_replysign
3.42. crypt_replysignencrypted
3.43. crypt_timestamp
3.44. crypt_use_gpgme
3.45. crypt_use_pka
3.46. crypt_verify_sig
3.47. date_format
3.48. default_hook
3.49. delete
3.50. delete_untag
3.51. digest_collapse
3.52. display_filter
3.53. dotlock_program
3.54. dsn_notify
3.55. dsn_return
3.56. duplicate_threads
3.57. edit_headers
3.58. editor
3.59. encode_from
3.60. envelope_from_address
3.61. escape
3.62. fast_reply
3.63. fcc_attach
3.64. fcc_clear
3.65. folder
3.66. folder_format
3.67. followup_to
3.68. force_name
3.69. forward_decode
3.70. forward_decrypt
3.71. forward_edit
3.72. forward_format
3.73. forward_quote
3.74. from
3.75. gecos_mask
3.76. hdrs
3.77. header
3.78. header_cache
3.79. header_cache_compress
3.80. help
3.81. hidden_host
3.82. hide_limited
3.83. hide_missing
3.84. hide_thread_subject
3.85. hide_top_limited
3.86. hide_top_missing
3.87. history
3.88. history_file
3.89. honor_disposition
3.90. honor_followup_to
3.91. hostname
3.92. ignore_linear_white_space
3.93. ignore_list_reply_to
3.94. imap_authenticators
3.95. imap_check_subscribed
3.96. imap_delim_chars
3.97. imap_headers
3.98. imap_idle
3.99. imap_keepalive
3.100. imap_list_subscribed
3.101. imap_login
3.102. imap_pass
3.103. imap_passive
3.104. imap_peek
3.105. imap_pipeline_depth
3.106. imap_servernoise
3.107. imap_user
3.108. implicit_autoview
3.109. include
3.110. include_onlyfirst
3.111. indent_string
3.112. index_format
3.113. ispell
3.114. keep_flagged
3.115. locale
3.116. mail_check
3.117. mail_check_recent
3.118. mailcap_path
3.119. mailcap_sanitize
3.120. maildir_header_cache_verify
3.121. maildir_trash
3.122. mark_old
3.123. markers
3.124. mask
3.125. mbox
3.126. mbox_type
3.127. menu_context
3.128. menu_move_off
3.129. menu_scroll
3.130. message_cache_clean
3.131. message_cachedir
3.132. message_format
3.133. meta_key
3.134. metoo
3.135. mh_purge
3.136. mh_seq_flagged
3.137. mh_seq_replied
3.138. mh_seq_unseen
3.139. mime_forward
3.140. mime_forward_decode
3.141. mime_forward_rest
3.142. mix_entry_format
3.143. mixmaster
3.144. move
3.145. narrow_tree
3.146. net_inc
3.147. pager
3.148. pager_context
3.149. pager_format
3.150. pager_index_lines
3.151. pager_stop
3.152. pgp_auto_decode
3.153. pgp_autoinline
3.154. pgp_check_exit
3.155. pgp_clearsign_command
3.156. pgp_decode_command
3.157. pgp_decrypt_command
3.158. pgp_encrypt_only_command
3.159. pgp_encrypt_sign_command
3.160. pgp_entry_format
3.161. pgp_export_command
3.162. pgp_getkeys_command
3.163. pgp_good_sign
3.164. pgp_ignore_subkeys
3.165. pgp_import_command
3.166. pgp_list_pubring_command
3.167. pgp_list_secring_command
3.168. pgp_long_ids
3.169. pgp_mime_auto
3.170. pgp_replyinline
3.171. pgp_retainable_sigs
3.172. pgp_show_unusable
3.173. pgp_sign_as
3.174. pgp_sign_command
3.175. pgp_sort_keys
3.176. pgp_strict_enc
3.177. pgp_timeout
3.178. pgp_use_gpg_agent
3.179. pgp_verify_command
3.180. pgp_verify_key_command
3.181. pipe_decode
3.182. pipe_sep
3.183. pipe_split
3.184. pop_auth_try_all
3.185. pop_authenticators
3.186. pop_checkinterval
3.187. pop_delete
3.188. pop_host
3.189. pop_last
3.190. pop_pass
3.191. pop_reconnect
3.192. pop_user
3.193. post_indent_string
3.194. postpone
3.195. postponed
3.196. preconnect
3.197. print
3.198. print_command
3.199. print_decode
3.200. print_split
3.201. prompt_after
3.202. query_command
3.203. query_format
3.204. quit
3.205. quote_regexp
3.206. read_inc
3.207. read_only
3.208. realname
3.209. recall
3.210. record
3.211. reflow_text
3.212. reflow_wrap
3.213. reply_regexp
3.214. reply_self
3.215. reply_to
3.216. resolve
3.217. reverse_alias
3.218. reverse_name
3.219. reverse_realname
3.220. rfc2047_parameters
3.221. save_address
3.222. save_empty
3.223. save_history
3.224. save_name
3.225. score
3.226. score_threshold_delete
3.227. score_threshold_flag
3.228. score_threshold_read
3.229. search_context
3.230. send_charset
3.231. sendmail
3.232. sendmail_wait
3.233. shell
3.234. sig_dashes
3.235. sig_on_top
3.236. signature
3.237. simple_search
3.238. sleep_time
3.239. smart_wrap
3.240. smileys
3.241. pgp_mime_signature_filename
3.242. pgp_mime_signature_description
3.243. smime_ask_cert_label
3.244. smime_ca_location
3.245. smime_certificates
3.246. smime_decrypt_command
3.247. smime_decrypt_use_default_key
3.248. smime_default_key
3.249. smime_encrypt_command
3.250. smime_encrypt_with
3.251. smime_get_cert_command
3.252. smime_get_cert_email_command
3.253. smime_get_signer_cert_command
3.254. smime_import_cert_command
3.255. smime_is_default
3.256. smime_keys
3.257. smime_pk7out_command
3.258. smime_sign_command
3.259. smime_sign_opaque_command
3.260. smime_timeout
3.261. smime_verify_command
3.262. smime_verify_opaque_command
3.263. smtp_authenticators
3.264. smtp_pass
3.265. smtp_url
3.266. sort
3.267. sort_alias
3.268. sort_aux
3.269. sort_browser
3.270. sort_re
3.271. spam_separator
3.272. spoolfile
3.273. ssl_ca_certificates_file
3.274. ssl_client_cert
3.275. ssl_force_tls
3.276. ssl_min_dh_prime_bits
3.277. ssl_starttls
3.278. ssl_use_sslv3
3.279. ssl_use_tlsv1
3.280. ssl_use_tlsv1_1
3.281. ssl_use_tlsv1_2
3.282. ssl_verify_dates
3.283. ssl_verify_host
3.284. status_chars
3.285. status_format
3.286. status_on_top
3.287. strict_threads
3.288. suspend
3.289. text_flowed
3.290. thorough_search
3.291. thread_received
3.292. tilde
3.293. time_inc
3.294. timeout
3.295. tmpdir
3.296. to_chars
3.297. trash
3.298. tunnel
3.299. uncollapse_jump
3.300. use_8bitmime
3.301. use_domain
3.302. use_envelope_from
3.303. use_from
3.304. use_idn
3.305. use_ipv6
3.306. user_agent
3.307. visual
3.308. wait_key
3.309. weed
3.310. wrap
3.311. wrap_headers
3.312. wrap_search
3.313. wrapmargin
3.314. write_bcc
3.315. write_inc
3.316. xterm_icon
3.317. xterm_set_titles
3.318. xterm_title
4. Functions
4.1. Generic Menu
4.2. Index Menu
4.3. Pager Menu
4.4. Alias Menu
4.5. Query Menu
4.6. Attachment Menu
4.7. Compose Menu
4.8. Postpone Menu
4.9. Browser Menu
4.10. Pgp Menu
4.11. Smime Menu
4.12. Mixmaster Menu
4.13. Editor Menu
10. Miscellany
1. Acknowledgements
2. About This Document

List of Tables

1.1. Typographical conventions for special terms
2.1. Most common navigation keys in entry-based menus
2.2. Most common navigation keys in page-based menus
2.3. Most common line editor keys
2.4. Most common message index keys
2.5. Message status flags
2.6. Message recipient flags
2.7. Most common pager keys
2.8. ANSI escape sequences
2.9. Color sequences
2.10. Most common thread mode keys
2.11. Most common mail sending keys
2.12. Most common compose menu keys
2.13. PGP key menu flags
3.1. Symbolic key names
4.1. POSIX regular expression character classes
4.2. Regular expression repetition operators
4.3. GNU regular expression extensions
4.4. Pattern modifiers
4.5. Simple search keywords
4.6. Date units
4.7. Mailbox shortcuts
5.1. Supported MIME types
9.1. Command line options
9.2. Default Generic Menu Bindings
9.3. Default Index Menu Bindings
9.4. Default Pager Menu Bindings
9.5. Default Alias Menu Bindings
9.6. Default Query Menu Bindings
9.7. Default Attachment Menu Bindings
9.8. Default Compose Menu Bindings
9.9. Default Postpone Menu Bindings
9.10. Default Browser Menu Bindings
9.11. Default Pgp Menu Bindings
9.12. Default Smime Menu Bindings
9.13. Default Mixmaster Menu Bindings
9.14. Default Editor Menu Bindings

List of Examples

3.1. Multiple configuration commands per line
3.2. Commenting configuration files
3.3. Escaping quotes in configuration files
3.4. Splitting long configuration commands over several lines
3.5. Using external command's output in configuration files
3.6. Using environment variables in configuration files
3.7. Configuring external alias files
3.8. Setting sort method based on mailbox name
3.9. Header weeding
3.10. Configuring header display order
3.11. Defining custom headers
3.12. Using %-expandos in save-hook
3.13. Embedding push in folder-hook
3.14. Configuring spam detection
3.15. Using user-defined variables for config file readability
3.16. Using user-defined variables for backing up other config option values
3.17. Deferring user-defined variable expansion to runtime
3.18. Type conversions using variables
3.19. Using external filters in format strings
4.1. Matching all addresses in address lists
4.2. Using boolean operators in patterns
4.3. Specifying a default hook
5.1. mime.types
5.2. Attachment counting
6.1. URLs
6.2. Managing multiple accounts

1. Compressed folders Support (OPTIONAL)

If Mutt was compiled with compressed folders support (by running the configure script with the --enable-compressed flag), Mutt can open folders stored in an arbitrary format, provided that the user has a script to convert from/to this format to one of the accepted. The most common use is to open compressed archived folders e.g. with gzip. In addition, the user can provide a script that gets a folder in an accepted format and appends its context to the folder in the user-defined format, which may be faster than converting the entire folder to the accepted format, appending to it and converting back to the user-defined format. There are three hooks defined (open-hook, close-hook and append-hook) which define commands to uncompress and compress a folder and to append messages to an existing compressed folder respectively. For example:

open-hook \\.gz$ "gzip -cd %f > %t"
close-hook \\.gz$ "gzip -c %t > %f"
append-hook \\.gz$ "gzip -c %t >> %f"

You do not have to specify all of the commands. If you omit append-hook, the folder will be open and closed again each time you will add to it. If you omit close-hook (or give empty command) , the folder will be open in the mode. If you specify append-hook though you'll be able to append to the folder. Note that Mutt will only try to use hooks if the file is not in one of the accepted formats. In particular, if the file is empty, mutt supposes it is not compressed. This is important because it allows the use of programs that do not have well defined extensions. Just use "." as a regexp. But this may be surprising if your compressing script produces empty files. In this situation, unset $save_empty, so that the compressed file will be removed if you delete all of the messages.

1.1. Open a compressed mailbox for reading

Usage: open-hook regexp "command" The command is the command that can be used for opening the folders whose names match regexp. The command string is the printf-like format string, and it should accept two parameters: %f, which is replaced with the (compressed) folder name, and %t which is replaced with the name of the temporary folder to which to write. %f and %t can be repeated any number of times in the command string, and all of the entries are replaced with the appropriate folder name. In addition, %% is replaced by %, as in printf, and any other %anything is left as is. The command should not remove the original compressed file. The command should return non-zero exit status if it fails, so mutt knows something's wrong. Example:

open-hook \\.gz$ "gzip -cd %f > %t"

If the command is empty, this operation is disabled for this file type.

1.2. Write a compressed mailbox

Usage: close-hook regexp "command" This is used to close the folder that was open with the open-hook command after some changes were made to it. The command string is the command that can be used for closing the folders whose names match regexp. It has the same format as in the open-hook command. Temporary folder in this case is the folder previously produced by the open-hook command. The command should not remove the decompressed file. The command should return non-zero exit status if it fails, so mutt knows something's wrong. Example:

close-hook \\.gz$ "gzip -c %t > %f"

If the command is empty, this operation is disabled for this file type, and the file can only be open in the read-only mode. close-hook is not called when you exit from the folder if the folder was not changed.

1.3. Append a message to a compressed mailbox

Usage: append-hook regexp "command" This command is used for saving to an existing compressed folder. The command is the command that can be used for appending to the folders whose names match regexp. It has the same format as in the open-hook command. The temporary folder in this case contains the messages that are being appended. The command should not remove the decompressed file. The command should return non-zero exit status if it fails, so mutt knows something's wrong. Example:

append-hook \\.gz$ "gzip -c %t >> %f"

When append-hook is used, the folder is not opened, which saves time, but this means that we can not find out what the folder type is. Thus the default ($mbox_type) type is always supposed (i.e. this is the format used for the temporary folder). If the file does not exist when you save to it, close-hook is called, and not append-hook. append-hook is only for appending to existing folders. If the command is empty, this operation is disabled for this file type. In this case, the folder will be open and closed again (using open-hook and close-hookrespectively) each time you will add to it.

1.4. Encrypted folders

The compressed folders support can also be used to handle encrypted folders. If you want to encrypt a folder with PGP, you may want to use the following hooks:

open-hook  \\.pgp$ "pgp -f < %f > %t"
close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId < %t > %f"

Please note, that PGP does not support appending to an encrypted folder, so there is no append-hook defined. If you are using GnuPG instead of PGP, you may use the following hooks instead:

open-hook  \\.gpg$ "gpg --decrypt < %f > %t"
close-hook \\.gpg$ "gpg --encrypt --recipient YourGpgUserIdOrKeyId < %t > %f"

Note: the folder is temporary stored decrypted in the /tmp directory, where it can be read by your system administrator. So think about the security aspects of this.