From the Linux man page
Examples
Muttrc
Name
muttrc - Configuration file for the Mutt Mail User Agent
Description
A mutt configuration 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 (";").
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.
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.
"\\" 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 (`command`).
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 dollar ("$") sign.
Commands
alias key address [, address [ ... ]]
unalias key
alias defines an alias key for the given addresses.
unalias removes the alias corresponding to the given
key.
alternative_order type[/subtype] [ ... ]
This command permits you to define an order of preference
which is used by mutt to determine which part of a multipart/alternative
body to display. A subtype of "*" matches
any subtype, as does an empty subtype.
auto_view type[/subtype] [ ... ]
This commands permits you to specify that mutt should
automatically convert the given MIME types to text/plain
when displaying messages. For this to work, there must
be a mailcap(5) entry for the given MIME type with the
copiousoutput flag set. A subtype of "*" matches
any subtype, as does an empty subtype.
bind map key function
This command binds the given key for the given map to
the given function.
Valid maps are: generic,
alias, attach, browser, editor, index, compose, pager,
pgp, postpone, mix.
For more information on keys and functions, please
consult the Mutt Manual.
charset-hook alias charset
This command defines an alias for a character set. This
is useful to properly display messages which are tagged
with a character set name not known to
mutt.
folder-hook [!]regexp command
When mutt enters a folder which matches regexp (or,
when regexp is preceded by an exclamation mark, does
not match regexp), the given command is exe
cuted.
When several folder-hooks match a given mail folder,
they are executed in the order given in the configuration
file.
macro map key sequence [ description ]
This command binds the given sequence of keys to the
given key in the given map. For valid maps,see bind.
color object foreground background [ regexp
]
color index foreground background [ pattern ]
uncolor index pattern [ pattern ... ]
If your terminal supports color, these commands can
be used to assign foreground/backgound combinations
to certain objects. Valid objects are: attachment, body,
bold, header, hdrdefault, index, indicator, markers,
message, normal, quoted, quotedN, search, signature,
status, tilde, tree, underline. The
body and header objects allow you to restrict the colorization
to a regular expression. The index object permits you
to select colored messages by
pattern.
Valid colors include: white, black, green, magenta,
blue, cyan, yellow, red, default, colorN.
mono object attribute [ regexp ]
mono index attribute [ pattern ]
For terminals which don't support color, you can still
assign attributes to objects. Valid attributes include:
none, bold, underline, reverse, and standout.
[un]ignore pattern [ pattern ... ]
The ignore command permits you to specify header fields
which you usually don't wish to see. Any header field
whose tag begins with an "ignored" pattern
will be ignored.
The unignore command permits you to define exceptions
from the above mentioned list of ignored headers.
lists address [ address ... ]
unlists address [ address ... ]
subscribe address [ address ... ]
unsubscribe address [ address ... ]
Mutt maintains two lists of mailing list addresses,
a list of subscribed mailing lists, and a list of known
mailing lists. All subscribed mailing lists are known.
A mail address matches a mailing list if it begins with
the given address. For example, the lists pattern "mutt-"
will match mutt dev@mutt.org and mutt-users@mutt.org.
The lists command adds a mailing list address to the
list of known mailing lists. The unlists com mand
removes a mailig list from the lists of known and subscribed
mailing lists. The subscribe com mand adds a mailing
list to the lists of known and subscribed mailing lists.
The unsubscribe command removes it from the list of
subscribed mailing lists.
mbox-hook [!]pattern mailbox
When mutt changes to a mail folder which matches pattern,
mailbox will be used as the "mbox" folder,
i.e., read messages will be moved to that folder when
the mail folder is left.
The first matchig mbox-hook applies.
mailboxes filename [ filename ... ]
This command specifies folders which can receive mail
and which will be checked for new messages. When changing
folders, pressing space will cycle through folders with
new mail.
my_hdr string
unmy_hdr field
Using my_hdr, you can define headers which will be
added to the messages you compose. unmy_hdr will remove
the given user-defined headers.
hdr_order header1 header2 [ ... ]
With this command, you can specify an order in which
mutt will attempt to present headers to you when viewing
messages.
save-hook [!]pattern filename
When a message matches pattern, the default file name
when saving it will be the given filename.
fcc-hook [!]pattern filename
When an outgoing message matches pattern, the default
file name for storing a copy (fcc) will be the given
filename.
fcc-save-hook [!]pattern filename
This command is an abbreviation for identical fcc hook
and save-hook commands.
send-hook [!]pattern command
When composing a message matching pattern, command is
executed. When multiple send-hooks match, they are executed
in the order in which they occur in the configuration
file.
pgp-hook pattern key-id
The pgp-hook command provides a method by which you
can specify the ID of the public key to be used when
encrypting messages to a certain recipient.
push string
This command adds the named string to the keyboard buffer.
set [no|inv]variable[=value] [ ... ]
toggle variable [ ... ]
unset variable [ ... ]
reset variable [ ... ]
These commands are used to set and manipulate configuration
varibles.
Mutt knows four basic types of variables: boolean,
number, string and quadoption. Boolean variables can
be set (true), unset (false), or toggled. Num ber
variables can be assigned a positive integer value.
String variables consist of any number of printable
characters. Strings must be enclosed in quotes if they
contain spaces or tabs. You may also use the "C"
escape sequences \n and \t for newline and tab, respectively.
Quadoption variables are used to control whether or
not to be prompted for certain actions, or to spec
ify a default action. A value of yes will cause the
action to be carried out automatically as if you had
answered yes to the question. Similarly, a value of
no will cause the the action to be carried out as if
you had answered "no." A value of ask-yes
will cause a prompt with a default answer of "yes"
and ask-no will provide a default answer of "no."
The reset command resets all given variables to the
compile time defaults. If you reset the special variabe
all, all variables will reset to their sys tem
defaults.
source filename
The given file will be evaluated as a configuration
file.
unhook [ * | hook-type ]
This command will remove all hooks of a given type,
or all hooks when "*" is used as an argument.
hook-type can be any of the -hook commands docu
mented above.
Patterns
In various places with mutt, including some of the above
mentioned hook commands, you can specify patterns to
match messages.
Constructing Patterns
A simple pattern consists of an operator of the form
"~character", possibly followed by a parameter
against which mutt is supposed to match the obeject
specified by this operator. (For a list of operators,
see below.)
With some of these operators, the object to be matched
consists of several e-mail addresses. In these cases,
the object is matched if at least one of these e-mail
addresses matches. You can prepend a hat ("^")
character to such a pattern to indicate that all addresses
must match in order to match the object.
You can construct complex patterns by combining simple
patterns with logical operators. Logical AND is specified
by simply concatenating two simple patterns, for instance
"~C mutt-dev ~s bug". Logical OR is specified
by insert ing a vertical bar ("|") between
two patterns, for instance "~C mutt-dev | ~s bug".
Additionally, you can negate a pattern by prepending
a bang ("!") character. For logical grouping,
use braces ("()"). Example: "!(~t mutt|~c
mutt) ~f elkins".
Simple Patterns Mutt understands the following
simple patterns:
| ~A |
all messages ~b EXPR messages which
contain EXPR in the message body |
| ~B EXPR |
messages which contain EXPR in the whole message |
| ~c |
EXPR messages carbon-copied to EXPR |
| ~C |
EXPR message is either to: or cc: EXPR |
| ~D |
deleted messages |
| ~d |
MIN-MAX messages with "date-sent" in a
Date range |
| ~E |
expired messages |
| ~e |
EXPR message which contains EXPR in the "Sender"
field |
| ~F |
flagged messages |
| ~f |
EXPR messages originating from EXPR |
| ~g |
PGP signed messages |
| ~G |
PGP encrypted messages |
| ~h |
EXPR messages which contain EXPR in the message
header |
| ~k |
message contains PGP key material |
| ~i |
EXPR message which match EXPR in the "Message-ID"
field |
| ~L |
EXPR message is either originated or received
by EXPR |
| ~l |
message is addressed to a known mailing list |
| ~m |
MIN-MAX message in the range MIN to MAX |
| ~n |
MIN-MAX messages with a score in the range MIN
to MAX |
| ~N |
new messages |
| ~O |
old messages |
| ~p |
message is addressed to you (consults $alternates) |
| ~P |
message is from you (consults $alternates) |
| ~Q |
messages which have been replied to |
| ~R |
read messages |
| ~r |
MIN-MAX messages with "date-received"
in a Date range |
| ~S |
superseded messages |
| ~s |
EXPR messages having EXPR in the "Subject"
field. |
| ~T |
tagged messages |
| ~t |
EXPR messages addressed to EXPR |
| ~U |
unread messages |
| ~v |
message is part of a collapsed thread. |
| ~x |
EXPR messages which contain EXPR in the "References"
field |
| ~z |
MIN-MAX messages with a size in the range MIN
to MAX |
| |
|
In the above, EXPR is a regular expression.
With the ~m, ~n, and ~z operators, you can also specify
ranges in the forms MIN, MIN-, and -MAX.
Matching dates
The ~d and ~r operators are used to match date ranges,
which are interpreted to be given in your local time
zone.
A date is of the form DD[/MM[/[cc]YY]], that is, a
two-digit date, optionally followed by a two-digit month,
optionally followed by a year specifications. Omitted
fields default to the current month and year.
Mutt understands either two or four digit year specifications.
When given a two-digit year, mutt will interpret values
less than 70 as lying in the 21st century (i.e.,
"38" means 2038 and not 1938, and "00"
is interpreted as 2000), and values greater than or
equal to 70 as lying in the 20th century.
Note that this behaviour is Y2K compliant, but that
mutt does have a Y2.07K problem.
If a date range consists of a single date, the operator
in question will match that precise date. If the date
range consists of a dash ("-"), followed by
a date, this range will match any date before and up
to the date given. Similarly, a date followed by a dash
matches the date given and any later point of time.
Two dates, separated by a dash, match any date which
lies in the given range of time.
You can also specify offsets relative to the current
date. An offset is specified as one of the characters
<, >, =, followed by a positive number, followed
by one of the unit characters y, m, w, or d, specifying
a unit of years, months, weeks, or days. An offset which
begins with the character > matches dates which are
older than the specified amount of time, an offset which
begins with the character < matches dates which are
more recent than the specified amount of time, and an
offset which begins with the character = matches points
of time which are precisely the given amount of time
ago.
Configuration
Variables
|