~ubuntu-dev/ubuntu/lucid/mutt/lucid-201002110857

« back to all changes in this revision

Viewing changes to doc/configuration.html

  • Committer: Bazaar Package Importer
  • Author(s): Bhavani Shankar
  • Date: 2009-06-07 17:30:03 UTC
  • mto: (16.2.1 experimental) (2.3.1 squeeze)
  • mto: This revision was merged to the branch mainline in revision 21.
  • Revision ID: james.westby@ubuntu.com-20090607173003-rg37ui3h2bbv7wl0
Tags: upstream-1.5.19
Import upstream version 1.5.19

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2
2
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
3
 
<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.71.1" /><link rel="start" 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" /></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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="configuration"></a>Chapter 3. Configuration</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="configuration.html#muttrc-syntax">1. Syntax of Initialization Files</a></span></dt><dt><span class="sect1"><a href="configuration.html#addrgroup">2. Address groups</a></span></dt><dt><span class="sect1"><a href="configuration.html#alias">3. Defining/Using aliases</a></span></dt><dt><span class="sect1"><a href="configuration.html#bind">4. Changing the default key bindings</a></span></dt><dt><span class="sect1"><a href="configuration.html#charset-hook">5. Defining aliases for character sets </a></span></dt><dt><span class="sect1"><a href="configuration.html#folder-hook">6. Setting variables based upon mailbox</a></span></dt><dt><span class="sect1"><a href="configuration.html#macro">7. Keyboard macros</a></span></dt><dt><span class="sect1"><a href="configuration.html#color">8. Using color and mono video attributes</a></span></dt><dt><span class="sect1"><a href="configuration.html#ignore">9. Ignoring (weeding) unwanted message headers</a></span></dt><dt><span class="sect1"><a href="configuration.html#alternates">10. Alternative addresses</a></span></dt><dt><span class="sect1"><a href="configuration.html#lists">11. Mailing lists</a></span></dt><dt><span class="sect1"><a href="configuration.html#mbox-hook">12. Using Multiple spool mailboxes</a></span></dt><dt><span class="sect1"><a href="configuration.html#mailboxes">13. Monitoring incoming mail</a></span></dt><dt><span class="sect1"><a href="configuration.html#my-hdr">14. User defined headers</a></span></dt><dt><span class="sect1"><a href="configuration.html#hdr-order">15. Defining the order of headers when viewing messages</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#id470510">29.1. Basic usage</a></span></dt><dt><span class="sect2"><a href="configuration.html#id470640">29.2. Filters</a></span></dt></dl></dd></dl></div><p>
4
 
While the default configuration (or ``preferences'') make Mutt
 
3
<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.73.2" /><link rel="start" 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">
 
4
      body { margin-left:2%; margin-right:2%; font-family:serif; }
 
5
.toc, .list-of-tables, .list-of-examples { font-family:sans-serif; }
 
6
h1, h2, h3, h4, h5, h6 { font-family:sans-serif; }
 
7
em.replaceable code { font-family:sans-serif; }
 
8
p { text-align:justify; }
 
9
div.table p.title, div.example p.title { font-size:smaller; font-family:sans-serif; }
 
10
.email, .email a { font-family:monospace; }
 
