1 <?xml version="1.0" encoding="UTF-8" standalone="no"?>
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 4. Advanced Usage</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="configuration.html" title="Chapter 3. Configuration" /><link rel="next" href="mimesupport.html" title="Chapter 5. Mutt's MIME Support" /><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;
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; }
24 </style></head><body><div class="navheader"><table width="100%" summary="Navigation header"><tr><th colspan="3" align="center">Chapter 4. Advanced Usage</th></tr><tr><td width="20%" align="left"><a accesskey="p" href="configuration.html">Prev</a> </td><th width="60%" align="center"> </th><td width="20%" align="right"> <a accesskey="n" href="mimesupport.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="advancedusage"></a>Chapter 4. Advanced Usage</h2></div></div></div><div class="toc"><p><b>Table of Contents</b></p><dl><dt><span class="sect1"><a href="advancedusage.html#regexp">1. Regular Expressions</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#patterns">2. Patterns: Searching, Limiting and Tagging</a></span></dt><dd><dl><dt><span class="sect2"><a href="advancedusage.html#patterns-modifier">2.1. Pattern Modifier</a></span></dt><dt><span class="sect2"><a href="advancedusage.html#simple-patterns">2.2. Simple Patterns</a></span></dt><dt><span class="sect2"><a href="advancedusage.html#complex-patterns">2.3. Complex Patterns</a></span></dt><dt><span class="sect2"><a href="advancedusage.html#date-patterns">2.4. Searching by Date</a></span></dt></dl></dd><dt><span class="sect1"><a href="advancedusage.html#tags">3. Using Tags</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#hooks">4. Using Hooks</a></span></dt><dd><dl><dt><span class="sect2"><a href="advancedusage.html#pattern-hook">4.1. Message Matching in Hooks</a></span></dt></dl></dd><dt><span class="sect1"><a href="advancedusage.html#query">5. External Address Queries</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#mailbox-formats">6. Mailbox Formats</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#shortcuts">7. Mailbox Shortcuts</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#using-lists">8. Handling Mailing Lists</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#handling-folders">9. Handling multiple folders</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#editing-threads">10. Editing threads</a></span></dt><dd><dl><dt><span class="sect2"><a href="advancedusage.html#link-threads">10.1. Linking threads</a></span></dt><dt><span class="sect2"><a href="advancedusage.html#break-threads">10.2. Breaking threads</a></span></dt></dl></dd><dt><span class="sect1"><a href="advancedusage.html#dsn">11. Delivery Status Notification (DSN) Support</a></span></dt><dt><span class="sect1"><a href="advancedusage.html#urlview">12. Start a WWW Browser on URLs</a></span></dt></dl></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="regexp"></a>1. Regular Expressions</h2></div></div></div><p>
25 All string patterns in Mutt including those in more complex
26 <a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> must be specified
27 using regular expressions (regexp) in the “<span class="quote">POSIX extended</span>” syntax (which
28 is more or less the syntax used by egrep and GNU awk). For your
29 convenience, we have included below a brief description of this syntax.
31 The search is case sensitive if the pattern contains at least one upper
32 case letter, and case insensitive otherwise.
33 </p><div class="note"><h3 class="title">Note</h3><p>
34 Note that “<span class="quote">\</span>”
35 must be quoted if used for a regular expression in an initialization
36 command: “<span class="quote">\\</span>”.
38 A regular expression is a pattern that describes a set of strings.
39 Regular expressions are constructed analogously to arithmetic
40 expressions, by using various operators to combine smaller expressions.
41 </p><div class="note"><h3 class="title">Note</h3><p>
42 Note that the regular expression can be enclosed/delimited by either "
43 or ' which is useful if the regular expression includes a white-space
44 character. See <a class="xref" href="configuration.html#muttrc-syntax" title="2. Syntax of Initialization Files">Syntax of Initialization Files</a>
45 for more information on " and ' delimiter processing. To match a
46 literal " or ' you must preface it with \ (backslash).
48 The fundamental building blocks are the regular expressions that match
49 a single character. Most characters, including all letters and digits,
50 are regular expressions that match themselves. Any metacharacter with
51 special meaning may be quoted by preceding it with a backslash.
53 The period “<span class="quote">.</span>” matches any single character. The caret “<span class="quote">^</span>” and
54 the dollar sign “<span class="quote">$</span>” are metacharacters that respectively match
55 the empty string at the beginning and end of a line.
57 A list of characters enclosed by “<span class="quote">[</span>” and “<span class="quote">]</span>” matches any
58 single character in that list; if the first character of the list
59 is a caret “<span class="quote">^</span>” then it matches any character <span class="bold"><strong>not</strong></span> in the
60 list. For example, the regular expression <span class="bold"><strong>[0123456789]</strong></span>
61 matches any single digit. A range of ASCII characters may be specified
62 by giving the first and last characters, separated by a hyphen
63 “<span class="quote">-</span>”. Most metacharacters lose their special meaning inside
64 lists. To include a literal “<span class="quote">]</span>” place it first in the list.
65 Similarly, to include a literal “<span class="quote">^</span>” place it anywhere but first.
66 Finally, to include a literal hyphen “<span class="quote">-</span>” place it last.
68 Certain named classes of characters are predefined. Character classes
69 consist of “<span class="quote">[:</span>”, a keyword denoting the class, and “<span class="quote">:]</span>”.
70 The following classes are defined by the POSIX standard in
71 <a class="xref" href="advancedusage.html#posix-regex-char-classes" title="Table 4.1. POSIX regular expression character classes">Table 4.1, “POSIX regular expression character classes”</a>
72 </p><div class="table"><a id="posix-regex-char-classes"></a><p class="title"><b>Table 4.1. POSIX regular expression character classes</b></p><div class="table-contents"><table summary="POSIX regular expression character classes" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Character class</th><th>Description</th></tr></thead><tbody><tr><td>[:alnum:]</td><td>Alphanumeric characters</td></tr><tr><td>[:alpha:]</td><td>Alphabetic characters</td></tr><tr><td>[:blank:]</td><td>Space or tab characters</td></tr><tr><td>[:cntrl:]</td><td>Control characters</td></tr><tr><td>[:digit:]</td><td>Numeric characters</td></tr><tr><td>[:graph:]</td><td>Characters that are both printable and visible. (A space is printable, but not visible, while an “<span class="quote">a</span>” is both)</td></tr><tr><td>[:lower:]</td><td>Lower-case alphabetic characters</td></tr><tr><td>[:print:]</td><td>Printable characters (characters that are not control characters)</td></tr><tr><td>[:punct:]</td><td>Punctuation characters (characters that are not letter, digits, control characters, or space characters)</td></tr><tr><td>[:space:]</td><td>Space characters (such as space, tab and formfeed, to name a few)</td></tr><tr><td>[:upper:]</td><td>Upper-case alphabetic characters</td></tr><tr><td>[:xdigit:]</td><td>Characters that are hexadecimal digits</td></tr></tbody></table></div></div><br class="table-break" /><p>
73 A character class is only valid in a regular expression inside the
74 brackets of a character list.
75 </p><div class="note"><h3 class="title">Note</h3><p>
76 Note that the brackets in these
77 class names are part of the symbolic names, and must be included
78 in addition to the brackets delimiting the bracket list. For
79 example, <span class="bold"><strong>[[:digit:]]</strong></span> is equivalent to
80 <span class="bold"><strong>[0-9]</strong></span>.
82 Two additional special sequences can appear in character lists. These
83 apply to non-ASCII character sets, which can have single symbols (called
84 collating elements) that are represented with more than one character,
85 as well as several characters that are equivalent for collating or
87 </p><div class="variablelist"><dl><dt><span class="term">Collating Symbols</span></dt><dd><p>
88 A collating symbol is a multi-character collating element enclosed in
89 “<span class="quote">[.</span>” and “<span class="quote">.]</span>”. For example, if “<span class="quote">ch</span>” is a collating
90 element, then <span class="bold"><strong>[[.ch.]]</strong></span> is a regexp that matches
91 this collating element, while <span class="bold"><strong>[ch]</strong></span> is a regexp that
92 matches either “<span class="quote">c</span>” or “<span class="quote">h</span>”.
93 </p></dd><dt><span class="term">Equivalence Classes</span></dt><dd><p>
94 An equivalence class is a locale-specific name for a list of
95 characters that are equivalent. The name is enclosed in “<span class="quote">[=</span>”
96 and “<span class="quote">=]</span>”. For example, the name “<span class="quote">e</span>” might be used to
97 represent all of “<span class="quote">è</span>” “<span class="quote">é</span>” and “<span class="quote">e</span>”. In this case,
98 <span class="bold"><strong>[[=e=]]</strong></span> is a regexp that matches any of
99 “<span class="quote">è</span>”, “<span class="quote">é</span>” and “<span class="quote">e</span>”.
100 </p></dd></dl></div><p>
101 A regular expression matching a single character may be followed by one
102 of several repetition operators described in <a class="xref" href="advancedusage.html#regex-repeat" title="Table 4.2. Regular expression repetition operators">Table 4.2, “Regular expression repetition operators”</a>.
103 </p><div class="table"><a id="regex-repeat"></a><p class="title"><b>Table 4.2. Regular expression repetition operators</b></p><div class="table-contents"><table summary="Regular expression repetition operators" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Operator</th><th>Description</th></tr></thead><tbody><tr><td>?</td><td>The preceding item is optional and matched at most once</td></tr><tr><td>*</td><td>The preceding item will be matched zero or more times</td></tr><tr><td>+</td><td>The preceding item will be matched one or more times</td></tr><tr><td>{n}</td><td>The preceding item is matched exactly <span class="emphasis"><em>n</em></span> times</td></tr><tr><td>{n,}</td><td>The preceding item is matched <span class="emphasis"><em>n</em></span> or more times</td></tr><tr><td>{,m}</td><td>The preceding item is matched at most <span class="emphasis"><em>m</em></span> times</td></tr><tr><td>{n,m}</td><td>The preceding item is matched at least <span class="emphasis"><em>n</em></span> times, but no more than <span class="emphasis"><em>m</em></span> times</td></tr></tbody></table></div></div><br class="table-break" /><p>
104 Two regular expressions may be concatenated; the resulting regular
105 expression matches any string formed by concatenating two substrings
106 that respectively match the concatenated subexpressions.
108 Two regular expressions may be joined by the infix operator “<span class="quote">|</span>”;
109 the resulting regular expression matches any string matching either
112 Repetition takes precedence over concatenation, which in turn takes
113 precedence over alternation. A whole subexpression may be enclosed in
114 parentheses to override these precedence rules.
115 </p><div class="note"><h3 class="title">Note</h3><p>
116 If you compile Mutt with the GNU <span class="emphasis"><em>rx</em></span> package, the
117 following operators may also be used in regular expressions as described in <a class="xref" href="advancedusage.html#regex-gnu-ext" title="Table 4.3. GNU regular expression extensions">Table 4.3, “GNU regular expression extensions”</a>.
118 </p></div><div class="table"><a id="regex-gnu-ext"></a><p class="title"><b>Table 4.3. GNU regular expression extensions</b></p><div class="table-contents"><table summary="GNU regular expression extensions" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Expression</th><th>Description</th></tr></thead><tbody><tr><td>\\y</td><td>Matches the empty string at either the beginning or the end of a word</td></tr><tr><td>\\B</td><td>Matches the empty string within a word</td></tr><tr><td>\\<</td><td>Matches the empty string at the beginning of a word</td></tr><tr><td>\\></td><td>Matches the empty string at the end of a word</td></tr><tr><td>\\w</td><td>Matches any word-constituent character (letter, digit, or underscore)</td></tr><tr><td>\\W</td><td>Matches any character that is not word-constituent</td></tr><tr><td>\\`</td><td>Matches the empty string at the beginning of a buffer (string)</td></tr><tr><td>\\'</td><td>Matches the empty string at the end of a buffer</td></tr></tbody></table></div></div><br class="table-break" /><p>
119 Please note however that these operators are not defined by POSIX, so
120 they may or may not be available in stock libraries on various systems.
121 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="patterns"></a>2. Patterns: Searching, Limiting and Tagging</h2></div></div></div><p>
122 Many of Mutt's commands allow you to specify a pattern to match
123 (<code class="literal">limit</code>, <code class="literal">tag-pattern</code>,
124 <code class="literal">delete-pattern</code>, etc.). <a class="xref" href="advancedusage.html#tab-patterns" title="Table 4.4. Pattern modifiers">Table 4.4, “Pattern modifiers”</a>
125 shows several ways to select messages.
126 </p><div class="table"><a id="tab-patterns"></a><p class="title"><b>Table 4.4. Pattern modifiers</b></p><div class="table-contents"><table summary="Pattern modifiers" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Pattern modifier</th><th>Description</th></tr></thead><tbody><tr><td>~A</td><td>all messages</td></tr><tr><td>~b <span class="emphasis"><em>EXPR</em></span></td><td>messages which contain <span class="emphasis"><em>EXPR</em></span> in the message body</td></tr><tr><td>=b <span class="emphasis"><em>STRING</em></span></td><td>messages which contain <span class="emphasis"><em>STRING</em></span> in the message body. If IMAP is enabled, searches for <span class="emphasis"><em>STRING</em></span> on the server, rather than downloading each message and searching it locally.</td></tr><tr><td>~B <span class="emphasis"><em>EXPR</em></span></td><td>messages which contain <span class="emphasis"><em>EXPR</em></span> in the whole message</td></tr><tr><td>~c <span class="emphasis"><em>EXPR</em></span></td><td>messages carbon-copied to <span class="emphasis"><em>EXPR</em></span></td></tr><tr><td>%c <span class="emphasis"><em>GROUP</em></span></td><td>messages carbon-copied to any member of <span class="emphasis"><em>GROUP</em></span></td></tr><tr><td>~C <span class="emphasis"><em>EXPR</em></span></td><td>messages either to: or cc: <span class="emphasis"><em>EXPR</em></span></td></tr><tr><td>%C <span class="emphasis"><em>GROUP</em></span></td><td>messages either to: or cc: to any member of <span class="emphasis"><em>GROUP</em></span></td></tr><tr><td>~d [<span class="emphasis"><em>MIN</em></span>]-[<span class="emphasis"><em>MAX</em></span>]</td><td>messages with “<span class="quote">date-sent</span>” in a Date range</td></tr><tr><td>~D</td><td>deleted messages</td></tr><tr><td>~e <span class="emphasis"><em>EXPR</em></span></td><td>messages which contains <span class="emphasis"><em>EXPR</em></span> in the “<span class="quote">Sender</span>” field</td></tr><tr><td>%e <span class="emphasis"><em>GROUP</em></span></td><td>messages which contain a member of <span class="emphasis"><em>GROUP</em></span> in the “<span class="quote">Sender</span>” field</td></tr><tr><td>~E</td><td>expired messages</td></tr><tr><td>~F</td><td>flagged messages</td></tr><tr><td>~f <span class="emphasis"><em>EXPR</em></span></td><td>messages originating from <span class="emphasis"><em>EXPR</em></span></td></tr><tr><td>%f <span class="emphasis"><em>GROUP</em></span></td><td>messages originating from any member of <span class="emphasis"><em>GROUP</em></span></td></tr><tr><td>~g</td><td>cryptographically signed messages</td></tr><tr><td>~G</td><td>cryptographically encrypted messages</td></tr><tr><td>~h <span class="emphasis"><em>EXPR</em></span></td><td>messages which contain <span class="emphasis"><em>EXPR</em></span> in the message header</td></tr><tr><td>~H <span class="emphasis"><em>EXPR</em></span></td><td>messages with a spam attribute matching <span class="emphasis"><em>EXPR</em></span></td></tr><tr><td>~i <span class="emphasis"><em>EXPR</em></span></td><td>messages which match <span class="emphasis"><em>EXPR</em></span> in the “<span class="quote">Message-ID</span>” field</td></tr><tr><td>~k</td><td>messages which contain PGP key material</td></tr><tr><td>~L <span class="emphasis"><em>EXPR</em></span></td><td>messages either originated or received by <span class="emphasis"><em>EXPR</em></span></td></tr><tr><td>%L <span class="emphasis"><em>GROUP</em></span></td><td>message either originated or received by any member of <span class="emphasis"><em>GROUP</em></span></td></tr><tr><td>~l</td><td>messages addressed to a known mailing list</td></tr><tr><td>~m [<span class="emphasis"><em>MIN</em></span>]-[<span class="emphasis"><em>MAX</em></span>]</td><td>messages in the range <span class="emphasis"><em>MIN</em></span> to <span class="emphasis"><em>MAX</em></span> *)</td></tr><tr><td>~n [<span class="emphasis"><em>MIN</em></span>]-[<span class="emphasis"><em>MAX</em></span>]</td><td>messages with a score in the range <span class="emphasis"><em>MIN</em></span> to <span class="emphasis"><em>MAX</em></span> *)</td></tr><tr><td>~N</td><td>new messages</td></tr><tr><td>~O</td><td>old messages</td></tr><tr><td>~p</td><td>messages addressed to you (consults alternates)</td></tr><tr><td>~P</td><td>messages from you (consults alternates)</td></tr><tr><td>~Q</td><td>messages which have been replied to</td></tr><tr><td>~r [<span class="emphasis"><em>MIN</em></span>]-[<span class="emphasis"><em>MAX</em></span>]</td><td>messages with “<span class="quote">date-received</span>” in a Date range</td></tr><tr><td>~R</td><td>read messages</td></tr><tr><td>~s <span class="emphasis"><em>EXPR</em></span></td><td>messages having <span class="emphasis"><em>EXPR</em></span> in the “<span class="quote">Subject</span>” field.</td></tr><tr><td>~S</td><td>superseded messages</td></tr><tr><td>~t <span class="emphasis"><em>EXPR</em></span></td><td>messages addressed to <span class="emphasis"><em>EXPR</em></span></td></tr><tr><td>~T</td><td>tagged messages</td></tr><tr><td>~u</td><td>messages addressed to a subscribed mailing list</td></tr><tr><td>~U</td><td>unread messages</td></tr><tr><td>~v</td><td>messages part of a collapsed thread.</td></tr><tr><td>~V</td><td>cryptographically verified messages</td></tr><tr><td>~x <span class="emphasis"><em>EXPR</em></span></td><td>messages which contain <span class="emphasis"><em>EXPR</em></span> in the “<span class="quote">References</span>” field</td></tr><tr><td>~X [<span class="emphasis"><em>MIN</em></span>]-[<span class="emphasis"><em>MAX</em></span>]</td><td>messages with <span class="emphasis"><em>MIN</em></span> to <span class="emphasis"><em>MAX</em></span> attachments *)</td></tr><tr><td>~y <span class="emphasis"><em>EXPR</em></span></td><td>messages which contain <span class="emphasis"><em>EXPR</em></span> in the “<span class="quote">X-Label</span>” field</td></tr><tr><td>~z [<span class="emphasis"><em>MIN</em></span>]-[<span class="emphasis"><em>MAX</em></span>]</td><td>messages with a size in the range <span class="emphasis"><em>MIN</em></span> to <span class="emphasis"><em>MAX</em></span> *)</td></tr><tr><td>~=</td><td>duplicated messages (see <a class="link" href="reference.html#duplicate-threads" title="3.49. duplicate_threads">$duplicate_threads</a>)</td></tr><tr><td>~$</td><td>unreferenced messages (requires threaded view)</td></tr><tr><td>~(<span class="emphasis"><em>PATTERN</em></span>)</td><td>messages in threads
127 containing messages matching <span class="emphasis"><em>PATTERN</em></span>, e.g. all
128 threads containing messages from you: ~(~P)</td></tr></tbody></table></div></div><br class="table-break" /><p>
129 Where <span class="emphasis"><em>EXPR</em></span> is a
130 <a class="link" href="advancedusage.html#regexp" title="1. Regular Expressions">regular expression</a>. Special attention has to be
131 made when using regular expressions inside of patterns. Specifically,
132 Mutt's parser for these patterns will strip one level of backslash (“<span class="quote">\</span>”),
133 which is normally used for quoting. If it is your intention to use a
134 backslash in the regular expression, you will need to use two backslashes
135 instead (“<span class="quote">\\</span>”). You can force mutt to treat <span class="emphasis"><em>EXPR</em></span> as a simple string
136 instead of a regular expression by using = instead of ˜ in the
137 pattern name. For example, <code class="literal">=b *.*</code> will find all messages that contain
138 the literal string “<span class="quote">*.*</span>”. Simple string matches are less powerful than
139 regular expressions but can be considerably faster. This is especially
140 true for IMAP folders, because string matches can be performed on the
141 server instead of by fetching every message. IMAP treats <code class="literal">=h</code> specially:
142 it must be of the form "header: substring" and will not partially
143 match header names. The substring part may be omitted if you simply
144 wish to find messages containing a particular header without regard to
147 *) The forms “<span class="quote"><[<span class="emphasis"><em>MAX</em></span>]</span>”, “<span class="quote">>[<span class="emphasis"><em>MIN</em></span>]</span>”,
148 “<span class="quote">[<span class="emphasis"><em>MIN</em></span>]-</span>” and “<span class="quote">-[<span class="emphasis"><em>MAX</em></span>]</span>”
150 </p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="patterns-modifier"></a>2.1. Pattern Modifier</h3></div></div></div><div class="note"><h3 class="title">Note</h3><p>
151 Note that patterns matching 'lists' of addresses (notably c, C, p, P and t)
152 match if there is at least one match in the whole list. If you want to
153 make sure that all elements of that list match, you need to prefix your
154 pattern with “<span class="quote">^</span>”.
155 This example matches all mails which only has recipients from Germany.
156 </p></div><pre class="screen">
158 </pre></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="simple-patterns"></a>2.2. Simple Patterns</h3></div></div></div><p>
159 Mutt supports two versions of so called “<span class="quote">simple searches</span>” which are
160 issued if the query entered for searching, limiting and similar
161 operations does not seem to be a valid pattern (i.e. it does not contain
162 one of these characters: “<span class="quote">˜</span>”, “<span class="quote">=</span>” or “<span class="quote">%</span>”). If the query is
163 supposed to contain one of these special characters, they must be escaped
164 by prepending a backslash (“<span class="quote">\</span>”).
166 The first type is by checking whether the query string equals
167 a keyword case-insensitively from <a class="xref" href="advancedusage.html#tab-simplesearch-keywords" title="Table 4.5. Simple search keywords">Table 4.5, “Simple search keywords”</a>:
168 If that is the case, Mutt will use the shown pattern modifier instead.
169 If a keyword would conflict with your search keyword, you need to turn
170 it into a regular expression to avoid matching the keyword table. For
171 example, if you want to find all messages matching “<span class="quote">flag</span>”
172 (using <a class="link" href="reference.html#simple-search" title="3.266. simple_search">$simple_search</a>)
173 but don't want to match flagged messages, simply search for
174 “<span class="quote"><code class="literal">[f]lag</code></span>”.
175 </p><div class="table"><a id="tab-simplesearch-keywords"></a><p class="title"><b>Table 4.5. Simple search keywords</b></p><div class="table-contents"><table summary="Simple search keywords" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Keyword</th><th>Pattern modifier</th></tr></thead><tbody><tr><td>all</td><td>~A</td></tr><tr><td>.</td><td>~A</td></tr><tr><td>^</td><td>~A</td></tr><tr><td>del</td><td>~D</td></tr><tr><td>flag</td><td>~F</td></tr><tr><td>new</td><td>~N</td></tr><tr><td>old</td><td>~O</td></tr><tr><td>repl</td><td>~Q</td></tr><tr><td>read</td><td>~R</td></tr><tr><td>tag</td><td>~T</td></tr><tr><td>unread</td><td>~U</td></tr></tbody></table></div></div><br class="table-break" /><p>
176 The second type of simple search is to build a complex search
177 pattern using <a class="link" href="reference.html#simple-search" title="3.266. simple_search">$simple_search</a>
178 as a template. Mutt will insert your query properly quoted and search
179 for the composed complex query.
180 </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="complex-patterns"></a>2.3. Complex Patterns</h3></div></div></div><p>
181 Logical AND is performed by specifying more than one criterion. For
183 </p><pre class="screen">
186 would select messages which contain the word “<span class="quote">mutt</span>” in the list of
187 recipients <span class="bold"><strong>and</strong></span> that have the word “<span class="quote">elkins</span>” in the “<span class="quote">From</span>” header
190 Mutt also recognizes the following operators to create more complex search
192 </p><div class="itemizedlist"><ul type="disc"><li><p>
193 ! -- logical NOT operator
195 | -- logical OR operator
197 () -- logical grouping operator
198 </p></li></ul></div><p>
199 Here is an example illustrating a complex search pattern. This pattern will
200 select all messages which do not contain “<span class="quote">mutt</span>” in the “<span class="quote">To</span>” or “<span class="quote">Cc</span>”
201 field and which are from “<span class="quote">elkins</span>”.
202 </p><div class="example"><a id="ex-pattern-bool"></a><p class="title"><b>Example 4.1. Using boolean operators in patterns</b></p><div class="example-contents"><pre class="screen">
203 !(~t mutt|~c mutt) ~f elkins
204 </pre></div></div><br class="example-break" /><p>
205 Here is an example using white space in the regular expression (note
206 the ' and " delimiters). For this to match, the mail's subject must
207 match the “<span class="quote">^Junk +From +Me$</span>” and it must be from either “<span class="quote">Jim +Somebody</span>”
208 or “<span class="quote">Ed +SomeoneElse</span>”:
209 </p><pre class="screen">
210 '~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")'
211 </pre><div class="note"><h3 class="title">Note</h3><p>
212 If a regular expression contains parenthesis, or a vertical bar
213 ("|"), you <span class="bold"><strong>must</strong></span> enclose the expression in double or single quotes since
214 those characters are also used to separate different parts of Mutt's
215 pattern language. For example: <code class="literal">~f "me@(mutt\.org|cs\.hmc\.edu)"</code>
217 Without the quotes, the parenthesis wouldn't end.
218 This would be separated to two OR'd patterns: <span class="emphasis"><em>˜f me@(mutt\.org</em></span>
219 and <span class="emphasis"><em>cs\.hmc\.edu)</em></span>. They are never what you want.
220 </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="date-patterns"></a>2.4. Searching by Date</h3></div></div></div><p>
221 Mutt supports two types of dates, <span class="emphasis"><em>absolute</em></span> and <span class="emphasis"><em>relative</em></span>.
223 <span class="bold"><strong>Absolute</strong></span>. Dates <span class="bold"><strong>must</strong></span> be in DD/MM/YY format (month and year are
224 optional, defaulting to the current month and year). An example of a valid
226 </p><pre class="screen">
227 Limit to messages matching: ~d 20/1/95-31/10
229 If you omit the minimum (first) date, and just specify “<span class="quote">-DD/MM/YY</span>”, all
230 messages <span class="emphasis"><em>before</em></span> the given date will be selected. If you omit the maximum
231 (second) date, and specify “<span class="quote">DD/MM/YY-</span>”, all messages <span class="emphasis"><em>after</em></span> the given
232 date will be selected. If you specify a single date with no dash (“<span class="quote">-</span>”),
233 only messages sent on the given date will be selected.
235 <span class="bold"><strong>Error Margins</strong></span>. You can add error margins to absolute dates.
236 An error margin is a sign (+ or -), followed by a digit, followed by
237 one of the units in <a class="xref" href="advancedusage.html#tab-date-units" title="Table 4.6. Date units">Table 4.6, “Date units”</a>. As a special case, you can replace the
238 sign by a “<span class="quote">*</span>” character, which is equivalent to giving identical plus and minus error margins.
239 </p><div class="table"><a id="tab-date-units"></a><p class="title"><b>Table 4.6. Date units</b></p><div class="table-contents"><table summary="Date units" border="1"><colgroup><col /><col /></colgroup><thead><tr><th>Unit</th><th>Description</th></tr></thead><tbody><tr><td>y</td><td>Years</td></tr><tr><td>m</td><td>Months</td></tr><tr><td>w</td><td>Weeks</td></tr><tr><td>d</td><td>Days</td></tr></tbody></table></div></div><br class="table-break" /><p>
240 Example: To select any messages two weeks around January 15, 2001,
241 you'd use the following pattern:
242 </p><pre class="screen">
243 Limit to messages matching: ~d 15/1/2001*2w
245 <span class="bold"><strong>Relative</strong></span>. This type of date is relative to the current date, and may
247 </p><div class="itemizedlist"><ul type="disc"><li><p>
248 ><span class="emphasis"><em>offset</em></span> (messages older than <span class="emphasis"><em>offset</em></span> units)
250 <<span class="emphasis"><em>offset</em></span> (messages newer than <span class="emphasis"><em>offset</em></span> units)
252 =<span class="emphasis"><em>offset</em></span> (messages exactly <span class="emphasis"><em>offset</em></span> units old)
253 </p></li></ul></div><p>
254 <span class="emphasis"><em>offset</em></span> is specified as a positive number with one of the units from <a class="xref" href="advancedusage.html#tab-date-units" title="Table 4.6. Date units">Table 4.6, “Date units”</a>.
256 Example: to select messages less than 1 month old, you would use
257 </p><pre class="screen">
258 Limit to messages matching: ~d <1m
259 </pre><div class="note"><h3 class="title">Note</h3><p>
260 All dates used when searching are relative to the
261 <span class="bold"><strong>local</strong></span> time zone, so unless you change the setting of your <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> to include a
262 <code class="literal">%[...]</code> format, these are <span class="bold"><strong>not</strong></span> the dates shown
264 </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="tags"></a>3. Using Tags</h2></div></div></div><p>
265 Sometimes it is desirable to perform an operation on a group of
266 messages all at once rather than one at a time. An example might be
267 to save messages to a mailing list to a separate folder, or to
268 delete all messages with a given subject. To tag all messages
269 matching a pattern, use the <code class="literal"><tag-pattern></code> function, which is bound to
270 “<span class="quote">shift-T</span>” by default. Or you can select individual messages by
271 hand using the <code class="literal"><tag-message></code> function, which is bound to “<span class="quote">t</span>” by
272 default. See <a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">patterns</a> for Mutt's pattern
275 Once you have tagged the desired messages, you can use the
276 “<span class="quote">tag-prefix</span>” operator, which is the “<span class="quote">;</span>” (semicolon) key by default.
277 When the “<span class="quote">tag-prefix</span>” operator is used, the <span class="bold"><strong>next</strong></span> operation will
278 be applied to all tagged messages if that operation can be used in that
279 manner. If the <a class="link" href="reference.html#auto-tag" title="3.18. auto_tag">$auto_tag</a>
280 variable is set, the next operation applies to the tagged messages
281 automatically, without requiring the “<span class="quote">tag-prefix</span>”.
283 In <a class="link" href="configuration.html#macro" title="8. Keyboard macros">macros</a> or <a class="link" href="configuration.html#push" title="22. Adding key sequences to the keyboard buffer">push</a> commands,
284 you can use the “<span class="quote">tag-prefix-cond</span>” operator. If there are no tagged
285 messages, mutt will "eat" the rest of the macro to abort it's execution.
286 Mutt will stop "eating" the macro when it encounters the “<span class="quote">end-cond</span>”
287 operator; after this operator the rest of the macro will be executed as
289 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="hooks"></a>4. Using Hooks</h2></div></div></div><p>
290 A <span class="emphasis"><em>hook</em></span> is a concept found in many other programs which allows you to
291 execute arbitrary commands before performing some operation. For example,
292 you may wish to tailor your configuration based upon which mailbox you are
293 reading, or to whom you are sending mail. In the Mutt world, a <span class="emphasis"><em>hook</em></span>
294 consists of a <a class="link" href="advancedusage.html#regexp" title="1. Regular Expressions">regular expression</a> or
295 <a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">pattern</a> along with a
296 configuration option/command. See
298 </p><div class="itemizedlist"><ul type="disc"><li><p>
299 <a class="link" href="configuration.html#folder-hook" title="7. Setting variables based upon mailbox">folder-hook</a>
301 <a class="link" href="configuration.html#send-hook" title="19. Change settings based upon message recipients">send-hook</a>
303 <a class="link" href="configuration.html#message-hook" title="20. Change settings before formatting a message">message-hook</a>
305 <a class="link" href="configuration.html#save-hook" title="16. Specify default save mailbox">save-hook</a>
307 <a class="link" href="configuration.html#mbox-hook" title="13. Using Multiple spool mailboxes">mbox-hook</a>
309 <a class="link" href="configuration.html#fcc-hook" title="17. Specify default Fcc: mailbox when composing">fcc-hook</a>
311 <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>
312 </p></li></ul></div><p>
314 for specific details on each type of <span class="emphasis"><em>hook</em></span> available.
315 </p><div class="note"><h3 class="title">Note</h3><p>
316 If a hook changes configuration settings, these changes remain
317 effective until the end of the current mutt session. As this is generally
318 not desired, a default hook needs to be added before all other hooks to
319 restore configuration defaults. Here is an example with send-hook and the
321 </p></div><div class="example"><a id="ex-send-hook-my-hdr"></a><p class="title"><b>Example 4.2. Combining <code class="literal">send-hook</code> and <code class="literal">my_hdr</code></b></p><div class="example-contents"><pre class="screen">
322 send-hook . 'unmy_hdr From:'
323 send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
324 </pre></div></div><br class="example-break" /><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="pattern-hook"></a>4.1. Message Matching in Hooks</h3></div></div></div><p>
325 Hooks that act upon messages (<code class="literal">message-hook, reply-hook,
326 send-hook, send2-hook, save-hook, fcc-hook</code>) are evaluated in a
327 slightly different manner. For the other
328 types of hooks, a <a class="link" href="advancedusage.html#regexp" title="1. Regular Expressions">regular expression</a> is
329 sufficient. But in dealing with messages a finer grain of control is
330 needed for matching since for different purposes you want to match
333 Mutt allows the use of the <a class="link" href="advancedusage.html#patterns" title="2. Patterns: Searching, Limiting and Tagging">search pattern</a>
334 language for matching messages in hook commands. This works in
335 exactly the same way as it would when <span class="emphasis"><em>limiting</em></span> or
336 <span class="emphasis"><em>searching</em></span> the mailbox, except that you are restricted to those
337 operators which match information mutt extracts from the header of
338 the message (i.e., from, to, cc, date, subject, etc.).
340 For example, if you wanted to set your return address based upon sending
341 mail to a specific address, you could do something like:
342 </p><pre class="screen">
343 send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt User <user@host>'
345 which would execute the given command when sending mail to
346 <span class="emphasis"><em>me@cs.hmc.edu</em></span>.
348 However, it is not required that you write the pattern to match using the
349 full searching language. You can still specify a simple <span class="emphasis"><em>regular
350 expression</em></span> like the other hooks, in which case Mutt will translate your
351 pattern into the full language, using the translation specified by the
352 <a class="link" href="reference.html#default-hook" title="3.41. default_hook">$default_hook</a> variable. The
353 pattern is translated at the time the hook is declared, so the value of
354 <a class="link" href="reference.html#default-hook" title="3.41. default_hook">$default_hook</a> that is in effect
355 at that time will be used.
356 </p></div></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="query"></a>5. External Address Queries</h2></div></div></div><p>
357 Mutt supports connecting to external directory databases such as LDAP,
358 ph/qi, bbdb, or NIS through a wrapper script which connects to mutt
359 using a simple interface. Using the <a class="link" href="reference.html#query-command" title="3.234. query_command">$query_command</a> variable, you specify the wrapper
360 command to use. For example:
361 </p><pre class="screen">
362 set query_command = "mutt_ldap_query.pl '%s'"
364 The wrapper script should accept the query on the command-line. It
365 should return a one line message, then each matching response on a
366 single line, each line containing a tab separated address then name then
367 some other optional information. On error, or if there are no matching
368 addresses, return a non-zero exit code and a one line error message.
370 An example multiple response output:
371 </p><pre class="screen">
372 Searching database ... 20 entries ... 3 matching:
373 me@cs.hmc.edu Michael Elkins mutt dude
374 blong@fiction.net Brandon Long mutt and more
375 roessler@does-not-exist.org Thomas Roessler mutt pgp
377 There are two mechanisms for accessing the query function of mutt. One
378 is to do a query from the index menu using the <code class="literal"><query></code> function (default: Q).
379 This will prompt for a query, then bring up the query menu which will
380 list the matching responses. From the query menu, you can select
381 addresses to create aliases, or to mail. You can tag multiple addresses
382 to mail, start a new query, or have a new query appended to the current
385 The other mechanism for accessing the query function is for address
386 completion, similar to the alias completion. In any prompt for address
387 entry, you can use the <code class="literal"><complete-query></code> function (default: ^T) to run a
388 query based on the current address you have typed. Like aliases, mutt
389 will look for what you have typed back to the last space or comma. If
390 there is a single response for that query, mutt will expand the address
391 in place. If there are multiple responses, mutt will activate the query
392 menu. At the query menu, you can select one or more addresses to be
394 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="mailbox-formats"></a>6. Mailbox Formats</h2></div></div></div><p>
395 Mutt supports reading and writing of four different mailbox formats:
396 mbox, MMDF, MH and Maildir. The mailbox type is autodetected, so there
397 is no need to use a flag for different mailbox types. When creating new
398 mailboxes, Mutt uses the default specified with the <a class="link" href="reference.html#mbox-type" title="3.117. mbox_type">$mbox_type</a> variable.
400 <span class="bold"><strong>mbox</strong></span>. This is the most widely used mailbox format for UNIX. All
401 messages are stored in a single file. Each message has a line of the form:
402 </p><pre class="screen">
403 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
405 to denote the start of a new message (this is often referred to as the
406 “<span class="quote">From_</span>” line).
408 <span class="bold"><strong>MMDF</strong></span>. This is a variant of the <span class="emphasis"><em>mbox</em></span> format. Each message is
409 surrounded by lines containing “<span class="quote">^A^A^A^A</span>” (four control-A's).
411 <span class="bold"><strong>MH</strong></span>. A radical departure from <span class="emphasis"><em>mbox</em></span> and <span class="emphasis"><em>MMDF</em></span>, a mailbox
412 consists of a directory and each message is stored in a separate file.
413 The filename indicates the message number (however, this is may not
414 correspond to the message number Mutt displays). Deleted messages are
415 renamed with a comma (,) prepended to the filename. Mutt
416 detects this type of mailbox by looking for either <code class="literal">.mh_sequences</code>
417 or <code class="literal">.xmhcache</code> (needed to distinguish normal directories from MH
420 <span class="bold"><strong>Maildir</strong></span>. The newest of the mailbox formats, used by the Qmail MTA (a
421 replacement for sendmail). Similar to <span class="emphasis"><em>MH</em></span>, except that it adds three
422 subdirectories of the mailbox: <span class="emphasis"><em>tmp</em></span>, <span class="emphasis"><em>new</em></span> and <span class="emphasis"><em>cur</em></span>. Filenames
423 for the messages are chosen in such a way they are unique, even when two
424 programs are writing the mailbox over NFS, which means that no file locking
426 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="shortcuts"></a>7. Mailbox Shortcuts</h2></div></div></div><p>
427 There are a number of built in shortcuts which refer to specific mailboxes.
428 These shortcuts can be used anywhere you are prompted for a file or mailbox
430 </p><div class="itemizedlist"><ul type="disc"><li><p>
431 ! -- refers to your <a class="link" href="reference.html#spoolfile" title="3.279. spoolfile">$spoolfile</a> (incoming) mailbox
433 > -- refers to your <a class="link" href="reference.html#mbox" title="3.116. mbox">$mbox</a> file
435 < -- refers to your <a class="link" href="reference.html#record" title="3.242. record">$record</a> file
437 ^ -- refers to the current mailbox
439 - or !! -- refers to the file you've last visited
441 ˜ -- refers to your home directory
443 = or + -- refers to your <a class="link" href="reference.html#folder" title="3.58. folder">$folder</a> directory
445 @<span class="emphasis"><em>alias</em></span> -- refers to the <a class="link" href="configuration.html#save-hook" title="16. Specify default save mailbox">default save folder</a> as determined by the address of the alias
446 </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="using-lists"></a>8. Handling Mailing Lists</h2></div></div></div><p>
447 Mutt has a few configuration options that make dealing with large
448 amounts of mail easier. The first thing you must do is to let Mutt
449 know what addresses you consider to be mailing lists (technically
450 this does not have to be a mailing list, but that is what it is most
451 often used for), and what lists you are subscribed to. This is
452 accomplished through the use of the <a class="link" href="configuration.html#lists" title="12. Mailing lists">lists and subscribe</a> commands in your muttrc.
454 Now that Mutt knows what your mailing lists are, it can do several
455 things, the first of which is the ability to show the name of a list
456 through which you received a message (i.e., of a subscribed list) in
457 the <span class="emphasis"><em>index</em></span> menu display. This is useful to distinguish between
458 personal and list mail in the same mailbox. In the <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> variable, the escape “<span class="quote">%L</span>”
459 will return the string “<span class="quote">To <list></span>” when “<span class="quote">list</span>” appears in the
460 “<span class="quote">To</span>” field, and “<span class="quote">Cc <list></span>” when it appears in the “<span class="quote">Cc</span>”
461 field (otherwise it returns the name of the author).
463 Often times the “<span class="quote">To</span>” and “<span class="quote">Cc</span>” fields in mailing list messages
464 tend to get quite large. Most people do not bother to remove the
465 author of the message they reply to from the list, resulting in
466 two or more copies being sent to that person. The <code class="literal"><list-reply></code>
467 function, which by default is bound to “<span class="quote">L</span>” in the <span class="emphasis"><em>index</em></span> menu
468 and <span class="emphasis"><em>pager</em></span>, helps reduce the clutter by only replying to the
469 known mailing list addresses instead of all recipients (except as
470 specified by <code class="literal">Mail-Followup-To</code>, see below).
472 Mutt also supports the <code class="literal">Mail-Followup-To</code> header. When you send
473 a message to a list of recipients which includes one or several
474 subscribed mailing lists, and if the <a class="link" href="reference.html#followup-to" title="3.60. followup_to">$followup_to</a> option is set, mutt will generate
475 a Mail-Followup-To header which contains all the recipients to whom
476 you send this message, but not your address. This indicates that
477 group-replies or list-replies (also known as “<span class="quote">followups</span>”) to this
478 message should only be sent to the original recipients of the
479 message, and not separately to you - you'll receive your copy through
480 one of the mailing lists you are subscribed to.
482 Conversely, when group-replying or list-replying to a message which
483 has a <code class="literal">Mail-Followup-To</code> header, mutt will respect this header if
484 the <a class="link" href="reference.html#honor-followup-to" title="3.79. honor_followup_to">$honor_followup_to</a> configuration
485 variable is set. Using list-reply will in this case also make sure
486 that the reply goes to the mailing list, even if it's not specified
487 in the list of recipients in the <code class="literal">Mail-Followup-To</code>.
488 </p><div class="note"><h3 class="title">Note</h3><p>
489 When header editing is enabled, you can create a
490 <code class="literal">Mail-Followup-To</code> header manually. Mutt will only auto-generate
491 this header if it doesn't exist when you send the message.
493 The other method some mailing list admins use is to generate a
494 “<span class="quote">Reply-To</span>” field which points back to the mailing list address rather
495 than the author of the message. This can create problems when trying
496 to reply directly to the author in private, since most mail clients
497 will automatically reply to the address given in the “<span class="quote">Reply-To</span>”
498 field. Mutt uses the <a class="link" href="reference.html#reply-to" title="3.245. reply_to">$reply_to</a>
499 variable to help decide which address to use. If set to <span class="emphasis"><em>ask-yes</em></span> or
500 <span class="emphasis"><em>ask-no</em></span>, you will be
501 prompted as to whether or not you would like to use the address given in
502 the “<span class="quote">Reply-To</span>” field, or reply directly to the address given in the
503 “<span class="quote">From</span>” field. When set to <span class="emphasis"><em>yes</em></span>, the “<span class="quote">Reply-To</span>” field will be used when
506 The “<span class="quote">X-Label:</span>” header field can be used to further identify mailing
507 lists or list subject matter (or just to annotate messages
508 individually). The <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a> variable's “<span class="quote">%y</span>” and
509 “<span class="quote">%Y</span>” escapes can be used to expand “<span class="quote">X-Label:</span>” fields in the
510 index, and Mutt's pattern-matcher can match regular expressions to
511 “<span class="quote">X-Label:</span>” fields with the “<span class="quote">˜y</span>” selector. “<span class="quote">X-Label:</span>” is not a
512 standard message header field, but it can easily be inserted by procmail
513 and other mail filtering agents.
515 Lastly, Mutt has the ability to <a class="link" href="reference.html#sort" title="3.273. sort">sort</a> the mailbox into
516 <a class="link" href="gettingstarted.html#threads" title="4.3. Threaded Mode">threads</a>. A thread is a group of messages which all relate to the same
517 subject. This is usually organized into a tree-like structure where a
518 message and all of its replies are represented graphically. If you've ever
519 used a threaded news client, this is the same concept. It makes dealing
520 with large volume mailing lists easier because you can easily delete
521 uninteresting threads and quickly find topics of value.
522 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="handling-folders"></a>9. Handling multiple folders</h2></div></div></div><p>
523 Mutt supports setups with multiple folders, allowing all of them to
524 be monitored for new mail (see <a class="xref" href="configuration.html#mailboxes" title="14. Monitoring incoming mail">Section 14, “Monitoring incoming mail”</a> for details).
526 When in the index menu and being idle (also see
527 <a class="link" href="reference.html#timeout" title="3.290. timeout">$timeout</a>), Mutt periodically checks
528 for new mail in all folders which have been configured via the
529 <code class="literal">mailboxes</code> command. The interval depends on the folder
530 type: for local/IMAP folders it consults
531 <a class="link" href="reference.html#mail-check" title="3.105. mail_check">$mail_check</a> and
532 <a class="link" href="reference.html#pop-checkinterval" title="3.218. pop_checkinterval">$pop_checkinterval</a>
535 Outside the index menu the directory browser supports checking
536 for new mail using the <code class="literal"><check-new></code> function which is
537 unbound by default. Pressing TAB will bring up a
538 menu showing the files specified by the <code class="literal">mailboxes</code> command,
539 and indicate which contain new messages. Mutt will automatically enter this
540 mode when invoked from the command line with the <code class="literal">-y</code> option.
542 For the pager, index and directory browser menus, Mutt contains the
543 <code class="literal"><buffy-list></code> function (bound to “<span class="quote">.</span>” by default)
544 which will print a list of folders with new mail in the command line at
545 the bottom of the screen.
547 For the index, by default Mutt displays the number of mailboxes with new
548 mail in the status bar, please refer to the
549 <a class="link" href="reference.html#index-format" title="3.101. index_format">$index_format</a>
550 variable for details.
552 When changing folders, Mutt fills the prompt with the first folder from
553 the mailboxes list containing new mail (if any), pressing
554 <span class="emphasis"><em>space</em></span> will cycle through folders with new mail.
555 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="editing-threads"></a>10. Editing threads</h2></div></div></div><p>
556 Mutt has the ability to dynamically restructure threads that are broken
557 either by misconfigured software or bad behavior from some
558 correspondents. This allows to clean your mailboxes formats) from these
559 annoyances which make it hard to follow a discussion.
560 </p><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="link-threads"></a>10.1. Linking threads</h3></div></div></div><p>
561 Some mailers tend to "forget" to correctly set the "In-Reply-To:" and
562 "References:" headers when replying to a message. This results in broken
563 discussions because Mutt has not enough information to guess the correct
565 You can fix this by tagging the reply, then moving to the parent message
566 and using the <code class="literal"><link-threads></code> function (bound to & by default). The
567 reply will then be connected to this "parent" message.
569 You can also connect multiple children at once, tagging them and using the
570 tag-prefix command (';') or the auto_tag option.
571 </p></div><div class="sect2" lang="en" xml:lang="en"><div class="titlepage"><div><div><h3 class="title"><a id="break-threads"></a>10.2. Breaking threads</h3></div></div></div><p>
572 On mailing lists, some people are in the bad habit of starting a new
573 discussion by hitting "reply" to any message from the list and changing
574 the subject to a totally unrelated one.
575 You can fix such threads by using the <code class="literal"><break-thread></code> function (bound
576 by default to #), which will turn the subthread starting from the
577 current message into a whole different thread.
578 </p></div></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="dsn"></a>11. Delivery Status Notification (DSN) Support</h2></div></div></div><p>
579 RFC1894 defines a set of MIME content types for relaying information
580 about the status of electronic mail messages. These can be thought of as
581 “<span class="quote">return receipts.</span>”
583 To support DSN, there are two variables. <a class="link" href="reference.html#dsn-notify" title="3.47. dsn_notify">$dsn_notify</a> is used to request receipts for
584 different results (such as failed message, message delivered, etc.).
585 <a class="link" href="reference.html#dsn-return" title="3.48. dsn_return">$dsn_return</a> requests how much
586 of your message should be returned with the receipt (headers or full
589 When using <a class="link" href="reference.html#sendmail" title="3.260. sendmail">$sendmail</a> for mail
590 delivery, you need to use either Berkeley sendmail 8.8.x (or greater) a MTA
591 supporting DSN command line options compatible to Sendmail: The -N and -R
592 options can be used by the mail client to make requests as to what type of
593 status messages should be returned. Please consider your MTA documentation
594 whether DSN is supported.
596 For SMTP delivery using <a class="link" href="reference.html#smtp-url" title="3.272. smtp_url">$smtp_url</a>, it depends on the
597 capabilities announced by the server whether mutt will attempt to
599 </p></div><div class="sect1" lang="en" xml:lang="en"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="urlview"></a>12. Start a WWW Browser on URLs</h2></div></div></div><p>
600 If a message contains URLs, it is efficient to get
601 a menu with all the URLs and start a WWW browser on one of them. This
602 functionality is provided by the external urlview program which can be
604 <a class="ulink" href="ftp://ftp.mutt.org/mutt/contrib/" target="_top">ftp://ftp.mutt.org/mutt/contrib/</a>
605 and the configuration commands:
606 </p><pre class="screen">
607 macro index \cb |urlview\n
608 macro pager \cb |urlview\n
609 </pre></div></div><div class="navfooter"><hr /><table width="100%" summary="Navigation footer"><tr><td width="40%" align="left"><a accesskey="p" href="configuration.html">Prev</a> </td><td width="20%" align="center"> </td><td width="40%" align="right"> <a accesskey="n" href="mimesupport.html">Next</a></td></tr><tr><td width="40%" align="left" valign="top">Chapter 3. Configuration </td><td width="20%" align="center"><a accesskey="h" href="index.html">Home</a></td><td width="40%" align="right" valign="top"> Chapter 5. Mutt's MIME Support</td></tr></table></div></body></html>