Sophie

Sophie

distrib > Momonga > development > i686 > media > os > by-pkgid > 5d3f2a67850fca1298a028f035410826 > files > 40

mutt-1.5.19-10m.mo8.i686.rpm

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title>Chapter 3. Configuration</title><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /><link rel="home" href="index.html" title="The Mutt E-Mail Client" /><link rel="up" href="index.html" title="The Mutt E-Mail Client" /><link rel="prev" href="gettingstarted.html" title="Chapter 2. Getting Started" /><link rel="next" href="advancedusage.html" title="Chapter 4. Advanced Usage" /><style xmlns="" type="text/css">
      body { margin-left:2%; margin-right:2%; font-family:serif; }
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
em.replaceable code { font-family:sans-serif; }
p { text-align:justify; }
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
.email, .email a { font-family:monospace; }
div.table-contents table { border-collapse:collapse; border:1px solid #c0c0c0; }
div.table-contents table td, div.table-contents table th { padding:5px; text-align:left; }
div.table-contents table th {
    font-family:sans-serif;
    background:#d0d0d0;
    font-weight:normal;
    vertical-align:top;
}
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; }
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
div.note h3:after { content: ":" }
div.note { margin-bottom: 5px; }

    </style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 3. Configuration</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="gettingstarted.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="advancedusage.html">Next</a></td></tr></table><hr /></div><div class="chapter" title="Chapter 3. Configuration"><div class="titlepage"><div><div><h2 class="title"><a id="configuration"></a>Chapter 3. Configuration</h2></div></div></div><div class="toc"><p><strong>Table of Contents</strong></p><dl><dt><span class="sect1"><a href="configuration.html#configuration-files">1. Location of initialization files</a></span></dt><dt><span class="sect1"><a href="configuration.html#muttrc-syntax">2. Syntax of Initialization Files</a></span></dt><dt><span class="sect1"><a href="configuration.html#addrgroup">3. Address groups</a></span></dt><dt><span class="sect1"><a href="configuration.html#alias">4. Defining/Using aliases</a></span></dt><dt><span class="sect1"><a href="configuration.html#bind">5. Changing the default key bindings</a></span></dt><dt><span class="sect1"><a href="configuration.html#charset-hook">6. Defining aliases for character sets </a></span></dt><dt><span class="sect1"><a href="configuration.html#folder-hook">7. Setting variables based upon mailbox</a></span></dt><dt><span class="sect1"><a href="configuration.html#macro">8. Keyboard macros</a></span></dt><dt><span class="sect1"><a href="configuration.html#color">9. Using color and mono video attributes</a></span></dt><dt><span class="sect1"><a href="configuration.html#ignore">10. Message header display</a></span></dt><dt><span class="sect1"><a href="configuration.html#alternates">11. Alternative addresses</a></span></dt><dt><span class="sect1"><a href="configuration.html#lists">12. Mailing lists</a></span></dt><dt><span class="sect1"><a href="configuration.html#mbox-hook">13. Using Multiple spool mailboxes</a></span></dt><dt><span class="sect1"><a href="configuration.html#mailboxes">14. Monitoring incoming mail</a></span></dt><dt><span class="sect1"><a href="configuration.html#my-hdr">15. User defined headers</a></span></dt><dt><span class="sect1"><a href="configuration.html#save-hook">16. Specify default save mailbox</a></span></dt><dt><span class="sect1"><a href="configuration.html#fcc-hook">17. Specify default Fcc: mailbox when composing</a></span></dt><dt><span class="sect1"><a href="configuration.html#fcc-save-hook">18. Specify default save filename and default Fcc: mailbox at once</a></span></dt><dt><span class="sect1"><a href="configuration.html#send-hook">19. Change settings based upon message recipients</a></span></dt><dt><span class="sect1"><a href="configuration.html#message-hook">20. Change settings before formatting a message</a></span></dt><dt><span class="sect1"><a href="configuration.html#crypt-hook">21. Choosing the cryptographic key of the recipient</a></span></dt><dt><span class="sect1"><a href="configuration.html#push">22. Adding key sequences to the keyboard buffer</a></span></dt><dt><span class="sect1"><a href="configuration.html#exec">23. Executing functions</a></span></dt><dt><span class="sect1"><a href="configuration.html#score-command">24. Message Scoring</a></span></dt><dt><span class="sect1"><a href="configuration.html#spam">25. Spam detection</a></span></dt><dt><span class="sect1"><a href="configuration.html#set">26. Setting and Querying Variables</a></span></dt><dd><dl><dt><span class="sect2"><a href="configuration.html#set-commands">26.1. Commands</a></span></dt><dt><span class="sect2"><a href="configuration.html#set-myvar">26.2. User-defined variables</a></span></dt></dl></dd><dt><span class="sect1"><a href="configuration.html#source">27. Reading initialization commands from another file</a></span></dt><dt><span class="sect1"><a href="configuration.html#unhook">28. Removing hooks</a></span></dt><dt><span class="sect1"><a href="configuration.html#formatstrings">29. Format Strings</a></span></dt><dd><dl><dt><span class="sect2"><a href="configuration.html#formatstrings-basics">29.1. Basic usage</a></span></dt><dt><span class="sect2"><a href="configuration.html#formatstrings-filters">29.2. Filters</a></span></dt></dl></dd></dl></div><div class="sect1" title="1. Location of initialization files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="configuration-files"></a>1. Location of initialization files</h2></div></div></div><p>
While the default configuration (or <span class="quote">“<span class="quote">preferences</span>”</span>) 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 <span class="quote">“<span class="quote">system</span>”</span> configuration file (defaults set by your local
system administrator), unless the <span class="quote">“<span class="quote">-n</span>”</span> <a class="link" href="reference.html#commandline" title="1. Command line options">command line</a> option is specified.  This file is typically
<code class="literal">/usr/local/share/mutt/Muttrc</code> or <code class="literal">/etc/Muttrc</code>. Mutt
will next look for a file named <code class="literal">.muttrc</code> in your home
directory.  If this file does not exist and your home directory has
a subdirectory named <code class="literal">.mutt</code>, mutt try to load a file named
<code class="literal">.mutt/muttrc</code>.
</p><p>
<code class="literal">.muttrc</code> is the file where you will usually place your <a class="link" href="reference.html#commands" title="2. Configuration Commands">commands</a> to configure Mutt.
</p><p>
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 <code class="literal">Muttrc-0.88</code> file in the system configuration
directory, and you are running version 0.88 of mutt, this file will be
sourced instead of the <code class="literal">Muttrc</code> file.  The same is true of the user
configuration file, if you have a file <code class="literal">.muttrc-0.88.6</code> in your home
directory, when you run mutt version 0.88.6, it will source this file
instead of the default <code class="literal">.muttrc</code> file.  The version number is the
same which is visible using the <span class="quote">“<span class="quote">-v</span>”</span> <a class="link" href="reference.html#commandline" title="1. Command line options">command line</a> switch or using the <code class="literal">show-version</code> key (default:
V) from the index menu.
</p></div><div class="sect1" title="2. Syntax of Initialization Files"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="muttrc-syntax"></a>2. Syntax of Initialization Files</h2></div></div></div><p>
An initialization file consists of a series of <a class="link" href="reference.html#commands" title="2. Configuration Commands">commands</a>.  Each line of the file may contain one or more commands.
When multiple commands are used, they must be separated by a semicolon
(;).
</p><div class="example"><a id="ex-rc-multiple-cmds"></a><p class="title"><strong>Example 3.1. Multiple configuration commands per line</strong></p><div class="example-contents"><pre class="screen">
set realname='Mutt user' ; ignore x-
</pre></div></div><br class="example-break" /><p>
The hash mark, or pound sign
(<span class="quote">“<span class="quote">#</span>”</span>), is used as a <span class="quote">“<span class="quote">comment</span>”</span> 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,
</p><div class="example"><a id="ex-ec-comment"></a><p class="title"><strong>Example 3.2. Commenting configuration files</strong></p><div class="example-contents"><pre class="screen">
my_hdr X-Disclaimer: Why are you listening to me? # This is a comment
</pre></div></div><br class="example-break" /><p>
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, backticks are evaluated inside of double
quotes, but <span class="bold"><strong>not</strong></span> for single quotes.
</p><p>
\ quotes the next character, just as in shells such as bash and zsh.
For example, if want to put quotes <span class="quote">“<span class="quote">"</span>”</span> inside of a string, you can use
<span class="quote">“<span class="quote">\</span>”</span> to force the next character to be a literal instead of interpreted
character.
</p><div class="example"><a id="ex-rc-quote"></a><p class="title"><strong>Example 3.3. Escaping quotes in congfiguration files</strong></p><div class="example-contents"><pre class="screen">
set realname="Michael \"MuttDude\" Elkins"
</pre></div></div><br class="example-break" /><p>
<span class="quote">“<span class="quote">\\</span>”</span> means to insert a literal <span class="quote">“<span class="quote">\</span>”</span> into the line.
<span class="quote">“<span class="quote">\n</span>”</span> and <span class="quote">“<span class="quote">\r</span>”</span> have their usual C meanings of linefeed and
carriage-return, respectively.
</p><p>
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.
</p><p>
It is also possible to substitute the output of a Unix command in an
initialization file.  This is accomplished by enclosing the command in
backticks (``).  For example,
</p><div class="example"><a id="ex-rc-backtick"></a><p class="title"><strong>Example 3.4. Using external command's output in configuration files</strong></p><div class="example-contents"><pre class="screen">
my_hdr X-Operating-System: `uname -a`
</pre></div></div><br class="example-break" /><p>
The output of the Unix command <span class="quote">“<span class="quote">uname -a</span>”</span> will be substituted before the
line is parsed.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
Since initialization files are line oriented, only
the first line of output from the Unix command will be substituted.
</p></div><p>
Both environment variables and mutt variables can be accessed by
prepending <span class="quote">“<span class="quote">$</span>”</span> to the name of the variable. For example,
</p><div class="example"><a id="ex-rc-env"></a><p class="title"><strong>Example 3.5. Using environment variables in configuration files</strong></p><div class="example-contents"><pre class="screen">
set record=+sent_on_$HOSTNAME
</pre></div></div><br class="example-break" /><p>
will cause mutt to save outgoing messages to a folder named
<span class="quote">“<span class="quote">sent_on_kremvax</span>”</span> if the environment variable HOSTNAME is set to
<span class="quote">“<span class="quote">kremvax.</span>”</span> (See <a class="link" href="reference.html#record" title="3.243. record">$record</a> for
details.)
</p><p>
Mutt expands the variable when it is assigned, not when it is used. If
the value of a variable on the right-hand side of an assignment
changes after the assignment, the variable on the left-hand side will
not be affected.
</p><p>
The commands understood by mutt are explained in the next paragraphs.
For a complete list, see the <a class="link" href="reference.html#commands" title="2. Configuration Commands">command reference</a>.
</p><p>
All configuration files are expected to be in the current locale as
specified by the <a class="link" href="reference.html#charset" title="3.25. charset">$charset</a> variable
which doesn't have a default value since it's determined by Mutt at startup.
If a configuration file is not encoded in the same character set the
<a class="link" href="reference.html#config-charset" title="3.30. config_charset">$config_charset</a>
variable should be used: all lines starting with the next are recoded
from $config_charset to $charset.
</p><p>
This mechanism should be avoided if possible as it has the
following implications:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>These variables should be set early in a configuration
file with $charset preceding $config_charset so Mutt
know what character set to convert to.</p></li><li class="listitem"><p>If $config_charset is set, it should be set
in each configuration file because the value is global and <span class="emphasis"><em>not</em></span>
per configuration file.</p></li><li class="listitem"><p>Because Mutt first recodes a line before it attempts to parse it,
a conversion introducing question marks or other characters as
part of errors (unconvertable characters, transliteration) may introduce syntax
errors or silently change the meaning of certain tokens (e.g. inserting
question marks into regular expressions).</p></li></ul></div></div><div class="sect1" title="3. Address groups"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="addrgroup"></a>3. Address groups</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">group</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...] { 
<code class="option">-rx</code>
<em class="replaceable"><code>expr</code></em>
...  |   
<code class="option">-addr</code>
<em class="replaceable"><code>expr</code></em>
... }</p></div><div class="cmdsynopsis"><p><code class="command">ungroup</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...] { 
<em class="replaceable"><code>*</code></em>
  |   
<code class="option">-rx</code>
<em class="replaceable"><code>expr</code></em>
...  |   
<code class="option">-addr</code>
<em class="replaceable"><code>expr</code></em>
... }</p></div><p>
<code class="literal">group</code> is used to directly add either addresses or
regular expressions to the specified group or groups. The different
categories of arguments to the <code class="literal">group</code> command can be
in any order. The flags <code class="literal">-rx</code> and
<code class="literal">-addr</code> specify what the following strings (that cannot
begin with a hyphen) should be interpreted as: either a regular
expression or an email address, respectively.
</p><p>
These address groups can also be created implicitly by the
<a class="link" href="configuration.html#alias" title="4. Defining/Using aliases">alias</a>, <a class="link" href="configuration.html#lists" title="12. Mailing lists">lists</a>,
<a class="link" href="configuration.html#lists" title="12. Mailing lists">subscribe</a> and
<a class="link" href="configuration.html#alternates" title="11. Alternative addresses">alternates</a> commands by specifying the
optional <code class="literal">-group</code> option.
</p><p>
Once defined, these address groups can be used in
<a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> to search for and limit the
display to messages matching a group.
</p><p>
<code class="literal">ungroup</code> is used to remove addresses or regular
expressions from the specified group or groups. The syntax is similar to
the <code class="literal">group</code> command, however the special character
<code class="literal">*</code> can be used to empty a group of all of its
contents.
</p></div><div class="sect1" title="4. Defining/Using aliases"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alias"></a>4. Defining/Using aliases</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">alias</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...]  
<em class="replaceable"><code>key</code></em>
   