11
div.table-contents table { border-collapse:collapse; border:1px solid #c0c0c0; }
 
12
div.table-contents table td, div.table-contents table th { padding:5px; text-align:left; }
 
13
div.table-contents table th {
 
14
    font-family:sans-serif;
 
15
    background:#d0d0d0;
 
16
    font-weight:normal;
 
17
    vertical-align:top;
 
18
}
 
19
pre.screen, div.note { background:#f0f0f0; border:1px solid #c0c0c0; padding:5px; }
 
20
div.note h3 { font-size:small; font-style:italic; font-variant: small-caps; }
 
21
div.note h3:after { content: ":" }
 
22
div.note { margin-bottom: 5px; }
 
23
 
 
24
    </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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title"><a id="configuration"></a>Chapter 3. Configuration</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></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" lang="en" xml:lang="en"><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>
 
25
While the default configuration (or “<span class="quote">preferences</span>”) make Mutt
5
26
usable right out of the box, it is often desirable to tailor Mutt to
6
27
suit your own tastes. When Mutt is first invoked, it will attempt to
7
 
read the ``system'' configuration file (defaults set by your local
8
 
system administrator), unless the ``-n'' <a href="reference.html#commandline" title="1. Command line options">command line</a> option is specified.  This file is typically
 
28
read the “<span class="quote">system</span>” configuration file (defaults set by your local
 
29
system administrator), unless the “<span class="quote">-n</span>” <a class="link" href="reference.html#commandline" title="1. Command line options">command line</a> option is specified.  This file is typically
9
30
<code class="literal">/usr/local/share/mutt/Muttrc</code> or <code class="literal">/etc/Muttrc</code>. Mutt
10
31
will next look for a file named <code class="literal">.muttrc</code> in your home
11
32
directory.  If this file does not exist and your home directory has
12
33
a subdirectory named <code class="literal">.mutt</code>, mutt try to load a file named
13
 
<code class="literal">.mutt/muttrc</code>. 
 
34
<code class="literal">.mutt/muttrc</code>.
14
35
</p><p>
15
 
<code class="literal">.muttrc</code> is the file where you will usually place your <a href="reference.html#commands" title="2. Configuration Commands">commands</a> to configure Mutt.
 
36
<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.
16
37
</p><p>
17
38
In addition, mutt supports version specific configuration files that are
18
39
parsed instead of the default files as explained above.  For instance, if
22
43
configuration file, if you have a file <code class="literal">.muttrc-0.88.6</code> in your home
23
44
directory, when you run mutt version 0.88.6, it will source this file
24
45
instead of the default <code class="literal">.muttrc</code> file.  The version number is the
25
 
same which is visible using the ``-v'' <a href="reference.html#commandline" title="1. Command line options">command line</a> switch or using the <code class="literal">show-version</code> key (default:
 
46
same which is visible using the “<span class="quote">-v</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:
26
47
V) from the index menu.
27
 
</p><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="muttrc-syntax"></a>1. Syntax of Initialization Files</h2></div></div></div><p>
28
 
An initialization file consists of a series of <a href="reference.html#commands" title="2. Configuration Commands">commands</a>.  Each line of the file may contain one or more commands.
29
 
When multiple commands are used, they must be separated by a semicolon (;).
30
 
 
31
 
</p><pre class="screen">
 
48
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
 
49
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.
 
50
When multiple commands are used, they must be separated by a semicolon
 
51
(;).
 
52
</p><div class="example"><a id="ex-rc-multiple-cmds"></a><p class="title"><b>Example 3.1. Multiple configuration commands per line</b></p><div class="example-contents"><pre class="screen">
32
53
set realname='Mutt user' ; ignore x-
33
 
</pre><p>
34
 
 
 
54
</pre></div></div><br class="example-break" /><p>
35
55
The hash mark, or pound sign
36
 
(``#''), is used as a ``comment'' character. You can use it to
 
56
(“<span class="quote">#</span>”), is used as a “<span class="quote">comment</span>” character. You can use it to
37
57
annotate your initialization file. All text after the comment character
38
58
to the end of the line is ignored. For example,
39
 
</p><p>
40
 
 
41
 
</p><pre class="screen">
 
59
</p><div class="example"><a id="ex-ec-comment"></a><p class="title"><b>Example 3.2. Commenting configuration files</b></p><div class="example-contents"><pre class="screen">
42
60
my_hdr X-Disclaimer: Why are you listening to me? # This is a comment
43
 
</pre><p>
44
 
 
45
 
</p><p>
 
61
</pre></div></div><br class="example-break" /><p>
46
62
Single quotes (') and double quotes (") can be used to quote strings
47
63
which contain spaces or other special characters.  The difference between
48
64
the two types of quotes is similar to that of many popular shell programs,
49
65
namely that a single quote is used to specify a literal string (one that is
50
66
not interpreted for shell variables or quoting with a backslash [see
51
67
next paragraph]), while double quotes indicate a string for which
52
 
should be evaluated.  For example, backtics are evaluated inside of double
 
68
should be evaluated.  For example, backticks are evaluated inside of double
53
69
quotes, but <span class="bold"><strong>not</strong></span> for single quotes.
54
70
</p><p>
55
71
\ quotes the next character, just as in shells such as bash and zsh.
56
 
For example, if want to put quotes ``"'' inside of a string, you can use
57
 
``\'' to force the next character to be a literal instead of interpreted
 
72
For example, if want to put quotes “<span class="quote">"</span>” inside of a string, you can use
 
73
“<span class="quote">\</span>” to force the next character to be a literal instead of interpreted
58
74
character.
59
 
 
60
 
</p><pre class="screen">
 
75
</p><div class="example"><a id="ex-rc-quote"></a><p class="title"><b>Example 3.3. Escaping quotes in congfiguration files</b></p><div class="example-contents"><pre class="screen">
61
76
set realname="Michael \"MuttDude\" Elkins"
62
 
</pre><p>
63
 
 
64
 
</p><p>
65
 
``\\'' means to insert a literal ``\'' into the line.
66
 
``\n'' and ``\r'' have their usual C meanings of linefeed and
 
77
</pre></div></div><br class="example-break" /><p>
 
78
“<span class="quote">\\</span>” means to insert a literal “<span class="quote">\</span>” into the line.
 
79
“<span class="quote">\n</span>” and “<span class="quote">\r</span>” have their usual C meanings of linefeed and
67
80
carriage-return, respectively.
68
81
</p><p>
69
82
A \ at the end of a line can be used to split commands over
72
85
</p><p>
73
86
It is also possible to substitute the output of a Unix command in an
74
87
initialization file.  This is accomplished by enclosing the command in
75
 
backquotes (``).  For example,
76
 
 
77
 
</p><pre class="screen">
 
88
backticks (``).  For example,
 
89
</p><div class="example"><a id="ex-rc-backtick"></a><p class="title"><b>Example 3.4. Using external command's output in configuration files</b></p><div class="example-contents"><pre class="screen">
78
90
my_hdr X-Operating-System: `uname -a`
79
 
</pre><p>
80
 
 
81
 
The output of the Unix command ``uname -a'' will be substituted before the
82
 
line is parsed.  Note that since initialization files are line oriented, only
 
91
</pre></div></div><br class="example-break" /><p>
 
92
The output of the Unix command “<span class="quote">uname -a</span>” will be substituted before the
 
93
line is parsed.
 
94
</p><div class="note"><h3 class="title">Note</h3><p>
 
95
Since initialization files are line oriented, only
83
96
the first line of output from the Unix command will be substituted.
84
 
</p><p>
 
97
</p></div><p>
85
98
Both environment variables and mutt variables can be accessed by
86
 
prepending ``$'' to the name of the variable. For example,
87
 
</p><pre class="screen">
 
99
prepending “<span class="quote">$</span>” to the name of the variable. For example,
 
100
</p><div class="example"><a id="ex-rc-env"></a><p class="title"><b>Example 3.5. Using environment variables in configuration files</b></p><div class="example-contents"><pre class="screen">
88
101
set record=+sent_on_$HOSTNAME
89
 
</pre><p>
 
102
</pre></div></div><br class="example-break" /><p>
90
103
will cause mutt to save outgoing messages to a folder named
91
 
``sent_on_kremvax'' if the environment variable HOSTNAME is set to
92
 
``kremvax.'' (See <a href="reference.html#record" title="3.239. record">$record</a> for
 
104
“<span class="quote">sent_on_kremvax</span>” if the environment variable HOSTNAME is set to
 
105
“<span class="quote">kremvax.</span>” (See <a class="link" href="reference.html#record" title="3.240. record">$record</a> for
93
106
details.)
94
107
</p><p>
95
108
Mutt expands the variable when it is assigned, not when it is used. If
98
111
not be affected.
99
112
</p><p>
100
113
The commands understood by mutt are explained in the next paragraphs.
101
 
For a complete list, see the <a href="reference.html#commands" title="2. Configuration Commands">command reference</a>.
102
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="addrgroup"></a>2. Address groups</h2></div></div></div><p>
103
 
Usage: <code class="literal">group</code> [ <code class="literal">-group</code> <span class="emphasis"><em>name</em></span> [ ... ] ] [ <code class="literal">-rx</code> <span class="emphasis"><em>EXPR</em></span> [ ... ] ] [ <code class="literal">-addr</code> <span class="emphasis"><em>EXPR</em></span> [ ... ] ]
104
 
</p><p>
 
114
For a complete list, see the <a class="link" href="reference.html#commands" title="2. Configuration Commands">command reference</a>.
 
115
</p><p>
 
116
All configuration files are expected to be in the current locale as
 
117
specified by the <a class="link" href="reference.html#charset" title="3.25. charset">$charset</a> variable
 
118
which doesn't have a default value since it's determined by Mutt at startup.
 
119
If a configuration file is not encoded in the same character set the
 
120
<a class="link" href="reference.html#config-charset" title="3.30. config_charset">$config_charset</a>
 
121
variable should be used: all lines starting with the next are recoded
 
122
from $config_charset to $charset.
 
123
</p><p>
 
124
This mechanism should be avoided if possible as it has the
 
125
following implications:
 
126
</p><div class="itemizedlist"><ul type="disc"><li><p>These variables should be set early in a configuration
 
127
file with $charset preceding $config_charset so Mutt
 
128
know what character set to convert to.</p></li><li><p>If $config_charset is set, it should be set
 
129
in each configuration file because the value is global and <span class="emphasis"><em>not</em></span>
 
130
per configuration file.</p></li><li><p>Because Mutt first recodes a line before it attempts to parse it,
 
131
a conversion introducing question marks or other characters as
 
132
part of errors (unconvertable characters, transliteration) may introduce syntax
 
133
errors or silently change the meaning of certain tokens (e.g. inserting
 
134
question marks into regular expressions).</p></li></ul></div></div><div class="sect1" lang="en" xml:lang="en"><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>  [
 
135
<code class="option">-group</code>
 
136
<em class="replaceable"><code>name</code></em>
 
137
...] { 
 
138
<code class="option">-rx</code>
 
139
<em class="replaceable"><code>expr</code></em>
 
140
...  |   
 
141
<code class="option">-addr</code>
 
142
<em class="replaceable"><code>expr</code></em>
 
143
... }</p></div><div class="cmdsynopsis"><p><code class="command">ungroup</code>  [
 
144
<code class="option">-group</code>
 
145
<em class="replaceable"><code>name</code></em>
 
146
...] { 
 
147
<em class="replaceable"><code>*</code></em>
 
148
  |   
 
149
<code class="option">-rx</code>
 
150
<em class="replaceable"><code>expr</code></em>
 
151
...  |   
 
152
<code class="option">-addr</code>
 
153
<em class="replaceable"><code>expr</code></em>
 
154
... }</p></div><p>
105
155
<code class="literal">group</code> is used to directly add either addresses or
106
156
regular expressions to the specified group or groups. The different
107
157
categories of arguments to the <code class="literal">group</code> command can be
110
160
begin with a hyphen) should be interpreted as: either a regular
111
161
expression or an email address, respectively.
112
162
</p><p>
113
 
These address groups can also be created implicitely by the
114
 
<a href="configuration.html#alias" title="3. Defining/Using aliases">alias</a>, <a href="configuration.html#lists" title="11. Mailing lists">lists</a>,
115
 
<a href="configuration.html#lists" title="11. Mailing lists">subscribe</a> and
116
 
<a href="configuration.html#alternates" title="10. Alternative addresses">alternates</a> commands by specifying the
 
163
These address groups can also be created implicitly by the
 
164
<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>,
 
165
<a class="link" href="configuration.html#lists" title="12. Mailing lists">subscribe</a> and
 
166
<a class="link" href="configuration.html#alternates" title="11. Alternative addresses">alternates</a> commands by specifying the
117
167
optional <code class="literal">-group</code> option.
118
168
</p><p>
119
169
Once defined, these address groups can be used in
120
 
<a href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> to search for and limit the
 
170
<a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> to search for and limit the
121
171
display to messages matching a group.
122
172
</p><p>
123
 
Usage: <code class="literal">ungroup</code> [ <code class="literal">-group</code> <span class="emphasis"><em>name</em></span> [ ... ] ] [ * | [ [ <code class="literal">-rx</code> <span class="emphasis"><em>EXPR</em></span> [ ... ] ] [ <code class="literal">-addr</code> <span class="emphasis"><em>EXPR</em></span> [ ... ] ] ]
124
 
</p><p>
125
173
<code class="literal">ungroup</code> is used to remove addresses or regular
126
174
expressions from the specified group or groups. The syntax is similar to
127
175
the <code class="literal">group</code> command, however the special character
128
176
<code class="literal">*</code> can be used to empty a group of all of its
129
177
contents.
130
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alias"></a>3. Defining/Using aliases</h2></div></div></div><p>
131
 
Usage: <code class="literal">alias</code> [ <code class="literal">-group</code> <span class="emphasis"><em>name</em></span> [ ... ] ] <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>address</em></span> [ , <span class="emphasis"><em>address</em></span>, ... ]
132
 
</p><p>
 
178
</p></div><div class="sect1" lang="en" xml:lang="en"><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>  [
 
179
<code class="option">-group</code>
 
180
<em class="replaceable"><code>name</code></em>
 
181
...]  
 
182
<em class="replaceable"><code>key</code></em>
 
183
   
 
184
<em class="replaceable"><code>address</code></em>
 
185
  [
 
186
<em class="replaceable"><code>address</code></em>
 
187
...]</p></div><p>
133
188
It's usually very cumbersome to remember or type out the address of someone
134
 
you are communicating with.  Mutt allows you to create ``aliases'' which map
 
189
you are communicating with.  Mutt allows you to create “<span class="quote">aliases</span>” which map
135
190
a short string to a full address.
136
 
</p><p>
137
 
<span class="bold"><strong>Note:</strong></span> if you want to create an alias for more than
138
 
one address, you <span class="bold"><strong>must</strong></span> separate the addresses with a comma (``,'').
139
 
</p><p>
 
191
</p><div class="note"><h3 class="title">Note</h3><p>
 
192
If you want to create an alias for more than
 
193
one address, you <span class="bold"><strong>must</strong></span> separate the addresses with a comma (“<span class="quote">,</span>”).
 
194
</p></div><p>
140
195
The optional <code class="literal">-group</code> argument to
141
196
<code class="literal">alias</code> causes the aliased address(es) to be added to
142
197
the named <span class="emphasis"><em>group</em></span>.
143
198
</p><p>
144
 
To remove an alias or aliases (``*'' means all aliases):
145
 
</p><p>
146
 
<code class="literal">unalias</code> [ * | <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>...</em></span> ]
147
 
</p><p>
148
 
 
149
 
</p><pre class="screen">
 
199
To remove an alias or aliases (“<span class="quote">*</span>” means all aliases):
 
200
</p><div class="cmdsynopsis"><p><code class="command">unalias</code>  [
 
201
<code class="option">-group</code>
 
202
<em class="replaceable"><code>name</code></em>
 
203
...] { 
 
204
<em class="replaceable"><code>*</code></em>
 
205
  |   
 
206
<em class="replaceable"><code>key</code></em>
 
207
... }</p></div><pre class="screen">
150
208
alias muttdude me@cs.hmc.edu (Michael Elkins)
151
209
alias theguys manny, moe, jack
152
210
</pre><p>
153
 
 
154
 
</p><p>
155
211
Unlike other mailers, Mutt doesn't require aliases to be defined
156
212
in a special file.  The <code class="literal">alias</code> command can appear anywhere in
157
 
a configuration file, as long as this file is <a href="configuration.html#source" title="27. Reading initialization commands from another file">sourced</a>.  Consequently, you can have multiple alias files, or
 
213
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
158
214
you can have all aliases defined in your muttrc.
159
215
</p><p>
160
 
On the other hand, the <a href="gettingstarted.html#create-alias">create-alias</a>
161
 
function can use only one file, the one pointed to by the <a href="reference.html#alias-file" title="3.3. alias_file">$alias_file</a> variable (which is
 
216
On the other hand, the <a class="link" href="gettingstarted.html#create-alias"><code class="literal">&lt;create-alias&gt;</code></a>
 
217
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
162
218
<code class="literal">˜/.muttrc</code> by default). This file is not special either,
163
219
in the sense that Mutt will happily append aliases to any file, but in
164
 
order for the new aliases to take effect you need to explicitly <a href="configuration.html#source" title="27. Reading initialization commands from another file">source</a> this file too.
 
220
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.
165
221
</p><p>
166
222
For example:
167
 
</p><p>
168
 
 
169
 
</p><pre class="screen">
 
223
</p><div class="example"><a id="ex-alias-external"></a><p class="title"><b>Example 3.6. Configuring external alias files</b></p><div class="example-contents"><pre class="screen">
170
224
source /usr/local/share/Mutt.aliases
171
225
source ~/.mail_aliases
172
226
set alias_file=~/.mail_aliases
173
 
</pre><p>
174
 
 
175
 
</p><p>
 
227
</pre></div></div><br class="example-break" /><p>
176
228
To use aliases, you merely use the alias at any place in mutt where mutt
177
229
prompts for addresses, such as the <span class="emphasis"><em>To:</em></span> or <span class="emphasis"><em>Cc:</em></span> prompt.  You can
178
230
also enter aliases in your editor at the appropriate headers if you have the
179
 
<a href="reference.html#edit-headers" title="3.50. edit_headers">$edit_headers</a> variable set.
 
231
<a class="link" href="reference.html#edit-headers" title="3.50. edit_headers">$edit_headers</a> variable set.
180
232
</p><p>
181
233
In addition, at the various address prompts, you can use the tab character
182
234
to expand a partial alias to the full alias.  If there are multiple matches,
186
238
multiple addresses.
187
239
</p><p>
188
240
In the alias menu, you can select as many aliases as you want with the
189
 
<span class="emphasis"><em>select-entry</em></span> key (default: RET), and use the <span class="emphasis"><em>exit</em></span> key
190
 
(default: q) to return to the address prompt.
191
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="bind"></a>4. Changing the default key bindings</h2></div></div></div><p>
192
 
Usage: <code class="literal">bind</code> <span class="emphasis"><em>map</em></span> <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>function</em></span>
193
 
</p><p>
 
241
<code class="literal">select-entry</code> key (default: &lt;Return&gt;), and use the
 
242
<span class="emphasis"><em>exit</em></span> key (default: q) to return to the address prompt.
 
243
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
244
<em class="replaceable"><code>map</code></em>
 
245
   
 
246
<em class="replaceable"><code>key</code></em>
 
247
   
 
248
<em class="replaceable"><code>function</code></em>
 
249
 </p></div><p>
194
250
This command allows you to change the default key bindings (operation
195
251
invoked when pressing a key).
196
252
</p><p>
197
253
<span class="emphasis"><em>map</em></span> specifies in which menu the binding belongs.  Multiple maps may
198
254
be specified by separating them with commas (no additional whitespace is
199
255
allowed). The currently defined maps are:
200
 
</p><p>
201
 
<a id="maps"></a>
202
 
</p><div class="variablelist"><dl><dt><span class="term">generic</span></dt><dd><p>
 
256
</p><a id="maps"></a><div class="variablelist"><dl><dt><span class="term">generic</span></dt><dd><p>
203
257
This is not a real menu, but is used as a fallback for all of the other
204
258
menus except for the pager and editor modes.  If a key is not defined in
205
259
another menu, Mutt will look for a binding to use in this menu.  This allows
224
278
The pager is the mode used to display message/attachment data, and help
225
279
listings.
226
280
</p></dd><dt><span class="term">pgp</span></dt><dd><p>
227
 
The pgp menu is used to select the OpenPGP keys used for encrypting outgoing
 
281
The pgp menu is used to select the OpenPGP keys used to encrypt outgoing
 
282
messages.
 
283
</p></dd><dt><span class="term">smime</span></dt><dd><p>
 
284
The smime menu is used to select the OpenSSL certificates used to encrypt outgoing
228
285
messages.
229
286
</p></dd><dt><span class="term">postpone</span></dt><dd><p>
230
287
The postpone menu is similar to the index menu, except is used when
231
288
recalling a message the user was composing, but saved until later.
 
289
</p></dd><dt><span class="term">query</span></dt><dd><p>
 
290
The query menu is the browser for results returned by
 
291
<a class="link" href="reference.html#query-command" title="3.232. query_command">$query_command</a>.
 
292
</p></dd><dt><span class="term">mix</span></dt><dd><p>
 
293
The mixmaster screen is used to select remailer options for outgoing
 
294
messages (if Mutt is compiled with Mixmaster support).
232
295
</p></dd></dl></div><p>
233
 
</p><p>
234
296
<span class="emphasis"><em>key</em></span> is the key (or key sequence) you wish to bind.  To specify a
235
297
control character, use the sequence <span class="emphasis"><em>\Cx</em></span>, where <span class="emphasis"><em>x</em></span> is the
236
298
letter of the control character (for example, to specify control-A use
237
 
``\Ca'').  Note that the case of <span class="emphasis"><em>x</em></span> as well as <span class="emphasis"><em>\C</em></span> is
 
299
“<span class="quote">\Ca</span>”).  Note that the case of <span class="emphasis"><em>x</em></span> as well as <span class="emphasis"><em>\C</em></span> is
238
300
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
239
301
equivalent.  An alternative form is to specify the key as a three digit
240
 
octal number prefixed with a ``\'' (for example <span class="emphasis"><em>\177</em></span> is
 
302
octal number prefixed with a “<span class="quote">\</span>” (for example <span class="emphasis"><em>\177</em></span> is
241
303
equivalent to <span class="emphasis"><em>\c?</em></span>). In addition, <span class="emphasis"><em>key</em></span> may
242
 
be a symbolic name as shown in <a href="configuration.html#tab-key-names" title="Table 3.1. Symbolic key names">Table 3.1, “Symbolic key names”</a>.
243
 
</p><p>
244
 
 
245
 
</p><div class="table"><a id="tab-key-names"></a><p class="title"><b>Table 3.1. Symbolic key names</b></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><p><br class="table-break" />
246
 
 
247
 
</p><p>
 
304
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>.
 
305
</p><div class="table"><a id="tab-key-names"></a><p class="title"><b>Table 3.1. Symbolic key names</b></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>
248
306
<span class="emphasis"><em>key</em></span> does not need to be enclosed in quotes unless it contains a
249
 
space (`` '').
 
307
space (“<span class="quote"> </span>”) or semi-colon (“<span class="quote">;</span>”).
250
308
</p><p>
251
309
<span class="emphasis"><em>function</em></span> specifies which action to take when <span class="emphasis"><em>key</em></span> is pressed.
252
 
For a complete list of functions, see the <a href="reference.html#functions" title="4. Functions">reference</a>.  The special function <code class="literal">noop</code> unbinds the specified key
 
310
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
253
311
sequence.
254
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="charset-hook"></a>5. Defining aliases for character sets </h2></div></div></div><p>
255
 
</p><div class="literallayout"><p><br />
256
 
Usage: <code class="literal">charset-hook</code> <span class="emphasis"><em>alias</em></span> <span class="emphasis"><em>charset</em></span><br />
257
 
Usage: <code class="literal">iconv-hook</code> <span class="emphasis"><em>charset</em></span> <span class="emphasis"><em>local-charset</em></span><br />
258
 
</p></div><p>
259
 
</p><p>
 
312
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
313
<em class="replaceable"><code>alias</code></em>
 
314
   
 
315
<em class="replaceable"><code>charset</code></em>
 
316
 </p></div><div class="cmdsynopsis"><p><code class="command">iconv-hook</code>   
 
317
<em class="replaceable"><code>charset</code></em>
 
318
   
 
319
<em class="replaceable"><code>local-charset</code></em>
 
320
 </p></div><p>
260
321
The <code class="literal">charset-hook</code> command defines an alias for a character set.
261
322
This is useful to properly display messages which are tagged with a
262
323
character set name not known to mutt.
265
326
character set.  This is helpful when your systems character
266
327
conversion library insists on using strange, system-specific names
267
328
for character sets.
268
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="folder-hook"></a>6. Setting variables based upon mailbox</h2></div></div></div><p>
269
 
Usage: <code class="literal">folder-hook</code> [!]<span class="emphasis"><em>regexp</em></span> <span class="emphasis"><em>command</em></span>
270
 
</p><p>
 
329
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
330
<em class="replaceable"><code>[!]regexp</code></em>
 
331
   
 
332
<em class="replaceable"><code>command</code></em>
 
333
 </p></div><p>
271
334
It is often desirable to change settings based on which mailbox you are
272
335
reading.  The folder-hook command provides a method by which you can execute
273
336
any configuration command.  <span class="emphasis"><em>regexp</em></span> is a regular expression specifying
274
337
in which mailboxes to execute <span class="emphasis"><em>command</em></span> before loading.  If a mailbox
275
338
matches multiple folder-hook's, they are executed in the order given in the
276
339
muttrc.
277
 
</p><p>
278
 
<span class="bold"><strong>Note:</strong></span> if you use the ``!'' shortcut for <a href="reference.html#spoolfile" title="3.276. spoolfile">$spoolfile</a> at the beginning of the pattern, you must place it
 
340
</p><div class="note"><h3 class="title">Note</h3><p>
 
341
If you use the “<span class="quote">!</span>” shortcut for <a class="link" href="reference.html#spoolfile" title="3.277. spoolfile">$spoolfile</a> at the beginning of the pattern, you must place it
279
342
inside of double or single quotes in order to distinguish it from the
280
343
logical <span class="emphasis"><em>not</em></span> operator for the expression.
281
 
</p><p>
282
 
Note that the settings are <span class="emphasis"><em>not</em></span> restored when you leave the mailbox.
 
344
</p></div><div class="note"><h3 class="title">Note</h3><p>
 
345
Settings are <span class="emphasis"><em>not</em></span> restored when you leave the mailbox.
283
346
For example, a command action to perform is to change the sorting method
284
347
based upon the mailbox being read:
285
 
</p><p>
286
 
 
287
 
</p><pre class="screen">
 
348
</p></div><pre class="screen">
288
349
folder-hook mutt set sort=threads
289
350
</pre><p>
290
 
 
291
 
</p><p>
292
351
However, the sorting method is not restored to its previous value when
293
352
reading a different mailbox.  To specify a <span class="emphasis"><em>default</em></span> command, use the
294
 
pattern ``.'':
295
 
</p><p>
296
 
 
297
 
</p><pre class="screen">
 
353
pattern “<span class="quote">.</span>” before other folder-hooks adjusting a value on a per-folder basis
 
354
because folder-hooks are evaluated in the order given in the configuration file.
 
355
The following example will set the <a class="link" href="reference.html#sort" title="3.271. sort">sort</a> variable
 
356
to <code class="literal">date-sent</code> for all folders but to <code class="literal">threads</code>
 
357
for all folders containing “<span class="quote">mutt</span>” in their name.
 
358
</p><div class="example"><a id="ex-folder-sorting"></a><p class="title"><b>Example 3.7. Setting sort method based on mailbox name</b></p><div class="example-contents"><pre class="screen">
298
359
folder-hook . set sort=date-sent
299
 
</pre><p>
300
 
 
301
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="macro"></a>7. Keyboard macros</h2></div></div></div><p>
302
 
Usage: <code class="literal">macro</code> <span class="emphasis"><em>menu</em></span> <span class="emphasis"><em>key</em></span> <span class="emphasis"><em>sequence</em></span> [ <span class="emphasis"><em>description</em></span> ]
303
 
</p><p>
 
360
folder-hook mutt set sort=threads
 
361
</pre></div></div><br class="example-break" /></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
362
<em class="replaceable"><code>menu</code></em>
 
363
   
 
364
<em class="replaceable"><code>key</code></em>
 
365
   
 
366
<em class="replaceable"><code>sequence</code></em>
 
367
  [
 
368
<em class="replaceable"><code>description</code></em>
 
369
]</p></div><p>
304
370
Macros are useful when you would like a single key to perform a series of
305
371
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
306
372
you had typed <span class="emphasis"><em>sequence</em></span>.  So if you have a common sequence of commands
307
373
you type, you can create a macro to execute those commands with a single
308
 
key.
 
374
key or fewer keys.
309
375
</p><p>
310
 
<span class="emphasis"><em>menu</em></span> is the <a href="configuration.html#maps">map</a> which the macro will be bound.
 
376
<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.
311
377
Multiple maps may be specified by separating multiple menu arguments by
312
378
commas. Whitespace may not be used in between the menu arguments and the
313
379
commas separating them.
314
380
</p><p>
315
 
<span class="emphasis"><em>key</em></span> and <span class="emphasis"><em>sequence</em></span> are expanded by the same rules as the <a href="configuration.html#bind" title="4. Changing the default key bindings">key bindings</a>.  There are some additions however.  The
 
381
<span class="emphasis"><em>key</em></span> and <span class="emphasis"><em>sequence</em></span> are expanded by the same rules as the
 
382
<a class="link" href="configuration.html#bind" title="5. Changing the default key bindings">key bindings</a> with some additions.  The
316
383
first is that control characters in <span class="emphasis"><em>sequence</em></span> can also be specified
317
 
as <span class="emphasis"><em>^x</em></span>.  In order to get a caret (`^'') you need to use
 
384
as <span class="emphasis"><em>^x</em></span>.  In order to get a caret (“<span class="quote">^</span>”) you need to use
318
385
<span class="emphasis"><em>^^</em></span>.  Secondly, to specify a certain key such as <span class="emphasis"><em>up</em></span>
319
386
or to invoke a function directly, you can use the format
320
387
<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
321
 
names see the section on <a href="configuration.html#bind" title="4. Changing the default key bindings">key bindings</a>.  Functions
322
 
are listed in the <a href="reference.html#functions" title="4. Functions">reference</a>.
 
388
names see the section on <a class="link" href="configuration.html#bind" title="5. Changing the default key bindings">key bindings</a>.  Functions
 
389
are listed in the <a class="link" href="reference.html#functions" title="4. Functions">reference</a>.
323
390
</p><p>
324
391
The advantage with using function names directly is that the macros will
325
392
work regardless of the current key bindings, so they are not dependent on
329
396
</p><p>
330
397
Optionally you can specify a descriptive text after <span class="emphasis"><em>sequence</em></span>,
331
398
which is shown in the help screens.
332
 
</p><p>
333
 
<span class="bold"><strong>Note:</strong></span> Macro definitions (if any) listed in the help screen(s), are
 
399
</p><div class="note"><h3 class="title">Note</h3><p>
 
400
Macro definitions (if any) listed in the help screen(s), are
334
401
silently truncated at the screen width, and are not wrapped.
335
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="color"></a>8. Using color and mono video attributes</h2></div></div></div><p>
336
 
</p><div class="literallayout"><p><br />
337
 
Usage: <code class="literal">color</code> <span class="emphasis"><em>object</em></span> <span class="emphasis"><em>foreground</em></span> <span class="emphasis"><em>background</em></span> [ <span class="emphasis"><em>regexp</em></span> ]<br />
338
 
Usage: <code class="literal">color</code> index <span class="emphasis"><em>foreground</em></span> <span class="emphasis"><em>background</em></span> <span class="emphasis"><em>pattern</em></span><br />
339
 
Usage: <code class="literal">uncolor</code> index <span class="emphasis"><em>pattern</em></span> [ <span class="emphasis"><em>pattern</em></span> ...  ]<br />
340
 
</p></div><p>
341
 
</p><p>
 
402
</p></div></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
403
<em class="replaceable"><code>object</code></em>
 
404
   
 
405
<em class="replaceable"><code>foreground</code></em>
 
406
   
 
407
<em class="replaceable"><code>background</code></em>
 
408
 </p></div><div class="cmdsynopsis"><p><code class="command">color</code>  { 
 
409
<code class="option">header</code>
 
410
  |   
 
411
<code class="option">body</code>
 
412
 }  
 
413
<em class="replaceable"><code>foreground</code></em>
 
414
   
 
415
<em class="replaceable"><code>background</code></em>
 
416
   
 
417
<em class="replaceable"><code>regexp</code></em>
 
418
 </p></div><div class="cmdsynopsis"><p><code class="command">color</code>   
 
419
<code class="option">index</code>
 
420
   
 
421
<em class="replaceable"><code>foreground</code></em>
 
422
   
 
423
<em class="replaceable"><code>background</code></em>
 
424
   
 
425
<em class="replaceable"><code>pattern</code></em>
 
426
 </p></div><div class="cmdsynopsis"><p><code class="command">uncolor</code>   
 
427
<code class="option">index</code>
 
428
  { 
 
429
<em class="replaceable"><code>*</code></em>
 
430
  |   
 
431
<em class="replaceable"><code>pattern</code></em>
 
432
... }</p></div><p>
342
433
If your terminal supports color, you can spice up Mutt by creating your own
343
434
color scheme.  To define the color of an object (type of information), you
344
435
must specify both a foreground color <span class="bold"><strong>and</strong></span> a background color (it is not
345
436
possible to only specify one or the other).
346
437
</p><p>
 
438
<span class="emphasis"><em>header</em></span> and <span class="emphasis"><em>body</em></span> match <span class="emphasis"><em>regexp</em></span>
 
439
in the header/body of a message, <span class="emphasis"><em>index</em></span> matches <span class="emphasis"><em>pattern</em></span>
 
440
(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.
 
441
</p><p>
347
442
<span class="emphasis"><em>object</em></span> can be one of:
348
 
</p><p>
349
 
 
350
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
351
 
attachment
352
 
</p></li><li><p>
353
 
body (match <span class="emphasis"><em>regexp</em></span> in the body of messages)
354
 
</p></li><li><p>
355
 
bold (hiliting bold patterns in the body of messages)
356
 
</p></li><li><p>
357
 
error (error messages printed by Mutt)
358
 
</p></li><li><p>
359
 
header (match <span class="emphasis"><em>regexp</em></span> in the message header)
360
 
</p></li><li><p>
361
 
hdrdefault (default color of the message header in the pager)
362
 
</p></li><li><p>
363
 
index (match <span class="emphasis"><em>pattern</em></span> in the message index)
364
 
</p></li><li><p>
365
 
indicator (arrow or bar used to indicate the current item in a menu)
366
 
</p></li><li><p>
367
 
markers (the ``+'' markers at the beginning of wrapped lines in the pager)
368
 
</p></li><li><p>
369
 
message (informational messages)
370
 
</p></li><li><p>
371
 
normal
372
 
</p></li><li><p>
373
 
quoted (text matching <a href="reference.html#quote-regexp" title="3.234. quote_regexp">$quote_regexp</a> in the body of a message)
374
 
</p></li><li><p>
375
 
quoted1, quoted2, ..., quoted<span class="bold"><strong>N</strong></span> (higher levels of quoting)
376
 
</p></li><li><p>
377
 
search (hiliting of words in the pager)
378
 
</p></li><li><p>
379
 
signature
380
 
</p></li><li><p>
381
 
status (mode lines used to display info about the mailbox or message)
382
 
</p></li><li><p>
383
 
tilde (the ``˜'' used to pad blank lines in the pager)
384
 
</p></li><li><p>
385
 
tree (thread tree drawn in the message index and attachment menu)
386
 
</p></li><li><p>
387
 
underline (hiliting underlined patterns in the body of messages)
388
 
</p></li></ul></div><p>
389
 
 
390
 
</p><p>
 
443
</p><div class="itemizedlist"><ul type="disc"><li><p>attachment</p></li><li><p>bold (hiliting bold patterns in the body of messages)</p></li><li><p>error (error messages printed by Mutt)</p></li><li><p>hdrdefault (default color of the message header in the pager)</p></li><li><p>indicator (arrow or bar used to indicate the current item in a menu)</p></li><li><p>markers (the “<span class="quote">+</span>” markers at the beginning of wrapped lines in the pager)</p></li><li><p>message (informational messages)</p></li><li><p>normal</p></li><li><p>quoted (text matching <a class="link" href="reference.html#quote-regexp" title="3.235. quote_regexp">$quote_regexp</a> in the body of a message)</p></li><li><p>quoted1, quoted2, ..., quoted<span class="bold"><strong>N</strong></span> (higher levels of quoting)</p></li><li><p>search (hiliting of words in the pager)</p></li><li><p>signature</p></li><li><p>status (mode lines used to display info about the mailbox or message)</p></li><li><p>tilde (the “<span class="quote">˜</span>” used to pad blank lines in the pager)</p></li><li><p>tree (thread tree drawn in the message index and attachment menu)</p></li><li><p>underline (hiliting underlined patterns in the body of messages)</p></li></ul></div><p>
391
444
<span class="emphasis"><em>foreground</em></span> and <span class="emphasis"><em>background</em></span> can be one of the following:
392
 
</p><p>
393
 
 
394
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
395
 
white
396
 
</p></li><li><p>
397
 
black
398
 
</p></li><li><p>
399
 
green
400
 
</p></li><li><p>
401
 
magenta
402
 
</p></li><li><p>
403
 
blue
404
 
</p></li><li><p>
405
 
cyan
406
 
</p></li><li><p>
407
 
yellow
408
 
</p></li><li><p>
409
 
red
410
 
</p></li><li><p>
411
 
default
412
 
</p></li><li><p>
413
 
color<span class="emphasis"><em>x</em></span>
414
 
</p></li></ul></div><p>
415
 
 
416
 
</p><p>
 
445
</p><div class="itemizedlist"><ul type="disc"><li><p>white</p></li><li><p>black</p></li><li><p>green</p></li><li><p>magenta</p></li><li><p>blue</p></li><li><p>cyan</p></li><li><p>yellow</p></li><li><p>red</p></li><li><p>default</p></li><li><p>color<span class="emphasis"><em>x</em></span></p></li></ul></div><p>
417
446
<span class="emphasis"><em>foreground</em></span> can optionally be prefixed with the keyword <code class="literal">bright</code> to make
418
447
the foreground color boldfaced (e.g., <code class="literal">brightred</code>).
419
448
</p><p>
422
451
If Mutt is linked against the <span class="emphasis"><em>S-Lang</em></span> library, you also need to set
423
452
the <span class="emphasis"><em>COLORFGBG</em></span> environment variable to the default colors of your
424
453
terminal for this to work; for example (for Bourne-like shells):
425
 
</p><p>
426
 
 
427
454
</p><pre class="screen">
428
455
set COLORFGBG="green;black"
429
456
export COLORFGBG
430
 
</pre><p>
431
 
 
432
 
</p><p>
433
 
<span class="bold"><strong>Note:</strong></span> The <span class="emphasis"><em>S-Lang</em></span> library requires you to use the <span class="emphasis"><em>lightgray</em></span>
 
457
</pre><div class="note"><h3 class="title">Note</h3><p>
 
458
The <span class="emphasis"><em>S-Lang</em></span> library requires you to use the <span class="emphasis"><em>lightgray</em></span>
434
459
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
435
460
setting this variable.
436
 
</p><p>
437
 
<span class="bold"><strong>Note:</strong></span> The uncolor command can be applied to the index object only.  It
 
461
</p></div><div class="note"><h3 class="title">Note</h3><p>
 
462
The uncolor command can be applied to the index object only.  It
438
463
removes entries from the list. You <span class="bold"><strong>must</strong></span> specify the same pattern
439
 
specified in the color command for it to be removed.  The pattern ``*'' is
 
464
specified in the color command for it to be removed.  The pattern “<span class="quote">*</span>” is
440
465
a special token which means to clear the color index list of all entries.
441
 
</p><p>
 
466
</p></div><p>
442
467
Mutt also recognizes the keywords <span class="emphasis"><em>color0</em></span>, <span class="emphasis"><em>color1</em></span>, …,
443
468
<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
444
469
by your terminal).  This is useful when you remap the colors for your
446
471
for your xterm), since color names may then lose their normal meaning.
447
472
</p><p>
448
473
If your terminal does not support color, it is still possible change the video
449
 
attributes through the use of the ``mono'' command:
450
 
</p><p>
451
 
</p><div class="literallayout"><p><br />
452
 
Usage: <code class="literal">mono</code> <span class="emphasis"><em>&lt;object&gt; &lt;attribute&gt;</em></span> [ <span class="emphasis"><em>regexp</em></span> ]<br />
453
 
Usage: <code class="literal">mono</code> index <span class="emphasis"><em>attribute</em></span> <span class="emphasis"><em>pattern</em></span><br />
454
 
Usage: <code class="literal">unmono</code> index <span class="emphasis"><em>pattern</em></span> [ <span class="emphasis"><em>pattern</em></span> ...  ]<br />
455
 
</p></div><p>
456
 
</p><p>
457
 
where <span class="emphasis"><em>attribute</em></span> is one of the following:
458
 
</p><p>
459
 
 
460
 
</p><div class="itemizedlist"><ul type="disc"><li><p>
461
 
none
462
 
</p></li><li><p>
463
 
bold
464
 
</p></li><li><p>
465
 
underline
466
 
</p></li><li><p>
467
 
reverse
468
 
</p></li><li><p>
469
 
standout
470
 
</p></li></ul></div><p>
471
 
 
472
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="ignore"></a>9. Ignoring (weeding) unwanted message headers</h2></div></div></div><p>
473
 
Usage: <code class="literal">[un]ignore</code> <span class="emphasis"><em>pattern</em></span> [ <span class="emphasis"><em>pattern</em></span> ... ]
474
 
</p><p>
 
474
attributes through the use of the “<span class="quote">mono</span>” command:
 
475
</p><a id="mono"></a><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">mono</code>   
 
476
<em class="replaceable"><code>object</code></em>
 
477
   
 
478
<em class="replaceable"><code>attribute</code></em>
 
479
 </p></div><div class="cmdsynopsis"><p><code class="command">mono</code>  { 
 
480
<code class="option">header</code>
 
481
  |   
 
482
<code class="option">body</code>
 
483
 }  
 
484
<em class="replaceable"><code>attribute</code></em>
 
485
   
 
486
<em class="replaceable"><code>regexp</code></em>
 
487
 </p></div><div class="cmdsynopsis"><p><code class="command">mono</code>   
 
488
<code class="option">index</code>
 
489
   
 
490
<em class="replaceable"><code>attribute</code></em>
 
491
   
 
492
<em class="replaceable"><code>pattern</code></em>
 
493
 </p></div><div class="cmdsynopsis"><p><code class="command">unmono</code>   
 
494
<code class="option">index</code>
 
495
  { 
 
496
<em class="replaceable"><code>*</code></em>
 
497
  |   
 
498
<em class="replaceable"><code>pattern</code></em>
 
499
... }</p></div><p>
 
500
For <span class="emphasis"><em>object</em></span>, see the color command. <span class="emphasis"><em>attribute</em></span>
 
501
can be one of the following:
 
502
</p><div class="itemizedlist"><ul type="disc"><li><p>none</p></li><li><p>bold</p></li><li><p>underline</p></li><li><p>reverse</p></li><li><p>standout</p></li></ul></div></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
503
<em class="replaceable"><code>pattern</code></em>
 
504
  [
 
505
<em class="replaceable"><code>pattern</code></em>
 
506
...]</p></div><div class="cmdsynopsis"><p><code class="command">unignore</code>  { 
 
507
<em class="replaceable"><code>*</code></em>
 
508
  |   
 
509
<em class="replaceable"><code>pattern</code></em>
 
510
... }</p></div><p>
475
511
Messages often have many header fields added by automatic processing systems,
476
512
or which may not seem useful to display on the screen.  This command allows
477
 
you to specify header fields which you don't normally want to see.
 
513
you to specify header fields which you don't normally want to see in the pager.
478
514
</p><p>
479
515
You do not need to specify the full header field name.  For example,
480
 
``ignore content-'' will ignore all header fields that begin with the pattern
481
 
``content-''. ``ignore *'' will ignore all headers.
482
 
</p><p>
483
 
To remove a previously added token from the list, use the ``unignore'' command.
484
 
The ``unignore'' command will make Mutt display headers with the given pattern.
485
 
For example, if you do ``ignore x-'' it is possible to ``unignore x-mailer''.
486
 
</p><p>
487
 
``unignore *'' will remove all tokens from the ignore list.
 
516
“<span class="quote">ignore content-</span>” will ignore all header fields that begin with the pattern
 
517
“<span class="quote">content-</span>”. “<span class="quote">ignore *</span>” will ignore all headers.
 
518
</p><p>
 
519
To remove a previously added token from the list, use the “<span class="quote">unignore</span>” command.
 
520
The “<span class="quote">unignore</span>” command will make Mutt display headers with the given pattern.
 
521
For example, if you do “<span class="quote">ignore x-</span>” it is possible to “<span class="quote">unignore x-mailer</span>”.
 
522
</p><p>
 
523
“<span class="quote">unignore *</span>” will remove all tokens from the ignore list.
488
524
</p><p>
489
525
For example:
490
 
 
491
 
</p><pre class="screen">
 
526
</p><div class="example"><a id="ex-header-weeding"></a><p class="title"><b>Example 3.8. Header weeding</b></p><div class="example-contents"><pre class="screen">
492
527
# Sven's draconian header weeding
493
528
ignore *
494
529
unignore from date subject to cc
495
530
unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
496
531
unignore posted-to:
497
 
</pre><p>
498
 
 
499
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="alternates"></a>10. Alternative addresses</h2></div></div></div><p>
500
 
Usage: <code class="literal">[un]alternates</code> [ <code class="literal">-group</code> <span class="emphasis"><em>name</em></span> [ ... ] ] <span class="emphasis"><em>regexp</em></span> [ <span class="emphasis"><em>regexp</em></span> ... ]
501
 
 
 
532
</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>   
 
533
<em class="replaceable"><code>header</code></em>
 
534
  [
 
535
<em class="replaceable"><code>header</code></em>
 
536
...]</p></div><div class="cmdsynopsis"><p><code class="command">unhdr_order</code>  { 
 
537
<em class="replaceable"><code>*</code></em>
 
538
  |   
 
539
<em class="replaceable"><code>header</code></em>
 
540
... }</p></div><p>
 
541
With the <code class="literal">hdr_order</code> command you can specify an order in
 
542
which mutt will attempt to present these headers to you when viewing messages.
502
543
</p><p>
 
544
“<span class="quote">unhdr_order *</span>” will clear all previous headers from the order list,
 
545
thus removing the header order effects set by the system-wide startup file.
 
546
</p><div class="example"><a id="ex-hdr-order"></a><p class="title"><b>Example 3.9. Configuring header display order</b></p><div class="example-contents"><pre class="screen">
 
547
hdr_order From Date: From: To: Cc: Subject:
 
548
</pre></div></div><br class="example-break" /></div><div class="sect1" lang="en" xml:lang="en"><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>  [
 
549
<code class="option">-group</code>
 
550
<em class="replaceable"><code>name</code></em>
 
551
...]  
 
552
<em class="replaceable"><code>regexp</code></em>
 
553
  [
 
554
<em class="replaceable"><code>regexp</code></em>
 
555
...]</p></div><div class="cmdsynopsis"><p><code class="command">unalternates</code>  [
 
556
<code class="option">-group</code>
 
557
<em class="replaceable"><code>name</code></em>
 
558
...] { 
 
559
<em class="replaceable"><code>*</code></em>
 
560
  |   
 
561
<em class="replaceable"><code>regexp</code></em>
 
562
... }</p></div><p>
503
563
With various functions, mutt will treat messages differently,
504
564
depending on whether you sent them or whether you received them from
505
565
someone else.  For instance, when replying to a message that you
506
566
sent to a different party, mutt will automatically suggest to send
507
567
the response to the original message's recipients -- responding to
508
 
yourself won't make much sense in many cases.  (See <a href="reference.html#reply-to" title="3.242. reply_to">$reply_to</a>.)
 
568
yourself won't make much sense in many cases.  (See <a class="link" href="reference.html#reply-to" title="3.243. reply_to">$reply_to</a>.)
509
569
</p><p>
510
570
Many users receive e-mail under a number of different addresses. To
511
571
fully use mutt's features here, the program must be able to
520
580
</p><pre class="screen">
521
581
alternates user@example
522
582
</pre><p>
523
 
mutt will consider ``<code class="literal">some-user@example</code>'' as
 
583
mutt will consider “<span class="quote"><code class="literal">some-user@example</code></span>” as
524
584
being your address, too which may not be desired. As a solution, in such
525
585
cases addresses should be specified as:
526
586
</p><pre class="screen">
540
600
Likewise, if the <span class="emphasis"><em>regexp</em></span> for an <code class="literal">alternates</code> command matches
541
601
an entry on the <code class="literal">unalternates</code> list, that <code class="literal">unalternates</code>
542
602
entry will be removed. If the <span class="emphasis"><em>regexp</em></span> for <code class="literal">unalternates</code>
543
 
is ``*'', <span class="emphasis"><em>all entries</em></span> on <code class="literal">alternates</code> will be removed.
544
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="lists"></a>11. Mailing lists</h2></div></div></div><p>
545
 
</p><div class="literallayout"><p><br />
546
 
Usage: <code class="literal">[un]lists</code> [ <code class="literal">-group</code> <span class="emphasis"><em>name</em></span> [ ... ] ] <span class="emphasis"><em>regexp</em></span> [ <span class="emphasis"><em>regexp</em></span> ... ]<br />
547
 
Usage: <code class="literal">[un]subscribe</code> [ <code class="literal">-group</code> <span class="emphasis"><em>name</em></span> [ ... ] ] <span class="emphasis"><em>regexp</em></span> [ <span class="emphasis"><em>regexp</em></span> ... ]<br />
548
 
</p></div><p>
549
 
</p><p>
550
 
Mutt has a few nice features for <a href="advancedusage.html#using-lists" title="8. Handling Mailing Lists">handling mailing lists</a>.  In order to take advantage of them, you must
 
603
is “<span class="quote">*</span>”, <span class="emphasis"><em>all entries</em></span> on <code class="literal">alternates</code> will be removed.
 
604
</p></div><div class="sect1" lang="en" xml:lang="en"><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>  [
 
605
<code class="option">-group</code>
 
606
<em class="replaceable"><code>name</code></em>
 
607
...]  
 
608
<em class="replaceable"><code>regexp</code></em>
 
609
  [
 
610
<em class="replaceable"><code>regexp</code></em>
 
611
...]</p></div><div class="cmdsynopsis"><p><code class="command">unlists</code>  [
 
612
<code class="option">-group</code>
 
613
<em class="replaceable"><code>name</code></em>
 
614
...] { 
 
615
<em class="replaceable"><code>*</code></em>
 
616
  |   
 
617
<em class="replaceable"><code>regexp</code></em>
 
618
... }</p></div><div class="cmdsynopsis"><p><code class="command">subscribe</code>  [
 
619
<code class="option">-group</code>
 
620
<em class="replaceable"><code>name</code></em>
 
621
...]  
 
622
<em class="replaceable"><code>regexp</code></em>
 
623
  [
 
624
<em class="replaceable"><code>regexp</code></em>
 
625
...]</p></div><div class="cmdsynopsis"><p><code class="command">unsubscribe</code>  [
 
626
<code class="option">-group</code>
 
627
<em class="replaceable"><code>name</code></em>
 
628
...] { 
 
629
<em class="replaceable"><code>*</code></em>
 
630
  |   
 
631
<em class="replaceable"><code>regexp</code></em>
 
632
... }</p></div><p>
 
633
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
551
634
specify which addresses belong to mailing lists, and which mailing
552
 
lists you are subscribed to.  Once you have done this, the <a href="gettingstarted.html#list-reply">list-reply</a> function will work for all known lists.
 
635
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.
553
636
Additionally, when you send a message to a subscribed list, mutt will
554
637
add a Mail-Followup-To header to tell other users' mail user agents
555
 
not to send copies of replies to your personal address.   Note that
556
 
the Mail-Followup-To header is a non-standard extension which is not
 
638
not to send copies of replies to your personal address.
 
639
</p><div class="note"><h3 class="title">Note</h3><p>
 
640
The Mail-Followup-To header is a non-standard extension which is not
557
641
supported by all mail user agents.  Adding it is not bullet-proof against
558
642
receiving personal CCs of list messages.  Also note that the generation
559
 
of the Mail-Followup-To header is controlled by the <a href="reference.html#followup-to" title="3.60. followup_to">$followup_to</a> configuration variable.
560
 
</p><p>
 
643
of the Mail-Followup-To header is controlled by the
 
644
<a class="link" href="reference.html#followup-to" title="3.60. followup_to">$followup_to</a>
 
645
configuration variable.
 
646
</p></div><p>
561
647
More precisely, Mutt maintains lists of patterns for the addresses
562
648
of known and subscribed mailing lists.  Every subscribed mailing
563
 
list is known. To mark a mailing list as known, use the ``lists''
564
 
command.  To mark it as subscribed, use ``subscribe''.
 
649
list is known. To mark a mailing list as known, use the “<span class="quote">lists</span>”
 
650
command.  To mark it as subscribed, use “<span class="quote">subscribe</span>”.
565
651
</p><p>
566
652
You can use regular expressions with both commands.  To mark all
567
653
messages sent to a specific bug report's address on mutt's bug
568
654
tracking system as list mail, for instance, you could say
569
 
``subscribe [0-9]*@bugs.guug.de''.  Often, it's sufficient to just
 
655
“<span class="quote">subscribe [0-9]*@bugs.guug.de</span>”.  Often, it's sufficient to just
570
656
give a portion of the list's e-mail address.
571
657
</p><p>
572
658
Specify as much of the address as you need to to remove ambiguity.  For
573
659
example, if you've subscribed to the Mutt mailing list, you will receive mail
574
660
addressed to <span class="emphasis"><em>mutt-users@mutt.org</em></span>.  So, to tell Mutt
575
 
that this is a mailing list, you could add ``lists mutt-users@'' to your
 
661
that this is a mailing list, you could add “<span class="quote">lists mutt-users@</span>” to your
576
662
initialization file.  To tell mutt that you are subscribed to it,
577
 
add ``subscribe mutt-users'' to your initialization file instead.
 
663
add “<span class="quote">subscribe mutt-users</span>” to your initialization file instead.
578
664
If you also happen to get mail from someone whose address is
579
665
<span class="emphasis"><em>mutt-users@example.com</em></span>, you could use
580
 
``lists ^mutt-users@mutt\\.org$'' 
581
 
or ``subscribe ^mutt-users@mutt\\.org$'' to
 
666
“<span class="quote">lists ^mutt-users@mutt\\.org$</span>”
 
667
or “<span class="quote">subscribe ^mutt-users@mutt\\.org$</span>” to
582
668
match only mail from the actual list.
583
669
</p><p>
584
670
The <code class="literal">-group</code> flag adds all of the subsequent regular expressions
585
671
to the named group.
586
672
</p><p>
587
 
The ``unlists'' command is used to remove a token from the list of
588
 
known and subscribed mailing-lists. Use ``unlists *'' to remove all
 
673
The “<span class="quote">unlists</span>” command is used to remove a token from the list of
 
674
known and subscribed mailing-lists. Use “<span class="quote">unlists *</span>” to remove all
589
675
tokens.
590
676
</p><p>
591
677
To remove a mailing list from the list of subscribed mailing lists,
592
 
but keep it on the list of known mailing lists, use ``unsubscribe''.
593
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mbox-hook"></a>12. Using Multiple spool mailboxes</h2></div></div></div><p>
594
 
Usage: <code class="literal">mbox-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>mailbox</em></span>
595
 
</p><p>
 
678
but keep it on the list of known mailing lists, use “<span class="quote">unsubscribe</span>”.
 
679
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
680
<em class="replaceable"><code>[!]pattern</code></em>
 
681
   
 
682
<em class="replaceable"><code>mailbox</code></em>
 
683
 </p></div><p>
596
684
This command is used to move read messages from a specified mailbox to a
597
685
different mailbox automatically when you quit or change folders.
598
686
<span class="emphasis"><em>pattern</em></span> is a regular expression specifying the mailbox to treat as a
599
 
``spool'' mailbox and <span class="emphasis"><em>mailbox</em></span> specifies where mail should be saved when
 
687
“<span class="quote">spool</span>” mailbox and <span class="emphasis"><em>mailbox</em></span> specifies where mail should be saved when
600
688
read.
601
689
</p><p>
602
690
Unlike some of the other <span class="emphasis"><em>hook</em></span> commands, only the <span class="emphasis"><em>first</em></span> matching
603
691
pattern is used (it is not possible to save read mail in more than a single
604
692
mailbox).
605
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mailboxes"></a>13. Monitoring incoming mail</h2></div></div></div><p>
606
 
Usage: <code class="literal">[un]mailboxes</code> <span class="emphasis"><em>folder</em></span> [ <span class="emphasis"><em>folder</em></span> ... ]
607
 
</p><p>
 
693
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
694
<em class="replaceable"><code>mailbox</code></em>
 
695
  [
 
696
<em class="replaceable"><code>mailbox</code></em>
 
697
...]</p></div><div class="cmdsynopsis"><p><code class="command">unmailboxes</code>  { 
 
698
<em class="replaceable"><code>*</code></em>
 
699
  |   
 
700
<em class="replaceable"><code>mailbox</code></em>
 
701
... }</p></div><p>
608
702
This command specifies folders which can receive mail and
609
 
which will be checked for new messages.  By default, the
610
 
main menu status bar displays how many of these folders have
611
 
new messages.
 
703
which will be checked for new messages periodically.
612
704
</p><p>
613
 
<code class="literal">folder</code> can either be a local file or directory
 
705
<span class="emphasis"><em>folder</em></span> can either be a local file or directory
614
706
(Mbox/Mmdf or Maildir/Mh). If Mutt was built with POP and/or IMAP
615
 
support, <code class="literal">folder</code> can also be a POP/IMAP folder
616
 
URL. The URL syntax is described in <a href="optionalfeatures.html#url-syntax" title="1.2. URL syntax">Section 1.2, “URL syntax”</a>,
617
 
POP and IMAP are described in <a href="optionalfeatures.html#pop" title="3. POP3 Support">Section 3, “POP3 Support”</a> and <a href="optionalfeatures.html#imap" title="4. IMAP Support">Section 4, “IMAP Support”</a>
 
707
support, <span class="emphasis"><em>folder</em></span> can also be a POP/IMAP folder
 
708
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>,
 
709
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>
618
710
respectively.
619
711
</p><p>
620
 
When changing folders, pressing <span class="emphasis"><em>space</em></span> will cycle
621
 
through folders with new mail.
622
 
</p><p>
623
 
Pressing TAB in the directory browser will bring up a menu showing the files
624
 
specified by the <code class="literal">mailboxes</code> command, and indicate which contain new
625
 
messages.  Mutt will automatically enter this mode when invoked from the
626
 
command line with the <code class="literal">-y</code> option.
627
 
</p><p>
628
 
The ``unmailboxes'' command is used to remove a token from the list
629
 
of folders which receive mail. Use ``unmailboxes *'' to remove all
 
712
Mutt provides a number of advanced features for handling (possibly many)
 
713
folders and new mail within them, please refer to
 
714
<a class="xref" href="advancedusage.html#handling-folders" title="9. Handling multiple folders">Section 9, “Handling multiple folders”</a> for details (including in what
 
715
situations and how often Mutt checks for new mail).
 
716
</p><p>
 
717
The “<span class="quote">unmailboxes</span>” command is used to remove a token from the list
 
718
of folders which receive mail. Use “<span class="quote">unmailboxes *</span>” to remove all
630
719
tokens.
631
 
</p><p>
632
 
<span class="bold"><strong>Note:</strong></span> the folders in the <code class="literal">mailboxes</code> command are resolved when
633
 
the command is executed, so if these names contain <a href="advancedusage.html#shortcuts" title="7. Mailbox Shortcuts">shortcut characters</a> (such as ``='' and ``!''), any variable
634
 
definition that affect these characters (like <a href="reference.html#folder" title="3.58. folder">$folder</a> and <a href="reference.html#spoolfile" title="3.276. spoolfile">$spoolfile</a>)
635
 
should be executed before the <code class="literal">mailboxes</code> command. If
 
720
</p><div class="note"><h3 class="title">Note</h3><p>
 
721
The folders in the <code class="literal">mailboxes</code> command are resolved when
 
722
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>” and “<span class="quote">!</span>”), any variable
 
723
definition that affects these characters (like <a class="link" href="reference.html#folder" title="3.58. folder">$folder</a> and <a class="link" href="reference.html#spoolfile" title="3.277. spoolfile">$spoolfile</a>)
 
724
should be set before the <code class="literal">mailboxes</code> command. If
636
725
none of these shorcuts are used, a local path should be absolute as
637
 
otherwise mutt tries to find it within the current working directory
 
726
otherwise mutt tries to find it relative to the directory
638
727
from where mutt was started which may not always be desired.
639
 
</p><p>
640
 
For local folders, new mail is detected by comparing access and/or
641
 
modification times of files and folders. The interval in which Mutt
642
 
checks for new mail is defined by
643
 
<a href="reference.html#mail-check" title="3.104. mail_check">$mail_check</a>.
644
 
</p><p>
645
 
Special care is required with Mbox and Mmdf
646
 
folders as Mutt assumes such a folder has new mail if it wasn't
 
728
</p></div><p>
 
729
For Mbox and Mmdf folders, new mail is detected by comparing access and/or
 
730
modification times of files: Mutt assumes a folder has new mail if it wasn't
647
731
accessed after it was last modified. Utilities like <code class="literal">biff</code> or
648
732
<code class="literal">frm</code> or any other program which accesses the mailbox might cause
649
733
Mutt to never detect new mail for that mailbox if they do not properly reset the
650
 
access time.  Backup tools are another common reason for updated access times.
651
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="my-hdr"></a>14. User defined headers</h2></div></div></div><p>
652
 
Usage:
653
 
 
654
 
<code class="literal">my_hdr</code> <span class="emphasis"><em>string</em></span>
655
 
 
656
 
<code class="literal">unmy_hdr</code> <span class="emphasis"><em>field</em></span> [ <span class="emphasis"><em>field</em></span> ... ]
 
734
access time. Other possible causes of Mutt not detecting new mail in these folders
 
735
are backup tools (updating access times) or filesystems mounted without
 
736
access time update support.
657
737
</p><p>
658
 
The ``my_hdr'' command allows you to create your own header
 
738
In cases where new mail detection for Mbox or Mmdf folders appears to be
 
739
unreliable, the
 
740
<a class="link" href="reference.html#check-mbox-size" title="3.24. check_mbox_size">$check_mbox_size</a>
 
741
option can be used to make Mutt track and consult file sizes for new
 
742
mail detection instead.
 
743
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
744
<em class="replaceable"><code>string</code></em>
 
745
 </p></div><div class="cmdsynopsis"><p><code class="command">unmy_hdr</code>  { 
 
746
<em class="replaceable"><code>*</code></em>
 
747
  |   
 
748
<em class="replaceable"><code>field</code></em>
 
749
... }</p></div><p>
 
750
The <code class="literal">my_hdr</code> command allows you to create your own header
659
751
fields which will be added to every message you send.
660
752
</p><p>
661
 
For example, if you would like to add an ``Organization:'' header field to
 
753
For example, if you would like to add an “<span class="quote">Organization:</span>” header field to
662
754
all of your outgoing messages, you can put the command
663
 
</p><p>
664
 
“<span class="quote">my_hdr Organization: A Really Big Company, Anytown, USA</span>”
665
 
</p><p>
 
755
</p><div class="example"><a id="ex-my-hdr"></a><p class="title"><b>Example 3.10. Defining custom headers</b></p><div class="example-contents"><pre class="screen">
 
756
my_hdr Organization: A Really Big Company, Anytown, USA
 
757
</pre></div></div><br class="example-break" /><p>
666
758
in your <code class="literal">.muttrc</code>.
667
 
</p><p>
668
 
<span class="bold"><strong>Note:</strong></span>  space characters are <span class="emphasis"><em>not</em></span> allowed between the keyword and
669
 
the colon (``:'').  The standard for electronic mail (RFC822) says that
 
759
</p><div class="note"><h3 class="title">Note</h3><p>
 
760
Space characters are <span class="emphasis"><em>not</em></span> allowed between the keyword and
 
761
the colon (“<span class="quote">:</span>”). The standard for electronic mail (RFC2822) says that
670
762
space is illegal there, so Mutt enforces the rule.
671
 
</p><p>
 
763
</p></div><p>
672
764
If you would like to add a header field to a single message, you should
673
 
either set the <a href="reference.html#edit-headers" title="3.50. edit_headers">$edit_headers</a> variable,
674
 
or use the <span class="emphasis"><em>edit-headers</em></span> function (default: ``E'') in the send-menu so
 
765
either set the <a class="link" href="reference.html#edit-headers" title="3.50. edit_headers">$edit_headers</a> variable,
 
766
or use the <code class="literal">&lt;edit-headers&gt;</code> function (default: “<span class="quote">E</span>”) in the compose menu so
675
767
that you can edit the header of your message along with the body.
676
768
</p><p>
677
 
To remove user defined header fields, use the ``unmy_hdr''
678
 
command.  You may specify an asterisk (``*'') to remove all header
679
 
fields, or the fields to remove.  For example, to remove all ``To'' and
680
 
``Cc'' header fields, you could use:
681
 
</p><p>
682
 
“<span class="quote">unmy_hdr to cc</span>”
683
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="hdr-order"></a>15. Defining the order of headers when viewing messages</h2></div></div></div><p>
684
 
Usage: <code class="literal">hdr_order</code> <span class="emphasis"><em>header1</em></span> <span class="emphasis"><em>header2</em></span> <span class="emphasis"><em>header3</em></span>
685
 
</p><p>
686
 
With this command, you can specify an order in which mutt will attempt
687
 
to present headers to you when viewing messages.
688
 
</p><p>
689
 
``unhdr_order *'' will clear all previous headers from the order list,
690
 
thus removing the header order effects set by the system-wide startup
691
 
file.
692
 
</p><p>
693
 
 
 
769
To remove user defined header fields, use the <code class="literal">unmy_hdr</code>
 
770
command. You may specify an asterisk (“<span class="quote">*</span>”) to remove all header
 
771
fields, or the fields to remove. For example, to remove all “<span class="quote">To</span>” and
 
772
“<span class="quote">Cc</span>” header fields, you could use:
694
773
</p><pre class="screen">
695
 
hdr_order From Date: From: To: Cc: Subject:
696
 
</pre><p>
697
 
 
698
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
699
 
Usage: <code class="literal">save-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>mailbox</em></span>
700
 
</p><p>
 
774
unmy_hdr to cc
 
775
</pre></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
776
<em class="replaceable"><code>[!]pattern</code></em>
 
777
   
 
778
<em class="replaceable"><code>mailbox</code></em>
 
779
 </p></div><p>
701
780
This command is used to override the default mailbox used when saving
702
781
messages. <span class="emphasis"><em>mailbox</em></span> will be used as the default if the message
703
 
matches <span class="emphasis"><em>pattern</em></span>, see <a href="advancedusage.html#pattern-hook">Message Matching in Hooks</a> for information
 
782
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
704
783
on the exact format.
705
784
</p><p>
706
785
To provide more flexibility and good defaults, Mutt applies the
707
 
expandos of <a href="reference.html#index-format" title="3.100. index_format">$index_format</a> to
 
786
expandos of <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> to
708
787
<span class="emphasis"><em>mailbox</em></span> after it was expanded.
709
788
</p><p>
710
789
Examples:
711
 
</p><p>
712
 
 
713
 
</p><pre class="screen">
 
790
</p><div class="example"><a id="ex-save-hook-exando"></a><p class="title"><b>Example 3.11. Using %-expandos in <code class="literal">save-hook</code></b></p><div class="example-contents"><pre class="screen">
714
791
# default: save all to ~/Mail/&lt;author name&gt;
715
792
save-hook . ~/Mail/%F
716
 
# save from me@turing.cs.hmc.edu/me@cs.hmc.edu to $folder/elinks
 
793
 
 
794
# save from me@turing.cs.hmc.edu and me@cs.hmc.edu to $folder/elkins
717
795
save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
 
796
 
718
797
# save from aol.com to $folder/spam
719
798
save-hook aol\\.com$ +spam
720
 
</pre><p>
721
 
 
722
 
</p><p>
723
 
Also see the <a href="configuration.html#fcc-save-hook" title="18. Specify default save filename and default Fcc: mailbox at once">fcc-save-hook</a> command.
724
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
725
 
Usage: <code class="literal">fcc-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>mailbox</em></span>
726
 
</p><p>
 
799
</pre></div></div><br class="example-break" /><p>
 
800
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.
 
801
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
802
<em class="replaceable"><code>[!]pattern</code></em>
 
803
   
 
804
<em class="replaceable"><code>mailbox</code></em>
 
805
 </p></div><p>
727
806
This command is used to save outgoing mail in a mailbox other than
728
 
<a href="reference.html#record" title="3.239. record">$record</a>.  Mutt searches the initial list of
 
807
<a class="link" href="reference.html#record" title="3.240. record">$record</a>.  Mutt searches the initial list of
729
808
message recipients for the first matching <span class="emphasis"><em>regexp</em></span> and uses <span class="emphasis"><em>mailbox</em></span>
730
809
as the default Fcc: mailbox.  If no match is found the message will be saved
731
 
to <a href="reference.html#record" title="3.239. record">$record</a> mailbox.
 
810
to <a class="link" href="reference.html#record" title="3.240. record">$record</a> mailbox.
732
811
</p><p>
733
812
To provide more flexibility and good defaults, Mutt applies the
734
 
expandos of <a href="reference.html#index-format" title="3.100. index_format">$index_format</a> to
 
813
expandos of <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> to
735
814
<span class="emphasis"><em>mailbox</em></span> after it was expanded.
736
815
</p><p>
737
 
See <a href="advancedusage.html#pattern-hook">Message Matching in Hooks</a> for information on the exact format of <span class="emphasis"><em>pattern</em></span>.
 
816
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>.
738
817
</p><p>
739
818
Example: <code class="literal">fcc-hook [@.]aol\\.com$ +spammers</code>
740
819
</p><p>
741
820
The above will save a copy of all messages going to the aol.com domain to
742
 
the `+spammers' mailbox by default.  Also see the <a href="configuration.html#fcc-save-hook" title="18. Specify default save filename and default Fcc: mailbox at once">fcc-save-hook</a> command.
743
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
744
 
Usage: <code class="literal">fcc-save-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>mailbox</em></span>
745
 
</p><p>
746
 
This command is a shortcut, equivalent to doing both a <a href="configuration.html#fcc-hook" title="17. Specify default Fcc: mailbox when composing">fcc-hook</a>
747
 
and a <a href="configuration.html#save-hook" title="16. Specify default save mailbox">save-hook</a> with its arguments,
 
821
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.
 
822
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
823
<em class="replaceable"><code>[!]pattern</code></em>
 
824
   
 
825
<em class="replaceable"><code>mailbox</code></em>
 
826
 </p></div><p>
 
827
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>
 
828
and a <a class="link" href="configuration.html#save-hook" title="16. Specify default save mailbox">save-hook</a> with its arguments,
748
829
including %-expansion on <span class="emphasis"><em>mailbox</em></span> according
749
 
to <a href="reference.html#index-format" title="3.100. index_format">$index_format</a>.
750
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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><p>
751
 
</p><div class="literallayout"><p><br />
752
 
Usage: <code class="literal">reply-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>command</em></span><br />
753
 
Usage: <code class="literal">send-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>command</em></span><br />
754
 
Usage: <code class="literal">send2-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>command</em></span><br />
755
 
</p></div><p>
756
 
</p><p>
 
830
to <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a>.
 
831
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
832
<em class="replaceable"><code>[!]pattern</code></em>
 
833
   
 
834
<em class="replaceable"><code>command</code></em>
 
835
 </p></div><div class="cmdsynopsis"><p><code class="command">send-hook</code>   
 
836
<em class="replaceable"><code>[!]pattern</code></em>
 
837
   
 
838
<em class="replaceable"><code>command</code></em>
 
839
 </p></div><div class="cmdsynopsis"><p><code class="command">send2-hook</code>   
 
840
<em class="replaceable"><code>[!]pattern</code></em>
 
841
   
 
842
<em class="replaceable"><code>command</code></em>
 
843
 </p></div><p>
757
844
These commands can be used to execute arbitrary configuration commands based
758
 
upon recipients of the message.  <span class="emphasis"><em>pattern</em></span> is a regular expression
759
 
matching the desired address.  <span class="emphasis"><em>command</em></span> is executed when <span class="emphasis"><em>regexp</em></span>
760
 
matches recipients of the message.
 
845
upon recipients of the message.  <span class="emphasis"><em>pattern</em></span> is used to match
 
846
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>
 
847
is executed when <span class="emphasis"><em>pattern</em></span> matches.
761
848
</p><p>
762
 
<code class="literal">reply-hook</code> is matched against the message you are <span class="emphasis"><em>replying</em></span>
763
 
<span class="bold"><strong>to</strong></span>, instead of the message you are <span class="emphasis"><em>sending</em></span>.  <code class="literal">send-hook</code> is
764
 
matched against all messages, both <span class="emphasis"><em>new</em></span> and <span class="emphasis"><em>replies</em></span>.  <span class="bold"><strong>Note:</strong></span>
 
849
<code class="literal">reply-hook</code> is matched against the message you are <span class="emphasis"><em>replying to</em></span>,
 
850
instead of the message you are <span class="emphasis"><em>sending</em></span>.  <code class="literal">send-hook</code> is
 
851
matched against all messages, both <span class="emphasis"><em>new</em></span>
 
852
and <span class="emphasis"><em>replies</em></span>.
 
853
</p><div class="note"><h3 class="title">Note</h3><p>
765
854
<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>
766
855
of the order specified in the user's configuration file.
767
 
</p><p>
 
856
</p></div><p>
768
857
<code class="literal">send2-hook</code> is matched every time a message is changed, either
769
858
by editing it, or by using the compose menu to change its recipients
770
859
or subject.  <code class="literal">send2-hook</code> is executed after <code class="literal">send-hook</code>, and
771
 
can, e.g., be used to set parameters such as the <a href="reference.html#sendmail" title="3.257. sendmail">$sendmail</a> variable depending on the message's sender
 
860
can, e.g., be used to set parameters such as the <a class="link" href="reference.html#sendmail" title="3.258. sendmail">$sendmail</a> variable depending on the message's sender
772
861
address.
773
862
</p><p>
774
863
For each type of <code class="literal">send-hook</code> or <code class="literal">reply-hook</code>, when multiple matches
775
864
occur, commands are executed in the order they are specified in the muttrc
776
865
(for that type of hook).
777
866
</p><p>
778
 
See <a href="advancedusage.html#pattern-hook">Message Matching in Hooks</a> for information on the exact format of <span class="emphasis"><em>pattern</em></span>.
779
 
</p><p>
780
867
Example: <code class="literal">send-hook mutt "set mime_forward signature=''"</code>
781
868
</p><p>
782
869
Another typical use for this command is to change the values of the
783
 
<a href="reference.html#attribution" title="3.16. attribution">$attribution</a>, <a href="reference.html#signature" title="3.262. signature">$signature</a> and <a href="reference.html#locale" title="3.103. locale">$locale</a>
 
870
<a class="link" href="reference.html#attribution" title="3.16. attribution">$attribution</a>, <a class="link" href="reference.html#signature" title="3.263. signature">$signature</a> and <a class="link" href="reference.html#locale" title="3.104. locale">$locale</a>
784
871
variables in order to change the language of the attributions and
785
872
signatures based upon the recipients.
786
 
</p><p>
787
 
<span class="bold"><strong>Note:</strong></span> the send-hook's are only executed ONCE after getting the initial
 
873
</p><div class="note"><h3 class="title">Note</h3><p>
 
874
send-hook's are only executed once after getting the initial
788
875
list of recipients.  Adding a recipient after replying or editing the
789
 
message will NOT cause any send-hook to be executed.  Also note that
790
 
my_hdr commands which modify recipient headers, or the message's
 
876
message will not cause any send-hook to be executed.  Also note that
 
877
<code class="literal">my_hdr</code> commands which modify recipient headers, or the message's
791
878
subject, don't have any effect on the current message when executed
792
879
from a send-hook.
793
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
794
 
Usage: <code class="literal">message-hook</code> [!]<span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>command</em></span>
795
 
</p><p>
 
880
</p></div></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
881
<em class="replaceable"><code>[!]pattern</code></em>
 
882
   
 
883
<em class="replaceable"><code>command</code></em>
 
884
 </p></div><p>
796
885
This command can be used to execute arbitrary configuration commands
797
886
before viewing or formatting a message based upon information about the message.
798
887
<span class="emphasis"><em>command</em></span> is executed if the <span class="emphasis"><em>pattern</em></span> matches the message to be
799
888
displayed. When multiple matches occur, commands are executed in the order
800
889
they are specified in the muttrc.
801
890
</p><p>
802
 
See <a href="advancedusage.html#pattern-hook">Message Matching in Hooks</a> for
 
891
See <a class="xref" href="advancedusage.html#pattern-hook" title="4.1. Message Matching in Hooks">Message Matching in Hooks</a> for
803
892
information on the exact format of <span class="emphasis"><em>pattern</em></span>.
804
893
</p><p>
805
894
Example:
806
 
 
807
895
</p><pre class="screen">
808
896
message-hook ~A 'set pager=builtin'
809
897
message-hook '~f freshmeat-news' 'set pager="less \"+/^  subject: .*\""'
810
 
</pre><p>
811
 
 
812
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
813
 
Usage: <code class="literal">crypt-hook</code> <span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>keyid</em></span>
814
 
</p><p>
815
 
When encrypting messages with PGP or OpenSSL, you may want to associate a certain
 
898
</pre></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
899
<em class="replaceable"><code>pattern</code></em>
 
900
   
 
901
<em class="replaceable"><code>keyid</code></em>
 
902
 </p></div><p>
 
903
When encrypting messages with PGP/GnuPG or OpenSSL, you may want to associate a certain
816
904
key with a given e-mail address automatically, either because the
817
905
recipient's public key can't be deduced from the destination address,
818
906
or because, for some reasons, you need to override the key Mutt would
819
 
normally use.  The crypt-hook command provides a method by which you can
820
 
specify the ID of the public key to be used when encrypting messages to
821
 
a certain recipient.
 
907
normally use.  The <code class="literal">crypt-hook</code> command provides a
 
908
method by which you can specify the ID of the public key to be used
 
909
when encrypting messages to a certain recipient.
822
910
</p><p>
823
 
The meaning of "key id" is to be taken broadly in this context:  You
 
911
The meaning of <span class="emphasis"><em>keyid</em></span> is to be taken broadly in this context:  You
824
912
can either put a numerical key ID here, an e-mail address, or even
825
913
just a real name.
826
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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>
827
 
Usage: <code class="literal">push</code> <span class="emphasis"><em>string</em></span>
828
 
</p><p>
 
914
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
915
<em class="replaceable"><code>string</code></em>
 
916
 </p></div><p>
829
917
This command adds the named string to the keyboard buffer. The string may
830
918
contain control characters, key names and function names like the sequence
831
 
string in the <a href="configuration.html#macro" title="7. Keyboard macros">macro</a> command. You may use it to
 
919
string in the <a class="link" href="configuration.html#macro" title="8. Keyboard macros">macro</a> command. You may use it to
832
920
automatically run a sequence of commands at startup, or when entering
833
921
certain folders. For example, the following command will automatically
834
922
collapse all threads when entering a folder:
835
 
 
836
 
</p><pre class="screen">
 
923
</p><div class="example"><a id="ex-folder-hook-push"></a><p class="title"><b>Example 3.12. Embedding <code class="literal">push</code> in <code class="literal">folder-hook</code></b></p><div class="example-contents"><pre class="screen">
837
924
folder-hook . 'push &lt;collapse-all&gt;'
838
 
</pre><p>
839
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="exec"></a>23. Executing functions</h2></div></div></div><p>
840
 
Usage: <code class="literal">exec</code> <span class="emphasis"><em>function</em></span> [ <span class="emphasis"><em>function</em></span> ... ]
841
 
</p><p>
 
925
</pre></div></div><br class="example-break" /></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
926
<em class="replaceable"><code>function</code></em>
 
927
  [
 
928
<em class="replaceable"><code>function</code></em>
 
929
...]</p></div><p>
842
930
This command can be used to execute any function. Functions are
843
 
listed in the <a href="reference.html#functions" title="4. Functions">function reference</a>.
844
 
``exec function'' is equivalent to ``push &lt;function&gt;''.
845
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="score-command"></a>24. Message Scoring</h2></div></div></div><p>
846
 
</p><div class="literallayout"><p><br />
847
 
Usage: <code class="literal">score</code> <span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>value</em></span><br />
848
 
Usage: <code class="literal">unscore</code> <span class="emphasis"><em>pattern</em></span> [ <span class="emphasis"><em>pattern</em></span> ... ]<br />
849
 
</p></div><p>
850
 
</p><p>
 
931
listed in the <a class="link" href="reference.html#functions" title="4. Functions">function reference</a>.
 
932
“<span class="quote">exec function</span>” is equivalent to “<span class="quote">push &lt;function&gt;</span>”.
 
933
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
934
<em class="replaceable"><code>pattern</code></em>
 
935
   
 
936
<em class="replaceable"><code>value</code></em>
 
937
 </p></div><div class="cmdsynopsis"><p><code class="command">unscore</code>  { 
 
938
<em class="replaceable"><code>*</code></em>
 
939
  |   
 
940
<em class="replaceable"><code>pattern</code></em>
 
941
... }</p></div><p>
851
942
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>
852
 
matches it.  <span class="emphasis"><em>pattern</em></span> is a string in the format described in the <a href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> section (note: For efficiency reasons, patterns
 
943
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
853
944
which scan information not available in the index, such as <code class="literal">˜b</code>,
854
945
<code class="literal">˜B</code> or <code class="literal">˜h</code>, may not be used).  <span class="emphasis"><em>value</em></span> is a
855
946
positive or negative integer.  A message's final score is the sum total of all
859
950
</p><p>
860
951
The <code class="literal">unscore</code> command removes score entries from the list.  You <span class="bold"><strong>must</strong></span>
861
952
specify the same pattern specified in the <code class="literal">score</code> command for it to be
862
 
removed.  The pattern ``*'' is a special token which means to clear the list
 
953
removed.  The pattern “<span class="quote">*</span>” is a special token which means to clear the list
863
954
of all score entries.
864
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="spam"></a>25. Spam detection</h2></div></div></div><p>
865
 
</p><div class="literallayout"><p><br />
866
 
Usage: <code class="literal">spam</code> <span class="emphasis"><em>pattern</em></span> <span class="emphasis"><em>format</em></span><br />
867
 
Usage: <code class="literal">nospam</code> <span class="emphasis"><em>pattern</em></span><br />
868
 
</p></div><p>
869
 
</p><p>
 
955
</p></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
956
<em class="replaceable"><code>pattern</code></em>
 
957
   
 
958
<em class="replaceable"><code>format</code></em>
 
959
 </p></div><div class="cmdsynopsis"><p><code class="command">nospam</code>  { 
 
960
<em class="replaceable"><code>*</code></em>
 
961
  |   
 
962
<em class="replaceable"><code>pattern</code></em>
 
963
 }</p></div><p>
870
964
Mutt has generalized support for external spam-scoring filters.
871
965
By defining your spam patterns with the <code class="literal">spam</code> and <code class="literal">nospam</code>
872
966
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
873
967
mail based on its spam attributes, as determined by the external
874
968
filter. You also can display the spam attributes in your index
875
 
display using the <code class="literal">%H</code> selector in the <a href="reference.html#index-format" title="3.100. index_format">$index_format</a> variable. (Tip: try <code class="literal">%?H?[%H] ?</code>
 
969
display using the <code class="literal">%H</code> selector in the <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> variable. (Tip: try <code class="literal">%?H?[%H] ?</code>
876
970
to display spam tags only when they are defined for a given message.)
877
971
</p><p>
878
972
Your first step is to define your external filter's spam patterns using
879
973
the <code class="literal">spam</code> command. <span class="emphasis"><em>pattern</em></span> should be a regular expression
880
974
that matches a header in a mail message. If any message in the mailbox
881
 
matches this regular expression, it will receive a ``spam tag'' or
882
 
``spam attribute'' (unless it also matches a <code class="literal">nospam</code> pattern -- see
 
975
matches this regular expression, it will receive a “<span class="quote">spam tag</span>” or
 
976
“<span class="quote">spam attribute</span>” (unless it also matches a <code class="literal">nospam</code> pattern -- see
883
977
below.) The appearance of this attribute is entirely up to you, and is
884
978
governed by the <span class="emphasis"><em>format</em></span> parameter. <span class="emphasis"><em>format</em></span> can be any static
885
979
text, but it also can include back-references from the <span class="emphasis"><em>pattern</em></span>
886
 
expression. (A regular expression ``back-reference'' refers to a
 
980
expression. (A regular expression “<span class="quote">back-reference</span>” refers to a
887
981
sub-expression contained within parentheses.) <code class="literal">%1</code> is replaced with
888
982
the first back-reference in the regex, <code class="literal">%2</code> with the second, etc.
889
983
</p><p>
897
991
</p><p>
898
992
For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
899
993
define these spam settings:
900
 
 
901
 
</p><pre class="screen">
 
994
</p><div class="example"><a id="ex-spam"></a><p class="title"><b>Example 3.13. Configuring spam detection</b></p><div class="example-contents"><pre class="screen">
902
995
spam "X-DCC-.*-Metrics:.*(....)=many"         "90+/DCC-%1"
903
996
spam "X-Spam-Status: Yes"                     "90+/SA"
904
997
spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
905
998
set spam_separator=", "
906
 
</pre><p>
907
 
 
908
 
</p><p>
909
 
If I then received a message that DCC registered with ``many'' hits
910
 
under the ``Fuz2'' checksum, and that PureMessage registered with a
 
999
</pre></div></div><br class="example-break" /><p>
 
1000
If I then received a message that DCC registered with “<span class="quote">many</span>” hits
 
1001
under the “<span class="quote">Fuz2</span>” checksum, and that PureMessage registered with a
911
1002
97% probability of being spam, that message's spam tag would read
912
 
<code class="literal">90+/DCC-Fuz2, 97/PM</code>. (The four characters before ``=many'' in a
913
 
DCC report indicate the checksum used -- in this case, ``Fuz2''.)
 
1003
<code class="literal">90+/DCC-Fuz2, 97/PM</code>. (The four characters before “<span class="quote">=many</span>” in a
 
1004
DCC report indicate the checksum used -- in this case, “<span class="quote">Fuz2</span>”.)
914
1005
</p><p>
915
1006
If the $spam_separator variable is unset, then each
916
1007
spam pattern match supersedes the previous one. Instead of getting
919
1010
The spam tag is what will be displayed in the index when you use
920
1011
<code class="literal">%H</code> in the <code class="literal">$index_format</code> variable. It's also the
921
1012
string that the <code class="literal">˜H</code> pattern-matching expression matches against for
922
 
<span class="emphasis"><em>search</em></span> and <span class="emphasis"><em>limit</em></span> functions. And it's what sorting by spam
 
1013
<code class="literal">&lt;search&gt;</code> and <code class="literal">&lt;limit&gt;</code> functions. And it's what sorting by spam
923
1014
attribute will use as a sort key.
924
1015
</p><p>
925
1016
That's a pretty complicated example, and most people's actual
934
1025
<code class="literal">sort -n</code>.) A message with no spam attributes at all -- that is, one
935
1026
that didn't match <span class="emphasis"><em>any</em></span> of your <code class="literal">spam</code> patterns -- is sorted at
936
1027
lowest priority. Numbers are sorted next, beginning with 0 and ranging
937
 
upward. Finally, non-numeric strings are sorted, with ``a'' taking lower
938
 
priority than ``z''. Clearly, in general, sorting by spam tags is most
 
1028
upward. Finally, non-numeric strings are sorted, with “<span class="quote">a</span>” taking lower
 
1029
priority than “<span class="quote">z</span>”. Clearly, in general, sorting by spam tags is most
939
1030
effective when you can coerce your filter to give you a raw number. But
940
1031
in case you can't, mutt can still do something useful.
941
1032
</p><p>
949
1040
remove the entry from the spam list, instead of adding an exception.
950
1041
Likewise, if the <span class="emphasis"><em>pattern</em></span> for a <code class="literal">spam</code> command matches an entry
951
1042
on the <code class="literal">nospam</code> list, that <code class="literal">nospam</code> entry will be removed. If the
952
 
<span class="emphasis"><em>pattern</em></span> for <code class="literal">nospam</code> is ``*'', <span class="emphasis"><em>all entries on both lists</em></span>
 
1043
<span class="emphasis"><em>pattern</em></span> for <code class="literal">nospam</code> is “<span class="quote">*</span>”, <span class="emphasis"><em>all entries on both lists</em></span>
953
1044
will be removed. This might be the default action if you use <code class="literal">spam</code>
954
1045
and <code class="literal">nospam</code> in conjunction with a <code class="literal">folder-hook</code>.
955
1046
</p><p>
957
1048
You can even do your own primitive spam detection within mutt -- for
958
1049
example, if you consider all mail from <code class="literal">MAILER-DAEMON</code> to be spam,
959
1050
you can use a <code class="literal">spam</code> command like this:
960
 
</p><p>
961
 
 
962
1051
</p><pre class="screen">
963
1052
spam "^From: .*MAILER-DAEMON"       "999"
964
 
</pre><p>
965
 
 
966
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="set-commands"></a>26.1. Commands</h3></div></div></div><p>
 
1053
</pre></div><div class="sect1" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="set-commands"></a>26.1. Commands</h3></div></div></div><p>
967
1054
The following commands are available to manipulate and query variables:
968
 
</p><p>
969
 
</p><div class="literallayout"><p><br />
970
 
Usage: <code class="literal">set</code> [no|inv]<span class="emphasis"><em>variable</em></span>[=<span class="emphasis"><em>value</em></span>] [ <span class="emphasis"><em>variable</em></span> ... ]<br />
971
 
Usage: <code class="literal">toggle</code> <span class="emphasis"><em>variable</em></span> [<span class="emphasis"><em>variable</em></span> ... ]<br />
972
 
Usage: <code class="literal">unset</code> <span class="emphasis"><em>variable</em></span> [<span class="emphasis"><em>variable</em></span> ... ]<br />
973
 
Usage: <code class="literal">reset</code> <span class="emphasis"><em>variable</em></span> [<span class="emphasis"><em>variable</em></span> ... ]<br />
974
 
</p></div><p>
975
 
</p><p>
976
 
This command is used to set (and unset) <a href="reference.html#variables" title="3. Configuration variables">configuration variables</a>.  There are four basic types of variables:
 
1055
</p><p>Usage:</p><div class="cmdsynopsis"><p><code class="command">set</code>  { 
 
1056
[ <code class="option">no</code>  |   <code class="option">inv</code> ]
 
1057
<em class="replaceable"><code>variable</code></em>
 
1058
  |   
 
1059
<em class="replaceable"><code>variable=value</code></em>
 
1060
 } [...]</p></div><div class="cmdsynopsis"><p><code class="command">toggle</code>   
 
1061
<em class="replaceable"><code>variable</code></em>
 
1062
  [
 
1063
<em class="replaceable"><code>variable</code></em>
 
1064
...]</p></div><div class="cmdsynopsis"><p><code class="command">unset</code>   
 
1065
<em class="replaceable"><code>variable</code></em>
 
1066
  [
 
1067
<em class="replaceable"><code>variable</code></em>
 
1068
...]</p></div><div class="cmdsynopsis"><p><code class="command">reset</code>   
 
1069
<em class="replaceable"><code>variable</code></em>
 
1070
  [
 
1071
<em class="replaceable"><code>variable</code></em>
 
1072
...]</p></div><p>
 
1073
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:
977
1074
boolean, number, string and quadoption.  <span class="emphasis"><em>boolean</em></span> variables can be
978
1075
<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
979
1076
assigned a positive integer value.
980
 
</p><p>
981
 
<span class="emphasis"><em>string</em></span> variables consist of any number of printable characters.
982
 
<span class="emphasis"><em>strings</em></span> must be enclosed in quotes if they contain spaces or tabs.  You
983
 
may also use the ``C'' escape sequences <span class="bold"><strong>\n</strong></span> and <span class="bold"><strong>\t</strong></span> for
984
 
newline and tab, respectively.
985
 
</p><p>
 
1077
<span class="emphasis"><em>string</em></span> variables consist of any number of printable characters and
 
1078
must be enclosed in quotes if they contain spaces or tabs.  You
 
1079
may also use the escape sequences “<span class="quote">\n</span>” and “<span class="quote">\t</span>” for newline and tab, respectively.
986
1080
<span class="emphasis"><em>quadoption</em></span> variables are used to control whether or not to be prompted
987
1081
for certain actions, or to specify a default action.  A value of <span class="emphasis"><em>yes</em></span>
988
1082
will cause the action to be carried out automatically as if you had answered
989
1083
yes to the question.  Similarly, a value of <span class="emphasis"><em>no</em></span> will cause the
990
 
action to be carried out as if you had answered ``no.''  A value of
991
 
<span class="emphasis"><em>ask-yes</em></span> will cause a prompt with a default answer of ``yes'' and
992
 
<span class="emphasis"><em>ask-no</em></span> will provide a default answer of ``no.''
 
1084
action to be carried out as if you had answered “<span class="quote">no.</span>”  A value of
 
1085
<span class="emphasis"><em>ask-yes</em></span> will cause a prompt with a default answer of “<span class="quote">yes</span>” and
 
1086
<span class="emphasis"><em>ask-no</em></span> will provide a default answer of “<span class="quote">no.</span>”
993
1087
</p><p>
994
 
Prefixing a variable with ``no'' will unset it.  Example: <code class="literal">set noaskbcc</code>.
 
1088
Prefixing a variable with “<span class="quote">no</span>” will unset it.  Example: <code class="literal">set noaskbcc</code>.
995
1089
</p><p>
996
1090
For <span class="emphasis"><em>boolean</em></span> variables, you may optionally prefix the variable name with
997
1091
<code class="literal">inv</code> to toggle the value (on or off).  This is useful when writing
1003
1097
The <code class="literal">unset</code> command automatically prepends the <code class="literal">no</code> prefix to all
1004
1098
specified variables.
1005
1099
</p><p>
1006
 
Using the enter-command function in the <span class="emphasis"><em>index</em></span> menu, you can query the
 
1100
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
1007
1101
value of a variable by prefixing the name of the variable with a question
1008
1102
mark:
1009
 
</p><p>
1010
 
 
1011
1103
</p><pre class="screen">
1012
1104
set ?allow_8bit
1013
1105
</pre><p>
1014
 
 
1015
 
</p><p>
1016
 
The question mark is actually only required for boolean and quadoption 
 
1106
The question mark is actually only required for boolean and quadoption
1017
1107
variables.
1018
1108
</p><p>
1019
1109
The <code class="literal">reset</code> command resets all given variables to the compile time
1020
1110
defaults (hopefully mentioned in this manual). If you use the command
1021
 
<code class="literal">set</code> and prefix the variable with ``&amp;'' this has the same
 
1111
<code class="literal">set</code> and prefix the variable with “<span class="quote">&amp;</span>” this has the same
1022
1112
behavior as the reset command.
1023
1113
</p><p>
1024
 
With the <code class="literal">reset</code> command there exists the special variable ``all'',
 
1114
With the <code class="literal">reset</code> command there exists the special variable “<span class="quote">all</span>”,
1025
1115
which allows you to reset all variables to their system defaults.
1026
1116
</p></div><div class="sect2" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="set-myvar-intro"></a>26.2.1. Introduction</h4></div></div></div><p>
1027
1117
Along with the variables listed in the
1028
 
<a href="reference.html#variables" title="3. Configuration variables">Configuration variables</a> section, mutt
 
1118
<a class="link" href="reference.html#variables" title="3. Configuration variables">Configuration variables</a> section, mutt
1029
1119
supports user-defined variables with names starting
1030
1120
with <code class="literal">my_</code> as in, for
1031
1121
example, <code class="literal">my_cfgdir</code>.
1032
1122
</p><p>
1033
 
The <code class="literal">set</code> command creates a
1034
 
custom <code class="literal">$my_</code> variable and changes its
1035
 
value. The <code class="literal">unset</code> and <code class="literal">reset</code>
 
1123
The <code class="literal">set</code> command either creates a
 
1124
custom <code class="literal">my_</code> variable or changes its
 
1125
value if it does exist already. The <code class="literal">unset</code> and <code class="literal">reset</code>
1036
1126
commands remove the variable entirely.
1037
1127
</p><p>
1038
1128
Since user-defined variables are expanded in the same way that
1039
1129
environment variables are (except for
1040
 
the <a href="gettingstarted.html#shell-escape">shell-escape</a> command), this
1041
 
feature can be used to make configuration files more readable.
 
1130
the <a class="link" href="gettingstarted.html#shell-escape">shell-escape</a> command and
 
1131
backtick expansion), this feature can be used to make configuration
 
1132
files more readable.
1042
1133
</p></div><div class="sect3" lang="en" xml:lang="en"><div class="titlepage"><div><div><h4 class="title"><a id="set-myvar-examples"></a>26.2.2. Examples</h4></div></div></div><p>
1043
 
The following example defines and uses the variable <code class="literal">my_cfgdir</code> 
1044
 
to abbreviate the calls of the <a href="configuration.html#source" title="27. Reading initialization commands from another file">source</a> command:
1045
 
</p><p>
1046
 
</p><pre class="screen">
 
1134
The following example defines and uses the variable <code class="literal">my_cfgdir</code>
 
1135
to abbreviate the calls of the <a class="link" href="configuration.html#source" title="27. Reading initialization commands from another file">source</a> command:
 
1136
</p><div class="example"><a id="ex-myvar1"></a><p class="title"><b>Example 3.14. Using user-defined variables for config file readability</b></p><div class="example-contents"><pre class="screen">
1047
1137
set my_cfgdir = $HOME/mutt/config
1048
1138
 
1049
1139
source $my_cfgdir/hooks
1050
1140
source $my_cfgdir/macros
1051
1141
# more source commands...
1052
 
</pre><p>
1053
 
</p><p>
 
1142
</pre></div></div><br class="example-break" /><p>
1054
1143
A custom variable can also be used in macros to backup the current value
1055
 
of another variable. In the following example, the value of the 
1056
 
<a href="reference.html#delete" title="3.42. delete">$delete</a> is changed temporarily
 
1144
of another variable. In the following example, the value of the
 
1145
<a class="link" href="reference.html#delete" title="3.42. delete">$delete</a> is changed temporarily
1057
1146
while its original value is saved as <code class="literal">my_delete</code>.
1058
 
After the macro has executed all commands, the original value of <a href="reference.html#delete" title="3.42. delete">$delete</a> is restored.
1059
 
</p><p>
1060
 
</p><pre class="screen">
 
1147
After the macro has executed all commands, the original value of <a class="link" href="reference.html#delete" title="3.42. delete">$delete</a> is restored.
 
1148
</p><div class="example"><a id="ex-myvar2"></a><p class="title"><b>Example 3.15. Using user-defined variables for backing up other config option values</b></p><div class="example-contents"><pre class="screen">
1061
1149
macro pager ,x '\
1062
1150
&lt;enter-command&gt;set my_delete=$delete&lt;enter&gt;\
1063
1151
&lt;enter-command&gt;set delete=yes&lt;enter&gt;\
1064
1152
...\
1065
1153
&lt;enter-command&gt;set delete=$my_delete&lt;enter&gt;'
1066
 
</pre><p>
1067
 
</p><p>
 
1154
</pre></div></div><br class="example-break" /><p>
1068
1155
Since mutt expands such values already when parsing the configuration
1069
1156
file(s), the value of <code class="literal">$my_delete</code> in the
1070
1157
last example would be the value of <code class="literal">$delete</code> exactly
1074
1161
<code class="literal">$my_delete</code>. However, the expansion can
1075
1162
be deferred to runtime, as shown in the next example, when escaping the
1076
1163
dollar sign.
1077
 
</p><p>
1078
 
</p><pre class="screen">
 
1164
</p><div class="example"><a id="ex-myvar3"></a><p class="title"><b>Example 3.16. Deferring user-defined variable expansion to runtime</b></p><div class="example-contents"><pre class="screen">
1079
1165
macro pager &lt;PageDown&gt; "\
1080
1166
&lt;enter-command&gt; set my_old_pager_stop=\$pager_stop pager_stop&lt;Enter&gt;\
1081
1167
&lt;next-page&gt;\
1082
1168
&lt;enter-command&gt; set pager_stop=\$my_old_pager_stop&lt;Enter&gt;\
1083
1169
&lt;enter-command&gt; unset my_old_pager_stop&lt;Enter&gt;"
1084
 
</pre><p>
1085
 
</p><p>
 
1170
</pre></div></div><br class="example-break" /><p>
1086
1171
Note that there is a space
1087
1172
between <code class="literal">&lt;enter-command&gt;</code> and
1088
1173
the <code class="literal">set</code> configuration command, preventing mutt from
1089
1174
recording the macro's commands into its history.
1090
 
</p></div></div></div><div class="sect1" lang="en" xml:lang="en"><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>
1091
 
Usage: <code class="literal">source</code> <span class="emphasis"><em>filename</em></span>
1092
 
</p><p>
 
1175
</p></div></div></div><div class="sect1" lang="en" xml:lang="en"><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>   
 
1176
<em class="replaceable"><code>filename</code></em>
 
1177
 </p></div><p>
1093
1178
This command allows the inclusion of initialization commands
1094
1179
from other files.  For example, I place all of my aliases in
1095
1180
<code class="literal">˜/.mail_aliases</code> so that I can make my
1096
1181
<code class="literal">˜/.muttrc</code> readable and keep my aliases private.
1097
1182
</p><p>
1098
 
If the filename begins with a tilde (``˜''), it will be expanded to the
 
1183
If the filename begins with a tilde (“<span class="quote">˜</span>”), it will be expanded to the
1099
1184
path of your home directory.
1100
1185
</p><p>
1101
1186
If the filename ends with a vertical bar (|), then <span class="emphasis"><em>filename</em></span> is
1102
1187
considered to be an executable program from which to read input (eg.
1103
1188
<code class="literal">source ˜/bin/myscript|</code>).
1104
 
</p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="unhook"></a>28. Removing hooks</h2></div></div></div><p>
1105
 
Usage: <code class="literal">unhook</code> [ * | <span class="emphasis"><em>hook-type</em></span> ]
1106
 
</p><p>
 
1189
</p></div><div class="sect1" lang="en" xml:lang="en"><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>  { 
 
1190
<em class="replaceable"><code>*</code></em>
 
1191
  |   
 
1192
<em class="replaceable"><code>hook-type</code></em>
 
1193
 }</p></div><p>
1107
1194
This command permits you to flush hooks you have previously defined.
1108
 
You can either remove all hooks by giving the ``*'' character as an
 
1195
You can either remove all hooks by giving the “<span class="quote">*</span>” character as an
1109
1196
argument, or you can remove all hooks of a specific type by saying
1110
1197
something like <code class="literal">unhook send-hook</code>.
1111
 
</p></div><div class="sect1" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id470510"></a>29.1. Basic usage</h3></div></div></div><p>
 
1198
</p></div><div class="sect1" lang="en" xml:lang="en"><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" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="formatstrings-basics"></a>29.1. Basic usage</h3></div></div></div><p>
1112
1199
Format strings are a general concept you'll find in several locations
1113
1200
through the mutt configuration, especially in the
1114
 
<a href="reference.html#index-format" title="3.100. index_format">$index_format"</a>,
1115
 
<a href="reference.html#pager-format" title="3.139. pager_format">$pager_format"</a>,
1116
 
<a href="reference.html#status-format" title="3.278. status_format">$status_format"</a>,
1117
 
and other ``*_format'' variables. These can be very straightforward,
 
1201
<a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a>,
 
1202
<a class="link" href="reference.html#pager-format" title="3.140. pager_format">$pager_format</a>,
 
1203
<a class="link" href="reference.html#status-format" title="3.279. status_format">$status_format</a>,
 
1204
and other “<span class="quote">*_format</span>” variables. These can be very straightforward,
1118
1205
and it's quite possible you already know how to use them.
1119
1206
</p><p>
1120
1207
The most basic format string element is a percent symbol followed
1121
1208
by another character. For example, <code class="literal">%s</code>
1122
 
represents a message's Subject: header in the <a href="reference.html#index-format" title="3.100. index_format">$index_format"</a> variable. The
1123
 
``expandos'' available are documented with each format variable, but
 
1209
represents a message's Subject: header in the <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> variable. The
 
1210
“<span class="quote">expandos</span>” available are documented with each format variable, but
1124
1211
there are general modifiers available with all formatting expandos,
1125
1212
too. Those are our concern here.
1126
1213
</p><p>
1127
 
Some of the modifers are borrowed right out of C (though you might
1128
 
know them from Perl, Python, shell, or another langugage). These are
 
1214
Some of the modifiers are borrowed right out of C (though you might
 
1215
know them from Perl, Python, shell, or another language). These are
1129
1216
the [-]m.n modifiers, as in <code class="literal">%-12.12s</code>. As with
1130
1217
such programming languages, these modifiers allow you to specify the
1131
 
minumum and maximum size of the resulting string, as well as its
1132
 
justification. If the ``-'' sign follows the percent, the string will
 
1218
minimum and maximum size of the resulting string, as well as its
 
1219
justification. If the “<span class="quote">-</span>” sign follows the percent, the string will
1133
1220
be left-justified instead of right-justified. If there's a number
1134
1221
immediately following that, it's the minimum amount of space the
1135
1222
formatted string will occupy -- if it's naturally smaller than that, it
1151
1238
<code class="literal">$index_format</code>. If the expansion
1152
1239
results in a string less than 14 characters, it will be centered in a
1153
1240
14-character space.  If the X-Label for a message were "test", that
1154
 
expansion would look like ``     test     ''.
 
1241
expansion would look like “<span class="quote">     test     </span>”.
1155
1242
</p><p>
1156
1243
There are two very little-known modifiers that affect the way that an
1157
 
expando is replaced. If there is an underline (``_'') character
 
1244
expando is replaced. If there is an underline (“<span class="quote">_</span>”) character
1158
1245
between any format modifiers (as above) and the expando letter, it will
1159
 
expands in all lower case. And if you use a colon (``:''), it will
 
1246
expands in all lower case. And if you use a colon (“<span class="quote">:</span>”), it will
1160
1247
replace all decimal points with underlines.
1161
 
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="id470640"></a>29.2. Filters</h3></div></div></div><p>
1162
 
Any format string ending in a vertical bar (``|'') will be
 
1248
</p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="formatstrings-filters"></a>29.2. Filters</h3></div></div></div><p>
 
1249
Any format string ending in a vertical bar (“<span class="quote">|</span>”) will be
1163
1250
expanded and piped through the first word in the string, using spaces
1164
1251
as separator. The string returned will be used for display.
1165
1252
If the returned string ends in %, it will be passed through
1168
1255
</p><p>
1169
1256
All % expandos in a format string are expanded before the script
1170
1257
is called so that:
1171
 
</p><pre class="screen">
 
1258
</p><div class="example"><a id="ex-fmtpipe"></a><p class="title"><b>Example 3.17. Using external filters in format strings</b></p><div class="example-contents"><pre class="screen">
1172
1259
set status_format="script.sh '%r %f (%L)'|"
1173
 
</pre><p>
 
1260
</pre></div></div><br class="example-break" /><p>
1174
1261
will make mutt expand <code class="literal">%r</code>,
1175
1262
<code class="literal">%f</code> and <code class="literal">%L</code>
1176
1263
before calling the script. The example also shows that arguments can be