Next Previous Contents

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.

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