<em class="replaceable"><code>address</code></em>
  [
<em class="replaceable"><code>address</code></em>
...]</p></div><p>
It's usually very cumbersome to remember or type out the address of someone
you are communicating with.  Mutt allows you to create <span class="quote">“<span class="quote">aliases</span>”</span> which map
a short string to a full address.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
If you want to create an alias for more than
one address, you <span class="bold"><strong>must</strong></span> separate the addresses with a comma (<span class="quote">“<span class="quote">,</span>”</span>).
</p></div><p>
The optional <code class="literal">-group</code> argument to
<code class="literal">alias</code> causes the aliased address(es) to be added to
the named <span class="emphasis"><em>group</em></span>.
</p><p>
To remove an alias or aliases (<span class="quote">“<span class="quote">*</span>”</span> means all aliases):
</p><div class="cmdsynopsis"><p><code class="command">unalias</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...] { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>key</code></em>
... }</p></div><pre class="screen">
alias muttdude me@cs.hmc.edu (Michael Elkins)
alias theguys manny, moe, jack
</pre><p>
Unlike other mailers, Mutt doesn't require aliases to be defined
in a special file.  The <code class="literal">alias</code> command can appear anywhere in
a configuration file, as long as this file is <a class="link" href="configuration.html#source" title="27. Reading initialization commands from another file">sourced</a>.  Consequently, you can have multiple alias files, or
you can have all aliases defined in your muttrc.
</p><p>
On the other hand, the <a class="link" href="gettingstarted.html#create-alias"><code class="literal">&lt;create-alias&gt;</code></a>
function can use only one file, the one pointed to by the <a class="link" href="reference.html#alias-file" title="3.3. alias_file">$alias_file</a> variable (which is
<code class="literal">˜/.muttrc</code> by default). This file is not special either,
in the sense that Mutt will happily append aliases to any file, but in
order for the new aliases to take effect you need to explicitly <a class="link" href="configuration.html#source" title="27. Reading initialization commands from another file">source</a> this file too.
</p><p>
For example:
</p><div class="example"><a id="ex-alias-external"></a><p class="title"><strong>Example 3.6. Configuring external alias files</strong></p><div class="example-contents"><pre class="screen">
source /usr/local/share/Mutt.aliases
source ~/.mail_aliases
set alias_file=~/.mail_aliases
</pre></div></div><br class="example-break" /><p>
To use aliases, you merely use the alias at any place in mutt where mutt
prompts for addresses, such as the <span class="emphasis"><em>To:</em></span> or <span class="emphasis"><em>Cc:</em></span> prompt.  You can
also enter aliases in your editor at the appropriate headers if you have the
<a class="link" href="reference.html#edit-headers" title="3.53. edit_headers">$edit_headers</a> variable set.
</p><p>
In addition, at the various address prompts, you can use the tab character
to expand a partial alias to the full alias.  If there are multiple matches,
mutt will bring up a menu with the matching aliases.  In order to be
presented with the full list of aliases, you must hit tab with out a partial
alias, such as at the beginning of the prompt or after a comma denoting
multiple addresses.
</p><p>
In the alias menu, you can select as many aliases as you want with the
<code class="literal">select-entry</code> key (default: &lt;Return&gt;), and use the
<span class="emphasis"><em>exit</em></span> key (default: q) to return to the address prompt.
</p></div><div class="sect1" title="5. Changing the default key bindings"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="bind"></a>5. Changing the default key bindings</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">bind</code>   
<em class="replaceable"><code>map</code></em>
   
<em class="replaceable"><code>key</code></em>
   
<em class="replaceable"><code>function</code></em>
 </p></div><p>
