The Mutt E-Mail Client : Configuration : Syntax of Initialization Files
Previous: Configuration
Next: Defining/Using aliases

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 command in an initialization file. This is accomplished by enclosing the command in backquotes (``). For example,

my_hdr X-Operating-System: `uname -a`
The output of the Unix command ``uname -a'' will be substituted before the line is parsed. Note that since initialization files are line oriented, only the first line of output from the Unix command will be substituted.

UNIX environments can be accessed like the way it is done in shells like sh and bash: Prepend the name of the environment by a ``$''. For example,

set record=+sent_on_$HOSTNAME

The commands understood by mutt are explained in the next paragraphs. For a complete list, see the command reference.


The Mutt E-Mail Client : Configuration : Syntax of Initialization Files
Previous: Configuration
Next: Defining/Using aliases