The Mutt E-Mail Client

Michael Elkins

version 1.5.11

Abstract

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


Table of Contents

1. Introduction
1.1. Mutt Home Page
1.2. Mailing Lists
1.3. Software Distribution Sites
1.4. IRC
1.5. USENET
1.6. Copyright
2. Getting Started
2.1. Moving Around in Menus
2.2. Editing Input Fields
2.3. Reading Mail - The Index and Pager
2.4. Sending Mail
2.5. Forwarding and Bouncing Mail
2.6. Postponing Mail
2.7. Reading news via NNTP
3. Configuration
3.1. Syntax of Initialization Files
3.2. Defining/Using aliases
3.3. Changing the default key bindings
3.4. Defining aliases for character sets
3.5. Setting variables based upon mailbox
3.6. Keyboard macros
3.7. Using color and mono video attributes
3.8. Ignoring (weeding) unwanted message headers
3.9. Alternative addresses
3.10. Mailing lists
3.11. Using Multiple spool mailboxes
3.12. Defining mailboxes which receive mail
3.13. User defined headers
3.14. Defining the order of headers when viewing messages
3.15. Specify default save filename
3.16. Specify default Fcc: mailbox when composing
3.17. Specify default save filename and default Fcc: mailbox at once
3.18. Change settings based upon message recipients
3.19. Change settings before formatting a message
3.20. Choosing the cryptographic key of the recipient
3.21. Adding key sequences to the keyboard buffer
3.22. Executing functions
3.23. Message Scoring
3.24. Spam detection
3.25. Setting variables
3.26. Reading initialization commands from another file
3.27. Removing hooks
4. Advanced Usage
4.1. Regular Expressions
4.2. Patterns
4.3. Using Tags
4.4. Using Hooks
4.5. External Address Queries
4.6. Mailbox Formats
4.7. Mailbox Shortcuts
4.8. Handling Mailing Lists
4.9. Editing threads
4.10. Delivery Status Notification (DSN) Support
4.11. POP3 Support (OPTIONAL)
4.12. IMAP Support (OPTIONAL)
4.13. Managing multiple IMAP/POP accounts (OPTIONAL)
4.14. Start a WWW Browser on URLs (EXTERNAL)
5. Mutt's MIME Support
5.1. Using MIME in Mutt
5.2. MIME Type configuration with mime.types
5.3. MIME Viewer configuration with mailcap
5.4. MIME Autoview
5.5. MIME Multipart/Alternative
5.6. MIME Lookup
6. Reference
6.1. Command line options
6.2. Configuration Commands
6.3. Configuration variables
6.4. Functions
7. Miscellany
7.1. Acknowledgements
7.2. About this document

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.1. Mutt Home Page

http://www.mutt.org/

1.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.

1.3. Software Distribution Sites

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

1.4. IRC

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

1.5. USENET

See the newsgroup comp.mail.mutt.

1.6. Copyright

Mutt is Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu> 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., 59 Temple Place - Suite 330, Boston, MA 02111, USA.

.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.