This command allows you to change the default key bindings (operation
invoked when pressing a key).
</p><p>
<span class="emphasis"><em>map</em></span> specifies in which menu the binding belongs.  Multiple maps may
be specified by separating them with commas (no additional whitespace is
allowed). The currently defined maps are:
</p><a id="maps"></a><div class="variablelist"><dl><dt><span class="term">generic</span></dt><dd><p>
This is not a real menu, but is used as a fallback for all of the other
menus except for the pager and editor modes.  If a key is not defined in
another menu, Mutt will look for a binding to use in this menu.  This allows
you to bind a key to a certain function in multiple menus instead of having
multiple bind statements to accomplish the same task.
</p></dd><dt><span class="term">alias</span></dt><dd><p>
The alias menu is the list of your personal aliases as defined in your
muttrc.  It is the mapping from a short alias name to the full email
address(es) of the recipient(s).
</p></dd><dt><span class="term">attach</span></dt><dd><p>
The attachment menu is used to access the attachments on received messages.
</p></dd><dt><span class="term">browser</span></dt><dd><p>
The browser is used for both browsing the local directory structure, and for
listing all of your incoming mailboxes.
</p></dd><dt><span class="term">editor</span></dt><dd><p>
The editor is the line-based editor the user enters text data.
</p></dd><dt><span class="term">index</span></dt><dd><p>
The index is the list of messages contained in a mailbox.
</p></dd><dt><span class="term">compose</span></dt><dd><p>
The compose menu is the screen used when sending a new message.
</p></dd><dt><span class="term">pager</span></dt><dd><p>
The pager is the mode used to display message/attachment data, and help
listings.
</p></dd><dt><span class="term">pgp</span></dt><dd><p>
The pgp menu is used to select the OpenPGP keys used to encrypt outgoing
messages.
</p></dd><dt><span class="term">smime</span></dt><dd><p>
The smime menu is used to select the OpenSSL certificates used to encrypt outgoing
messages.
</p></dd><dt><span class="term">postpone</span></dt><dd><p>
The postpone menu is similar to the index menu, except is used when
recalling a message the user was composing, but saved until later.
</p></dd><dt><span class="term">query</span></dt><dd><p>
The query menu is the browser for results returned by
<a class="link" href="reference.html#query-command" title="3.235. query_command">$query_command</a>.
</p></dd><dt><span class="term">mix</span></dt><dd><p>
The mixmaster screen is used to select remailer options for outgoing
messages (if Mutt is compiled with Mixmaster support).
</p></dd></dl></div><p>
<span class="emphasis"><em>key</em></span> is the key (or key sequence) you wish to bind.  To specify a
control character, use the sequence <span class="emphasis"><em>\Cx</em></span>, where <span class="emphasis"><em>x</em></span> is the
letter of the control character (for example, to specify control-A use
<span class="quote">“<span class="quote">\Ca</span>”</span>).  Note that the case of <span class="emphasis"><em>x</em></span> as well as <span class="emphasis"><em>\C</em></span> is
ignored, so that <span class="emphasis"><em>\CA</em></span>, <span class="emphasis"><em>\Ca</em></span>, <span class="emphasis"><em>\cA</em></span> and <span class="emphasis"><em>\ca</em></span> are all
equivalent.  An alternative form is to specify the key as a three digit
octal number prefixed with a <span class="quote">“<span class="quote">\</span>”</span> (for example <span class="emphasis"><em>\177</em></span> is
equivalent to <span class="emphasis"><em>\c?</em></span>). In addition, <span class="emphasis"><em>key</em></span> may
be a symbolic name as shown in <a class="xref" href="configuration.html#tab-key-names" title="Table 3.1. Symbolic key names">Table 3.1, “Symbolic key names”</a>.
</p><div class="table"><a id="tab-key-names"></a><p class="title"><strong>Table 3.1. Symbolic key names</strong></p><div class="table-contents"><table summary="Symbolic key names" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Symbolic name</th><th>Meaning</th></tr></thead><tbody><tr><td>\t</td><td>tab</td></tr><tr><td>&lt;tab&gt;</td><td>tab</td></tr><tr><td>&lt;backtab&gt;</td><td>backtab / shift-tab</td></tr><tr><td>\r</td><td>carriage return</td></tr><tr><td>\n</td><td>newline</td></tr><tr><td>\e</td><td>escape</td></tr><tr><td>&lt;esc&gt;</td><td>escape</td></tr><tr><td>&lt;up&gt;</td><td>up arrow</td></tr><tr><td>&lt;down&gt;</td><td>down arrow</td></tr><tr><td>&lt;left&gt;</td><td>left arrow</td></tr><tr><td>&lt;right&gt;</td><td>right arrow</td></tr><tr><td>&lt;pageup&gt;</td><td>Page Up</td></tr><tr><td>&lt;pagedown&gt;</td><td>Page Down</td></tr><tr><td>&lt;backspace&gt;</td><td>Backspace</td></tr><tr><td>&lt;delete&gt;</td><td>Delete</td></tr><tr><td>&lt;insert&gt;</td><td>Insert</td></tr><tr><td>&lt;enter&gt;</td><td>Enter</td></tr><tr><td>&lt;return&gt;</td><td>Return</td></tr><tr><td>&lt;home&gt;</td><td>Home</td></tr><tr><td>&lt;end&gt;</td><td>End</td></tr><tr><td>&lt;space&gt;</td><td>Space bar</td></tr><tr><td>&lt;f1&gt;</td><td>function key 1</td></tr><tr><td>&lt;f10&gt;</td><td>function key 10</td></tr></tbody></table></div></div><br class="table-break" /><p>
<span class="emphasis"><em>key</em></span> does not need to be enclosed in quotes unless it contains a
space (<span class="quote">“<span class="quote"> </span>”</span>) or semi-colon (<span class="quote">“<span class="quote">;</span>”</span>).
</p><p>
<span class="emphasis"><em>function</em></span> specifies which action to take when <span class="emphasis"><em>key</em></span> is pressed.
For a complete list of functions, see the <a class="link" href="reference.html#functions" title="4. Functions">reference</a>.  The special function <code class="literal">&lt;noop&gt;</code> unbinds the specified key
sequence.
</p></div><div class="sect1" title="6. Defining aliases for character sets"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="charset-hook"></a>6. Defining aliases for character sets </h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">charset-hook</code>   
<em class="replaceable"><code>alias</code></em>
   
<em class="replaceable"><code>charset</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">iconv-hook</code>   
<em class="replaceable"><code>charset</code></em>
   
<em class="replaceable"><code>local-charset</code></em>
 </p></div><p>
The <code class="literal">charset-hook</code> 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.
</p><p>
The <code class="literal">iconv-hook</code> command defines a system-specific name for a
character set.  This is helpful when your systems character
conversion library insists on using strange, system-specific names
for character sets.
</p></div><div class="sect1" title="7. Setting variables based upon mailbox"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="folder-hook"></a>7. Setting variables based upon mailbox</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">folder-hook</code>   
<em class="replaceable"><code>[!]regexp</code></em>
   
<em class="replaceable"><code>command</code></em>
 </p></div><p>
It is often desirable to change settings based on which mailbox you are
reading.  The folder-hook command provides a method by which you can execute
any configuration command.  <span class="emphasis"><em>regexp</em></span> is a regular expression specifying
in which mailboxes to execute <span class="emphasis"><em>command</em></span> before loading.  If a mailbox
matches multiple folder-hook's, they are executed in the order given in the
muttrc.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
If you use the <span class="quote">“<span class="quote">!</span>”</span> shortcut for <a class="link" href="reference.html#spoolfile" title="3.281. spoolfile">$spoolfile</a> at the beginning of the pattern, you must place it
inside of double or single quotes in order to distinguish it from the
logical <span class="emphasis"><em>not</em></span> operator for the expression.
</p></div><div class="note" title="Note"><h3 class="title">Note</h3><p>
Settings are <span class="emphasis"><em>not</em></span> restored when you leave the mailbox.
For example, a command action to perform is to change the sorting method
based upon the mailbox being read:
</p></div><pre class="screen">
folder-hook mutt set sort=threads
</pre><p>
However, the sorting method is not restored to its previous value when
reading a different mailbox.  To specify a <span class="emphasis"><em>default</em></span> command, use the
pattern <span class="quote">“<span class="quote">.</span>”</span> before other folder-hooks adjusting a value on a per-folder basis
because folder-hooks are evaluated in the order given in the configuration file.
The following example will set the <a class="link" href="reference.html#sort" title="3.275. sort">sort</a> variable
to <code class="literal">date-sent</code> for all folders but to <code class="literal">threads</code>
for all folders containing <span class="quote">“<span class="quote">mutt</span>”</span> in their name.
</p><div class="example"><a id="ex-folder-sorting"></a><p class="title"><strong>Example 3.7. Setting sort method based on mailbox name</strong></p><div class="example-contents"><pre class="screen">
folder-hook . set sort=date-sent
folder-hook mutt set sort=threads
</pre></div></div><br class="example-break" /></div><div class="sect1" title="8. Keyboard macros"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="macro"></a>8. Keyboard macros</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">macro</code>   
<em class="replaceable"><code>menu</code></em>
   
<em class="replaceable"><code>key</code></em>
   
<em class="replaceable"><code>sequence</code></em>
  [
<em class="replaceable"><code>description</code></em>
]</p></div><p>
Macros are useful when you would like a single key to perform a series of
actions.  When you press <span class="emphasis"><em>key</em></span> in menu <span class="emphasis"><em>menu</em></span>, Mutt will behave as if
you had typed <span class="emphasis"><em>sequence</em></span>.  So if you have a common sequence of commands
you type, you can create a macro to execute those commands with a single
key or fewer keys.
</p><p>
<span class="emphasis"><em>menu</em></span> is the <a class="link" href="configuration.html#maps">map</a> which the macro will be bound in.
Multiple maps may be specified by separating multiple menu arguments by
commas. Whitespace may not be used in between the menu arguments and the
commas separating them.
</p><p>
<span class="emphasis"><em>key</em></span> and <span class="emphasis"><em>sequence</em></span> are expanded by the same rules as the
<a class="link" href="configuration.html#bind" title="5. Changing the default key bindings">key bindings</a> with some additions.  The
first is that control characters in <span class="emphasis"><em>sequence</em></span> can also be specified
as <span class="emphasis"><em>^x</em></span>.  In order to get a caret (<span class="quote">“<span class="quote">^</span>”</span>) you need to use
<span class="emphasis"><em>^^</em></span>.  Secondly, to specify a certain key such as <span class="emphasis"><em>up</em></span>
or to invoke a function directly, you can use the format
<span class="emphasis"><em>&lt;key name&gt;</em></span> and <span class="emphasis"><em>&lt;function name&gt;</em></span>.  For a listing of key
names see the section on <a class="link" href="configuration.html#bind" title="5. Changing the default key bindings">key bindings</a>.  Functions
are listed in the <a class="link" href="reference.html#functions" title="4. Functions">reference</a>.
</p><p>
The advantage with using function names directly is that the macros will
work regardless of the current key bindings, so they are not dependent on
the user having particular key definitions.  This makes them more robust
and portable, and also facilitates defining of macros in files used by more
than one user (e.g., the system Muttrc).
</p><p>
Optionally you can specify a descriptive text after <span class="emphasis"><em>sequence</em></span>,
which is shown in the help screens.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
Macro definitions (if any) listed in the help screen(s), are
silently truncated at the screen width, and are not wrapped.
</p></div></div><div class="sect1" title="9. Using color and mono video attributes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="color"></a>9. Using color and mono video attributes</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">color</code>   
<em class="replaceable"><code>object</code></em>
   
<em class="replaceable"><code>foreground</code></em>
   
<em class="replaceable"><code>background</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">color</code>  { 
<code class="option">header</code>
  |   
<code class="option">body</code>
 }  
<em class="replaceable"><code>foreground</code></em>
   
<em class="replaceable"><code>background</code></em>
   
<em class="replaceable"><code>regexp</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">color</code>   
<code class="option">index</code>
   
<em class="replaceable"><code>foreground</code></em>
   
<em class="replaceable"><code>background</code></em>
   
<em class="replaceable"><code>pattern</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">uncolor</code>   
<code class="option">index</code>
  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>pattern</code></em>
