Description: All mail clients suck. This one just sucks less. — me, circa 1995

The Mutt E-Mail Client
|  | Next

# The Mutt E-Mail Client

### Michael Elkins

`<me@cs.hmc.edu>`

version 1.5.23 (2014-03-12)

Abstract

“All mail clients suck. This one just sucks less.” — me, circa 1995

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.

|  | Next
|  | Chapter 1. Introduction