The Mutt E-Mail Client

Michael Elkins

version 2.0.5 (2021-01-21)

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. Sidebar
2.5. Help
2.6. Compose Menu
2.7. Alias Menu
2.8. 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
6.5. Background Editing
7. Forwarding and Bouncing Mail
8. Postponing Mail
9. Encryption and Signing
9.1. OpenPGP Configuration
9.2. S/MIME Configuration
3. Configuration
1. Location of Initialization Files
2. Starter Muttrc
3. Syntax of Initialization Files
4. Address Groups
5. Defining/Using Aliases
6. Changing the Default Key Bindings
6.1. Terminal Keybindings
7. Changing the current working directory
8. Defining Aliases for Character Sets
9. Setting Variables Based Upon Mailbox
10. Keyboard Macros
11. Using Color and Mono Video Attributes
12. Message Header Display
12.1. Header Display
12.2. Selecting Headers
12.3. Ordering Displayed Headers
13. Alternative Addresses
14. Mailing Lists
15. Using Multiple Spool Mailboxes
16. Monitoring Incoming Mail
17. User-Defined Headers
18. Specify Default Save Mailbox
19. Specify Default Fcc: Mailbox When Composing
20. Specify Default Save Filename and Default Fcc: Mailbox at Once
21. Change Settings Based Upon Message Recipients
22. Change Settings Before Formatting a Message
23. Choosing the Cryptographic Key of the Recipient
24. Dynamically Changing $index_format using Patterns
25. Adding Key Sequences to the Keyboard Buffer
26. Executing Functions
27. Message Scoring
28. Spam Detection
29. Setting and Querying Variables
29.1. Variable Types
29.2. Commands
29.3. User-Defined Variables
29.4. Type Conversions
30. Reading Initialization Commands From Another File
31. Removing Hooks
32. Format Strings
32.1. Basic usage
32.2. Conditionals
32.3. Filters
32.4. Padding
32.5. Bytes size display
33. Control allowed header fields in a mailto: URL
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. Marking Messages
5. Using Tags
6. Using Hooks
6.1. Message Matching in Hooks
6.2. Mailbox Matching in Hooks
7. Managing the Environment
8. External Address Queries
9. Mailbox Formats
10. Mailbox Shortcuts
11. Handling Mailing Lists
12. Display Munging
13. New Mail Detection
13.1. How New Mail Detection Works
13.2. Polling For New Mail
13.3. Monitoring New Mail
13.4. Calculating Mailbox Message Counts
14. Editing Threads
14.1. Linking Threads
14.2. Breaking Threads
15. Delivery Status Notification (DSN) Support
16. Start a WWW Browser on URLs
17. Echoing Text
18. Message Composition Flow
19. Using MuttLisp (EXPERIMENTAL)
19.1. Running a command generated by MuttLisp
19.2. Interpolating MuttLisp in a Command Argument
19.3. MuttLisp Syntax
19.4. MuttLisp Functions
19.5. Examples
20. 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
2.1. STARTTLS
2.2. Tunnel
3. POP3 Support
4. IMAP Support
4.1. The IMAP Folder Browser
4.2. Authentication
5. SMTP Support
6. OAUTHBEARER Support
6.1. XOAUTH2 Support
7. Managing Multiple Accounts
8. Local Caching
8.1. Header Caching
8.2. Body Caching
8.3. Cache Directories
8.4. Maintenance
9. Exact Address Generation
10. Sending Anonymous Messages via Mixmaster
11. Sidebar
11.1. Introduction
11.2. Variables
11.3. Functions
11.4. Commands
11.5. Colors
11.6. Sort
11.7. See Also
12. Compressed Folders Feature
12.1. Introduction
12.2. Commands
13. Autocrypt
13.1. Requirements
13.2. First Run
13.3. Compose Menu
13.4. Account Management
13.5. Alternative Key and Keyring Strategies
7. Security Considerations
1. Passwords
2. Temporary Files
3. Information Leaks
3.1. 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_noattach
3.2. abort_noattach_regexp
3.3. abort_nosubject
3.4. abort_unmodified
3.5. alias_file
3.6. alias_format
3.7. allow_8bit
3.8. allow_ansi
3.9. arrow_cursor
3.10. ascii_chars
3.11. askbcc
3.12. askcc
3.13. assumed_charset
3.14. attach_charset
3.15. attach_format
3.16. attach_save_dir
3.17. attach_sep
3.18. attach_split
3.19. attribution
3.20. attribution_locale
3.21. auto_subscribe
3.22. auto_tag
3.23. autocrypt
3.24. autocrypt_acct_format
3.25. autocrypt_dir
3.26. autocrypt_reply
3.27. autoedit
3.28. background_edit
3.29. background_confirm_quit
3.30. background_format
3.31. beep
3.32. beep_new
3.33. bounce
3.34. bounce_delivered
3.35. braille_friendly
3.36. browser_abbreviate_mailboxes
3.37. browser_sticky_cursor
3.38. certificate_file
3.39. change_folder_next
3.40. charset
3.41. check_mbox_size
3.42. check_new
3.43. collapse_unread
3.44. compose_format
3.45. config_charset
3.46. confirmappend
3.47. confirmcreate
3.48. connect_timeout
3.49. content_type
3.50. copy
3.51. copy_decode_weed
3.52. count_alternatives
3.53. cursor_overlay
3.54. crypt_autoencrypt
3.55. crypt_autopgp
3.56. crypt_autosign
3.57. crypt_autosmime
3.58. crypt_confirmhook
3.59. crypt_opportunistic_encrypt
3.60. crypt_opportunistic_encrypt_strong_keys
3.61. crypt_protected_headers_read
3.62. crypt_protected_headers_save
3.63. crypt_protected_headers_subject
3.64. crypt_protected_headers_write
3.65. crypt_replyencrypt
3.66. crypt_replysign
3.67. crypt_replysignencrypted
3.68. crypt_timestamp
3.69. crypt_use_gpgme
3.70. crypt_use_pka
3.71. crypt_verify_sig
3.72. date_format
3.73. default_hook
3.74. delete
3.75. delete_untag
3.76. digest_collapse
3.77. display_filter
3.78. dotlock_program
3.79. dsn_notify
3.80. dsn_return
3.81. duplicate_threads
3.82. edit_headers
3.83. editor
3.84. encode_from
3.85. entropy_file
3.86. envelope_from_address
3.87. error_history
3.88. escape
3.89. fast_reply
3.90. fcc_attach
3.91. fcc_before_send
3.92. fcc_clear
3.93. fcc_delimiter
3.94. flag_safe
3.95. folder
3.96. folder_format
3.97. followup_to
3.98. force_name
3.99. forward_attachments
3.100. forward_attribution_intro
3.101. forward_attribution_trailer
3.102. forward_decode
3.103. forward_decrypt
3.104. forward_edit
3.105. forward_format
3.106. forward_quote
3.107. from
3.108. gecos_mask
3.109. hdrs
3.110. header
3.111. header_cache
3.112. header_cache_compress
3.113. header_cache_pagesize
3.114. header_color_partial
3.115. help
3.116. hidden_host
3.117. hide_limited
3.118. hide_missing
3.119. hide_thread_subject
3.120. hide_top_limited
3.121. hide_top_missing
3.122. history
3.123. history_file
3.124. history_remove_dups
3.125. honor_disposition
3.126. honor_followup_to
3.127. hostname
3.128. idn_decode
3.129. idn_encode
3.130. ignore_linear_white_space
3.131. ignore_list_reply_to
3.132. imap_authenticators
3.133. imap_check_subscribed
3.134. imap_condstore
3.135. imap_deflate
3.136. imap_delim_chars
3.137. imap_fetch_chunk_size
3.138. imap_headers
3.139. imap_idle
3.140. imap_keepalive
3.141. imap_list_subscribed
3.142. imap_login
3.143. imap_oauth_refresh_command
3.144. imap_pass
3.145. imap_passive
3.146. imap_peek
3.147. imap_pipeline_depth
3.148. imap_poll_timeout
3.149. imap_qresync
3.150. imap_servernoise
3.151. imap_user
3.152. implicit_autoview
3.153. include
3.154. include_encrypted
3.155. include_onlyfirst
3.156. indent_string
3.157. index_format
3.158. ispell
3.159. keep_flagged
3.160. mail_check
3.161. mail_check_recent
3.162. mail_check_stats
3.163. mail_check_stats_interval
3.164. mailcap_path
3.165. mailcap_sanitize
3.166. maildir_header_cache_verify
3.167. maildir_trash
3.168. maildir_check_cur
3.169. mark_macro_prefix
3.170. mark_old
3.171. markers
3.172. mask
3.173. mbox
3.174. mbox_type
3.175. menu_context
3.176. menu_move_off
3.177. menu_scroll
3.178. message_cache_clean
3.179. message_cachedir
3.180. message_format
3.181. meta_key
3.182. metoo
3.183. mh_purge
3.184. mh_seq_flagged
3.185. mh_seq_replied
3.186. mh_seq_unseen
3.187. mime_forward
3.188. mime_forward_decode
3.189. mime_forward_rest
3.190. mime_type_query_command
3.191. mime_type_query_first
3.192. mix_entry_format
3.193. mixmaster
3.194. move
3.195. muttlisp_inline_eval
3.196. narrow_tree
3.197. net_inc
3.198. new_mail_command
3.199. pager
3.200. pager_context
3.201. pager_format
3.202. pager_index_lines
3.203. pager_stop
3.204. pattern_format
3.205. pgp_auto_decode
3.206. pgp_autoinline
3.207. pgp_check_exit
3.208. pgp_check_gpg_decrypt_status_fd
3.209. pgp_clearsign_command
3.210. pgp_decode_command
3.211. pgp_decrypt_command
3.212. pgp_decryption_okay
3.213. pgp_default_key
3.214. pgp_encrypt_only_command
3.215. pgp_encrypt_sign_command
3.216. pgp_entry_format
3.217. pgp_export_command
3.218. pgp_getkeys_command
3.219. pgp_good_sign
3.220. pgp_ignore_subkeys
3.221. pgp_import_command
3.222. pgp_list_pubring_command
3.223. pgp_list_secring_command
3.224. pgp_long_ids
3.225. pgp_mime_auto
3.226. pgp_replyinline
3.227. pgp_retainable_sigs
3.228. pgp_self_encrypt
3.229. pgp_show_unusable
3.230. pgp_sign_as
3.231. pgp_sign_command
3.232. pgp_sort_keys
3.233. pgp_strict_enc
3.234. pgp_timeout
3.235. pgp_use_gpg_agent
3.236. pgp_verify_command
3.237. pgp_verify_key_command
3.238. pipe_decode
3.239. pipe_decode_weed
3.240. pipe_sep
3.241. pipe_split
3.242. pop_auth_try_all
3.243. pop_authenticators
3.244. pop_checkinterval
3.245. pop_delete
3.246. pop_host
3.247. pop_last
3.248. pop_oauth_refresh_command
3.249. pop_pass
3.250. pop_reconnect
3.251. pop_user
3.252. post_indent_string
3.253. postpone
3.254. postponed
3.255. postpone_encrypt
3.256. postpone_encrypt_as
3.257. preconnect
3.258. print
3.259. print_command
3.260. print_decode
3.261. print_decode_weed
3.262. print_split
3.263. prompt_after
3.264. query_command
3.265. query_format
3.266. quit
3.267. quote_regexp
3.268. read_inc
3.269. read_only
3.270. realname
3.271. recall
3.272. record
3.273. reflow_space_quotes
3.274. reflow_text
3.275. reflow_wrap
3.276. reply_regexp
3.277. reply_self
3.278. reply_to
3.279. resolve
3.280. resume_draft_files
3.281. resume_edited_draft_files
3.282. reverse_alias
3.283. reverse_name
3.284. reverse_realname
3.285. rfc2047_parameters
3.286. save_address
3.287. save_empty
3.288. save_history
3.289. save_name
3.290. score
3.291. score_threshold_delete
3.292. score_threshold_flag
3.293. score_threshold_read
3.294. search_context
3.295. send_charset
3.296. send_multipart_alternative
3.297. send_multipart_alternative_filter
3.298. sendmail
3.299. sendmail_wait
3.300. shell
3.301. sidebar_delim_chars
3.302. sidebar_divider_char
3.303. sidebar_folder_indent
3.304. sidebar_format
3.305. sidebar_indent_string
3.306. sidebar_new_mail_only
3.307. sidebar_next_new_wrap
3.308. sidebar_relative_shortpath_indent
3.309. sidebar_short_path
3.310. sidebar_sort_method
3.311. sidebar_use_mailbox_shortcuts
3.312. sidebar_visible
3.313. sidebar_width
3.314. sig_dashes
3.315. sig_on_top
3.316. signature
3.317. simple_search
3.318. size_show_bytes
3.319. size_show_fractions
3.320. size_show_mb
3.321. size_units_on_left
3.322. sleep_time
3.323. smart_wrap
3.324. smileys
3.325. smime_ask_cert_label
3.326. smime_ca_location
3.327. smime_certificates
3.328. smime_decrypt_command
3.329. smime_decrypt_use_default_key
3.330. smime_default_key
3.331. smime_encrypt_command
3.332. smime_encrypt_with
3.333. smime_get_cert_command
3.334. smime_get_cert_email_command
3.335. smime_get_signer_cert_command
3.336. smime_import_cert_command
3.337. smime_is_default
3.338. smime_keys
3.339. smime_pk7out_command
3.340. smime_self_encrypt
3.341. smime_sign_as
3.342. smime_sign_command
3.343. smime_sign_digest_alg
3.344. smime_sign_opaque_command
3.345. smime_timeout
3.346. smime_verify_command
3.347. smime_verify_opaque_command
3.348. smtp_authenticators
3.349. smtp_oauth_refresh_command
3.350. smtp_pass
3.351. smtp_url
3.352. sort
3.353. sort_alias
3.354. sort_aux
3.355. sort_browser
3.356. sort_re
3.357. spam_separator
3.358. spoolfile
3.359. ssl_ca_certificates_file
3.360. ssl_client_cert
3.361. ssl_force_tls
3.362. ssl_min_dh_prime_bits
3.363. ssl_starttls
3.364. ssl_use_sslv2
3.365. ssl_use_sslv3
3.366. ssl_use_tlsv1
3.367. ssl_use_tlsv1_1
3.368. ssl_use_tlsv1_2
3.369. ssl_use_tlsv1_3
3.370. ssl_usesystemcerts
3.371. ssl_verify_dates
3.372. ssl_verify_host
3.373. ssl_verify_partial_chains
3.374. ssl_ciphers
3.375. status_chars
3.376. status_format
3.377. status_on_top
3.378. strict_threads
3.379. suspend
3.380. text_flowed
3.381. thorough_search
3.382. thread_received
3.383. tilde
3.384. time_inc
3.385. timeout
3.386. tmpdir
3.387. to_chars
3.388. trash
3.389. ts_icon_format
3.390. ts_enabled
3.391. ts_status_format
3.392. tunnel
3.393. tunnel_is_secure
3.394. uncollapse_jump
3.395. uncollapse_new
3.396. use_8bitmime
3.397. use_domain
3.398. use_envelope_from
3.399. use_from
3.400. use_ipv6
3.401. user_agent
3.402. visual
3.403. wait_key
3.404. weed
3.405. wrap
3.406. wrap_headers
3.407. wrap_search
3.408. wrapmargin
3.409. write_bcc
3.410. write_inc
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
4.14. Autocrypt Account 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. Special Thread Characters
2.12. Most common mail sending keys
2.13. Most common compose menu keys
2.14. 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. Relative date units
4.8. Mailbox shortcuts
5.1. Supported MIME types
6.1. Sidebar Variables
6.2. Sidebar Functions
6.3. Sidebar Colors
6.4. Sidebar Sort
6.5. Not all Hooks are Required
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
9.15. Default Autocrypt Account 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. Preventing the output of backticks from being parsed
3.7. Using environment variables in configuration files
3.8. Using MuttLisp expresions
3.9. Configuring external alias files
3.10. Setting sort method based on mailbox name
3.11. Header weeding
3.12. Configuring header display order
3.13. Defining custom headers
3.14. Using %-expandos in save-hook
3.15. Embedding push in folder-hook
3.16. Configuring spam detection
3.17. Using user-defined variables for config file readability
3.18. Using user-defined variables for backing up other config option values
3.19. Deferring user-defined variable expansion to runtime
3.20. Type conversions using variables
3.21. Using external filters in format strings
4.1. Matching all addresses in address lists
4.2. Matching restricted to aliases
4.3. Matching any defined alias
4.4. Using boolean operators in patterns
4.5. Specifying a default hook
4.6. Subject Munging
5.1. mime.types
5.2. Attachment counting
6.1. URLs
6.2. Managing multiple accounts
6.3. Example of open-hook
6.4. Example of close-hook
6.5. Example of append-hook