... }</p></div><p>
If your terminal supports color, you can spice up Mutt by creating your own
color scheme.  To define the color of an object (type of information), you
must specify both a foreground color <span class="bold"><strong>and</strong></span> a background color (it is not
possible to only specify one or the other).
</p><p>
<span class="emphasis"><em>header</em></span> and <span class="emphasis"><em>body</em></span> match <span class="emphasis"><em>regexp</em></span>
in the header/body of a message, <span class="emphasis"><em>index</em></span> matches <span class="emphasis"><em>pattern</em></span>
(see <a class="xref" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">Section 2, “Patterns: Searching, Limiting and Tagging”</a>) in the message index.
</p><p>
<span class="emphasis"><em>object</em></span> can be one of:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>attachment</p></li><li class="listitem"><p>bold (hiliting bold patterns in the body of messages)</p></li><li class="listitem"><p>error (error messages printed by Mutt)</p></li><li class="listitem"><p>hdrdefault (default color of the message header in the pager)</p></li><li class="listitem"><p>indicator (arrow or bar used to indicate the current item in a menu)</p></li><li class="listitem"><p>markers (the <span class="quote">“<span class="quote">+</span>”</span> markers at the beginning of wrapped lines in the pager)</p></li><li class="listitem"><p>message (informational messages)</p></li><li class="listitem"><p>normal</p></li><li class="listitem"><p>quoted (text matching <a class="link" href="reference.html#quote-regexp" title="3.238. quote_regexp">$quote_regexp</a> in the body of a message)</p></li><li class="listitem"><p>quoted1, quoted2, ..., quoted<span class="bold"><strong>N</strong></span> (higher levels of quoting)</p></li><li class="listitem"><p>search (hiliting of words in the pager)</p></li><li class="listitem"><p>signature</p></li><li class="listitem"><p>status (mode lines used to display info about the mailbox or message)</p></li><li class="listitem"><p>tilde (the <span class="quote">“<span class="quote">˜</span>”</span> used to pad blank lines in the pager)</p></li><li class="listitem"><p>tree (thread tree drawn in the message index and attachment menu)</p></li><li class="listitem"><p>underline (hiliting underlined patterns in the body of messages)</p></li></ul></div><p>
<span class="emphasis"><em>foreground</em></span> and <span class="emphasis"><em>background</em></span> can be one of the following:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>white</p></li><li class="listitem"><p>black</p></li><li class="listitem"><p>green</p></li><li class="listitem"><p>magenta</p></li><li class="listitem"><p>blue</p></li><li class="listitem"><p>cyan</p></li><li class="listitem"><p>yellow</p></li><li class="listitem"><p>red</p></li><li class="listitem"><p>default</p></li><li class="listitem"><p>color<span class="emphasis"><em>x</em></span></p></li></ul></div><p>
<span class="emphasis"><em>foreground</em></span> can optionally be prefixed with the keyword <code class="literal">bright</code> to make
the foreground color boldfaced (e.g., <code class="literal">brightred</code>).
</p><p>
If your terminal supports it, the special keyword <span class="emphasis"><em>default</em></span> can be
used as a transparent color.  The value <span class="emphasis"><em>brightdefault</em></span> is also valid.
If Mutt is linked against the <span class="emphasis"><em>S-Lang</em></span> library, you also need to set
the <span class="emphasis"><em>COLORFGBG</em></span> environment variable to the default colors of your
terminal for this to work; for example (for Bourne-like shells):
</p><pre class="screen">
set COLORFGBG="green;black"
export COLORFGBG
</pre><div class="note" title="Note"><h3 class="title">Note</h3><p>
The <span class="emphasis"><em>S-Lang</em></span> library requires you to use the <span class="emphasis"><em>lightgray</em></span>
and <span class="emphasis"><em>brown</em></span> keywords instead of <span class="emphasis"><em>white</em></span> and <span class="emphasis"><em>yellow</em></span> when
setting this variable.
</p></div><div class="note" title="Note"><h3 class="title">Note</h3><p>
The uncolor command can be applied to the index object only.  It
removes entries from the list. You <span class="bold"><strong>must</strong></span> specify the same pattern
specified in the color command for it to be removed.  The pattern <span class="quote">“<span class="quote">*</span>”</span> is
a special token which means to clear the color index list of all entries.
</p></div><p>
Mutt also recognizes the keywords <span class="emphasis"><em>color0</em></span>, <span class="emphasis"><em>color1</em></span>, …,
<span class="emphasis"><em>color</em></span><span class="bold"><strong>N-1</strong></span> (<span class="bold"><strong>N</strong></span> being the number of colors supported
by your terminal).  This is useful when you remap the colors for your
display (for example by changing the color associated with <span class="emphasis"><em>color2</em></span>
for your xterm), since color names may then lose their normal meaning.
</p><p>
If your terminal does not support color, it is still possible change the video
attributes through the use of the <span class="quote">“<span class="quote">mono</span>”</span> command:
</p><a id="mono"></a><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">mono</code>   
<em class="replaceable"><code>object</code></em>
   
<em class="replaceable"><code>attribute</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">mono</code>  { 
<code class="option">header</code>
  |   
<code class="option">body</code>
 }  
<em class="replaceable"><code>attribute</code></em>
   
<em class="replaceable"><code>regexp</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">mono</code>   
<code class="option">index</code>
   
<em class="replaceable"><code>attribute</code></em>
   
<em class="replaceable"><code>pattern</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">unmono</code>   
<code class="option">index</code>
  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>pattern</code></em>
... }</p></div><p>
For <span class="emphasis"><em>object</em></span>, see the color command. <span class="emphasis"><em>attribute</em></span>
can be one of the following:
</p><div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem"><p>none</p></li><li class="listitem"><p>bold</p></li><li class="listitem"><p>underline</p></li><li class="listitem"><p>reverse</p></li><li class="listitem"><p>standout</p></li></ul></div></div><div class="sect1" title="10. Message header display"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="ignore"></a>10. Message header display</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">ignore</code>   
<em class="replaceable"><code>pattern</code></em>
  [
<em class="replaceable"><code>pattern</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unignore</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>pattern</code></em>
... }</p></div><p>
Messages often have many header fields added by automatic processing systems,
or which may not seem useful to display on the screen.  This command allows
you to specify header fields which you don't normally want to see in the pager.
</p><p>
You do not need to specify the full header field name.  For example,
<span class="quote">“<span class="quote">ignore content-</span>”</span> will ignore all header fields that begin with the pattern
<span class="quote">“<span class="quote">content-</span>”</span>. <span class="quote">“<span class="quote">ignore *</span>”</span> will ignore all headers.
</p><p>
To remove a previously added token from the list, use the <span class="quote">“<span class="quote">unignore</span>”</span> command.
The <span class="quote">“<span class="quote">unignore</span>”</span> command will make Mutt display headers with the given pattern.
For example, if you do <span class="quote">“<span class="quote">ignore x-</span>”</span> it is possible to <span class="quote">“<span class="quote">unignore x-mailer</span>”</span>.
</p><p>
<span class="quote">“<span class="quote">unignore *</span>”</span> will remove all tokens from the ignore list.
</p><p>
For example:
</p><div class="example"><a id="ex-header-weeding"></a><p class="title"><strong>Example 3.8. Header weeding</strong></p><div class="example-contents"><pre class="screen">
# Sven's draconian header weeding
ignore *
unignore from date subject to cc
unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
unignore posted-to:
</pre></div></div><br class="example-break" /><a id="hdr-order"></a><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">hdr_order</code>   
<em class="replaceable"><code>header</code></em>
  [
<em class="replaceable"><code>header</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unhdr_order</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>header</code></em>
... }</p></div><p>
With the <code class="literal">hdr_order</code> command you can specify an order in
which mutt will attempt to present these headers to you when viewing messages.
</p><p>
<span class="quote">“<span class="quote">unhdr_order *</span>”</span> will clear all previous headers from the order list,
thus removing the header order effects set by the system-wide startup file.
</p><div class="example"><a id="ex-hdr-order"></a><p class="title"><strong>Example 3.9. Configuring header display order</strong></p><div class="example-contents"><pre class="screen">
hdr_order From Date: From: To: Cc: Subject:
</pre></div></div><br class="example-break" /></div><div class="sect1" title="11. Alternative addresses"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alternates"></a>11. Alternative addresses</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">alternates</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...]  
<em class="replaceable"><code>regexp</code></em>
  [
<em class="replaceable"><code>regexp</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unalternates</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...] { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>regexp</code></em>
... }</p></div><p>
With various functions, mutt will treat messages differently,
depending on whether you sent them or whether you received them from
someone else.  For instance, when replying to a message that you
sent to a different party, mutt will automatically suggest to send
the response to the original message's recipients -- responding to
yourself won't make much sense in many cases.  (See <a class="link" href="reference.html#reply-to" title="3.246. reply_to">$reply_to</a>.)
</p><p>
Many users receive e-mail under a number of different addresses. To
fully use mutt's features here, the program must be able to
recognize what e-mail addresses you receive mail under. That's the
purpose of the <code class="literal">alternates</code> command: It takes a list of regular
expressions, each of which can identify an address under which you
receive e-mail.
</p><p>
As addresses are matched using regular expressions and not exact strict
comparisons, you should make sure you specify your addresses as precise
as possible to avoid mismatches. For example, if you specify:
</p><pre class="screen">
alternates user@example
</pre><p>
mutt will consider <span class="quote">“<span class="quote"><code class="literal">some-user@example</code></span>”</span> as
being your address, too which may not be desired. As a solution, in such
cases addresses should be specified as:
</p><pre class="screen">
alternates '^user@example$'
</pre><p>
The <code class="literal">-group</code> flag causes all of the subsequent regular expressions
to be added to the named group.
</p><p>
The <code class="literal">unalternates</code> command can be used to write exceptions to
<code class="literal">alternates</code> patterns. If an address matches something in an
<code class="literal">alternates</code> command, but you nonetheless do not think it is
from you, you can list a more precise pattern under an <code class="literal">unalternates</code>
command.
</p><p>
To remove a regular expression from the <code class="literal">alternates</code> list, use the
<code class="literal">unalternates</code> command with exactly the same <span class="emphasis"><em>regexp</em></span>.
Likewise, if the <span class="emphasis"><em>regexp</em></span> for an <code class="literal">alternates</code> command matches
an entry on the <code class="literal">unalternates</code> list, that <code class="literal">unalternates</code>
entry will be removed. If the <span class="emphasis"><em>regexp</em></span> for <code class="literal">unalternates</code>
is <span class="quote">“<span class="quote">*</span>”</span>, <span class="emphasis"><em>all entries</em></span> on <code class="literal">alternates</code> will be removed.
</p></div><div class="sect1" title="12. Mailing lists"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lists"></a>12. Mailing lists</h2></div></div></div><a id="subscribe"></a><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">lists</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...]  
<em class="replaceable"><code>regexp</code></em>
  [
<em class="replaceable"><code>regexp</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unlists</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...] { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>regexp</code></em>
... }</p></div><div class="cmdsynopsis"><p><code class="command">subscribe</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...]  
<em class="replaceable"><code>regexp</code></em>
  [
<em class="replaceable"><code>regexp</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unsubscribe</code>  [
<code class="option">-group</code>
<em class="replaceable"><code>name</code></em>
...] { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>regexp</code></em>
... }</p></div><p>
Mutt has a few nice features for <a class="link" href="advancedusage.html#using-lists" title="8. Handling Mailing Lists">handling mailing lists</a>.  In order to take advantage of them, you must
specify which addresses belong to mailing lists, and which mailing
lists you are subscribed to.  Once you have done this, the <a class="link" href="gettingstarted.html#list-reply"><code class="literal">&lt;list-reply&gt;</code></a> function will work for all known lists.
Additionally, when you send a message to a subscribed list, mutt will
add a Mail-Followup-To header to tell other users' mail user agents
not to send copies of replies to your personal address.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
The Mail-Followup-To header is a non-standard extension which is not
supported by all mail user agents.  Adding it is not bullet-proof against
receiving personal CCs of list messages.  Also note that the generation
of the Mail-Followup-To header is controlled by the
<a class="link" href="reference.html#followup-to" title="3.63. followup_to">$followup_to</a>
configuration variable.
</p></div><p>
More precisely, Mutt maintains lists of patterns for the addresses
of known and subscribed mailing lists.  Every subscribed mailing
list is known. To mark a mailing list as known, use the <span class="quote">“<span class="quote">lists</span>”</span>
command.  To mark it as subscribed, use <span class="quote">“<span class="quote">subscribe</span>”</span>.
</p><p>
You can use regular expressions with both commands.  To mark all
messages sent to a specific bug report's address on mutt's bug
tracking system as list mail, for instance, you could say
<span class="quote">“<span class="quote">subscribe [0-9]*@bugs.guug.de</span>”</span>.  Often, it's sufficient to just
give a portion of the list's e-mail address.
</p><p>
Specify as much of the address as you need to to remove ambiguity.  For
example, if you've subscribed to the Mutt mailing list, you will receive mail
addressed to <span class="emphasis"><em>mutt-users@mutt.org</em></span>.  So, to tell Mutt
that this is a mailing list, you could add <span class="quote">“<span class="quote">lists mutt-users@</span>”</span> to your
initialization file.  To tell mutt that you are subscribed to it,
add <span class="quote">“<span class="quote">subscribe mutt-users</span>”</span> to your initialization file instead.
If you also happen to get mail from someone whose address is
<span class="emphasis"><em>mutt-users@example.com</em></span>, you could use
<span class="quote">“<span class="quote">lists ^mutt-users@mutt\\.org$</span>”</span>
or <span class="quote">“<span class="quote">subscribe ^mutt-users@mutt\\.org$</span>”</span> to
match only mail from the actual list.
</p><p>
The <code class="literal">-group</code> flag adds all of the subsequent regular expressions
to the named group.
</p><p>
The <span class="quote">“<span class="quote">unlists</span>”</span> command is used to remove a token from the list of
known and subscribed mailing-lists. Use <span class="quote">“<span class="quote">unlists *</span>”</span> to remove all
tokens.
</p><p>
To remove a mailing list from the list of subscribed mailing lists,
but keep it on the list of known mailing lists, use <span class="quote">“<span class="quote">unsubscribe</span>”</span>.
</p></div><div class="sect1" title="13. Using Multiple spool mailboxes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mbox-hook"></a>13. Using Multiple spool mailboxes</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">mbox-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>mailbox</code></em>
 </p></div><p>
This command is used to move read messages from a specified mailbox to a
different mailbox automatically when you quit or change folders.
<span class="emphasis"><em>pattern</em></span> is a regular expression specifying the mailbox to treat as a
<span class="quote">“<span class="quote">spool</span>”</span> mailbox and <span class="emphasis"><em>mailbox</em></span> specifies where mail should be saved when
read.
</p><p>
Unlike some of the other <span class="emphasis"><em>hook</em></span> commands, only the <span class="emphasis"><em>first</em></span> matching
pattern is used (it is not possible to save read mail in more than a single
mailbox).
</p></div><div class="sect1" title="14. Monitoring incoming mail"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mailboxes"></a>14. Monitoring incoming mail</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">mailboxes</code>   
<em class="replaceable"><code>mailbox</code></em>
  [
<em class="replaceable"><code>mailbox</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unmailboxes</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>mailbox</code></em>
... }</p></div><p>
This command specifies folders which can receive mail and
which will be checked for new messages periodically.
</p><p>
<span class="emphasis"><em>folder</em></span> can either be a local file or directory
(Mbox/Mmdf or Maildir/Mh). If Mutt was built with POP and/or IMAP
support, <span class="emphasis"><em>folder</em></span> can also be a POP/IMAP folder
URL. The URL syntax is described in <a class="xref" href="optionalfeatures.html#url-syntax" title="1.2. URL syntax">Section 1.2, “URL syntax”</a>,
POP and IMAP are described in <a class="xref" href="optionalfeatures.html#pop" title="3. POP3 Support">Section 3, “POP3 Support”</a> and <a class="xref" href="optionalfeatures.html#imap" title="4. IMAP Support">Section 4, “IMAP Support”</a>
respectively.
</p><p>
Mutt provides a number of advanced features for handling (possibly many)
folders and new mail within them, please refer to
<a class="xref" href="advancedusage.html#handling-folders" title="9. Handling multiple folders">Section 9, “Handling multiple folders”</a> for details (including in what
situations and how often Mutt checks for new mail).
</p><p>
The <span class="quote">“<span class="quote">unmailboxes</span>”</span> command is used to remove a token from the list
of folders which receive mail. Use <span class="quote">“<span class="quote">unmailboxes *</span>”</span> to remove all
tokens.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
The folders in the <code class="literal">mailboxes</code> command are resolved when
the command is executed, so if these names contain <a class="link" href="advancedusage.html#shortcuts" title="7. Mailbox Shortcuts">shortcut characters</a> (such as <span class="quote">“<span class="quote">=</span>”</span> and <span class="quote">“<span class="quote">!</span>”</span>), any variable
definition that affects these characters (like <a class="link" href="reference.html#folder" title="3.61. folder">$folder</a> and <a class="link" href="reference.html#spoolfile" title="3.281. spoolfile">$spoolfile</a>)
should be set before the <code class="literal">mailboxes</code> command. If
none of these shorcuts are used, a local path should be absolute as
otherwise mutt tries to find it relative to the directory
from where mutt was started which may not always be desired.
</p></div><p>
For Mbox and Mmdf folders, new mail is detected by comparing access and/or
modification times of files: Mutt assumes a folder has new mail if it wasn't
accessed after it was last modified. Utilities like <code class="literal">biff</code> or
<code class="literal">frm</code> or any other program which accesses the mailbox might cause
Mutt to never detect new mail for that mailbox if they do not properly reset the
access time. Other possible causes of Mutt not detecting new mail in these folders
are backup tools (updating access times) or filesystems mounted without
access time update support.
</p><p>
In cases where new mail detection for Mbox or Mmdf folders appears to be
unreliable, the
<a class="link" href="reference.html#check-mbox-size" title="3.24. check_mbox_size">$check_mbox_size</a>
option can be used to make Mutt track and consult file sizes for new
mail detection instead.
</p></div><div class="sect1" title="15. User defined headers"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="my-hdr"></a>15. User defined headers</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">my_hdr</code>   
<em class="replaceable"><code>string</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">unmy_hdr</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>field</code></em>
... }</p></div><p>
The <code class="literal">my_hdr</code> command allows you to create your own header
fields which will be added to every message you send.
</p><p>
For example, if you would like to add an <span class="quote">“<span class="quote">Organization:</span>”</span> header field to
all of your outgoing messages, you can put the command
</p><div class="example"><a id="ex-my-hdr"></a><p class="title"><strong>Example 3.10. Defining custom headers</strong></p><div class="example-contents"><pre class="screen">
my_hdr Organization: A Really Big Company, Anytown, USA
</pre></div></div><br class="example-break" /><p>
in your <code class="literal">.muttrc</code>.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
Space characters are <span class="emphasis"><em>not</em></span> allowed between the keyword and
the colon (<span class="quote">“<span class="quote">:</span>”</span>). The standard for electronic mail (RFC2822) says that
space is illegal there, so Mutt enforces the rule.
</p></div><p>
If you would like to add a header field to a single message, you should
either set the <a class="link" href="reference.html#edit-headers" title="3.53. edit_headers">$edit_headers</a> variable,
or use the <code class="literal">&lt;edit-headers&gt;</code> function (default: <span class="quote">“<span class="quote">E</span>”</span>) in the compose menu so
that you can edit the header of your message along with the body.
</p><p>
To remove user defined header fields, use the <code class="literal">unmy_hdr</code>
command. You may specify an asterisk (<span class="quote">“<span class="quote">*</span>”</span>) to remove all header
fields, or the fields to remove. For example, to remove all <span class="quote">“<span class="quote">To</span>”</span> and
<span class="quote">“<span class="quote">Cc</span>”</span> header fields, you could use:
</p><pre class="screen">
unmy_hdr to cc
</pre></div><div class="sect1" title="16. Specify default save mailbox"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="save-hook"></a>16. Specify default save mailbox</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">save-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>mailbox</code></em>
 </p></div><p>
This command is used to override the default mailbox used when saving
messages. <span class="emphasis"><em>mailbox</em></span> will be used as the default if the message
matches <span class="emphasis"><em>pattern</em></span>, see <a class="xref" href="advancedusage.html#pattern-hook" title="4.1. Message Matching in Hooks">Message Matching in Hooks</a> for information
on the exact format.
</p><p>
To provide more flexibility and good defaults, Mutt applies the
expandos of <a class="link" href="reference.html#index-format" title="3.104. index_format">$index_format</a> to
<span class="emphasis"><em>mailbox</em></span> after it was expanded.
</p><p>
Examples:
</p><div class="example"><a id="ex-save-hook-exando"></a><p class="title"><strong>Example 3.11. Using %-expandos in <code class="literal">save-hook</code></strong></p><div class="example-contents"><pre class="screen">
# default: save all to ~/Mail/&lt;author name&gt;
save-hook . ~/Mail/%F

# save from me@turing.cs.hmc.edu and me@cs.hmc.edu to $folder/elkins
save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins

# save from aol.com to $folder/spam
save-hook aol\\.com$ +spam
</pre></div></div><br class="example-break" /><p>
Also see the <a class="link" href="configuration.html#fcc-save-hook" title="18. Specify default save filename and default Fcc: mailbox at once">fcc-save-hook</a> command.
</p></div><div class="sect1" title="17. Specify default Fcc: mailbox when composing"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="fcc-hook"></a>17. Specify default Fcc: mailbox when composing</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">fcc-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>mailbox</code></em>
 </p></div><p>
This command is used to save outgoing mail in a mailbox other than
<a class="link" href="reference.html#record" title="3.243. record">$record</a>.  Mutt searches the initial list of
message recipients for the first matching <span class="emphasis"><em>regexp</em></span> and uses <span class="emphasis"><em>mailbox</em></span>
as the default Fcc: mailbox.  If no match is found the message will be saved
to <a class="link" href="reference.html#record" title="3.243. record">$record</a> mailbox.
</p><p>
To provide more flexibility and good defaults, Mutt applies the
expandos of <a class="link" href="reference.html#index-format" title="3.104. index_format">$index_format</a> to
<span class="emphasis"><em>mailbox</em></span> after it was expanded.
</p><p>
See <a class="xref" href="advancedusage.html#pattern-hook" title="4.1. Message Matching in Hooks">Message Matching in Hooks</a> for information on the exact format of <span class="emphasis"><em>pattern</em></span>.
</p><p>
Example: <code class="literal">fcc-hook [@.]aol\\.com$ +spammers</code>
</p><p>
The above will save a copy of all messages going to the aol.com domain to
the `+spammers' mailbox by default.  Also see the <a class="link" href="configuration.html#fcc-save-hook" title="18. Specify default save filename and default Fcc: mailbox at once">fcc-save-hook</a> command.
</p></div><div class="sect1" title="18. Specify default save filename and default Fcc: mailbox at once"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="fcc-save-hook"></a>18. Specify default save filename and default Fcc: mailbox at once</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">fcc-save-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>mailbox</code></em>
 </p></div><p>
This command is a shortcut, equivalent to doing both a <a class="link" href="configuration.html#fcc-hook" title="17. Specify default Fcc: mailbox when composing">fcc-hook</a>
and a <a class="link" href="configuration.html#save-hook" title="16. Specify default save mailbox">save-hook</a> with its arguments,
including %-expansion on <span class="emphasis"><em>mailbox</em></span> according
to <a class="link" href="reference.html#index-format" title="3.104. index_format">$index_format</a>.
</p></div><div class="sect1" title="19. Change settings based upon message recipients"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="send-hook"></a>19. Change settings based upon message recipients</h2></div></div></div><a id="reply-hook"></a><a id="send2-hook"></a><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">reply-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>command</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">send-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>command</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">send2-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>command</code></em>
 </p></div><p>
These commands can be used to execute arbitrary configuration commands based
upon recipients of the message.  <span class="emphasis"><em>pattern</em></span> is used to match
the message, see <a class="xref" href="advancedusage.html#pattern-hook" title="4.1. Message Matching in Hooks">Message Matching in Hooks</a> for details. <span class="emphasis"><em>command</em></span>
is executed when <span class="emphasis"><em>pattern</em></span> matches.
</p><p>
<code class="literal">reply-hook</code> is matched against the message you are <span class="emphasis"><em>replying to</em></span>,
instead of the message you are <span class="emphasis"><em>sending</em></span>.  <code class="literal">send-hook</code> is
matched against all messages, both <span class="emphasis"><em>new</em></span>
and <span class="emphasis"><em>replies</em></span>.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
<code class="literal">reply-hook</code>s are matched <span class="bold"><strong>before</strong></span> the <code class="literal">send-hook</code>, <span class="bold"><strong>regardless</strong></span>
of the order specified in the user's configuration file.
</p></div><p>
<code class="literal">send2-hook</code> is matched every time a message is changed, either
by editing it, or by using the compose menu to change its recipients
or subject.  <code class="literal">send2-hook</code> is executed after <code class="literal">send-hook</code>, and
can, e.g., be used to set parameters such as the <a class="link" href="reference.html#sendmail" title="3.262. sendmail">$sendmail</a> variable depending on the message's sender
address.
</p><p>
For each type of <code class="literal">send-hook</code> or <code class="literal">reply-hook</code>, when multiple matches
occur, commands are executed in the order they are specified in the muttrc
(for that type of hook).
</p><p>
Example: <code class="literal">send-hook mutt "set mime_forward signature=''"</code>
</p><p>
Another typical use for this command is to change the values of the
<a class="link" href="reference.html#attribution" title="3.16. attribution">$attribution</a>, <a class="link" href="reference.html#signature" title="3.267. signature">$signature</a> and <a class="link" href="reference.html#locale" title="3.107. locale">$locale</a>
variables in order to change the language of the attributions and
signatures based upon the recipients.
</p><div class="note" title="Note"><h3 class="title">Note</h3><p>
send-hook's are only executed once after getting the initial
list of recipients.  Adding a recipient after replying or editing the
message will not cause any send-hook to be executed.  Also note that
<code class="literal">my_hdr</code> commands which modify recipient headers, or the message's
subject, don't have any effect on the current message when executed
from a send-hook.
</p></div></div><div class="sect1" title="20. Change settings before formatting a message"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="message-hook"></a>20. Change settings before formatting a message</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">message-hook</code>   
<em class="replaceable"><code>[!]pattern</code></em>
   
<em class="replaceable"><code>command</code></em>
 </p></div><p>
This command can be used to execute arbitrary configuration commands
before viewing or formatting a message based upon information about the message.
<span class="emphasis"><em>command</em></span> is executed if the <span class="emphasis"><em>pattern</em></span> matches the message to be
displayed. When multiple matches occur, commands are executed in the order
they are specified in the muttrc.
</p><p>
See <a class="xref" href="advancedusage.html#pattern-hook" title="4.1. Message Matching in Hooks">Message Matching in Hooks</a> for
information on the exact format of <span class="emphasis"><em>pattern</em></span>.
</p><p>
Example:
</p><pre class="screen">
message-hook ~A 'set pager=builtin'
message-hook '~f freshmeat-news' 'set pager="less \"+/^  subject: .*\""'
</pre></div><div class="sect1" title="21. Choosing the cryptographic key of the recipient"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="crypt-hook"></a>21. Choosing the cryptographic key of the recipient</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">crypt-hook</code>   
<em class="replaceable"><code>pattern</code></em>
   
<em class="replaceable"><code>keyid</code></em>
 </p></div><p>
When encrypting messages with PGP/GnuPG or OpenSSL, you may want to associate a certain
key with a given e-mail address automatically, either because the
recipient's public key can't be deduced from the destination address,
or because, for some reasons, you need to override the key Mutt would
normally use.  The <code class="literal">crypt-hook</code> 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.
</p><p>
The meaning of <span class="emphasis"><em>keyid</em></span> is to be taken broadly in this context:  You
can either put a numerical key ID here, an e-mail address, or even
just a real name.
</p></div><div class="sect1" title="22. Adding key sequences to the keyboard buffer"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="push"></a>22. Adding key sequences to the keyboard buffer</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">push</code>   
<em class="replaceable"><code>string</code></em>
 </p></div><p>
This command adds the named string to the keyboard buffer. The string may
contain control characters, key names and function names like the sequence
string in the <a class="link" href="configuration.html#macro" title="8. Keyboard macros">macro</a> command. You may use it to
automatically run a sequence of commands at startup, or when entering
certain folders. For example, the following command will automatically
collapse all threads when entering a folder:
</p><div class="example"><a id="ex-folder-hook-push"></a><p class="title"><strong>Example 3.12. Embedding <code class="literal">push</code> in <code class="literal">folder-hook</code></strong></p><div class="example-contents"><pre class="screen">
folder-hook . 'push &lt;collapse-all&gt;'
</pre></div></div><br class="example-break" /></div><div class="sect1" title="23. Executing functions"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="exec"></a>23. Executing functions</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">exec</code>   
<em class="replaceable"><code>function</code></em>
  [
<em class="replaceable"><code>function</code></em>
...]</p></div><p>
This command can be used to execute any function. Functions are
listed in the <a class="link" href="reference.html#functions" title="4. Functions">function reference</a>.
<span class="quote">“<span class="quote">exec function</span>”</span> is equivalent to <span class="quote">“<span class="quote">push &lt;function&gt;</span>”</span>.
</p></div><div class="sect1" title="24. Message Scoring"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="score-command"></a>24. Message Scoring</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">score</code>   
<em class="replaceable"><code>pattern</code></em>
   
<em class="replaceable"><code>value</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">unscore</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>pattern</code></em>
... }</p></div><p>
The <code class="literal">score</code> commands adds <span class="emphasis"><em>value</em></span> to a message's score if <span class="emphasis"><em>pattern</em></span>
matches it.  <span class="emphasis"><em>pattern</em></span> is a string in the format described in the <a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> section (note: For efficiency reasons, patterns
which scan information not available in the index, such as <code class="literal">˜b</code>,
<code class="literal">˜B</code> or <code class="literal">˜h</code>, may not be used).  <span class="emphasis"><em>value</em></span> is a
positive or negative integer.  A message's final score is the sum total of all
matching <code class="literal">score</code> entries.  However, you may optionally prefix <span class="emphasis"><em>value</em></span> with
an equal sign (=) to cause evaluation to stop at a particular entry if there is
a match.  Negative final scores are rounded up to 0.
</p><p>
The <code class="literal">unscore</code> command removes score entries from the list.  You <span class="bold"><strong>must</strong></span>
specify the same pattern specified in the <code class="literal">score</code> command for it to be
removed.  The pattern <span class="quote">“<span class="quote">*</span>”</span> is a special token which means to clear the list
of all score entries.
</p></div><div class="sect1" title="25. Spam detection"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="spam"></a>25. Spam detection</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">spam</code>   
<em class="replaceable"><code>pattern</code></em>
   
<em class="replaceable"><code>format</code></em>
 </p></div><div class="cmdsynopsis"><p><code class="command">nospam</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>pattern</code></em>
 }</p></div><p>
Mutt has generalized support for external spam-scoring filters.
By defining your spam patterns with the <code class="literal">spam</code> and <code class="literal">nospam</code>
commands, you can <span class="emphasis"><em>limit</em></span>, <span class="emphasis"><em>search</em></span>, and <span class="emphasis"><em>sort</em></span> your
mail based on its spam attributes, as determined by the external
filter. You also can display the spam attributes in your index
display using the <code class="literal">%H</code> selector in the <a class="link" href="reference.html#index-format" title="3.104. index_format">$index_format</a> variable. (Tip: try <code class="literal">%?H?[%H] ?</code>
to display spam tags only when they are defined for a given message.)
</p><p>
Your first step is to define your external filter's spam patterns using
the <code class="literal">spam</code> command. <span class="emphasis"><em>pattern</em></span> should be a regular expression
that matches a header in a mail message. If any message in the mailbox
matches this regular expression, it will receive a <span class="quote">“<span class="quote">spam tag</span>”</span> or
<span class="quote">“<span class="quote">spam attribute</span>”</span> (unless it also matches a <code class="literal">nospam</code> pattern -- see
below.) The appearance of this attribute is entirely up to you, and is
governed by the <span class="emphasis"><em>format</em></span> parameter. <span class="emphasis"><em>format</em></span> can be any static
text, but it also can include back-references from the <span class="emphasis"><em>pattern</em></span>
expression. (A regular expression <span class="quote">“<span class="quote">back-reference</span>”</span> refers to a
sub-expression contained within parentheses.) <code class="literal">%1</code> is replaced with
the first back-reference in the regex, <code class="literal">%2</code> with the second, etc.
</p><p>
If you're using multiple spam filters, a message can have more than
one spam-related header. You can define <code class="literal">spam</code> patterns for each
filter you use. If a message matches two or more of these patterns, and
the $spam_separator variable is set to a string, then the
message's spam tag will consist of all the <span class="emphasis"><em>format</em></span> strings joined
together, with the value of $spam_separator separating
them.
</p><p>
For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
define these spam settings:
</p><div class="example"><a id="ex-spam"></a><p class="title"><strong>Example 3.13. Configuring spam detection</strong></p><div class="example-contents"><pre class="screen">
spam "X-DCC-.*-Metrics:.*(....)=many"         "90+/DCC-%1"
spam "X-Spam-Status: Yes"                     "90+/SA"
spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
set spam_separator=", "
</pre></div></div><br class="example-break" /><p>
If I then received a message that DCC registered with <span class="quote">“<span class="quote">many</span>”</span> hits
under the <span class="quote">“<span class="quote">Fuz2</span>”</span> checksum, and that PureMessage registered with a
97% probability of being spam, that message's spam tag would read
<code class="literal">90+/DCC-Fuz2, 97/PM</code>. (The four characters before <span class="quote">“<span class="quote">=many</span>”</span> in a
DCC report indicate the checksum used -- in this case, <span class="quote">“<span class="quote">Fuz2</span>”</span>.)
</p><p>
If the $spam_separator variable is unset, then each
spam pattern match supersedes the previous one. Instead of getting
joined <span class="emphasis"><em>format</em></span> strings, you'll get only the last one to match.
</p><p>
The spam tag is what will be displayed in the index when you use
<code class="literal">%H</code> in the <code class="literal">$index_format</code> variable. It's also the
string that the <code class="literal">˜H</code> pattern-matching expression matches against for
<code class="literal">&lt;search&gt;</code> and <code class="literal">&lt;limit&gt;</code> functions. And it's what sorting by spam
attribute will use as a sort key.
</p><p>
That's a pretty complicated example, and most people's actual
environments will have only one spam filter. The simpler your
configuration, the more effective mutt can be, especially when it comes
to sorting.
</p><p>
Generally, when you sort by spam tag, mutt will sort <span class="emphasis"><em>lexically</em></span> --
that is, by ordering strings alphanumerically. However, if a spam tag
begins with a number, mutt will sort numerically first, and lexically
only when two numbers are equal in value. (This is like UNIX's
<code class="literal">sort -n</code>.) A message with no spam attributes at all -- that is, one
that didn't match <span class="emphasis"><em>any</em></span> of your <code class="literal">spam</code> patterns -- is sorted at
lowest priority. Numbers are sorted next, beginning with 0 and ranging
upward. Finally, non-numeric strings are sorted, with <span class="quote">“<span class="quote">a</span>”</span> taking lower
priority than <span class="quote">“<span class="quote">z</span>”</span>. Clearly, in general, sorting by spam tags is most
effective when you can coerce your filter to give you a raw number. But
in case you can't, mutt can still do something useful.
</p><p>
The <code class="literal">nospam</code> command can be used to write exceptions to <code class="literal">spam</code>
patterns. If a header pattern matches something in a <code class="literal">spam</code> command,
but you nonetheless do not want it to receive a spam tag, you can list a
more precise pattern under a <code class="literal">nospam</code> command.
</p><p>
If the <span class="emphasis"><em>pattern</em></span> given to <code class="literal">nospam</code> is exactly the same as the
<span class="emphasis"><em>pattern</em></span> on an existing <code class="literal">spam</code> list entry, the effect will be to
remove the entry from the spam list, instead of adding an exception.
Likewise, if the <span class="emphasis"><em>pattern</em></span> for a <code class="literal">spam</code> command matches an entry
on the <code class="literal">nospam</code> list, that <code class="literal">nospam</code> entry will be removed. If the
<span class="emphasis"><em>pattern</em></span> for <code class="literal">nospam</code> is <span class="quote">“<span class="quote">*</span>”</span>, <span class="emphasis"><em>all entries on both lists</em></span>
will be removed. This might be the default action if you use <code class="literal">spam</code>
and <code class="literal">nospam</code> in conjunction with a <code class="literal">folder-hook</code>.
</p><p>
You can have as many <code class="literal">spam</code> or <code class="literal">nospam</code> commands as you like.
You can even do your own primitive spam detection within mutt -- for
example, if you consider all mail from <code class="literal">MAILER-DAEMON</code> to be spam,
you can use a <code class="literal">spam</code> command like this:
</p><pre class="screen">
spam "^From: .*MAILER-DAEMON"       "999"
</pre></div><div class="sect1" title="26. Setting and Querying Variables"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="set"></a>26. Setting and Querying Variables</h2></div></div></div><div class="sect2" title="26.1. Commands"><div class="titlepage"><div><div><h3 class="title"><a id="set-commands"></a>26.1. Commands</h3></div></div></div><p>
The following commands are available to manipulate and query variables:
</p><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">set</code>  { 
[ <code class="option">no</code>  |   <code class="option">inv</code> ]
<em class="replaceable"><code>variable</code></em>
  |   
<em class="replaceable"><code>variable=value</code></em>
 } [...]</p></div><div class="cmdsynopsis"><p><code class="command">toggle</code>   
<em class="replaceable"><code>variable</code></em>
  [
<em class="replaceable"><code>variable</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">unset</code>   
<em class="replaceable"><code>variable</code></em>
  [
<em class="replaceable"><code>variable</code></em>
...]</p></div><div class="cmdsynopsis"><p><code class="command">reset</code>   
<em class="replaceable"><code>variable</code></em>
  [
<em class="replaceable"><code>variable</code></em>
...]</p></div><p>
This command is used to set (and unset) <a class="link" href="reference.html#variables" title="3. Configuration variables">configuration variables</a>.  There are four basic types of variables:
boolean, number, string and quadoption.  <span class="emphasis"><em>boolean</em></span> variables can be
<span class="emphasis"><em>set</em></span> (true) or <span class="emphasis"><em>unset</em></span> (false).  <span class="emphasis"><em>number</em></span> variables can be
assigned a positive integer value.
<span class="emphasis"><em>string</em></span> variables consist of any number of printable characters and
must be enclosed in quotes if they contain spaces or tabs.  You
may also use the escape sequences <span class="quote">“<span class="quote">\n</span>”</span> and <span class="quote">“<span class="quote">\t</span>”</span> for newline and tab, respectively.
<span class="emphasis"><em>quadoption</em></span> variables are used to control whether or not to be prompted
for certain actions, or to specify a default action.  A value of <span class="emphasis"><em>yes</em></span>
will cause the action to be carried out automatically as if you had answered
yes to the question.  Similarly, a value of <span class="emphasis"><em>no</em></span> will cause the
action to be carried out as if you had answered <span class="quote">“<span class="quote">no.</span>”</span>  A value of
<span class="emphasis"><em>ask-yes</em></span> will cause a prompt with a default answer of <span class="quote">“<span class="quote">yes</span>”</span> and
<span class="emphasis"><em>ask-no</em></span> will provide a default answer of <span class="quote">“<span class="quote">no.</span>”</span>
</p><p>
Prefixing a variable with <span class="quote">“<span class="quote">no</span>”</span> will unset it.  Example: <code class="literal">set noaskbcc</code>.
</p><p>
For <span class="emphasis"><em>boolean</em></span> variables, you may optionally prefix the variable name with
<code class="literal">inv</code> to toggle the value (on or off).  This is useful when writing
macros.  Example: <code class="literal">set invsmart_wrap</code>.
</p><p>
The <code class="literal">toggle</code> command automatically prepends the <code class="literal">inv</code> prefix to all
specified variables.
</p><p>
The <code class="literal">unset</code> command automatically prepends the <code class="literal">no</code> prefix to all
specified variables.
</p><p>
Using the <code class="literal">&lt;enter-command&gt;</code> function in the <span class="emphasis"><em>index</em></span> menu, you can query the
value of a variable by prefixing the name of the variable with a question
mark:
</p><pre class="screen">
set ?allow_8bit
</pre><p>
The question mark is actually only required for boolean and quadoption
variables.
</p><p>
The <code class="literal">reset</code> command resets all given variables to the compile time
defaults (hopefully mentioned in this manual). If you use the command
<code class="literal">set</code> and prefix the variable with <span class="quote">“<span class="quote">&amp;</span>”</span> this has the same
behavior as the reset command.
</p><p>
With the <code class="literal">reset</code> command there exists the special variable <span class="quote">“<span class="quote">all</span>”</span>,
which allows you to reset all variables to their system defaults.
</p></div><div class="sect2" title="26.2. User-defined variables"><div class="titlepage"><div><div><h3 class="title"><a id="set-myvar"></a>26.2. User-defined variables</h3></div></div></div><div class="sect3" title="26.2.1. Introduction"><div class="titlepage"><div><div><h4 class="title"><a id="set-myvar-intro"></a>26.2.1. Introduction</h4></div></div></div><p>
Along with the variables listed in the
<a class="link" href="reference.html#variables" title="3. Configuration variables">Configuration variables</a> section, mutt
supports user-defined variables with names starting
with <code class="literal">my_</code> as in, for
example, <code class="literal">my_cfgdir</code>.
</p><p>
The <code class="literal">set</code> command either creates a
custom <code class="literal">my_</code> variable or changes its
value if it does exist already. The <code class="literal">unset</code> and <code class="literal">reset</code>
commands remove the variable entirely.
</p><p>
Since user-defined variables are expanded in the same way that
environment variables are (except for
the <a class="link" href="gettingstarted.html#shell-escape">shell-escape</a> command and
backtick expansion), this feature can be used to make configuration
files more readable.
</p></div><div class="sect3" title="26.2.2. Examples"><div class="titlepage"><div><div><h4 class="title"><a id="set-myvar-examples"></a>26.2.2. Examples</h4></div></div></div><p>
The following example defines and uses the variable <code class="literal">my_cfgdir</code>
to abbreviate the calls of the <a class="link" href="configuration.html#source" title="27. Reading initialization commands from another file">source</a> command:
</p><div class="example"><a id="ex-myvar1"></a><p class="title"><strong>Example 3.14. Using user-defined variables for config file readability</strong></p><div class="example-contents"><pre class="screen">
set my_cfgdir = $HOME/mutt/config

source $my_cfgdir/hooks
source $my_cfgdir/macros
# more source commands...
</pre></div></div><br class="example-break" /><p>
A custom variable can also be used in macros to backup the current value
of another variable. In the following example, the value of the
<a class="link" href="reference.html#delete" title="3.43. delete">$delete</a> is changed temporarily
while its original value is saved as <code class="literal">my_delete</code>.
After the macro has executed all commands, the original value of <a class="link" href="reference.html#delete" title="3.43. delete">$delete</a> is restored.
</p><div class="example"><a id="ex-myvar2"></a><p class="title"><strong>Example 3.15. Using user-defined variables for backing up other config option values</strong></p><div class="example-contents"><pre class="screen">
macro pager ,x '\
&lt;enter-command&gt;set my_delete=$delete&lt;enter&gt;\
&lt;enter-command&gt;set delete=yes&lt;enter&gt;\
...\
&lt;enter-command&gt;set delete=$my_delete&lt;enter&gt;'
</pre></div></div><br class="example-break" /><p>
Since mutt expands such values already when parsing the configuration
file(s), the value of <code class="literal">$my_delete</code> in the
last example would be the value of <code class="literal">$delete</code> exactly
as it was at that point during parsing the configuration file. If
another statement would change the value for <code class="literal">$delete</code>
later in the same or another file, it would have no effect on
<code class="literal">$my_delete</code>. However, the expansion can
be deferred to runtime, as shown in the next example, when escaping the
dollar sign.
</p><div class="example"><a id="ex-myvar3"></a><p class="title"><strong>Example 3.16. Deferring user-defined variable expansion to runtime</strong></p><div class="example-contents"><pre class="screen">
macro pager &lt;PageDown&gt; "\
&lt;enter-command&gt; set my_old_pager_stop=\$pager_stop pager_stop&lt;Enter&gt;\
&lt;next-page&gt;\
&lt;enter-command&gt; set pager_stop=\$my_old_pager_stop&lt;Enter&gt;\
&lt;enter-command&gt; unset my_old_pager_stop&lt;Enter&gt;"
</pre></div></div><br class="example-break" /><p>
Note that there is a space
between <code class="literal">&lt;enter-command&gt;</code> and
the <code class="literal">set</code> configuration command, preventing mutt from
recording the macro's commands into its history.
</p></div></div></div><div class="sect1" title="27. Reading initialization commands from another file"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="source"></a>27. Reading initialization commands from another file</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">source</code>   
<em class="replaceable"><code>filename</code></em>
 </p></div><p>
This command allows the inclusion of initialization commands
from other files.  For example, I place all of my aliases in
<code class="literal">˜/.mail_aliases</code> so that I can make my
<code class="literal">˜/.muttrc</code> readable and keep my aliases private.
</p><p>
If the filename begins with a tilde (<span class="quote">“<span class="quote">˜</span>”</span>), it will be expanded to the
path of your home directory.
</p><p>
If the filename ends with a vertical bar (|), then <span class="emphasis"><em>filename</em></span> is
considered to be an executable program from which to read input (eg.
<code class="literal">source ˜/bin/myscript|</code>).
</p></div><div class="sect1" title="28. Removing hooks"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="unhook"></a>28. Removing hooks</h2></div></div></div><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">unhook</code>  { 
<em class="replaceable"><code>*</code></em>
  |   
<em class="replaceable"><code>hook-type</code></em>
 }</p></div><p>
This command permits you to flush hooks you have previously defined.
You can either remove all hooks by giving the <span class="quote">“<span class="quote">*</span>”</span> character as an
argument, or you can remove all hooks of a specific type by saying
something like <code class="literal">unhook send-hook</code>.
</p></div><div class="sect1" title="29. Format Strings"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="formatstrings"></a>29. Format Strings</h2></div></div></div><div class="sect2" title="29.1. Basic usage"><div class="titlepage"><div><div><h3 class="title"><a id="formatstrings-basics"></a>29.1. Basic usage</h3></div></div></div><p>
Format strings are a general concept you'll find in several locations
through the mutt configuration, especially in the
<a class="link" href="reference.html#index-format" title="3.104. index_format">$index_format</a>,
<a class="link" href="reference.html#pager-format" title="3.143. pager_format">$pager_format</a>,
<a class="link" href="reference.html#status-format" title="3.283. status_format">$status_format</a>,
and other <span class="quote">“<span class="quote">*_format</span>”</span> variables. These can be very straightforward,
and it's quite possible you already know how to use them.
</p><p>
The most basic format string element is a percent symbol followed
by another character. For example, <code class="literal">%s</code>
represents a message's Subject: header in the <a class="link" href="reference.html#index-format" title="3.104. index_format">$index_format</a> variable. The
<span class="quote">“<span class="quote">expandos</span>”</span> available are documented with each format variable, but
there are general modifiers available with all formatting expandos,
too. Those are our concern here.
</p><p>
Some of the modifiers are borrowed right out of C (though you might
know them from Perl, Python, shell, or another language). These are
the [-]m.n modifiers, as in <code class="literal">%-12.12s</code>. As with
such programming languages, these modifiers allow you to specify the
minimum and maximum size of the resulting string, as well as its
justification. If the <span class="quote">“<span class="quote">-</span>”</span> sign follows the percent, the string will
be left-justified instead of right-justified. If there's a number
immediately following that, it's the minimum amount of space the
formatted string will occupy -- if it's naturally smaller than that, it
will be padded out with spaces.  If a decimal point and another number
follow, that's the maximum space allowable -- the string will not be
permitted to exceed that width, no matter its natural size. Each of
these three elements is optional, so that all these are legal format
strings:
<code class="literal">%-12s</code>
<code class="literal">%4c</code>
<code class="literal">%.15F</code>
<code class="literal">%-12.15L</code>
</p><p>
Mutt adds some other modifiers to format strings. If you use an equals
symbol (<code class="literal">=</code>) as a numeric prefix (like the minus
above), it will force the string to be centered within its minimum
space range. For example, <code class="literal">%=14y</code> will reserve 14
characters for the %y expansion -- that's the X-Label: header, in
<code class="literal">$index_format</code>. If the expansion
results in a string less than 14 characters, it will be centered in a
14-character space.  If the X-Label for a message were "test", that
expansion would look like <span class="quote">“<span class="quote">     test     </span>”</span>.
</p><p>
There are two very little-known modifiers that affect the way that an
expando is replaced. If there is an underline (<span class="quote">“<span class="quote">_</span>”</span>) character
between any format modifiers (as above) and the expando letter, it will
expands in all lower case. And if you use a colon (<span class="quote">“<span class="quote">:</span>”</span>), it will
replace all decimal points with underlines.
</p></div><div class="sect2" title="29.2. Filters"><div class="titlepage"><div><div><h3 class="title"><a id="formatstrings-filters"></a>29.2. Filters</h3></div></div></div><p>
Any format string ending in a vertical bar (<span class="quote">“<span class="quote">|</span>”</span>) will be
expanded and piped through the first word in the string, using spaces
as separator. The string returned will be used for display.
If the returned string ends in %, it will be passed through
the formatter a second time. This allows the filter to generate a
replacement format string including % expandos.
</p><p>
All % expandos in a format string are expanded before the script
is called so that:
</p><div class="example"><a id="ex-fmtpipe"></a><p class="title"><strong>Example 3.17. Using external filters in format strings</strong></p><div class="example-contents"><pre class="screen">
set status_format="script.sh '%r %f (%L)'|"
</pre></div></div><br class="example-break" /><p>
will make mutt expand <code class="literal">%r</code>,
<code class="literal">%f</code> and <code class="literal">%L</code>
before calling the script. The example also shows that arguments can be
quoted: the script will receive the expanded string between the single quotes
as the only argument.
</p><p>
A practical example is the <code class="literal">mutt_xtitle</code>
script installed in the <code class="literal">samples</code>
subdirectory of the mutt documentation: it can be used as filter for
<code class="literal">$status_format</code> to set the current
terminal's title, if supported.
</p></div></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="gettingstarted.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="advancedusage.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 2. Getting Started </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 4. Advanced Usage</td></tr></table></div></body></html>