Rocco Rutte:
[apps/madmutt.git] / doc / manual.sgml.head
1 <!doctype linuxdoc system>
2
3 <article>
4
5 <title>The Mutt E-Mail Client
6 <author>by Michael Elkins <htmlurl url="mailto:me@cs.hmc.edu" name="&lt;me@cs.hmc.edu&gt;">
7 <date>version @VERSION@
8 <abstract>
9 ``All mail clients suck.  This one just sucks less.'' -me, circa 1995
10 </abstract>
11
12 <toc>
13
14 <sect>Introduction
15 <p>
16 <bf/Mutt-ng/ is a small but very powerful text-based MIME mail client.  Mutt-ng is
17 highly configurable, and is well suited to the mail power user with advanced
18 features like key bindings, keyboard macros, mail threading, regular
19 expression searches and a powerful pattern matching language for selecting
20 groups of messages.
21
22 <p>This documentation additionaly contains documentation to <bf/Mutt-NG/, a 
23 fork from Mutt with the goal to fix all the little annoyances of Mutt, to
24 integrate all the Mutt patches that are floating around in the web, and to
25 add other new features. Features specific to Mutt-ng will be discussed in
26 an extra section. Don't be confused when most of the documentation talk about
27 Mutt and not Mutt-ng, Mutt-ng contains all Mutt-ng features, plus many more.
28
29
30 <sect1>Mutt-ng Home Page
31 <p>
32 <htmlurl url="http://www.muttng.org/"
33 name="http://www.muttng.org">
34
35 <sect1>Mailing Lists
36 <p>
37
38 <itemize>
39 <item><htmlurl url="https://lists.berlios.de/mailman/listinfo/mutt-ng-users"
40 name="mutt-ng-users@lists.berlios.de"> -- This is where the mutt-ng user support happens.
41 <item><htmlurl url="https://lists.berlios.de/mailman/listinfo/mutt-ng-devel" name="mutt-ng-devel@lists.berlios.de"> -- The development mailing list for mutt-ng
42 </itemize>
43
44 <sect1>Software Distribution Sites
45 <p>
46 So far, there are no official releases of Mutt-ng, but you can download
47 daily snapshots from <htmlurl url="http://mutt-ng.berlios.de/snapshots/" name="http://mutt-ng.berlios.de/snapshots/">
48 <!-- 
49 <itemize>
50 <item><htmlurl url="ftp://ftp.mutt.org/mutt/"
51 name="ftp://ftp.mutt.org/mutt/">
52 </itemize>
53 <p>
54 For a list of mirror sites, please refer to <htmlurl
55 url="http://www.mutt.org/download.html"
56 name="http://www.mutt.org/download.html">.
57 -->
58
59
60 <sect1>IRC
61 <p>
62 Visit channel <em/#muttng/ on <htmlurl
63 url="http://www.freenode.net/" name="irc.freenode.net
64 (www.freenode.net)"> to chat with other people interested in Mutt-ng.
65
66
67 <sect1>Weblog
68 <p>
69 If you want to read fresh news about the latest development in Mutt-ng, and get informed
70 about stuff like interesting, Mutt-ng-related articles and packages for your favorite
71 distribution, you can read and/or subscribe to our 
72 <htmlurl url="http://mutt-ng.supersized.org/" name="Mutt-ng development weblog">.
73
74 <sect1>Copyright
75 <p>
76 Mutt is Copyright (C) 1996-2000 Michael R. Elkins
77 &lt;me@cs.hmc.edu&gt; and others
78
79 This program is free software; you can redistribute it and/or modify
80 it under the terms of the GNU General Public License as published by
81 the Free Software Foundation; either version 2 of the License, or
82 (at your option) any later version.
83
84 This program is distributed in the hope that it will be useful,
85 but WITHOUT ANY WARRANTY; without even the implied warranty of
86 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
87 GNU General Public License for more details.
88
89 You should have received a copy of the GNU General Public License
90 along with this program; if not, write to the Free Software
91 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
92
93 <sect>Getting Started
94 <p>
95
96 This section is intended as a brief overview of how to use Mutt.  There are
97 many other features which are described elsewhere in the manual.  There
98 is even more information available in the Mutt FAQ and various web
99 pages.  See the <htmlurl url="http://www.mutt.org/mutt/"
100 name="Mutt Page"> for more details.
101
102 The keybindings described in this section are the defaults as distributed.
103 Your local system administrator may have altered the defaults for your site.
104 You can always type ``?'' in any menu to display the current bindings.
105
106 The first thing you need to do is invoke mutt, simply by typing mutt
107 at the command line.  There are various command-line options, see 
108 either the mutt man page or the <ref id="commandline" name="reference">.
109
110 <sect1>Moving Around in Menus
111 <p>
112
113 Information is presented in menus, very similar to ELM.  Here is a table
114 showing the common keys used to navigate menus in Mutt.
115
116 <tscreen><verb>
117 j or Down       next-entry      move to the next entry
118 k or Up         previous-entry  move to the previous entry
119 z or PageDn     page-down       go to the next page
120 Z or PageUp     page-up         go to the previous page
121 = or Home       first-entry     jump to the first entry
122 * or End        last-entry      jump to the last entry
123 q               quit            exit the current menu
124 ?               help            list all keybindings for the current menu
125 </verb></tscreen>
126
127 <sect1>Editing Input Fields<label id="editing">
128 <p>
129 Mutt has a builtin line editor which is used as the primary way to input
130 textual data such as email addresses or filenames.  The keys used to move
131 around while editing are very similar to those of Emacs.
132
133 <tscreen><verb>
134 ^A or <Home>    bol             move to the start of the line
135 ^B or <Left>    backward-char   move back one char
136 Esc B           backward-word   move back one word
137 ^D or <Delete>  delete-char     delete the char under the cursor
138 ^E or <End>     eol             move to the end of the line
139 ^F or <Right>   forward-char    move forward one char
140 Esc F           forward-word    move forward one word
141 <Tab>           complete        complete filename or alias
142 ^T              complete-query  complete address with query
143 ^K              kill-eol        delete to the end of the line
144 ESC d           kill-eow        delete to the end ot the word
145 ^W              kill-word       kill the word in front of the cursor
146 ^U              kill-line       delete entire line
147 ^V              quote-char      quote the next typed key
148 <Up>            history-up      recall previous string from history
149 <Down>          history-down    recall next string from history
150 <BackSpace>     backspace       kill the char in front of the cursor
151 Esc u           upcase-word     convert word to upper case
152 Esc l           downcase-word   convert word to lower case
153 Esc c           capitalize-word capitalize the word
154 ^G              n/a             abort
155 <Return>        n/a             finish editing
156 </verb></tscreen>
157
158 You can remap the <em/editor/ functions using the <ref id="bind" name="bind">
159 command.  For example, to make the <em/Delete/ key delete the character in
160 front of the cursor rather than under, you could use
161
162 <tt/bind editor &lt;delete&gt; backspace/
163
164 <sect1>Reading Mail - The Index and Pager
165 <p>
166
167 Similar to many other mail clients, there are two modes in which mail is
168 read in Mutt.  The first is the index of messages in the mailbox, which is
169 called the ``index'' in Mutt.  The second mode is the display of the
170 message contents.  This is called the ``pager.''
171
172 The next few sections describe the functions provided in each of these
173 modes.
174
175 <sect2>The Message Index
176 <p>
177
178 <tscreen><verb>
179 c               change to a different mailbox
180 ESC c           change to a folder in read-only mode
181 C               copy the current message to another mailbox
182 ESC C           decode a message and copy it to a folder
183 ESC s           decode a message and save it to a folder
184 D               delete messages matching a pattern
185 d               delete the current message
186 F               mark as important
187 l               show messages matching a pattern
188 N               mark message as new
189 o               change the current sort method
190 O               reverse sort the mailbox
191 q               save changes and exit
192 s               save-message
193 T               tag messages matching a pattern
194 t               toggle the tag on a message
195 ESC t           toggle tag on entire message thread
196 U               undelete messages matching a pattern
197 u               undelete-message
198 v               view-attachments
199 x               abort changes and exit
200 <Return>        display-message
201 <Tab>           jump to the next new message
202 @               show the author's full e-mail address
203 $               save changes to mailbox
204 /               search
205 ESC /           search-reverse
206 ^L              clear and redraw the screen
207 ^T              untag messages matching a pattern
208 </verb></tscreen>
209
210 <sect3>Status Flags
211 <p>
212
213 In addition to who sent the message and the subject, a short summary of
214 the disposition of each message is printed beside the message number.
215 Zero or more of the following ``flags'' may appear, which mean:
216
217 <p>
218 <descrip>
219 <tag/D/ message is deleted (is marked for deletion)
220 <tag/d/ message have attachments marked for deletion
221 <tag/K/ contains a PGP public key
222 <tag/N/ message is new
223 <tag/O/ message is old
224 <tag/P/ message is PGP encrypted
225 <tag/r/ message has been replied to
226 <tag/S/ message is signed, and the signature is succesfully verified
227 <tag/s/ message is signed
228 <tag/!/ message is flagged
229 <tag/*/ message is tagged
230 </descrip>
231
232 Some of the status flags can be turned on or off using
233 <itemize>
234 <item><bf/set-flag/ (default: w)
235 <item><bf/clear-flag/ (default: W)
236 </itemize>
237
238 <p>
239 Furthermore, the following flags reflect who the message is addressed
240 to.  They can be customized with the
241 <ref id="to_chars" name="&dollar;to&lowbar;chars"> variable.
242
243 <p>
244 <descrip>
245 <tag/+/ message is to you and you only
246 <tag/T/ message is to you, but also to or cc'ed to others
247 <tag/C/ message is cc'ed to you
248 <tag/F/ message is from you
249 <tag/L/ message is sent to a subscribed mailing list
250 </descrip>
251
252 <sect2>The Pager
253 <p>
254
255 By default, Mutt uses its builtin pager to display the body of messages.
256 The pager is very similar to the Unix program <em/less/ though not nearly as
257 featureful.
258
259 <tscreen><verb>
260 <Return>        go down one line
261 <Space>         display the next page (or next message if at the end of a message)
262 -               go back to the previous page
263 n               search for next match
264 S               skip beyond quoted text
265 T               toggle display of quoted text
266 ?               show keybindings
267 /               search for a regular expression (pattern)
268 ESC /           search backwards for a regular expression
269 \               toggle search pattern coloring
270 ^               jump to the top of the message
271 </verb></tscreen>
272
273 In addition, many of the functions from the <em/index/ are available in
274 the pager, such as <em/delete-message/ or <em/copy-message/ (this is one
275 advantage over using an external pager to view messages).
276
277 Also, the internal pager supports a couple other advanced features. For
278 one, it will accept and translate the ``standard'' nroff sequences for
279 bold and underline. These sequences are a series of either the letter,
280 backspace (^H), the letter again for bold or the letter, backspace,
281 ``&lowbar;'' for denoting underline. Mutt will attempt to display these
282 in bold and underline respectively if your terminal supports them. If
283 not, you can use the bold and underline <ref id="color" name="color">
284 objects to specify a color or mono attribute for them.
285
286 Additionally, the internal pager supports the ANSI escape sequences for
287 character attributes.  Mutt translates them into the correct color and
288 character settings.  The sequences Mutt supports are:
289
290 <p>
291 <tscreen><verb>
292 ESC [ Ps;Ps;Ps;...;Ps m
293 where Ps =
294 0    All Attributes Off
295 1    Bold on
296 4    Underline on
297 5    Blink on
298 7    Reverse video on
299 3x   Foreground color is x
300 4x   Background color is x
301
302 Colors are
303 0    black
304 1    red
305 2    green
306 3    yellow
307 4    blue
308 5    magenta
309 6    cyan
310 7    white
311 </verb></tscreen>
312
313 Mutt uses these attributes for handling text/enriched messages, and they
314 can also be used by an external <ref id="auto_view" name="autoview">
315 script for highlighting purposes.  <bf/Note:/ If you change the colors for your
316 display, for example by changing the color associated with color2 for
317 your xterm, then that color will be used instead of green.
318
319 <sect2>Threaded Mode<label id="threads">
320 <p>
321 When the mailbox is <ref id="sort" name="sorted"> by <em/threads/, there are
322 a few additional functions available in the <em/index/ and <em/pager/ modes.
323
324 <tscreen><verb>
325 ^D      delete-thread           delete all messages in the current thread
326 ^U      undelete-thread         undelete all messages in the current thread
327 ^N      next-thread             jump to the start of the next thread
328 ^P      previous-thread         jump to the start of the previous thread
329 ^R      read-thread             mark the current thread as read
330 ESC d   delete-subthread        delete all messages in the current subthread
331 ESC u   undelete-subthread      undelete all messages in the current subthread
332 ESC n   next-subthread          jump to the start of the next subthread
333 ESC p   previous-subthread      jump to the start of the previous subthread
334 ESC r   read-subthread          mark the current subthread as read
335 ESC t   tag-thread              toggle the tag on the current thread
336 ESC v   collapse-thread         toggle collapse for the current thread
337 ESC V   collapse-all            toggle collapse for all threads
338 P       parent-message          jump to parent message in thread
339 </verb></tscreen>
340
341 <bf/Note:/ Collapsing a thread displays only the first message
342 in the thread and hides the others. This is useful when threads
343 contain so many messages that you can only see a handful of threads on
344 the screen. See %M in <ref id="index_format"name="&dollar;index&lowbar;format">.
345 For example, you could use "&percnt;?M?(#&percnt;03M)&amp;(&percnt;4l)?" in <ref
346 id="index_format"name="&dollar;index&lowbar;format"> to optionally
347 display the number of hidden messages if the thread is collapsed.
348
349 See also: <ref id="strict_threads" name="&dollar;strict&lowbar;threads">.
350
351 <sect2>Miscellaneous Functions
352 <p><bf/create-alias/<label id="create-alias"> (default: a)<newline>
353
354 Creates a new alias based upon the current message (or prompts for a
355 new one).  Once editing is complete, an <ref id="alias" name="alias">
356 command is added to the file specified by the <ref id="alias_file"
357 name="&dollar;alias&lowbar;file"> variable for future use. <bf/Note:/
358 Specifying an <ref id="alias_file" name="&dollar;alias&lowbar;file">
359 does not add the aliases specified there-in, you must also <ref
360 id="source" name="source"> the file.
361
362 <p><bf/check-traditional-pgp/<label id="check-traditional-pgp"> (default: ESC P)<newline>
363
364 This function will search the current message for content signed or
365 encrypted with PGP the "traditional" way, that is, without proper
366 MIME tagging.  Technically, this function will temporarily change
367 the MIME content types of the body parts containing PGP data; this
368 is similar to the <ref id="edit-type" name="edit-type"> function's
369 effect.
370
371
372 <p><bf/display-toggle-weed/<label id="display-toggle-weed"> (default: h)<newline>
373
374 Toggles the weeding of message header fields specified by <ref id="ignore"
375 name="ignore"> commands.
376
377 <p><bf/edit/<label id="edit"> (default: e)<newline>
378
379 This command (available in the ``index'' and ``pager'') allows you to
380 edit the raw current message as it's present in the mail folder.
381 After you have finished editing, the changed message will be
382 appended to the current folder, and the original message will be
383 marked for deletion.
384
385 <p><bf/edit-type/<label id="edit-type"><newline>
386 (default: ^E on the attachment menu, and in the pager and index menus; ^T on the
387 compose menu)
388
389 This command is used to temporarily edit an attachment's content
390 type to fix, for instance, bogus character set parameters.  When
391 invoked from the index or from the pager, you'll have the
392 opportunity to edit the top-level attachment's content type.  On the
393 <ref id="attach_menu" name="attachment menu">, you can change any
394 attachment's content type. These changes are not persistent, and get
395 lost upon changing folders.
396
397 Note that this command is also available on the <ref
398 id="compose_menu" name="compose menu">.  There, it's used to
399 fine-tune the properties of attachments you are going to send.
400
401 <p><bf/enter-command/<label id="enter-command"> (default: ``:'')<newline>
402
403 This command is used to execute any command you would normally put in a
404 configuration file.  A common use is to check the settings of variables, or
405 in conjunction with <ref id="macro" name="macros"> to change settings on the
406 fly.
407
408 <p><bf/extract-keys/<label id="extract-keys"> (default: ^K)<newline>
409
410 This command extracts PGP public keys from the current or tagged
411 message(s) and adds them to your PGP public key ring.
412
413 <p><bf/forget-passphrase/<label id="forget-passphrase"> (default:
414 ^F)<newline> 
415
416 This command wipes the passphrase(s) from memory. It is useful, if
417 you misspelled the passphrase.
418
419 <p><bf/list-reply/<label id="list-reply"> (default: L)<newline>
420
421 Reply to the current or tagged message(s) by extracting any addresses which
422 match the regular expressions given by the <ref id="lists" name="lists or subscribe">
423 commands, but also honor any <tt/Mail-Followup-To/ header(s) if the
424 <ref id="honor_followup_to" name="&dollar;honor&lowbar;followup&lowbar;to">
425 configuration variable is set.  Using this when replying to messages posted
426 to mailing lists helps avoid duplicate copies being sent to the author of
427 the message you are replying to.
428
429 <bf/pipe-message/<label id="pipe-message"> (default: |)<newline>
430
431 Asks for an external Unix command and pipes the current or
432 tagged message(s) to it.  The variables <ref id="pipe_decode"
433 name="&dollar;pipe&lowbar;decode">, <ref id="pipe_split"
434 name="&dollar;pipe&lowbar;split">, <ref id="pipe_sep"
435 name="&dollar;pipe&lowbar;sep"> and <ref id="wait_key"
436 name="&dollar;wait&lowbar;key"> control the exact behaviour of this
437 function.
438
439 <bf/resend-message/<label id="resend-message"> (default: ESC e)<newline>
440
441 With resend-message, mutt takes the current message as a template for a
442 new message.  This function is best described as "recall from arbitrary
443 folders".  It can conveniently be used to forward MIME messages while
444 preserving the original mail structure. Note that the amount of headers
445 included here depends on the value of the <ref id="weed" name="&dollar;weed">
446 variable.
447
448 This function is also available from the attachment menu. You can use this
449 to easily resend a message which was included with a bounce message
450 as a message/rfc822 body part.
451
452 <bf/shell-escape/<label id="shell-escape"> (default: !)<newline>
453
454 Asks for an external Unix command and executes it.  The <ref
455 id="wait_key" name="&dollar;wait&lowbar;key"> can be used to control
456 whether Mutt will wait for a key to be pressed when the command returns
457 (presumably to let the user read the output of the command), based on
458 the return status of the named command.
459
460 <bf/toggle-quoted/<label id="toggle-quoted"> (default: T)<newline>
461
462 The <em/pager/ uses the <ref id="quote_regexp"
463 name="&dollar;quote&lowbar;regexp"> variable to detect quoted text when
464 displaying the body of the message.  This function toggles the display
465 of the quoted material in the message.  It is particularly useful when
466 are interested in just the response and there is a large amount of
467 quoted text in the way.
468
469 <bf/skip-quoted/<label id="skip-quoted"> (default: S)<newline>
470
471 This function will go to the next line of non-quoted text which come
472 after a line of quoted text in the internal pager.
473
474 <sect1>Sending Mail
475 <p>
476
477 The following bindings are available in the <em/index/ for sending
478 messages.
479
480 <tscreen><verb>
481 m       compose         compose a new message
482 r       reply           reply to sender
483 g       group-reply     reply to all recipients
484 L       list-reply      reply to mailing list address
485 f       forward         forward message
486 b       bounce          bounce (remail) message
487 ESC k   mail-key        mail a PGP public key to someone
488 </verb></tscreen>
489
490 Bouncing a message sends the message as is to the recipient you
491 specify.  Forwarding a message allows you to add comments or
492 modify the message you are forwarding.  These items are discussed
493 in greater detail in the next chapter <ref id="forwarding_mail"
494 name="``Forwarding and Bouncing Mail''">.
495
496 Mutt will then enter the <em/compose/ menu and prompt you for the
497 recipients to place on the ``To:'' header field.  Next, it will ask
498 you for the ``Subject:'' field for the message, providing a default if
499 you are replying to or forwarding a message.  See also <ref id="askcc"
500 name="&dollar;askcc">, <ref id="askbcc" name="&dollar;askbcc">, <ref
501 id="autoedit" name="&dollar;autoedit">, <ref id="bounce"
502 name="&dollar;bounce">, and <ref id="fast_reply"
503 name="&dollar;fast&lowbar;reply"> for changing how Mutt asks these
504 questions.
505
506 Mutt will then automatically start your <ref id="editor"
507 name="&dollar;editor"> on the message body.  If the <ref id="edit_headers"
508 name="&dollar;edit&lowbar;headers"> variable is set, the headers will be at
509 the top of the message in your editor.  Any messages you are replying
510 to will be added in sort order to the message, with appropriate <ref
511 id="attribution" name="&dollar;attribution">, <ref id="indent_string"
512 name="&dollar;indent&lowbar;string"> and <ref id="post_indent_string"
513 name="&dollar;post&lowbar;indent&lowbar;string">.  When forwarding a
514 message, if the <ref id="mime_forward" name="&dollar;mime&lowbar;forward">
515 variable is unset, a copy of the forwarded message will be included.  If
516 you have specified a <ref id="signature" name="&dollar;signature">, it
517 will be appended to the message.
518
519 Once you have finished editing the body of your mail message, you are
520 returned to the <em/compose/ menu.  The following options are available:
521
522 <tscreen><verb>
523 a       attach-file             attach a file
524 A       attach-message          attach message(s) to the message
525 ESC k   attach-key              attach a PGP public key
526 d       edit-description        edit description on attachment
527 D       detach-file             detach a file
528 t       edit-to                 edit the To field
529 ESC f   edit-from               edit the From field
530 r       edit-reply-to           edit the Reply-To field
531 c       edit-cc                 edit the Cc field
532 b       edit-bcc                edit the Bcc field
533 y       send-message            send the message
534 s       edit-subject            edit the Subject
535 S       smime-menu              select S/MIME options
536 f       edit-fcc                specify an ``Fcc'' mailbox
537 p       pgp-menu                select PGP options
538 P       postpone-message        postpone this message until later
539 q       quit                    quit (abort) sending the message
540 w       write-fcc               write the message to a folder
541 i       ispell                  check spelling (if available on your system)
542 ^F      forget-passphrase       wipe passphrase(s) from memory
543 </verb></tscreen>
544
545 <bf/Note:/ The attach-message function will prompt you for a folder to
546 attach messages from. You can now tag messages in that folder and they
547 will be attached to the message you are sending. Note that certain
548 operations like composing a new mail, replying, forwarding, etc. are
549 not permitted when you are in that folder. The %r in <ref
550 id="status_format" name="&dollar;status&lowbar;format"> will change to
551 a 'A' to indicate that you are in attach-message mode.
552
553 <sect2>Editing the message header
554 <p>
555 When editing the header of your outgoing message, there are a couple of
556 special features available.
557
558 If you specify<newline>
559 <tt/Fcc:/ <em/filename/<newline>
560 Mutt will pick up <em/filename/
561 just as if you had used the <em/edit-fcc/ function in the <em/compose/ menu.
562
563 You can also attach files to your message by specifying<newline>
564 <tt/Attach:/ <em/filename/  &lsqb; <em/description/ &rsqb;<newline>
565 where <em/filename/ is the file to attach and <em/description/ is an
566 optional string to use as the description of the attached file.
567
568 When replying to messages, if you remove the <em/In-Reply-To:/ field from
569 the header field, Mutt will not generate a <em/References:/ field, which
570 allows you to create a new message thread.
571
572 Also see <ref id="edit_headers" name="edit&lowbar;headers">.
573
574 <sect2>Using Mutt with PGP
575
576 <p>
577 If you want to use PGP, you can specify 
578
579 <tt/Pgp:/ &lsqb; <tt/E/ | <tt/S/ | <tt/S/<em/&lt;id&gt;/ &rsqb; <newline>
580
581 ``E'' encrypts, ``S'' signs and
582 ``S&lt;id&gt;'' signs with the given key, setting <ref
583 id="pgp_sign_as" name="&dollar;pgp&lowbar;sign&lowbar;as"> permanently.
584
585 If you have told mutt to PGP encrypt a message, it will guide you
586 through a key selection process when you try to send the message.
587 Mutt will not ask you any questions about keys which have a
588 certified user ID matching one of the message recipients' mail
589 addresses.  However, there may be situations in which there are
590 several keys, weakly certified user ID fields, or where no matching
591 keys can be found.
592
593 In these cases, you are dropped into a menu with a list of keys from
594 which you can select one.  When you quit this menu, or mutt can't
595 find any matching keys, you are prompted for a user ID.  You can, as
596 usually, abort this prompt using <tt/^G/.  When you do so, mutt will
597 return to the compose screen.
598
599 Once you have successfully finished the key selection, the message
600 will be encrypted using the selected public keys, and sent out.
601
602 Most fields of the entries in the key selection menu (see also <ref
603 id="pgp_entry_format" name="&dollar;pgp&lowbar;entry&lowbar;format">) 
604 have obvious meanings.  But some explanations on the capabilities, flags, 
605 and validity fields are in order.
606
607 The flags sequence (&percnt;f) will expand to one of the following flags:
608 <tscreen><verb>
609 R            The key has been revoked and can't be used.
610 X            The key is expired and can't be used.
611 d            You have marked the key as disabled.
612 c            There are unknown critical self-signature 
613              packets.
614 </verb></tscreen>
615
616 The capabilities field (&percnt;c) expands to a two-character sequence
617 representing a key's capabilities.  The first character gives
618 the key's encryption capabilities: A minus sign (<bf/-/) means 
619 that the key cannot be used for encryption.  A dot (<bf/./) means that
620 it's marked as a signature key in one of the user IDs, but may 
621 also be used for encryption.  The letter <bf/e/ indicates that 
622 this key can be used for encryption.
623  
624 The second character indicates the key's signing capabilities.  Once 
625 again, a ``<bf/-/'' implies ``not for signing'', ``<bf/./'' implies
626 that the key is marked as an encryption key in one of the user-ids, and
627 ``<bf/s/'' denotes a key which can be used for signing.
628
629 Finally, the validity field (%t) indicates how well-certified a user-id
630 is.  A question mark (<bf/?/) indicates undefined validity, a minus 
631 character (<bf/-/) marks an untrusted association, a space character 
632 means a partially trusted association, and a plus character (<bf/+/) 
633 indicates complete validity.
634
635 <sect2>Sending anonymous messages via mixmaster.
636
637 <p>
638 You may also have configured mutt to co-operate with Mixmaster, an
639 anonymous remailer.  Mixmaster permits you to send your messages
640 anonymously using a chain of remailers. Mixmaster support in mutt is for 
641 mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03. 
642 It does not support earlier versions or the later so-called version 3 betas, 
643 of which the latest appears to be called 2.9b23.
644
645 To use it, you'll have to obey certain restrictions.  Most
646 important, you cannot use the <tt/Cc/ and <tt/Bcc/ headers.  To tell
647 Mutt to use mixmaster, you have to select a remailer chain, using
648 the mix function on the compose menu.  
649
650 The chain selection screen is divided into two parts.  In the
651 (larger) upper part, you get a list of remailers you may use.  In
652 the lower part, you see the currently selected chain of remailers.
653
654 You can navigate in the chain using the <tt/chain-prev/ and
655 <tt/chain-next/ functions, which are by default bound to the left
656 and right arrows and to the <tt/h/ and <tt/l/ keys (think vi
657 keyboard bindings).  To insert a remailer at the current chain
658 position, use the <tt/insert/ function.  To append a remailer behind
659 the current chain position, use <tt/select-entry/ or <tt/append/.
660 You can also delete entries from the chain, using the corresponding
661 function.  Finally, to abandon your changes, leave the menu, or
662 <tt/accept/ them pressing (by default) the <tt/Return/ key.
663
664 Note that different remailers do have different capabilities,
665 indicated in the &percnt;c entry of the remailer menu lines (see
666 <ref id="mix_entry_format"
667 name="&dollar;mix&lowbar;entry&lowbar;format">).  Most important is
668 the ``middleman'' capability, indicated by a capital ``M'': This
669 means that the remailer in question cannot be used as the final
670 element of a chain, but will only forward messages to other
671 mixmaster remailers.  For details on the other capabilities, please
672 have a look at the mixmaster documentation.
673
674 <sect1>Forwarding and Bouncing Mail<label id="forwarding_mail">
675 <p>
676
677 Bouncing and forwarding let you send an existing message to recipients
678 that you specify.  Bouncing a message uses the <ref id="sendmail"
679 name="sendmail"> command to send a copy to alternative addresses as if
680 they were the message's original recipients.  Forwarding a message, on
681 the other hand, allows you to modify the message before it is resent
682 (for example, by adding your own comments).
683
684 The following keys are bound by default:
685
686 <tscreen><verb>
687 f       forward         forward message
688 b       bounce          bounce (remail) message
689 </verb></tscreen>
690
691 Forwarding can be done by including the original message in the new
692 message's body (surrounded by indicating lines) or including it as a MIME
693 attachment, depending on the value of the <ref id="mime_forward"
694 name="&dollar;mime&lowbar;forward"> variable.  Decoding of attachments,
695 like in the pager, can be controlled by the <ref id="forward_decode"
696 name="&dollar;forward&lowbar;decode"> and <ref id="mime_forward_decode"
697 name="&dollar;mime&lowbar;forward&lowbar;decode"> variables,
698 respectively.  The desired forwarding format may depend on the content,
699 therefore <em/&dollar;mime&lowbar;forward/ is a quadoption which, for
700 example, can be set to ``ask-no''.
701
702 The inclusion of headers is controlled by the current setting of the
703 <ref id="weed" name="&dollar;weed"> variable, unless <ref
704 id="mime_forward" name="mime&lowbar;forward"> is set.
705
706 Editing the message to forward follows the same procedure as sending or
707 replying to a message does.
708
709 <sect1>Postponing Mail<label id="postponing_mail">
710 <p>
711
712 At times it is desirable to delay sending a message that you have
713 already begun to compose.  When the <em/postpone-message/ function is
714 used in the <em/compose/ menu, the body of your message and attachments
715 are stored in the mailbox specified by the <ref id="postponed"
716 name="&dollar;postponed"> variable.  This means that you can recall the
717 message even if you exit Mutt and then restart it at a later time.
718
719 Once a message is postponed, there are several ways to resume it.  From the
720 command line you can use the ``-p'' option, or if you <em/compose/ a new
721 message from the <em/index/ or <em/pager/ you will be prompted if postponed
722 messages exist.  If multiple messages are currently postponed, the
723 <em/postponed/ menu will pop up and you can select which message you would
724 like to resume.
725
726 <bf/Note:/ If you postpone a reply to a message, the reply setting of
727 the message is only updated when you actually finish the message and
728 send it.  Also, you must be in the same folder with the message you
729 replied to for the status of the message to be updated.
730
731 See also the <ref id="postpone" name="&dollar;postpone"> quad-option.
732
733 <sect1>Reading news via NNTP<label id="reading_news">
734 <p>
735
736 If compiled with ``--enable-nntp'' option, Mutt can read news from newsserver
737 via NNTP.  You can open a newsgroup with function ``change-newsgroup''
738 (default: i).  Default newsserver can be obtained from <em/NNTPSERVER/
739 environment variable.  Like other news readers, info about subscribed
740 newsgroups is saved in file by <ref id="newsrc" name="&dollar;newsrc">
741 variable.  Article headers are cached and can be loaded from file when
742 newsgroup entered instead loading from newsserver.
743
744 <sect>Configuration
745 <p>
746
747 While the default configuration (or ``preferences'') make Mutt-ng usable right out
748 of the box, it is often desirable to tailor Mutt to suit your own tastes. When
749 Mutt-ng is first invoked, it will attempt to read the ``system'' configuration
750 file (defaults set by your local system administrator), unless the ``-n'' <ref
751 id="commandline" name="command line"> option is specified.  This file is
752 typically <tt>/usr/local/share/muttng/Muttngrc</tt> or <tt>/etc/Muttngrc</tt>,
753 Mutt-ng users will find this file in <tt>/usr/local/share/muttng/Muttrc</tt> or
754 <tt>/etc/Muttngrc</tt>. Mutt will next look for a file named <tt>.muttrc</tt>
755 in your home directory, Mutt-ng will look for <tt>.muttngrc</tt>.  If this file
756 does not exist and your home directory has a subdirectory named <tt/.mutt/,
757 mutt try to load a file named <tt>.muttng/muttngrc</tt>. 
758
759 <tt>.muttrc</tt> (or <tt>.muttngrc</tt> for Mutt-ng) is the file where you will
760 usually place your <ref id="commands" name="commands"> to configure Mutt.
761
762 In addition, mutt supports version specific configuration files that are
763 parsed instead of the default files as explained above.  For instance, if
764 your system has a <tt/Muttrc-0.88/ file in the system configuration
765 directory, and you are running version 0.88 of mutt, this file will be
766 sourced instead of the <tt/Muttrc/ file.  The same is true of the user
767 configuration file, if you have a file <tt/.muttrc-0.88.6/ in your home
768 directory, when you run mutt version 0.88.6, it will source this file
769 instead of the default <tt/.muttrc/ file.  The version number is the
770 same which is visible using the ``-v'' <ref id="commandline"
771 name="command line"> switch or using the <tt/show-version/ key (default:
772 V) from the index menu.
773
774 <sect1>Syntax of Initialization Files<label id="muttrc-syntax">
775 <p>
776
777 An initialization file consists of a series of <ref id="commands"
778 name="commands">.  Each line of the file may contain one or more commands.
779 When multiple commands are used, they must be separated by a semicolon (;).
780 <tscreen><verb>
781 set realname='Mutt user' ; ignore x-
782 </verb></tscreen>
783 The hash mark, or pound sign
784 (``&num;''), is used as a ``comment'' character. You can use it to
785 annotate your initialization file. All text after the comment character
786 to the end of the line is ignored. For example,
787
788 <tscreen><verb>
789 my_hdr X-Disclaimer: Why are you listening to me? &num; This is a comment
790 </verb></tscreen>
791
792 Single quotes (') and double quotes (&dquot;) can be used to quote strings
793 which contain spaces or other special characters.  The difference between
794 the two types of quotes is similar to that of many popular shell programs,
795 namely that a single quote is used to specify a literal string (one that is
796 not interpreted for shell variables or quoting with a backslash &lsqb;see
797 next paragraph&rsqb;), while double quotes indicate a string for which
798 should be evaluated.  For example, backtics are evaluated inside of double
799 quotes, but <bf/not/ for single quotes.
800
801 &bsol; quotes the next character, just as in shells such as bash and zsh.
802 For example, if want to put quotes ``&dquot;'' inside of a string, you can use
803 ``&bsol;'' to force the next character to be a literal instead of interpreted
804 character.
805 <tscreen><verb>
806 set realname="Michael \"MuttDude\" Elkins"
807 </verb></tscreen>
808
809 ``&bsol;&bsol;'' means to insert a literal ``&bsol;'' into the line.
810 ``&bsol;n'' and ``&bsol;r'' have their usual C meanings of linefeed and
811 carriage-return, respectively.
812
813 A &bsol; at the end of a line can be used to split commands over
814 multiple lines, provided that the split points don't appear in the
815 middle of command names.
816
817 It is also possible to substitute the output of a Unix command in an
818 initialization file.  This is accomplished by enclosing the command in
819 backquotes (``).  For example,
820 <tscreen><verb>
821 my_hdr X-Operating-System: `uname -a`
822 </verb></tscreen>
823 The output of the Unix command ``uname -a'' will be substituted before the
824 line is parsed.  Note that since initialization files are line oriented, only
825 the first line of output from the Unix command will be substituted.
826
827 UNIX environments can be accessed like the way it is done in shells like
828 sh and bash: Prepend the name of the environment by a ``&dollar;''.  For
829 example,
830 <tscreen><verb>
831 set record=+sent_on_$HOSTNAME
832 </verb></tscreen>
833
834 The commands understood by mutt are explained in the next paragraphs.
835 For a complete list, see the <ref id="commands" name="command reference">.
836
837 <sect1>Defining/Using aliases<label id="alias">
838 <p>
839
840 Usage: <tt/alias/ <em/key/ <em/address/ &lsqb; , <em/address/, ... &rsqb;
841
842 It's usually very cumbersome to remember or type out the address of someone
843 you are communicating with.  Mutt allows you to create ``aliases'' which map
844 a short string to a full address.
845
846 <bf/Note:/ if you want to create an alias for a group (by specifying more than
847 one address), you <bf/must/ separate the addresses with a comma (``,'').
848
849 To remove an alias or aliases (``*'' means all aliases):
850
851 <tt/unalias/ &lsqb; * | <em/key/ <em/.../ &rsqb;
852
853 <tscreen><verb>
854 alias muttdude me@cs.hmc.edu (Michael Elkins)
855 alias theguys manny, moe, jack
856 </verb></tscreen>
857
858 Unlike other mailers, Mutt doesn't require aliases to be defined
859 in a special file.  The <tt/alias/ command can appear anywhere in
860 a configuration file, as long as this file is <ref id="source"
861 name="sourced">.  Consequently, you can have multiple alias files, or
862 you can have all aliases defined in your muttrc.
863
864 On the other hand, the <ref id="create-alias" name="create-alias">
865 function can use only one file, the one pointed to by the <ref
866 id="alias_file" name="&dollar;alias&lowbar;file"> variable (which is
867 <tt>&tilde;/.muttrc</tt> by default). This file is not special either,
868 in the sense that Mutt will happily append aliases to any file, but in
869 order for the new aliases to take effect you need to explicitly <ref
870 id="source" name="source"> this file too.
871
872 For example:
873
874 <tscreen><verb>
875 source /usr/local/share/Mutt.aliases
876 source ~/.mail_aliases
877 set alias_file=~/.mail_aliases
878 </verb></tscreen>
879
880 To use aliases, you merely use the alias at any place in mutt where mutt
881 prompts for addresses, such as the <em/To:/ or <em/Cc:/ prompt.  You can
882 also enter aliases in your editor at the appropriate headers if you have the
883 <ref id="edit_headers" name="&dollar;edit&lowbar;headers"> variable set.
884
885 In addition, at the various address prompts, you can use the tab character
886 to expand a partial alias to the full alias.  If there are multiple matches,
887 mutt will bring up a menu with the matching aliases.  In order to be
888 presented with the full list of aliases, you must hit tab with out a partial
889 alias, such as at the beginning of the prompt or after a comma denoting
890 multiple addresses.
891
892 In the alias menu, you can select as many aliases as you want with the
893 <em/select-entry/ key (default: RET), and use the <em/exit/ key
894 (default: q) to return to the address prompt.
895
896 <sect1>Changing the default key bindings<label id="bind">
897 <p>
898 Usage: <tt/bind/ <em/map/ <em/key/ <em/function/
899
900 This command allows you to change the default key bindings (operation
901 invoked when pressing a key).
902
903 <em/map/ specifies in which menu the binding belongs.  Multiple maps may
904 be specified by separating them with commas (no additional whitespace is
905 allowed). The currently defined maps are:
906
907 <label id="maps">
908 <descrip>
909 <tag/generic/
910 This is not a real menu, but is used as a fallback for all of the other
911 menus except for the pager and editor modes.  If a key is not defined in
912 another menu, Mutt will look for a binding to use in this menu.  This allows
913 you to bind a key to a certain function in multiple menus instead of having
914 multiple bind statements to accomplish the same task.
915 <tag/alias/
916 The alias menu is the list of your personal aliases as defined in your
917 muttrc.  It is the mapping from a short alias name to the full email
918 address(es) of the recipient(s).
919 <tag/attach/
920 The attachment menu is used to access the attachments on received messages.
921 <tag/browser/
922 The browser is used for both browsing the local directory structure, and for
923 listing all of your incoming mailboxes.
924 <tag/editor/
925 The editor is the line-based editor the user enters text data.
926 <tag/index/
927 The index is the list of messages contained in a mailbox.
928 <tag/compose/
929 The compose menu is the screen used when sending a new message.
930 <tag/pager/
931 The pager is the mode used to display message/attachment data, and help
932 listings.
933 <tag/pgp/
934 The pgp menu is used to select the OpenPGP keys used for encrypting outgoing
935 messages.
936 <tag/postpone/
937 The postpone menu is similar to the index menu, except is used when
938 recalling a message the user was composing, but saved until later.
939 </descrip>
940
941 <em/key/ is the key (or key sequence) you wish to bind.  To specify a
942 control character, use the sequence <em/&bsol;Cx/, where <em/x/ is the
943 letter of the control character (for example, to specify control-A use
944 ``&bsol;Ca'').  Note that the case of <em/x/ as well as <em/&bsol;C/ is
945 ignored, so that <em/&bsol;CA/, <em/&bsol;Ca/, <em/&bsol;cA/ and <em/&bsol;ca/ are all
946 equivalent.  An alternative form is to specify the key as a three digit
947 octal number prefixed with a ``&bsol;'' (for example <em/&bsol;177/ is
948 equivalent to <em/&bsol;c?/).
949
950 In addition, <em/key/ may consist of:
951
952 <tscreen><verb>
953 \t              tab
954 <tab>           tab
955 \r              carriage return
956 \n              newline
957 \e              escape
958 <esc>           escape
959 <up>            up arrow
960 <down>          down arrow
961 <left>          left arrow
962 <right>         right arrow
963 <pageup>        Page Up
964 <pagedown>      Page Down
965 <backspace>     Backspace
966 <delete>        Delete
967 <insert>        Insert
968 <enter>         Enter
969 <return>        Return
970 <home>          Home
971 <end>           End
972 <space>         Space bar
973 <f1>            function key 1
974 <f10>           function key 10
975 </verb></tscreen>
976
977 <em/key/ does not need to be enclosed in quotes unless it contains a
978 space (`` '').
979
980 <em/function/ specifies which action to take when <em/key/ is pressed.
981 For a complete list of functions, see the <ref id="functions"
982 name="reference">.  The special function <tt/noop/ unbinds the specified key
983 sequence.
984
985 <sect1>Defining aliases for character sets <label id="charset-hook">
986 <p>
987 Usage: <tt/charset-hook/ <em/alias/ <em/charset/<newline>
988 Usage: <tt/iconv-hook/ <em/charset/ <em/local-charset/
989
990 The <tt/charset-hook/ command defines an alias for a character set.
991 This is useful to properly display messages which are tagged with a
992 character set name not known to mutt.
993
994 The <tt/iconv-hook/ command defines a system-specific name for a
995 character set.  This is helpful when your systems character
996 conversion library insists on using strange, system-specific names
997 for character sets.
998
999
1000 <sect1>Setting variables based upon mailbox<label id="folder-hook">
1001 <p>
1002 Usage: <tt/folder-hook/ &lsqb;!&rsqb;<em/regexp/ <em/command/
1003
1004 It is often desirable to change settings based on which mailbox you are
1005 reading.  The folder-hook command provides a method by which you can execute
1006 any configuration command.  <em/regexp/ is a regular expression specifying
1007 in which mailboxes to execute <em/command/ before loading.  If a mailbox
1008 matches multiple folder-hook's, they are executed in the order given in the
1009 muttrc.
1010
1011 <bf/Note:/ if you use the ``!'' shortcut for <ref id="spoolfile"
1012 name="&dollar;spoolfile"> at the beginning of the pattern, you must place it
1013 inside of double or single quotes in order to distinguish it from the
1014 logical <em/not/ operator for the expression.
1015
1016 Note that the settings are <em/not/ restored when you leave the mailbox.
1017 For example, a command action to perform is to change the sorting method
1018 based upon the mailbox being read:
1019
1020 <tscreen><verb>
1021 folder-hook mutt set sort=threads
1022 </verb></tscreen>
1023
1024 However, the sorting method is not restored to its previous value when
1025 reading a different mailbox.  To specify a <em/default/ command, use the
1026 pattern ``.'':
1027
1028 <p>
1029 <tscreen><verb>
1030 folder-hook . set sort=date-sent
1031 </verb></tscreen>
1032
1033 <sect1>Keyboard macros<label id="macro">
1034 <p>
1035 Usage: <tt/macro/ <em/menu/ <em/key/ <em/sequence/ &lsqb; <em/description/ &rsqb;
1036
1037 Macros are useful when you would like a single key to perform a series of
1038 actions.  When you press <em/key/ in menu <em/menu/, Mutt will behave as if
1039 you had typed <em/sequence/.  So if you have a common sequence of commands
1040 you type, you can create a macro to execute those commands with a single
1041 key.
1042
1043 <em/menu/ is the <ref id="maps" name="map"> which the macro will be bound.
1044 Multiple maps may be specified by separating multiple menu arguments by
1045 commas. Whitespace may not be used in between the menu arguments and the
1046 commas separating them.
1047
1048 <em/key/ and <em/sequence/ are expanded by the same rules as the <ref
1049 id="bind" name="key bindings">.  There are some additions however.  The
1050 first is that control characters in <em/sequence/ can also be specified
1051 as <em/&circ;x/.  In order to get a caret (`&circ;'') you need to use
1052 <em/&circ;&circ;/.  Secondly, to specify a certain key such as <em/up/
1053 or to invoke a function directly, you can use the format
1054 <em/&lt;key name&gt;/ and <em/&lt;function name&gt;/.  For a listing of key
1055 names see the section on <ref id="bind" name="key bindings">.  Functions
1056 are listed in the <ref id="functions" name="function reference">.
1057
1058 The advantage with using function names directly is that the macros will
1059 work regardless of the current key bindings, so they are not dependent on
1060 the user having particular key definitions.  This makes them more robust
1061 and portable, and also facilitates defining of macros in files used by more
1062 than one user (eg. the system Muttrc).
1063
1064 Optionally you can specify a descriptive text after <em/sequence/,
1065 which is shown in the help screens.
1066
1067 <bf/Note:/ Macro definitions (if any) listed in the help screen(s), are
1068 silently truncated at the screen width, and are not wrapped.   
1069
1070 <sect1>Using color and mono video attributes<label id="color">
1071 <p>
1072 Usage: <tt/color/ <em/object/ <em/foreground/ <em/background/ &lsqb; <em/regexp/ &rsqb;<newline>
1073 Usage: <tt/color/ index <em/foreground/ <em/background/ <em/pattern/<newline>
1074 Usage: <tt/uncolor/ index <em/pattern/ &lsqb; <em/pattern/ ...  &rsqb;<newline>
1075
1076 If your terminal supports color, you can spice up Mutt by creating your own
1077 color scheme.  To define the color of an object (type of information), you
1078 must specify both a foreground color <bf/and/ a background color (it is not
1079 possible to only specify one or the other).
1080
1081 <em/object/ can be one of:
1082
1083 <itemize>
1084 <item>attachment
1085 <item>body (match <em/regexp/ in the body of messages)
1086 <item>bold (hiliting bold patterns in the body of messages)
1087 <item>error (error messages printed by Mutt)
1088 <item>header (match <em/regexp/ in the message header)
1089 <item>hdrdefault (default color of the message header in the pager)
1090 <item>index (match <em/pattern/ in the message index)
1091 <item>indicator (arrow or bar used to indicate the current item in a menu)
1092 <item>markers (the ``+'' markers at the beginning of wrapped lines in the pager)
1093 <item>message (informational messages)
1094 <item>normal
1095 <item>quoted (text matching <ref id="quote_regexp"
1096 name="&dollar;quote&lowbar;regexp"> in the body of a message)
1097 <item>quoted1, quoted2, ..., quoted<bf/N/ (higher levels of quoting)
1098 <item>search (hiliting of words in the pager)
1099 <item>signature
1100 <item>status (mode lines used to display info about the mailbox or message)
1101 <item>tilde (the ``&tilde;'' used to pad blank lines in the pager)
1102 <item>tree (thread tree drawn in the message index and attachment menu)
1103 <item>underline (hiliting underlined patterns in the body of messages)
1104 </itemize>
1105
1106 <em/foreground/ and <em/background/ can be one of the following:
1107
1108 <itemize>
1109 <item>white
1110 <item>black
1111 <item>green
1112 <item>magenta
1113 <item>blue
1114 <item>cyan
1115 <item>yellow
1116 <item>red
1117 <item>default
1118 <item>color<em/x/
1119 </itemize>
1120
1121 <em/foreground/ can optionally be prefixed with the keyword <tt/bright/ to make
1122 the foreground color boldfaced (e.g., <tt/brightred/).
1123
1124 If your terminal supports it, the special keyword <em/default/ can be
1125 used as a transparent color.  The value <em/brightdefault/ is also valid.
1126 If Mutt is linked against the <em/S-Lang/ library, you also need to set
1127 the <em/COLORFGBG/ environment variable to the default colors of your
1128 terminal for this to work; for example (for Bourne-like shells):
1129
1130 <tscreen><verb>
1131 set COLORFGBG="green;black"
1132 export COLORFGBG
1133 </verb></tscreen>
1134
1135 <bf/Note:/ The <em/S-Lang/ library requires you to use the <em/lightgray/
1136 and <em/brown/ keywords instead of <em/white/ and <em/yellow/ when
1137 setting this variable.
1138
1139 <bf/Note:/ The uncolor command can be applied to the index object only.  It
1140 removes entries from the list. You <bf/must/ specify the same pattern
1141 specified in the color command for it to be removed.  The pattern ``*'' is
1142 a special token which means to clear the color index list of all entries.
1143
1144 Mutt also recognizes the keywords <em/color0/, <em/color1/, &hellip;,
1145 <em/color/<bf/N-1/ (<bf/N/ being the number of colors supported
1146 by your terminal).  This is useful when you remap the colors for your
1147 display (for example by changing the color associated with <em/color2/
1148 for your xterm), since color names may then lose their normal meaning.
1149
1150 If your terminal does not support color, it is still possible change the video
1151 attributes through the use of the ``mono'' command:
1152
1153 Usage: <tt/mono/ <em/&lt;object&gt; &lt;attribute&gt;/ &lsqb; <em/regexp/ &rsqb;<newline>
1154 Usage: <tt/mono/ index <em/attribute/ <em/pattern/<newline>
1155 Usage: <tt/unmono/ index <em/pattern/ &lsqb; <em/pattern/ ...  &rsqb;<newline>
1156
1157 where <em/attribute/ is one of the following:
1158
1159 <itemize>
1160 <item>none
1161 <item>bold
1162 <item>underline
1163 <item>reverse
1164 <item>standout
1165 </itemize>
1166
1167 <sect1>Ignoring (weeding) unwanted message headers<label id="ignore">
1168 <p>
1169 Usage: <tt/&lsqb;un&rsqb;ignore/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
1170
1171 Messages often have many header fields added by automatic processing systems,
1172 or which may not seem useful to display on the screen.  This command allows
1173 you to specify header fields which you don't normally want to see.
1174
1175 You do not need to specify the full header field name.  For example,
1176 ``ignore content-'' will ignore all header fields that begin with the pattern
1177 ``content-''. ``ignore *'' will ignore all headers.
1178
1179 To remove a previously added token from the list, use the ``unignore'' command.
1180 The ``unignore'' command will make Mutt display headers with the given pattern.
1181 For example, if you do ``ignore x-'' it is possible to ``unignore x-mailer''.
1182
1183 ``unignore *'' will remove all tokens from the ignore list.
1184
1185 For example:
1186 <tscreen><verb>
1187 # Sven's draconian header weeding
1188 ignore *
1189 unignore from date subject to cc
1190 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
1191 unignore posted-to:
1192 </verb></tscreen>
1193
1194 <sect1>Alternative addresses<label id="alternates">
1195 <p>
1196 Usage: <tt/&lsqb;un&rsqb;alternates/ <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;<newline>
1197
1198 With various functions, mutt will treat messages differently,
1199 depending on whether you sent them or whether you received them from
1200 someone else.  For instance, when replying to a message that you
1201 sent to a different party, mutt will automatically suggest to send
1202 the response to the original message's recipients -- responding to
1203 yourself won't make much sense in many cases.  (See <ref
1204 id="reply_to" name="&dollar;reply&lowbar;to">.)
1205
1206 Many users receive e-mail under a number of different addresses. To
1207 fully use mutt's features here, the program must be able to
1208 recognize what e-mail addresses you receive mail under. That's the
1209 purpose of the <tt/alternates/ command: It takes a list of regular
1210 expressions, each of which can identify an address under which you
1211 receive e-mail.
1212
1213 The <tt/unalternates/ command can be used to write exceptions to
1214 <tt/alternates/ patterns. If an address matches something in an
1215 <tt/alternates/ command, but you nonetheless do not think it is
1216 from you, you can list a more precise pattern under an <tt/unalternates/
1217 command.
1218
1219 To remove a regular expression from the <tt/alternates/ list, use the
1220 <tt/unalternates/ command with exactly the same <em/regexp/.
1221 Likewise, if the <em/regexp/ for a <tt/alternates/ command matches
1222 an entry on the <tt/unalternates/ list, that <tt/unalternates/
1223 entry will be removed. If the <em/regexp/ for <tt/unalternates/
1224 is ``*'', <em/all entries/ on <tt/alternates/ will be removed.
1225
1226 <sect1>Mailing lists<label id="lists">
1227 <p>
1228 Usage: <tt/&lsqb;un&rsqb;lists/ <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;<newline>
1229 Usage: <tt/&lsqb;un&rsqb;subscribe/ <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;
1230
1231 Mutt has a few nice features for <ref id="using_lists" name="handling
1232 mailing lists">.  In order to take advantage of them, you must
1233 specify which addresses belong to mailing lists, and which mailing
1234 lists you are subscribed to.  Once you have done this, the <ref
1235 id="list-reply" name="list-reply"> function will work for all known lists.
1236 Additionally, when you send a message to a subscribed list, mutt will
1237 add a Mail-Followup-To header to tell other users' mail user agents
1238 not to send copies of replies to your personal address.   Note that
1239 the Mail-Followup-To header is a non-standard extension which is not
1240 supported by all mail user agents.  Adding it is not bullet-proof against
1241 receiving personal CCs of list messages.  Also note that the generation
1242 of the Mail-Followup-To header is controlled by the <ref id="followup_to"
1243 name="&dollar;followup&lowbar;to"> configuration variable.
1244
1245 More precisely, Mutt maintains lists of patterns for the addresses
1246 of known and subscribed mailing lists.  Every subscribed mailing
1247 list is known. To mark a mailing list as known, use the ``lists''
1248 command.  To mark it as subscribed, use ``subscribe''.
1249
1250 You can use regular expressions with both commands.  To mark all
1251 messages sent to a specific bug report's address on mutt's bug
1252 tracking system as list mail, for instance, you could say
1253 ``subscribe [0-9]*@bugs.guug.de''.  Often, it's sufficient to just
1254 give a portion of the list's e-mail address.
1255
1256 Specify as much of the address as you need to to remove ambiguity.  For
1257 example, if you've subscribed to the Mutt mailing list, you will receive mail
1258 addresssed to <em/mutt-users@mutt.org/.  So, to tell Mutt that this is a
1259 mailing list, you could add ``lists mutt-users'' to your
1260 initialization file.  To tell mutt that you are subscribed to it,
1261 add ``subscribe mutt-users'' to your initialization file instead.
1262 If you also happen to get mail from someone whose address is
1263 <em/mutt-users@example.com/, you could use ``lists mutt-users@mutt&bsol;&bsol;.org'' 
1264 or ``subscribe mutt-users@mutt&bsol;&bsol;.org'' to
1265 match only mail from the actual list.
1266
1267 The ``unlists'' command is used to remove a token from the list of
1268 known and subscribed mailing-lists. Use ``unlists *'' to remove all
1269 tokens.
1270
1271 To remove a mailing list from the list of subscribed mailing lists,
1272 but keep it on the list of known mailing lists, use ``unsubscribe''.
1273
1274 <sect1>Using Multiple spool mailboxes<label id="mbox-hook">
1275 <p>
1276 Usage: <tt/mbox-hook/ &lsqb;!&rsqb;<em/pattern/ <em/mailbox/
1277
1278 This command is used to move read messages from a specified mailbox to a
1279 different mailbox automatically when you quit or change folders.
1280 <em/pattern/ is a regular expression specifying the mailbox to treat as a
1281 ``spool'' mailbox and <em/mailbox/ specifies where mail should be saved when
1282 read.
1283
1284 Unlike some of the other <em/hook/ commands, only the <em/first/ matching
1285 pattern is used (it is not possible to save read mail in more than a single
1286 mailbox).
1287
1288 <sect1>Defining mailboxes which receive mail<label id="mailboxes">
1289 <p>
1290 Usage: <tt/&lsqb;un&rsqb;mailboxes/ &lsqb;!&rsqb;<em/filename/ &lsqb; <em/filename/ ... &rsqb;
1291
1292 This command specifies folders which can receive mail and
1293 which will be checked for new messages.  By default, the
1294 main menu status bar displays how many of these folders have
1295 new messages.
1296 <p>
1297 When changing folders, pressing <em/space/ will cycle
1298 through folders with new mail.
1299 <p>
1300 Pressing TAB in the directory browser will bring up a menu showing the files
1301 specified by the <tt/mailboxes/ command, and indicate which contain new
1302 messages.  Mutt will automatically enter this mode when invoked from the
1303 command line with the <tt/-y/ option.
1304
1305 The ``unmailboxes'' command is used to remove a token from the list
1306 of folders which receive mail. Use ``unmailboxes *'' to remove all
1307 tokens.
1308
1309 <p>
1310 <bf/Note:/ new mail is detected by comparing the last modification time to
1311 the last access time.  Utilities like <tt/biff/ or <tt/frm/ or any other
1312 program which accesses the mailbox might cause Mutt to never detect new mail
1313 for that mailbox if they do not properly reset the access time.  Backup
1314 tools are another common reason for updated access times.
1315 <p>
1316
1317 <bf/Note:/ the filenames in the <tt/mailboxes/ command are resolved when
1318 the command is executed, so if these names contain <ref id="shortcuts"
1319 name="shortcut characters"> (such as ``='' and ``!''), any variable
1320 definition that affect these characters (like <ref id="folder"
1321 name="&dollar;folder"> and <ref id="spoolfile" name="&dollar;spoolfile">)
1322 should be executed before the <tt/mailboxes/ command.
1323
1324 <sect1>User defined headers<label id="my_hdr">
1325 <p>
1326 Usage:<newline>
1327 <tt/my_hdr/ <em/string/<newline>
1328 <tt/unmy_hdr/ <em/field/ &lsqb; <em/field/ ... &rsqb;
1329
1330 The ``my&lowbar;hdr'' command allows you to create your own header
1331 fields which will be added to every message you send.
1332
1333 For example, if you would like to add an ``Organization:'' header field to
1334 all of your outgoing messages, you can put the command
1335
1336 <quote>
1337 my_hdr Organization: A Really Big Company, Anytown, USA
1338 </quote>
1339
1340 in your <tt/.muttrc/.
1341
1342 <bf/Note:/  space characters are <em/not/ allowed between the keyword and
1343 the colon (``:'').  The standard for electronic mail (RFC822) says that
1344 space is illegal there, so Mutt enforces the rule.
1345
1346 If you would like to add a header field to a single message, you should
1347 either set the <ref id="edit_headers" name="edit&lowbar;headers"> variable,
1348 or use the <em/edit-headers/ function (default: ``E'') in the send-menu so
1349 that you can edit the header of your message along with the body.
1350
1351 To remove user defined header fields, use the ``unmy&lowbar;hdr''
1352 command.  You may specify an asterisk (``*'') to remove all header
1353 fields, or the fields to remove.  For example, to remove all ``To'' and
1354 ``Cc'' header fields, you could use:
1355
1356 <quote>
1357 unmy_hdr to cc
1358 </quote>
1359
1360 <sect1>Defining the order of headers when viewing messages<label id="hdr_order">
1361 <p>
1362 Usage: <tt/hdr&lowbar;order/ <em/header1/ <em/header2/ <em/header3/
1363
1364 With this command, you can specify an order in which mutt will attempt
1365 to present headers to you when viewing messages.
1366
1367 ``unhdr_order *'' will clear all previous headers from the order list,
1368 thus removing the header order effects set by the system-wide startup
1369 file.
1370
1371 <tscreen><verb>
1372 hdr&lowbar;order From Date: From: To: Cc: Subject:
1373 </verb></tscreen>
1374
1375 <sect1>Specify default save filename<label id="save-hook">
1376 <p>
1377 Usage: <tt/save-hook/ &lsqb;!&rsqb;<em/pattern/ <em/filename/
1378
1379 This command is used to override the default filename used when saving
1380 messages.  <em/filename/ will be used as the default filename if the message is
1381 <em/From:/ an address matching <em/regexp/ or if you are the author and the
1382 message is addressed <em/to:/ something matching <em/regexp/.
1383
1384 See <ref id="pattern_hook" name="Message Matching in Hooks"> for information on the exact format of <em/pattern/.
1385
1386 Examples:
1387
1388 <tscreen><verb>
1389 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
1390 save-hook aol\\.com$ +spam
1391 </verb></tscreen>
1392
1393 Also see the <ref id="fcc-save-hook" name="fcc-save-hook"> command.
1394
1395 <sect1>Specify default Fcc: mailbox when composing<label id="fcc-hook">
1396 <p>
1397 Usage: <tt/fcc-hook/ &lsqb;!&rsqb;<em/pattern/ <em/mailbox/
1398
1399 This command is used to save outgoing mail in a mailbox other than
1400 <ref id="record" name="&dollar;record">.  Mutt searches the initial list of
1401 message recipients for the first matching <em/regexp/ and uses <em/mailbox/
1402 as the default Fcc: mailbox.  If no match is found the message will be saved
1403 to <ref id="record" name="&dollar;record"> mailbox.
1404
1405 See <ref id="pattern_hook" name="Message Matching in Hooks"> for information on the exact format of <em/pattern/.
1406
1407 Example: <tt/fcc-hook &lsqb;@.&rsqb;aol&bsol;&bsol;.com&dollar; +spammers/
1408
1409 The above will save a copy of all messages going to the aol.com domain to
1410 the `+spammers' mailbox by default.  Also see the <ref id="fcc-save-hook" 
1411 name="fcc-save-hook"> command.
1412
1413 <sect1>Specify default save filename and default Fcc: mailbox at once<label
1414 id="fcc-save-hook">
1415 <p>
1416 Usage: <tt/fcc-save-hook/ &lsqb;!&rsqb;<em/pattern/ <em/mailbox/
1417
1418 This command is a shortcut, equivalent to doing both a <ref id="fcc-hook" name="fcc-hook">
1419 and a <ref id="save-hook" name="save-hook"> with its arguments.
1420
1421 <sect1>Change settings based upon message recipients<label id="send-hook"><label id="reply-hook"><label id="send2-hook">
1422 <p>
1423 Usage: <tt/reply-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/<newline>
1424 Usage: <tt/send-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/<newline>
1425 Usage: <tt/send2-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/
1426
1427 These commands can be used to execute arbitrary configuration commands based
1428 upon recipients of the message.  <em/pattern/ is a regular expression
1429 matching the desired address.  <em/command/ is executed when <em/regexp/
1430 matches recipients of the message.
1431
1432 <tt/reply-hook/ is matched against the message you are <em/replying/
1433 <bf/to/, instead of the message you are <em/sending/.  <tt/send-hook/ is
1434 matched against all messages, both <em/new/ and <em/replies/.  <bf/Note:/
1435 <tt/reply-hook/s are matched <bf/before/ the <tt/send-hook/, <bf/regardless/
1436 of the order specified in the users's configuration file.
1437
1438 <tt/send2-hook/ is matched every time a message is changed, either
1439 by editing it, or by using the compose menu to change its recipients
1440 or subject.  <tt/send2-hook/ is executed after <tt/send-hook/, and
1441 can, e.g., be used to set parameters such as the <ref id="sendmail"
1442 name="&dollar;sendmail"> variable depending on the message's sender
1443 address.
1444
1445 For each type of <tt/send-hook/ or <tt/reply-hook/, when multiple matches
1446 occur, commands are executed in the order they are specified in the muttrc
1447 (for that type of hook).
1448
1449 See <ref id="pattern_hook" name="Message Matching in Hooks"> for information on the exact format of <em/pattern/.
1450
1451 Example: <tt/send-hook mutt &dquot;set mime&lowbar;forward signature=''&dquot;/
1452
1453 Another typical use for this command is to change the values of the
1454 <ref id="attribution" name="&dollar;attribution">, <ref id="signature"
1455 name="&dollar;signature"> and <ref id="locale" name="&dollar;locale">
1456 variables in order to change the language of the attributions and
1457 signatures based upon the recipients.
1458
1459 <bf/Note:/ the send-hook's are only executed ONCE after getting the initial
1460 list of recipients.  Adding a recipient after replying or editing the
1461 message will NOT cause any send-hook to be executed.  Also note that
1462 my_hdr commands which modify recipient headers, or the message's
1463 subject, don't have any effect on the current message when executed
1464 from a send-hook.
1465
1466 <sect1>Change settings before formatting a message<label id="message-hook">
1467 <p>
1468 Usage: <tt/message-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/
1469
1470 This command can be used to execute arbitrary configuration commands
1471 before viewing or formatting a message based upon information about the message.
1472 <em/command/ is executed if the <em/pattern/ matches the message to be
1473 displayed. When multiple matches occur, commands are executed in the order
1474 they are specified in the muttrc.
1475
1476 See <ref id="pattern_hook" name="Message Matching in Hooks"> for
1477 information on the exact format of <em/pattern/.
1478
1479 Example:
1480 <tscreen><verb>
1481 message-hook ~A 'set pager=builtin'
1482 message-hook '~f freshmeat-news' 'set pager="less \"+/^  subject: .*\""'
1483 </verb></tscreen>
1484
1485 <sect1>Choosing the cryptographic key of the recipient<label id="crypt-hook">
1486 <p>
1487 Usage: <tt/crypt-hook/ <em/pattern/ <em/keyid/
1488
1489 When encrypting messages with PGP or OpenSSL, you may want to associate a certain
1490 key with a given e-mail address automatically, either because the
1491 recipient's public key can't be deduced from the destination address,
1492 or because, for some reasons, you need to override the key Mutt would
1493 normally use.  The crypt-hook command provides a method by which you can
1494 specify the ID of the public key to be used when encrypting messages to
1495 a certain recipient.
1496
1497 The meaning of "key id" is to be taken broadly in this context:  You
1498 can either put a numerical key ID here, an e-mail address, or even
1499 just a real name.
1500
1501 <sect1>Adding key sequences to the keyboard buffer<label id="push">
1502 <p>
1503 Usage: <tt/push/ <em/string/
1504
1505 This command adds the named string to the keyboard buffer. The string may
1506 contain control characters, key names and function names like the sequence
1507 string in the <ref id="macro" name="macro"> command. You may use it to
1508 automatically run a sequence of commands at startup, or when entering
1509 certain folders.
1510
1511 <sect1>Executing functions<label id="exec">
1512 <p>
1513 Usage: <tt/exec/ <em/function/ &lsqb; <em/function/ ... &rsqb;
1514
1515 This command can be used to execute any function. Functions are
1516 listed in the <ref id="functions" name="function reference">.
1517 ``exec function'' is equivalent to ``push &lt;function&gt;''.
1518
1519 <sect1>Message Scoring<label id="score-command">
1520 <p>
1521 Usage: <tt/score/ <em/pattern/ <em/value/<newline>
1522 Usage: <tt/unscore/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
1523
1524 The <tt/score/ commands adds <em/value/ to a message's score if <em/pattern/
1525 matches it.  <em/pattern/ is a string in the format described in the <ref
1526 id="patterns" name="patterns"> section (note: For efficiency reasons, patterns
1527 which scan information not available in the index, such as <tt>&tilde;b</tt>,
1528 <tt>&tilde;B</tt> or <tt>&tilde;h</tt>, may not be used).  <em/value/ is a
1529 positive or negative integer.  A message's final score is the sum total of all
1530 matching <tt/score/ entries.  However, you may optionally prefix <em/value/ with
1531 an equal sign (=) to cause evaluation to stop at a particular entry if there is
1532 a match.  Negative final scores are rounded up to 0.
1533
1534 The <tt/unscore/ command removes score entries from the list.  You <bf/must/
1535 specify the same pattern specified in the <tt/score/ command for it to be
1536 removed.  The pattern ``*'' is a special token which means to clear the list
1537 of all score entries.
1538
1539 <sect1>Spam detection<label id="spam">
1540 <p>
1541 Usage: <tt/spam/ <em/pattern/ <em/format/<newline>
1542 Usage: <tt/nospam/ <em/pattern/
1543
1544 Mutt has generalized support for external spam-scoring filters.
1545 By defining your spam patterns with the <tt/spam/ and <tt/nospam/
1546 commands, you can <em/limit/, <em/search/, and <em/sort/ your
1547 mail based on its spam attributes, as determined by the external
1548 filter. You also can display the spam attributes in your index
1549 display using the <tt/%H/ selector in the <ref id="index_format"
1550 name="&dollar;index&lowbar;format"> variable. (Tip: try <tt/%?H?[%H] ?/
1551 to display spam tags only when they are defined for a given message.)
1552
1553 Your first step is to define your external filter's spam patterns using
1554 the <tt/spam/ command. <em/pattern/ should be a regular expression
1555 that matches a header in a mail message. If any message in the mailbox
1556 matches this regular expression, it will receive a ``spam tag'' or
1557 ``spam attribute'' (unless it also matches a <tt/nospam/ pattern -- see
1558 below.) The appearance of this attribute is entirely up to you, and is
1559 governed by the <em/format/ parameter. <em/format/ can be any static
1560 text, but it also can include back-references from the <em/pattern/
1561 expression. (A regular expression ``back-reference'' refers to a
1562 sub-expression contained within parentheses.) <tt/%1/ is replaced with
1563 the first back-reference in the regex, <tt/%2/ with the second, etc.
1564
1565 If you're using multiple spam filters, a message can have more than
1566 one spam-related header. You can define <tt/spam/ patterns for each
1567 filter you use. If a message matches two or more of these patterns, and
1568 the &dollar;spam&lowbar;separator variable is set to a string, then the
1569 message's spam tag will consist of all the <em/format/ strings joined
1570 together, with the value of &dollar;spam&lowbar;separator separating
1571 them.
1572
1573 For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
1574 define these spam settings:
1575 <tscreen><verb>
1576 spam "X-DCC-.*-Metrics:.*(....)=many"         "90+/DCC-%1"
1577 spam "X-Spam-Status: Yes"                     "90+/SA"
1578 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
1579 set spam_separator=", "
1580 </verb></tscreen>
1581
1582 If I then received a message that DCC registered with ``many'' hits
1583 under the ``Fuz2'' checksum, and that PureMessage registered with a
1584 97% probability of being spam, that message's spam tag would read
1585 <tt>90+/DCC-Fuz2, 97/PM</tt>. (The four characters before ``=many'' in a
1586 DCC report indicate the checksum used -- in this case, ``Fuz2''.)
1587
1588 If the &dollar;spam&lowbar;separator variable is unset, then each
1589 spam pattern match supercedes the previous one. Instead of getting
1590 joined <em/format/ strings, you'll get only the last one to match.
1591
1592 The spam tag is what will be displayed in the index when you use
1593 <tt/%H/ in the <tt/&dollar;index&lowbar;format/ variable. It's also the
1594 string that the <tt/~H/ pattern-matching expression matches against for
1595 <em/search/ and <em/limit/ functions. And it's what sorting by spam
1596 attribute will use as a sort key.
1597
1598 That's a pretty complicated example, and most people's actual
1599 environments will have only one spam filter. The simpler your
1600 configuration, the more effective mutt can be, especially when it comes
1601 to sorting.
1602
1603 Generally, when you sort by spam tag, mutt will sort <em/lexically/ --
1604 that is, by ordering strings alphnumerically. However, if a spam tag
1605 begins with a number, mutt will sort numerically first, and lexically
1606 only when two numbers are equal in value. (This is like UNIX's
1607 <tt/sort -n/.) A message with no spam attributes at all -- that is, one
1608 that didn't match <em/any/ of your <tt/spam/ patterns -- is sorted at
1609 lowest priority. Numbers are sorted next, beginning with 0 and ranging
1610 upward. Finally, non-numeric strings are sorted, with ``a'' taking lower
1611 priority than ``z''. Clearly, in general, sorting by spam tags is most
1612 effective when you can coerce your filter to give you a raw number. But
1613 in case you can't, mutt can still do something useful.
1614
1615 The <tt/nospam/ command can be used to write exceptions to <tt/spam/
1616 patterns. If a header pattern matches something in a <tt/spam/ command,
1617 but you nonetheless do not want it to receive a spam tag, you can list a
1618 more precise pattern under a <tt/nospam/ command.
1619
1620 If the <em/pattern/ given to <tt/nospam/ is exactly the same as the
1621 <em/pattern/ on an existing <tt/spam/ list entry, the effect will be to
1622 remove the entry from the spam list, instead of adding an exception.
1623 Likewise, if the <em/pattern/ for a <tt/spam/ command matches an entry
1624 on the <tt/nospam/ list, that <tt/nospam/ entry will be removed. If the
1625 <em/pattern/ for <tt/nospam/ is ``*'', <em/all entries on both lists/
1626 will be removed. This might be the default action if you use <tt/spam/
1627 and <tt/nospam/ in conjunction with a <tt/folder-hook/.
1628
1629 You can have as many <tt/spam/ or <tt/nospam/ commands as you like.
1630 You can even do your own primitive spam detection within mutt -- for
1631 example, if you consider all mail from <tt/MAILER-DAEMON/ to be spam,
1632 you can use a <tt/spam/ command like this:
1633
1634 <tscreen><verb>
1635 spam "^From: .*MAILER-DAEMON"       "999"
1636 </verb></tscreen>
1637
1638
1639 <sect1>Setting variables<label id="set">
1640 <p>
1641 Usage: <tt/set/ &lsqb;no|inv&rsqb;<em/variable/&lsqb;=<em/value/&rsqb; &lsqb; <em/variable/ ... &rsqb;<newline>
1642 Usage: <tt/toggle/ <em/variable/ &lsqb;<em/variable/ ... &rsqb;<newline>
1643 Usage: <tt/unset/ <em/variable/ &lsqb;<em/variable/ ... &rsqb;<newline>
1644 Usage: <tt/reset/ <em/variable/ &lsqb;<em/variable/ ... &rsqb;
1645
1646 This command is used to set (and unset) <ref id="variables"
1647 name="configuration variables">.  There are four basic types of variables:
1648 boolean, number, string and quadoption.  <em/boolean/ variables can be
1649 <em/set/ (true) or <em/unset/ (false).  <em/number/ variables can be
1650 assigned a positive integer value.
1651
1652 <em/string/ variables consist of any number of printable characters.
1653 <em/strings/ must be enclosed in quotes if they contain spaces or tabs.  You
1654 may also use the ``C'' escape sequences <bf/&bsol;n/ and <bf/&bsol;t/ for
1655 newline and tab, respectively.
1656
1657 <em/quadoption/ variables are used to control whether or not to be prompted
1658 for certain actions, or to specify a default action.  A value of <em/yes/
1659 will cause the action to be carried out automatically as if you had answered
1660 yes to the question.  Similarly, a value of <em/no/ will cause the the
1661 action to be carried out as if you had answered ``no.''  A value of
1662 <em/ask-yes/ will cause a prompt with a default answer of ``yes'' and
1663 <em/ask-no/ will provide a default answer of ``no.''
1664
1665 Prefixing a variable with ``no'' will unset it.  Example: <tt/set noaskbcc/.
1666
1667 For <em/boolean/ variables, you may optionally prefix the variable name with
1668 <tt/inv/ to toggle the value (on or off).  This is useful when writing
1669 macros.  Example: <tt/set invsmart&lowbar;wrap/.
1670
1671 The <tt/toggle/ command automatically prepends the <tt/inv/ prefix to all
1672 specified variables.
1673
1674 The <tt/unset/ command automatically prepends the <tt/no/ prefix to all
1675 specified variables.
1676
1677 Using the enter-command function in the <em/index/ menu, you can query the
1678 value of a variable by prefixing the name of the variable with a question
1679 mark:
1680
1681 <tscreen><verb>
1682 set ?allow_8bit
1683 </verb></tscreen>
1684
1685 The question mark is actually only required for boolean and quadoption 
1686 variables.
1687
1688 The <tt/reset/ command resets all given variables to the compile time
1689 defaults (hopefully mentioned in this manual). If you use the command
1690 <tt/set/ and prefix the variable with ``&amp;'' this has the same
1691 behavior as the reset command.
1692
1693 With the <tt/reset/ command there exists the special variable ``all'',
1694 which allows you to reset all variables to their system defaults.
1695
1696 <sect1>Reading initialization commands from another file<label id="source">
1697 <p>
1698 Usage: <tt/source/ <em/filename/ &lsqb; <em/filename/ ... &rsqb;
1699
1700 This command allows the inclusion of initialization commands
1701 from other files.  For example, I place all of my aliases in
1702 <tt>&tilde;/.mail&lowbar;aliases</tt> so that I can make my
1703 <tt>&tilde;/.muttrc</tt> readable and keep my aliases private.
1704
1705 If the filename begins with a tilde (``&tilde;''), it will be expanded to the
1706 path of your home directory.
1707
1708 If the filename ends with a vertical bar (|), then <em/filename/ is
1709 considered to be an executable program from which to read input (eg.
1710 <tt>source ~/bin/myscript|</tt>).
1711
1712 <sect1>Configuring features conditionnaly<label id="ifdef">
1713 <p>
1714 Usage: <tt/ifdef/ <em/item/ <em/command/
1715
1716 This command allows to test if a feature has been compiled in, before
1717 actually executing the command. Item can be either the name of a
1718 function or a variable.
1719
1720 Example:
1721 <tscreen><verb>
1722 ifdef imap_keepalive 'source ~/.mutt/imap_setup'
1723 </verb></tscreen>
1724
1725 <sect1>Removing hooks<label id="unhook">
1726 <p>
1727 Usage: <tt/unhook/ &lsqb; * | <em/hook-type/ &rsqb;
1728
1729 This command permits you to flush hooks you have previously defined.
1730 You can either remove all hooks by giving the ``*'' character as an
1731 argument, or you can remove all hooks of a specific type by saying
1732 something like <tt/unhook send-hook/.
1733
1734 <sect>Advanced Usage
1735
1736 <sect1>Regular Expressions<label id="regexp">
1737 <p>
1738 All string patterns in Mutt including those in more complex
1739 <ref id="patterns" name="patterns"> must be specified
1740 using regular expressions (regexp) in the ``POSIX extended'' syntax (which
1741 is more or less the syntax used by egrep and GNU awk).  For your
1742 convenience, we have included below a brief description of this syntax.
1743
1744 The search is case sensitive if the pattern contains at least one upper
1745 case letter, and case insensitive otherwise. Note that ``&bsol;''
1746 must be quoted if used for a regular expression in an initialization
1747 command: ``&bsol;&bsol;''.
1748
1749 A regular expression is a pattern that describes a set of strings.
1750 Regular expressions are constructed analogously to arithmetic
1751 expressions, by using various operators to combine smaller expressions.
1752
1753 Note that the regular expression can be enclosed/delimited by either &dquot;
1754 or ' which is useful if the regular expression includes a white-space
1755 character.  See <ref id="muttrc-syntax" name="Syntax of Initialization Files">
1756 for more information on &dquot; and ' delimiter processing.  To match a
1757 literal &dquot; or ' you must preface it with \ (backslash).
1758
1759 The fundamental building blocks are the regular expressions that match
1760 a single character.  Most characters, including all letters and digits,
1761 are regular expressions that match themselves.  Any metacharacter with
1762 special meaning may be quoted by preceding it with a backslash.
1763
1764 The period ``.'' matches any single character.  The caret ``&circ;'' and
1765 the dollar sign ``&dollar'' are metacharacters that respectively match
1766 the empty string at the beginning and end of a line.
1767
1768 A list of characters enclosed by ``&lsqb;'' and ``&rsqb;'' matches any
1769 single character in that list; if the first character of the list
1770 is a caret ``&circ;'' then it matches any character <bf/not/ in the
1771 list.  For example, the regular expression <bf/&lsqb;0123456789&rsqb;/
1772 matches any single digit.  A range of ASCII characters may be specified
1773 by giving the first and last characters, separated by a hyphen
1774 ``&hyphen;''.  Most metacharacters lose their special meaning inside
1775 lists.  To include a literal ``&rsqb;'' place it first in the list.
1776 Similarly, to include a literal ``&circ;'' place it anywhere but first.
1777 Finally, to include a literal hyphen ``&hyphen;'' place it last.
1778
1779 Certain named classes of characters are predefined.  Character classes
1780 consist of ``&lsqb;:'', a keyword denoting the class, and ``:&rsqb;''.
1781 The following classes are defined by the POSIX standard:
1782
1783 <descrip>
1784 <tag/&lsqb;:alnum:&rsqb;/
1785 Alphanumeric characters.
1786 <tag/&lsqb;:alpha:&rsqb;/
1787 Alphabetic characters.
1788 <tag/&lsqb;:blank:&rsqb;/
1789 Space or tab characters.
1790 <tag/&lsqb;:cntrl:&rsqb;/
1791 Control characters.
1792 <tag/&lsqb;:digit:&rsqb;/
1793 Numeric characters.
1794 <tag/&lsqb;:graph:&rsqb;/
1795 Characters that are both printable and visible.  (A space is printable,
1796 but not visible, while an ``a'' is both.)
1797 <tag/&lsqb;:lower:&rsqb;/
1798 Lower-case alphabetic characters.
1799 <tag/&lsqb;:print:&rsqb;/
1800 Printable characters (characters that are not control characters.)
1801 <tag/&lsqb;:punct:&rsqb;/
1802 Punctuation characters (characters that are not letter, digits, control
1803 characters, or space characters).
1804 <tag/&lsqb;:space:&rsqb;/
1805 Space characters (such as space, tab and formfeed, to name a few).
1806 <tag/&lsqb;:upper:&rsqb;/
1807 Upper-case alphabetic characters.
1808 <tag/&lsqb;:xdigit:&rsqb;/
1809 Characters that are hexadecimal digits.
1810 </descrip>
1811
1812 A character class is only valid in a regular expression inside the
1813 brackets of a character list.  Note that the brackets in these
1814 class names are part of the symbolic names, and must be included
1815 in addition to the brackets delimiting the bracket list.  For
1816 example, <bf/&lsqb;&lsqb;:digit:&rsqb;&rsqb;/ is equivalent to
1817 <bf/&lsqb;0-9&rsqb;/.
1818
1819 Two additional special sequences can appear in character lists.  These
1820 apply to non-ASCII character sets, which can have single symbols (called
1821 collating elements) that are represented with more than one character,
1822 as well as several characters that are equivalent for collating or
1823 sorting purposes:
1824
1825 <descrip>
1826 <tag/Collating Symbols/
1827 A collating symbol is a multi-character collating element enclosed in
1828 ``&lsqb;.'' and ``.&rsqb;''.  For example, if ``ch'' is a collating
1829 element, then <bf/&lsqb;&lsqb;.ch.&rsqb;&rsqb;/ is a regexp that matches
1830 this collating element, while <bf/&lsqb;ch&rsqb;/ is a regexp that
1831 matches either ``c'' or ``h''.
1832 <tag/Equivalence Classes/
1833 An equivalence class is a locale-specific name for a list of
1834 characters that are equivalent. The name is enclosed in ``&lsqb;=''
1835 and ``=&rsqb;''.  For example, the name ``e'' might be used to
1836 represent all of ``&egrave;'' ``&eacute;'' and ``e''.  In this case,
1837 <bf/&lsqb;&lsqb;=e=&rsqb;&rsqb;/ is a regexp that matches any of
1838 ``&egrave;'', ``&eacute;'' and ``e''.
1839 </descrip>
1840
1841 A regular expression matching a single character may be followed by one
1842 of several repetition operators:
1843
1844 <descrip>
1845 <tag/?/
1846 The preceding item is optional and matched at most once.
1847 <tag/*/
1848 The preceding item will be matched zero or more times.
1849 <tag/+/
1850 The preceding item will be matched one or more times.
1851 <tag/&lcub;n&rcub;/
1852 The preceding item is matched exactly <em/n/ times.
1853 <tag/&lcub;n,&rcub;/
1854 The preceding item is matched <em/n/ or more times.
1855 <tag/&lcub;,m&rcub;/
1856 The preceding item is matched at most <em/m/ times.
1857 <tag/&lcub;n,m&rcub;/
1858 The preceding item is matched at least <em/n/ times, but no more than
1859 <em/m/ times.
1860 </descrip>
1861
1862 Two regular expressions may be concatenated; the resulting regular
1863 expression matches any string formed by concatenating two substrings
1864 that respectively match the concatenated subexpressions.
1865
1866 Two regular expressions may be joined by the infix operator ``|'';
1867 the resulting regular expression matches any string matching either
1868 subexpression.
1869
1870 Repetition takes precedence over concatenation, which in turn takes
1871 precedence over alternation.  A whole subexpression may be enclosed in
1872 parentheses to override these precedence rules.
1873
1874 <bf/Note:/ If you compile Mutt with the GNU <em/rx/ package, the
1875 following operators may also be used in regular expressions:
1876
1877 <descrip>
1878 <tag/&bsol;&bsol;y/
1879 Matches the empty string at either the beginning or the end of a word.
1880 <tag/&bsol;&bsol;B/
1881 Matches the empty string within a word.
1882 <tag/&bsol;&bsol;&lt;/
1883 Matches the empty string at the beginning of a word.
1884 <tag/&bsol;&bsol;&gt;/
1885 Matches the empty string at the end of a word.
1886 <tag/&bsol;&bsol;w/
1887 Matches any word-constituent character (letter, digit, or underscore).
1888 <tag/&bsol;&bsol;W/
1889 Matches any character that is not word-constituent.
1890 <tag/&bsol;&bsol;`/
1891 Matches the empty string at the beginning of a buffer (string).
1892 <tag/&bsol;&bsol;'/
1893 Matches the empty string at the end of a buffer.
1894 </descrip>
1895
1896 Please note however that these operators are not defined by POSIX, so
1897 they may or may not be available in stock libraries on various systems.
1898
1899 <sect1>Patterns<label id="patterns">
1900 <p>
1901 Many of Mutt's commands allow you to specify a pattern to match
1902 (limit, tag-pattern, delete-pattern, etc.).  There are several ways to select
1903 messages:
1904
1905 <tscreen><verb>
1906 ~A              all messages
1907 ~b EXPR         messages which contain EXPR in the message body
1908 ~B EXPR         messages which contain EXPR in the whole message
1909 ~c USER         messages carbon-copied to USER
1910 ~C EXPR         message is either to: or cc: EXPR
1911 ~D              deleted messages
1912 ~d [MIN]-[MAX]  messages with ``date-sent'' in a Date range
1913 ~E              expired messages
1914 ~e EXPR         message which contains EXPR in the ``Sender'' field
1915 ~F              flagged messages
1916 ~f USER         messages originating from USER
1917 ~g              cryptographically signed messages
1918 ~G              cryptographically encrypted messages
1919 ~H EXPR         messages with a spam attribute matching EXPR
1920 ~h EXPR         messages which contain EXPR in the message header
1921 ~k              message contains PGP key material
1922 ~i ID           message which match ID in the ``Message-ID'' field
1923 ~L EXPR         message is either originated or received by EXPR
1924 ~l              message is addressed to a known mailing list
1925 ~m [MIN]-[MAX]  message in the range MIN to MAX *)
1926 ~n [MIN]-[MAX]  messages with a score in the range MIN to MAX *)
1927 ~N              new messages
1928 ~O              old messages
1929 ~p              message is addressed to you (consults alternates)
1930 ~P              message is from you (consults alternates)
1931 ~Q              messages which have been replied to
1932 ~R              read messages
1933 ~r [MIN]-[MAX]  messages with ``date-received'' in a Date range
1934 ~S              superseded messages
1935 ~s SUBJECT      messages having SUBJECT in the ``Subject'' field.
1936 ~T              tagged messages
1937 ~t USER         messages addressed to USER
1938 ~U              unread messages
1939 ~v              message is part of a collapsed thread.
1940 ~V              cryptographically verified messages
1941 ~x EXPR         messages which contain EXPR in the `References' field
1942 ~y EXPR         messages which contain EXPR in the `X-Label' field
1943 ~z [MIN]-[MAX]  messages with a size in the range MIN to MAX *)
1944 ~=              duplicated messages (see $duplicate_threads)
1945 ~$              unreferenced messages (requires threaded view)
1946 ~*              ``From'' contains realname and (syntactically) valid
1947                 address (excluded are addresses matching against
1948                 alternates or any alias)
1949 </verb></tscreen>
1950
1951 Where EXPR, USER, ID, and SUBJECT are 
1952 <ref id="regexp" name="regular expressions">.  Special attention has to be
1953 made when using regular expressions inside of patterns.  Specifically,
1954 Mutt's parser for these patterns will strip one level of backslash (\),
1955 which is normally used for quoting.  If it is your intention to use a
1956 backslash in the regular expression, you will need to use two backslashes
1957 instead (\\).
1958
1959 *) The forms <tt/&lt;&lsqb;MAX&rsqb;/, <tt/&gt;&lsqb;MIN&rsqb;/,
1960 <tt/&lsqb;MIN&rsqb;-/ and <tt/-&lsqb;MAX&rsqb;/
1961 are allowed, too.
1962
1963 <sect2>Pattern Modifier
1964 <p>
1965
1966 Note that patterns matching 'lists' of addresses (notably c,C,p,P and t)
1967 match if there is at least one match in the whole list. If you want to
1968 make sure that all elements of that list match, you need to prefix your
1969 pattern with ^.
1970 This example matches all mails which only has recipients from Germany.
1971
1972 <tscreen><verb>
1973 ^~C \.de$
1974 </verb></tscreen>
1975
1976 <sect2>Complex Patterns
1977 <p>
1978
1979 Logical AND is performed by specifying more than one criterion.  For
1980 example:
1981
1982 <tscreen><verb>
1983 ~t mutt ~f elkins
1984 </verb></tscreen>
1985
1986 would select messages which contain the word ``mutt'' in the list of
1987 recipients <bf/and/ that have the word ``elkins'' in the ``From'' header
1988 field.
1989
1990 Mutt also recognizes the following operators to create more complex search
1991 patterns:
1992
1993 <itemize>
1994 <item>! -- logical NOT operator
1995 <item>| -- logical OR operator
1996 <item>() -- logical grouping operator
1997 </itemize>
1998
1999 Here is an example illustrating a complex search pattern.  This pattern will
2000 select all messages which do not contain ``mutt'' in the ``To'' or ``Cc''
2001 field and which are from ``elkins''.
2002
2003 <tscreen><verb>
2004 !(~t mutt|~c mutt) ~f elkins
2005 </verb></tscreen>
2006
2007 Here is an example using white space in the regular expression (note
2008 the ' and &dquot; delimiters).  For this to match, the mail's subject must
2009 match the ``^Junk +From +Me$'' and it must be from either ``Jim +Somebody''
2010 or ``Ed +SomeoneElse'':
2011
2012 <tscreen><verb>
2013  '~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")'
2014 </verb></tscreen>
2015
2016 Note that if a regular expression contains parenthesis, or a veritical bar
2017 ("|"), you <bf/must/ enclose the expression in double or single quotes since
2018 those characters are also used to separate different parts of Mutt's
2019 pattern language.  For example,
2020
2021 <tscreen><verb>
2022 ~f "me@(mutt\.org|cs\.hmc\.edu)"
2023 </verb></tscreen>
2024
2025 Without the quotes, the parenthesis wouldn't end.
2026 This would be seperated to two OR'd patterns: <em/&tilde;f me@(mutt\.org/
2027 and <em/cs\.hmc\.edu)/. They are never what you want.
2028
2029 <sect2>Searching by Date
2030 <p>
2031 Mutt supports two types of dates, <em/absolute/ and <em/relative/.
2032
2033 <bf/Absolute/.  Dates <bf/must/ be in DD/MM/YY format (month and year are
2034 optional, defaulting to the current month and year).  An example of a valid
2035 range of dates is:
2036
2037 <tscreen><verb>
2038 Limit to messages matching: ~d 20/1/95-31/10
2039 </verb></tscreen>
2040
2041 If you omit the minimum (first) date, and just specify ``-DD/MM/YY'', all
2042 messages <em/before/ the given date will be selected.  If you omit the maximum
2043 (second) date, and specify ``DD/MM/YY-'', all messages <em/after/ the given
2044 date will be selected.  If you specify a single date with no dash (``-''),
2045 only messages sent on the given date will be selected. 
2046
2047 <bf/Error Margins/.  You can add error margins to absolute dates.
2048 An error margin is a sign (+ or -), followed by a digit, followed by
2049 one of the following units:
2050 <verb>
2051 y       years
2052 m       months
2053 w       weeks
2054 d       days
2055 </verb>
2056 As a special case, you can replace the sign by a ``*'' character,
2057 which is equivalent to giving identical plus and minus error margins.
2058
2059 Example: To select any messages two weeks around January 15, 2001,
2060 you'd use the following pattern: 
2061 <tscreen><verb> 
2062 Limit to messages matching: ~d 15/1/2001*2w
2063 </verb></tscreen>
2064
2065
2066 <bf/Relative/.  This type of date is relative to the current date, and may
2067 be specified as:
2068 <itemize>
2069 <item>&gt;<em/offset/ (messages older than <em/offset/ units)
2070 <item>&lt;<em/offset/ (messages newer than <em/offset/ units)
2071 <item>=<em/offset/ (messages exactly <em/offset/ units old)
2072 </itemize>
2073
2074 <em/offset/ is specified as a positive number with one of the following
2075 units:
2076 <verb>
2077 y       years
2078 m       months
2079 w       weeks
2080 d       days
2081 </verb>
2082
2083 Example: to select messages less than 1 month old, you would use
2084 <tscreen><verb>
2085 Limit to messages matching: ~d <1m
2086 </verb></tscreen>
2087
2088
2089
2090 <bf/Note:/ all dates used when searching are relative to the
2091 <bf/local/ time zone, so unless you change the setting of your <ref
2092 id="index_format" name="&dollar;index&lowbar;format"> to include a
2093 <tt/&percnt;&lsqb;...&rsqb;/ format, these are <bf/not/ the dates shown
2094 in the main index.
2095
2096 <sect1>Using Tags
2097 <p>
2098
2099 Sometimes it is desirable to perform an operation on a group of
2100 messages all at once rather than one at a time.  An example might be
2101 to save messages to a mailing list to a separate folder, or to
2102 delete all messages with a given subject.  To tag all messages
2103 matching a pattern, use the tag-pattern function, which is bound to
2104 ``shift-T'' by default.  Or you can select individual messages by
2105 hand using the ``tag-message'' function, which is bound to ``t'' by
2106 default.  See <ref id="patterns" name="patterns"> for Mutt's pattern
2107 matching syntax.
2108
2109 Once you have tagged the desired messages, you can use the
2110 ``tag-prefix'' operator, which is the ``;'' (semicolon) key by default.
2111 When the ``tag-prefix'' operator is used, the <bf/next/ operation will
2112 be applied to all tagged messages if that operation can be used in that
2113 manner.  If the <ref id="auto_tag" name="&dollar;auto&lowbar;tag">
2114 variable is set, the next operation applies to the tagged messages
2115 automatically, without requiring the ``tag-prefix''.
2116
2117 In <ref id="macro" name="macros"> or <ref id="push" name="push"> commands,
2118 you can use the ``tag-prefix-cond'' operator.  If there are no tagged
2119 messages, mutt will "eat" the rest of the macro to abort it's execution.
2120 Mutt will stop "eating" the macro when it encounters the ``end-cond''
2121 operator;  after this operator the rest of the macro will be executed as
2122 normal.
2123
2124 <sect1>Using Hooks<label id="hooks">
2125 <p>
2126 A <em/hook/ is a concept borrowed from the EMACS editor which allows you to
2127 execute arbitrary commands before performing some operation.  For example,
2128 you may wish to tailor your configuration based upon which mailbox you are
2129 reading, or to whom you are sending mail.  In the Mutt world, a <em/hook/
2130 consists of a <ref id="regexp" name="regular expression"> or
2131 <ref id="patterns" name="pattern"> along with a
2132 configuration option/command.  See
2133 <itemize>
2134 <item><ref id="folder-hook" name="folder-hook">
2135 <item><ref id="send-hook" name="send-hook">
2136 <item><ref id="message-hook" name="message-hook">
2137 <item><ref id="save-hook" name="save-hook">
2138 <item><ref id="mbox-hook" name="mbox-hook">
2139 <item><ref id="fcc-hook" name="fcc-hook">
2140 <item><ref id="fcc-save-hook" name="fcc-save-hook">
2141 </itemize>
2142 for specific details on each type of <em/hook/ available.
2143
2144 <bf/Note:/ if a hook changes configuration settings, these changes remain
2145 effective until the end of the current mutt session. As this is generally
2146 not desired, a default hook needs to be added before all other hooks to
2147 restore configuration defaults. Here is an example with send-hook and the
2148 my_hdr directive:
2149
2150 <tscreen><verb>
2151 send-hook . 'unmy_hdr From:'
2152 send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
2153 </verb></tscreen>
2154
2155 <sect2>Message Matching in Hooks<label id="pattern_hook">
2156 <p>
2157 Hooks that act upon messages (<tt/send-hook, save-hook, fcc-hook,
2158 message-hook/) are evaluated in a slightly different manner.  For the other
2159 types of hooks, a <ref id="regexp" name="regular expression"> is
2160 sufficient.  But in dealing with messages a finer grain of control is
2161 needed for matching since for different purposes you want to match
2162 different criteria.
2163
2164 Mutt allows the use of the <ref id="patterns" name="search pattern">
2165 language for matching messages in hook commands.  This works in
2166 exactly the same way as it would when <em/limiting/ or
2167 <em/searching/ the mailbox, except that you are restricted to those
2168 operators which match information mutt extracts from the header of
2169 the message (i.e.  from, to, cc, date, subject, etc.).
2170
2171 For example, if you wanted to set your return address based upon sending
2172 mail to a specific address, you could do something like:
2173 <tscreen><verb>
2174 send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt User <user@host>'
2175 </verb></tscreen>
2176 which would execute the given command when sending mail to
2177 <em/me@cs.hmc.edu/.
2178
2179 However, it is not required that you write the pattern to match using the
2180 full searching language.  You can still specify a simple <em/regular
2181 expression/ like the other hooks, in which case Mutt will translate your
2182 pattern into the full language, using the translation specified by the 
2183 <ref id="default_hook" name="&dollar;default&lowbar;hook"> variable.  The
2184 pattern is translated at the time the hook is declared, so the value of 
2185 <ref id="default_hook" name="&dollar;default&lowbar;hook"> that is in effect
2186 at that time will be used.
2187
2188 <sect1>Using the sidebar<label id="sidebar">
2189 <p>
2190 The sidebar, a feature specific to Mutt-ng, allows you to use a mailbox listing 
2191 which looks very similar to the ones you probably know from GUI mail clients.
2192 The sidebar lists all specified mailboxes, shows the number in each
2193 and highlights the ones with new email
2194 Use the following configuration commands:
2195 <tscreen><verb>
2196 set sidebar_visible="yes"
2197 set sidebar_width=25
2198 </verb></tscreen>
2199
2200 If you want to specify the mailboxes you can do so with:
2201 <tscreen><verb>
2202 set mbox='=INBOX'
2203 mailboxes INBOX \
2204           MBOX1 \
2205           MBOX2 \
2206           ...
2207 </verb></tscreen>
2208
2209 You can also specify the colors for mailboxes with new mails by using:
2210 <tscreen><verb>
2211 color sidebar_new red black
2212 color sidebar white black
2213 </verb></tscreen>
2214
2215 The available functions are:
2216 <tscreen><verb>
2217 sidebar-scroll-up      Scrolls the mailbox list up 1 page
2218 sidebar-scroll-down    Scrolls the mailbox list down 1 page
2219 sidebar-next           Hilights the next mailbox
2220 sidebar-next-new       Hilights the next mailbox with new mail
2221 sidebar-previous       Hilights the previous mailbox
2222 sidebar-open           Opens the currently hilighted mailbox
2223 </verb></tscreen>
2224
2225 Reasonable key bindings look e.g. like this:
2226 <tscreen><verb>
2227 bind index \Cp sidebar-prev
2228 bind index \Cn sidebar-next
2229 bind index \Cb sidebar-open
2230 bind pager \Cp sidebar-prev
2231 bind pager \Cn sidebar-next
2232 bind pager \Cb sidebar-open
2233
2234 macro index B ':toggle sidebar_visible^M'
2235 macro pager B ':toggle sidebar_visible^M'
2236 </verb></tscreen>
2237
2238 You can then go up and down by pressing Ctrl-P and Ctrl-N, and 
2239 switch on and off the sidebar simply by pressing 'B'.
2240
2241 <sect1>External Address Queries<label id="query">
2242 <p>
2243 Mutt supports connecting to external directory databases such as LDAP,
2244 ph/qi, bbdb, or NIS through a wrapper script which connects to mutt
2245 using a simple interface.  Using the <ref id="query_command"
2246 name="&dollar;query&lowbar;command"> variable, you specify the wrapper
2247 command to use.  For example:
2248
2249 <tscreen><verb>
2250 set query_command = "mutt_ldap_query.pl '%s'"
2251 </verb></tscreen>
2252
2253 The wrapper script should accept the query on the command-line.  It
2254 should return a one line message, then each matching response on a
2255 single line, each line containing a tab separated address then name then
2256 some other optional information.  On error, or if there are no matching
2257 addresses, return a non-zero exit code and a one line error message.
2258
2259 An example multiple response output:
2260 <tscreen><verb>
2261 Searching database ... 20 entries ... 3 matching:
2262 me@cs.hmc.edu           Michael Elkins  mutt dude
2263 blong@fiction.net       Brandon Long    mutt and more
2264 roessler@guug.de        Thomas Roessler mutt pgp
2265 </verb></tscreen>
2266
2267 There are two mechanisms for accessing the query function of mutt.  One
2268 is to do a query from the index menu using the query function (default: Q).
2269 This will prompt for a query, then bring up the query menu which will
2270 list the matching responses.  From the query menu, you can select
2271 addresses to create aliases, or to mail.  You can tag multiple addresses
2272 to mail, start a new query, or have a new query appended to the current
2273 responses.
2274
2275 The other mechanism for accessing the query function is for address
2276 completion, similar to the alias completion.  In any prompt for address
2277 entry, you can use the complete-query function (default: ^T) to run a
2278 query based on the current address you have typed.  Like aliases, mutt
2279 will look for what you have typed back to the last space or comma.  If
2280 there is a single response for that query, mutt will expand the address
2281 in place.  If there are multiple responses, mutt will activate the query
2282 menu.  At the query menu, you can select one or more addresses to be
2283 added to the prompt.
2284
2285 <sect1>Mailbox Formats
2286 <p>
2287 Mutt supports reading and writing of four different mailbox formats:
2288 mbox, MMDF, MH and Maildir.  The mailbox type is autodetected, so there
2289 is no need to use a flag for different mailbox types.  When creating new
2290 mailboxes, Mutt uses the default specified with the <ref id="mbox_type"
2291 name="&dollar;mbox&lowbar;type"> variable.
2292
2293 <bf/mbox/.  This is the most widely used mailbox format for UNIX.  All
2294 messages are stored in a single file.  Each message has a line of the form:
2295
2296 <tscreen><verb>
2297 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
2298 </verb></tscreen>
2299
2300 to denote the start of a new message (this is often referred to as the
2301 ``From&lowbar;'' line).
2302
2303 <bf/MMDF/.  This is a variant of the <em/mbox/ format.  Each message is
2304 surrounded by lines containing ``^A^A^A^A'' (four control-A's).
2305
2306 <bf/MH/. A radical departure from <em/mbox/ and <em/MMDF/, a mailbox
2307 consists of a directory and each message is stored in a separate file.
2308 The filename indicates the message number (however, this is may not
2309 correspond to the message number Mutt displays). Deleted messages are
2310 renamed with a comma (,) prepended to the filename. <bf/Note:/ Mutt
2311 detects this type of mailbox by looking for either <tt/.mh&lowbar;sequences/
2312 or <tt/.xmhcache/ (needed to distinguish normal directories from MH
2313 mailboxes).
2314
2315 <bf/Maildir/.  The newest of the mailbox formats, used by the Qmail MTA (a
2316 replacement for sendmail).  Similar to <em/MH/, except that it adds three
2317 subdirectories of the mailbox: <em/tmp/, <em/new/ and <em/cur/.  Filenames
2318 for the messages are chosen in such a way they are unique, even when two
2319 programs are writing the mailbox over NFS, which means that no file locking
2320 is needed.
2321
2322 <sect1>Mailbox Shortcuts<label id="shortcuts">
2323 <p>
2324 There are a number of built in shortcuts which refer to specific mailboxes.
2325 These shortcuts can be used anywhere you are prompted for a file or mailbox
2326 path.
2327
2328 <itemize>
2329 <item>! -- refers to your <ref id="spoolfile" name="&dollar;spoolfile"> (incoming) mailbox
2330 <item>&gt; -- refers to your <ref id="mbox" name="&dollar;mbox"> file
2331 <item>&lt; -- refers to your <ref id="record" name="&dollar;record"> file
2332 <item>- or !! -- refers to the file you've last visited
2333 <item>&tilde; -- refers to your home directory
2334 <item>= or + -- refers to your <ref id="folder" name="&dollar;folder"> directory
2335 <item>@<em/alias/ -- refers to the <ref id="save-hook" 
2336 name="default save folder"> as determined by the address of the alias
2337 </itemize>
2338
2339 <sect1>Handling Mailing Lists<label id="using_lists">
2340 <p>
2341
2342 Mutt has a few configuration options that make dealing with large
2343 amounts of mail easier.  The first thing you must do is to let Mutt
2344 know what addresses you consider to be mailing lists (technically
2345 this does not have to be a mailing list, but that is what it is most
2346 often used for), and what lists you are subscribed to.  This is
2347 accomplished through the use of the <ref id="lists"
2348 name="lists and subscribe"> commands in your muttrc.
2349
2350 Now that Mutt knows what your mailing lists are, it can do several
2351 things, the first of which is the ability to show the name of a list
2352 through which you received a message (i.e., of a subscribed list) in
2353 the <em/index/ menu display.  This is useful to distinguish between
2354 personal and list mail in the same mailbox.  In the <ref id="index_format"
2355 name="&dollar;index&lowbar;format"> variable, the escape ``&percnt;L''
2356 will return the string ``To &lt;list&gt;'' when ``list'' appears in the
2357 ``To'' field, and ``Cc &lt;list&gt;'' when it appears in the ``Cc''
2358 field (otherwise it returns the name of the author).
2359
2360 Often times the ``To'' and ``Cc'' fields in mailing list messages
2361 tend to get quite large. Most people do not bother to remove the
2362 author of the message they are reply to from the list, resulting in
2363 two or more copies being sent to that person.  The ``list-reply''
2364 function, which by default is bound to ``L'' in the <em/index/ menu
2365 and <em/pager/, helps reduce the clutter by only replying to the
2366 known mailing list addresses instead of all recipients (except as
2367 specified by <tt/Mail-Followup-To/, see below).
2368
2369 Mutt also supports the <tt/Mail-Followup-To/ header.  When you send
2370 a message to a list of recipients which includes one or several
2371 subscribed mailing lists, and if the <ref id="followup_to"
2372 name="&dollar;followup&lowbar;to"> option is set, mutt will generate
2373 a Mail-Followup-To header which contains all the recipients to whom
2374 you send this message, but not your address. This indicates that
2375 group-replies or list-replies (also known as ``followups'') to this
2376 message should only be sent to the original recipients of the
2377 message, and not separately to you - you'll receive your copy through
2378 one of the mailing lists you are subscribed to.
2379
2380 Conversely, when group-replying or list-replying to a message which
2381 has a <tt/Mail-Followup-To/ header, mutt will respect this header if
2382 the <ref id="honor_followup_to"
2383 name="&dollar;honor&lowbar;followup&lowbar;to"> configuration
2384 variable is set.  Using list-reply will in this case also make sure
2385 that the reply goes to the mailing list, even if it's not specified
2386 in the list of recipients in the <tt/Mail-Followup-To/.
2387
2388 Note that, when header editing is enabled, you can create a
2389 <tt/Mail-Followup-To/ header manually.  Mutt will only auto-generate
2390 this header if it doesn't exist when you send the message.
2391
2392
2393 The other method some mailing list admins use is to generate a
2394 ``Reply-To'' field which points back to the mailing list address rather
2395 than the author of the message.  This can create problems when trying
2396 to reply directly to the author in private, since most mail clients
2397 will automatically reply to the address given in the ``Reply-To''
2398 field.  Mutt uses the <ref id="reply_to" name="&dollar;reply&lowbar;to">
2399 variable to help decide which address to use.  If set to <em/ask-yes/ or
2400 <em/ask-no/, you will be
2401 prompted as to whether or not you would like to use the address given in
2402 the ``Reply-To'' field, or reply directly to the address given in the
2403 ``From'' field.  When set to <em/yes/, the ``Reply-To'' field will be used when
2404 present.
2405
2406 The ``X-Label:'' header field can be used to further identify mailing
2407 lists or list subject matter (or just to annotate messages
2408 individually).  The <ref id="index_format"
2409 name="&dollar;index&lowbar;format"> variable's ``&percnt;y'' and
2410 ``&percnt;Y'' escapes can be used to expand ``X-Label:'' fields in the
2411 index, and Mutt's pattern-matcher can match regular expressions to
2412 ``X-Label:'' fields with the ``~y'' selector.  ``X-Label:'' is not a
2413 standard message header field, but it can easily be inserted by procmail
2414 and other mail filtering agents.
2415
2416 Lastly, Mutt has the ability to <ref id="sort" name="sort"> the mailbox into
2417 <ref id="threads" name="threads">.  A thread is a group of messages which all relate to the same
2418 subject.  This is usually organized into a tree-like structure where a
2419 message and all of its replies are represented graphically.  If you've ever
2420 used a threaded news client, this is the same concept.  It makes dealing
2421 with large volume mailing lists easier because you can easily delete
2422 uninteresting threads and quickly find topics of value.
2423
2424 <sect1>Editing threads
2425 <p>
2426 Mutt has the ability to dynamically restructure threads that are broken
2427 either by misconfigured software or bad behaviour from some
2428 correspondents. This allows to clean your mailboxes formats) from these
2429 annoyances which make it hard to follow a discussion.
2430
2431 <sect2>Linking threads
2432 <p>
2433
2434 Some mailers tend to "forget" to correctly set the "In-Reply-To:" and
2435 "References:" headers when replying to a message. This results in broken
2436 discussions because Mutt has not enough information to guess the correct
2437 threading.
2438 You can fix this by tagging the reply, then moving to the parent message
2439 and using the ``link-threads'' function (bound to & by default). The
2440 reply will then be connected to this "parent" message.
2441
2442 You can also connect multiple childs at once, tagging them and using the
2443 tag-prefix command (';') or the auto_tag option.
2444
2445 <sect2>Breaking threads
2446 <p>
2447
2448 On mailing lists, some people are in the bad habit of starting a new
2449 discussion by hitting "reply" to any message from the list and changing
2450 the subject to a totally unrelated one.
2451 You can fix such threads by using the ``break-thread'' function (bound
2452 by default to #), which will turn the subthread starting from the
2453 current message into a whole different thread.
2454
2455 <sect1>Delivery Status Notification (DSN) Support
2456 <p>
2457
2458 RFC1894 defines a set of MIME content types for relaying information
2459 about the status of electronic mail messages.  These can be thought of as
2460 ``return receipts.'' Berkeley sendmail 8.8.x currently has some command
2461 line options in which the mail client can make requests as to what type
2462 of status messages should be returned.
2463
2464 To support this, there are two variables. <ref id="dsn_notify"
2465 name="&dollar;dsn&lowbar;notify"> is used to request receipts for
2466 different results (such as failed message, message delivered, etc.).
2467 <ref id="dsn_return" name="&dollar;dsn&lowbar;return"> requests how much
2468 of your message should be returned with the receipt (headers or full
2469 message).  Refer to the man page on sendmail for more details on DSN.
2470
2471 <sect1>POP3 Support (OPTIONAL)
2472 <p>
2473
2474 If Mutt was compiled with POP3 support (by running the <em/configure/
2475 script with the <em/--enable-pop/ flag), it has the ability to work
2476 with mailboxes located on a remote POP3 server and fetch mail for local
2477 browsing.
2478
2479 You can access the remote POP3 mailbox by selecting the folder
2480 <tt>pop://popserver/</tt>.
2481
2482 You can select an alternative port by specifying it with the server, ie:
2483 <tt>pop://popserver:port/</tt>.
2484
2485 You can also specify different username for each folder, ie:
2486 <tt>pop://username@popserver[:port]/</tt>.
2487
2488 Polling for new mail is more expensive over POP3 than locally. For this
2489 reason the frequency at which Mutt will check for mail remotely can be
2490 controlled by the
2491 <ref id="pop_checkinterval" name="&dollar;pop&lowbar;checkinterval">
2492 variable, which defaults to every 60 seconds.
2493
2494 If Mutt was compiled with SSL support (by running the <em/configure/
2495 script with the <em/--with-ssl/ flag), connections to POP3 servers
2496 can be encrypted. This naturally requires that the server supports
2497 SSL encrypted connections. To access a folder with POP3/SSL, you should
2498 use pops: prefix, ie:
2499 <tt>pops://[username@]popserver[:port]/</tt>.
2500
2501 Another way to access your POP3 mail is the <em/fetch-mail/ function
2502 (default: G).  It allows to connect to <ref id="pop_host"
2503 name="pop&lowbar;host">, fetch all your new mail and place it in the
2504 local <ref id="spoolfile" name="spoolfile">.  After this
2505 point, Mutt runs exactly as if the mail had always been local.
2506
2507 <bf/Note:/ If you only need to fetch all messages to local mailbox
2508 you should consider using a specialized program, such as <htmlurl
2509 url="http://www.ccil.org/~esr/fetchmail" name="fetchmail">
2510
2511 <sect1>IMAP Support (OPTIONAL)
2512 <p>
2513
2514 If Mutt was compiled with IMAP support (by running the <em/configure/
2515 script with the <em/--enable-imap/ flag), it has the ability to work
2516 with folders located on a remote IMAP server.
2517
2518 You can access the remote inbox by selecting the folder
2519 <tt>imap://imapserver/INBOX</tt>, where <tt/imapserver/ is the name of the
2520 IMAP server and <tt/INBOX/ is the special name for your spool mailbox on
2521 the IMAP server. If you want to access another mail folder at the IMAP
2522 server, you should use <tt>imap://imapserver/path/to/folder</tt> where
2523 <tt>path/to/folder</tt> is the path of the folder you want to access.
2524
2525 You can select an alternative port by specifying it with the server, ie:
2526 <tt>imap://imapserver:port/INBOX</tt>.
2527
2528 You can also specify different username for each folder, ie:
2529 <tt>imap://username@imapserver[:port]/INBOX</tt>.
2530
2531 If Mutt was compiled with SSL support (by running the <em/configure/
2532 script with the <em/--with-ssl/ flag), connections to IMAP servers
2533 can be encrypted. This naturally requires that the server supports
2534 SSL encrypted connections. To access a folder with IMAP/SSL, you should
2535 use <tt>imaps://[username@]imapserver[:port]/path/to/folder</tt> as your 
2536 folder path.
2537
2538 Pine-compatible notation is also supported, ie
2539 <tt>{[username@]imapserver[:port][/ssl]}path/to/folder</tt>
2540
2541 Note that not all servers use / as the hierarchy separator.  Mutt should
2542 correctly notice which separator is being used by the server and convert
2543 paths accordingly.
2544
2545 When browsing folders on an IMAP server, you can toggle whether to look
2546 at only the folders you are subscribed to, or all folders with the
2547 <em/toggle-subscribed/ command.  See also the 
2548 <ref id="imap_list_subscribed"
2549 name="&dollar;imap&lowbar;list&lowbar;subscribed"> variable.
2550
2551 Polling for new mail on an IMAP server can cause noticeable delays. So, you'll
2552 want to carefully tune the
2553 <ref id="imap_mail_check" name="&dollar;imap&lowbar;mail&lowbar;check">
2554 and
2555 <ref id="timeout" name="&dollar;timeout">
2556 variables.
2557
2558 Note that if you are using mbox as the mail store on UW servers prior to
2559 v12.250, the server has been reported to disconnect a client if another client
2560 selects the same folder.
2561
2562 <sect2>The Folder Browser
2563 <p>
2564
2565 As of version 1.2, mutt supports browsing mailboxes on an IMAP
2566 server. This is mostly the same as the local file browser, with the
2567 following differences:
2568 <itemize>
2569 <item>Instead of file permissions, mutt displays the string "IMAP",
2570   possibly followed by the symbol "+", indicating
2571   that the entry contains both messages and subfolders. On
2572   Cyrus-like servers folders will often contain both messages and
2573   subfolders. 
2574 <item>For the case where an entry can contain both messages and
2575   subfolders, the selection key (bound to <tt>enter</tt> by default)
2576   will choose to descend into the subfolder view. If you wish to view
2577   the messages in that folder, you must use <tt>view-file</tt> instead
2578   (bound to <tt>space</tt> by default).
2579 <item>You can create, delete and rename mailboxes with the
2580   <tt>create-mailbox</tt>, <tt>delete-mailbox</tt>, and
2581   <tt>rename-mailbox</tt> commands (default bindings: <tt>C</tt>,
2582   <tt>d</tt> and <tt>r</tt>, respectively). You may also
2583   <tt>subscribe</tt> and <tt>unsubscribe</tt> to mailboxes (normally
2584   these are bound to <tt>s</tt> and <tt>u</tt>, respectively).
2585 </itemize>
2586
2587 <sect2>Authentication
2588 <p>
2589
2590 Mutt supports four authentication methods with IMAP servers: SASL,
2591 GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
2592 NTLM authentication for you poor exchange users out there, but it has
2593 yet to be integrated into the main tree). There is also support for
2594 the pseudo-protocol ANONYMOUS, which allows you to log in to a public
2595 IMAP server without having an account. To use ANONYMOUS, simply make
2596 your username blank or "anonymous".
2597 <p>
2598 SASL is a special super-authenticator, which selects among several protocols
2599 (including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most secure
2600 method available on your host and the server. Using some of these methods
2601 (including DIGEST-MD5 and possibly GSSAPI), your entire session will be
2602 encrypted and invisible to those teeming network snoops. It is the best
2603 option if you have it. To use it, you must have the Cyrus SASL library
2604 installed on your system and compile mutt with the <em/--with-sasl/ flag.
2605 <p>
2606 Mutt will try whichever methods are compiled in and available on the server,
2607 in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.
2608
2609 There are a few variables which control authentication: 
2610 <itemize>
2611 <item><ref id="imap_user" name="&dollar;imap&lowbar;user"> - controls
2612   the username under which you request authentication on the IMAP server,
2613   for all authenticators. This is overridden by an explicit username in
2614   the mailbox path (ie by using a mailbox name of the form
2615   <tt/{user@host}/).
2616 <item><ref id="imap_pass" name="&dollar;imap&lowbar;pass"> - a
2617   password which you may preset, used by all authentication methods where
2618   a password is needed.
2619 <item><ref id="imap_authenticators"
2620   name="&dollar;imap&lowbar;authenticators"> - a colon-delimited list of IMAP
2621   authentication methods to try, in the order you wish to try them. If
2622   specified, this overrides mutt's default (attempt everything, in the order
2623   listed above).
2624 </itemize>
2625
2626 <sect1>Managing multiple IMAP/POP accounts (OPTIONAL)<label id="account-hook">
2627 <p>
2628
2629 If you happen to have accounts on multiple IMAP and/or POP servers,
2630 you may find managing all the authentication settings inconvenient and
2631 error-prone.  The account-hook command may help. This hook works like
2632 folder-hook but is invoked whenever you access a remote mailbox
2633 (including inside the folder browser), not just when you open the
2634 mailbox.
2635 <p>
2636 Some examples:
2637
2638 <tscreen><verb>
2639 account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
2640 account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
2641 account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'
2642 </verb></tscreen>
2643
2644 <sect1>Start a WWW Browser on URLs (EXTERNAL)<label id="urlview">
2645 <p>
2646 If a message contains URLs (<em/unified resource locator/ = address in the
2647 WWW space like <em>http://www.mutt.org/</em>), it is efficient to get
2648 a menu with all the URLs and start a WWW browser on one of them.  This
2649 functionality is provided by the external urlview program which can be
2650 retrieved at <htmlurl url="ftp://ftp.mutt.org/mutt/contrib/"
2651 name="ftp://ftp.mutt.org/mutt/contrib/"> and the configuration commands:
2652 <tscreen><verb>
2653 macro index \cb |urlview\n
2654 macro pager \cb |urlview\n
2655 </verb></tscreen>
2656
2657 <sect1>Compressed folders Support (OPTIONAL)
2658 <p>
2659
2660 If Mutt was compiled with compressed folders support (by running the
2661 <em/configure/ script with the <em/--enable-compressed/ flag), Mutt
2662 can open folders stored in an arbitrary format, provided that the user
2663 has a script to convert from/to this format to one of the accepted.
2664
2665 The most common use is to open compressed archived folders e.g. with
2666 gzip.
2667
2668 In addition, the user can provide a script that gets a folder in an
2669 accepted format and appends its context to the folder in the
2670 user-defined format, which may be faster than converting the entire
2671 folder to the accepted format, appending to it and converting back to
2672 the user-defined format.
2673
2674 There are three hooks defined (<ref id="open-hook" name="open-hook">,
2675 <ref id="close-hook" name="close-hook"> and <ref id="append-hook"
2676 name="append-hook">) which define commands to uncompress and compress
2677 a folder and to append messages to an existing compressed folder 
2678 respectively.
2679
2680 For example:
2681
2682 <tscreen><verb>
2683 open-hook \\.gz$ "gzip -cd %f > %t" 
2684 close-hook \\.gz$ "gzip -c %t > %f"
2685 append-hook \\.gz$ "gzip -c %t >> %f" 
2686 </verb></tscreen>
2687
2688 You do not have to specify all of the commands. If you omit <ref
2689 id="append-hook" name="append-hook">, the folder will be open and
2690 closed again each time you will add to it. If you omit <ref
2691 id="close-hook" name="close-hook"> (or give empty command) , the
2692 folder will be open in the  mode. If you specify <ref
2693 id="append-hook" name="append-hook"> though you'll be able to append
2694 to the folder.
2695
2696 Note that Mutt will only try to use hooks if the file is not in one of
2697 the accepted formats. In particular, if the file is empty, mutt
2698 supposes it is not compressed. This is important because it allows the
2699 use of programs that do not have well defined extensions. Just use
2700 &dquot;.&dquot; as a regexp. But this may be surprising if your
2701 compressing script produces empty files. In this situation, unset <ref
2702 id="save_empty" name="&dollar;save&lowbar;empty">, so that the compressed file
2703 will be removed if you delete all of the messages.
2704
2705 <sect2>Open a compressed mailbox for reading<label id="open-hook">
2706 <p>
2707 Usage: <tt/open-hook/ <em/regexp/ &dquot;<em/command/&dquot;
2708
2709 The <em/command/ is the command that can be used for opening the
2710 folders whose names match <em/regexp/.
2711
2712 The <em/command/ string is the printf-like format string, and it
2713 should accept two parameters: &percnt;f, which is replaced with the
2714 (compressed) folder name, and &percnt;t which is replaced with the
2715 name of the temporary folder to which to write.
2716
2717 &percnt;f and &percnt;t can be repeated any number of times in the
2718 command string, and all of the entries are replaced with the
2719 appropriate folder name. In addition, &percnt;&percnt; is replaced by
2720 &percnt;, as in printf, and any other &percnt;anything is left as is.
2721
2722 The <em/command/ should <bf/not/ remove the original compressed file.
2723 The <em/command/ should return non-zero exit status if it fails, so
2724 mutt knows something's wrong.
2725
2726 Example:
2727
2728 <tscreen><verb>
2729 open-hook \\.gz$ "gzip -cd %f > %t" 
2730 </verb></tscreen>
2731
2732 If the <em/command/ is empty, this operation is disabled for this file
2733 type.
2734
2735 <sect2>Write a compressed mailbox<label id="close-hook">
2736 <p>
2737 Usage: <tt/close-hook/ <em/regexp/ &dquot;<em/command/&dquot;
2738
2739 This is used to close the folder that was open with the <ref id="open-hook" 
2740 name="open-hook"> command after some changes were made to it.
2741
2742 The <em/command/ string is the command that can be used for closing the
2743 folders whose names match <em/regexp/. It has the same format as in 
2744 the <ref id="open-hook" name="open-hook"> command. Temporary folder
2745 in this case is the folder previously produced by the <<ref id="open-hook"
2746 name="open-hook"> command.
2747
2748 The <em/command/ should <bf/not/ remove the decompressed file. The
2749 <em/command/ should return non-zero exit status if it fails, so mutt
2750 knows something's wrong.
2751
2752 Example:
2753
2754 <tscreen><verb>
2755 close-hook \\.gz$ "gzip -c %t > %f"
2756 </verb></tscreen>
2757
2758 If the <em/command/ is empty, this operation is disabled for this file
2759 type, and the file can only be open in the readonly mode.
2760
2761 <ref id="close-hook" name ="close-hook"> is not called when you exit
2762 from the folder if the folder was not changed.
2763
2764 <sect2>Append a message to a compressed mailbox<label id="append-hook">
2765 <p>
2766 Usage: <tt/append-hook/ <em/regexp/ &dquot;<em/command/&dquot;
2767
2768 This command is used for saving to an existing compressed folder.
2769 The <em/command/ is the command that can be used for appending to the
2770 folders whose names match <em/regexp/. It has the same format as in 
2771  the <ref id="open-hook" name="open-hook"> command.
2772 The temporary folder in this case contains the messages that are being
2773 appended. 
2774
2775 The <em/command/ should <bf/not/ remove the decompressed file. The
2776 <em/command/ should return non-zero exit status if it fails, so mutt
2777 knows something's wrong.
2778
2779 Example:
2780
2781 <tscreen><verb>
2782 append-hook \\.gz$ "gzip -c %t >> %f" 
2783 </verb></tscreen>
2784
2785 When <ref id="append-hook" name="append-hook"> is used, the folder is
2786 not opened, which saves time, but this means that we can not find out
2787 what the folder type is. Thus the default (<ref id="mbox_type"
2788 name="&dollar;mbox&lowbar;type">) type is always supposed (i.e.
2789 this is the format used for the temporary folder).
2790
2791 If the file does not exist when you save to it, <ref id="close-hook"
2792 name="close-hook"> is called, and not <ref id="append-hook"
2793 name="append-hook">. <ref id="append-hook" name="append-hook"> is only
2794 for appending to existing folders.
2795
2796 If the <em/command/ is empty, this operation is disabled for this file
2797 type. In this case, the folder will be open and closed again (using
2798 <ref id="open-hook" name="open-hook"> and <ref id="close-hook" 
2799 name="close-hook">respectively) each time you will add to it.
2800
2801 <sect2>Encrypted folders
2802 <p>
2803 The compressed folders support can also be used to handle encrypted
2804 folders. If you want to encrypt a folder with PGP, you may want to use
2805 the following hooks:
2806
2807 <tscreen><verb>
2808 open-hook  \\.pgp$ "pgp -f < %f > %t"
2809 close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId < %t > %f"
2810 </verb></tscreen>
2811
2812 Please note, that PGP does not support appending to an encrypted
2813 folder, so there is no append-hook defined.
2814
2815 <bf/Note:/ the folder is temporary stored decrypted in the /tmp
2816 directory, where it can be read by your system administrator. So think
2817 about the security aspects of this.
2818
2819 <sect>Mutt's MIME Support
2820 <p>
2821 Quite a bit of effort has been made to make Mutt the premier text-mode
2822 MIME MUA.  Every effort has been made to provide the functionality that
2823 the discerning MIME user requires, and the conformance to the standards
2824 wherever possible.  When configuring Mutt for MIME, there are two extra
2825 types of configuration files which Mutt uses.  One is the
2826 <tt/mime.types/ file, which contains the mapping of file extensions to 
2827 IANA MIME types.  The other is the <tt/mailcap/ file, which specifies
2828 the external commands to use for handling specific MIME types.
2829
2830 <sect1>Using MIME in Mutt
2831 <p>
2832 There are three areas/menus in Mutt which deal with MIME, they are the
2833 pager (while viewing a message), the attachment menu and the compose
2834 menu.
2835
2836 <sect2>Viewing MIME messages in the pager
2837 <p>
2838 When you select a message from the index and view it in the pager, Mutt
2839 decodes the message to a text representation.  Mutt internally supports
2840 a number of MIME types, including <tt>text/plain, text/enriched,
2841 message/rfc822, and message/news</tt>.  In addition, the export
2842 controlled version of Mutt recognizes a variety of PGP MIME types,
2843 including PGP/MIME and application/pgp.
2844
2845 Mutt will denote attachments with a couple lines describing them.
2846 These lines are of the form:
2847 <tscreen><verb>
2848 [-- Attachment #1: Description --]
2849 [-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
2850 </verb></tscreen>
2851 Where the <tt/Description/ is the description or filename given for the
2852 attachment, and the <tt/Encoding/ is one of
2853 <tt>7bit/8bit/quoted-printable/base64/binary</tt>.
2854
2855 If Mutt cannot deal with a MIME type, it will display a message like:
2856 <tscreen><verb>
2857 [-- image/gif is unsupported (use 'v' to view this part) --]
2858 </verb></tscreen>
2859
2860 <sect2>The Attachment Menu<label id="attach_menu">
2861 <p>
2862 The default binding for <tt/view-attachments/ is `v', which displays the
2863 attachment menu for a message.  The attachment menu displays a list of
2864 the attachments in a message.  From the attachment menu, you can save,
2865 print, pipe, delete, and view attachments.  You can apply these
2866 operations to a group of attachments at once, by tagging the attachments
2867 and by using the ``tag-prefix'' operator.  You can also reply to the
2868 current message from this menu, and only the current attachment (or the
2869 attachments tagged) will be quoted in your reply.  You can view
2870 attachments as text, or view them using the mailcap viewer definition.
2871
2872 Finally, you can apply the usual message-related functions (like 
2873 <ref id="resend-message" name="resend-message">, and the reply
2874 and forward functions) to attachments of type <tt>message/rfc822</tt>.
2875
2876 See the help on the attachment menu for more information.
2877
2878 <sect2>The Compose Menu<label id="compose_menu">
2879 <p>
2880 The compose menu is the menu you see before you send a message.  It
2881 allows you to edit the recipient list, the subject, and other aspects
2882 of your message.  It also contains a list of the attachments of your
2883 message, including the main body.  From this menu, you can print, copy,
2884 filter, pipe, edit, compose, review, and rename an attachment or a
2885 list of tagged attachments.  You can also modifying the attachment
2886 information, notably the type, encoding and description.
2887
2888 Attachments appear as follows:
2889 <verb>
2890 -   1 [text/plain, 7bit, 1K]             /tmp/mutt-euler-8082-0 <no description>
2891     2 [applica/x-gunzip, base64, 422K]   ~/src/mutt-0.85.tar.gz <no description>
2892 </verb>
2893
2894 The '-' denotes that Mutt will delete the file after sending (or
2895 postponing, or cancelling) the message.  It can be toggled with the
2896 <tt/toggle-unlink/ command (default: u).  The next field is the MIME
2897 content-type, and can be changed with the <tt/edit-type/ command
2898 (default: ^T).  The next field is the encoding for the attachment,
2899 which allows a binary message to be encoded for transmission on 7bit
2900 links.  It can be changed with the <tt/edit-encoding/ command
2901 (default: ^E).  The next field is the size of the attachment,
2902 rounded to kilobytes or megabytes.  The next field is the filename,
2903 which can be changed with the <tt/rename-file/ command (default: R).
2904 The final field is the description of the attachment, and can be
2905 changed with the <tt/edit-description/ command (default: d).
2906
2907 <sect1>MIME Type configuration with <tt/mime.types/
2908 <p>
2909 When you add an attachment to your mail message, Mutt searches your
2910 personal mime.types file at <tt>&dollar;{HOME}/.mime.types</tt>, and then
2911 the system mime.types file at <tt>/usr/local/share/mutt/mime.types</tt> or
2912 <tt>/etc/mime.types</tt>
2913
2914 The mime.types file consist of lines containing a MIME type and a space
2915 separated list of extensions.  For example:
2916 <tscreen><verb>
2917 application/postscript          ps eps
2918 application/pgp                 pgp
2919 audio/x-aiff                    aif aifc aiff
2920 </verb></tscreen>
2921 A sample <tt/mime.types/ file comes with the Mutt distribution, and
2922 should contain most of the MIME types you are likely to use.  
2923
2924 If Mutt can not determine the mime type by the extension of the file you
2925 attach, it will look at the file.  If the file is free of binary
2926 information, Mutt will assume that the file is plain text, and mark it
2927 as <tt>text/plain</tt>.  If the file contains binary information, then Mutt will
2928 mark it as <tt>application/octet-stream</tt>.  You can change the MIME
2929 type that Mutt assigns to an attachment by using the <tt/edit-type/
2930 command from the compose menu (default: ^T). The MIME type is actually a
2931 major mime type followed by the sub-type, separated by a '/'. 6 major
2932 types: application, text, image, video, audio, and model have been approved
2933 after various internet discussions. Mutt recognises all of these if the 
2934 appropriate entry is found in the mime.types file. It also recognises other
2935 major mime types, such as the chemical type that is widely used in the 
2936 molecular modelling community to pass molecular data in various forms to 
2937 various molecular viewers. Non-recognised mime types should only be used 
2938 if the recipient of the message is likely to be expecting such attachments.
2939
2940 <sect1>MIME Viewer configuration with <tt/mailcap/
2941 <p>
2942 Mutt supports RFC 1524 MIME Configuration, in particular the Unix
2943 specific format specified in Appendix A of RFC 1524.  This file format
2944 is commonly referred to as the mailcap format.  Many MIME compliant
2945 programs utilize the mailcap format, allowing you to specify handling
2946 for all MIME types in one place for all programs.  Programs known to
2947 use this format include Netscape, XMosaic, lynx and metamail.
2948
2949 In order to handle various MIME types that Mutt can not handle
2950 internally, Mutt parses a series of external configuration files to
2951 find an external handler.  The default search string for these files
2952 is a colon delimited list set to
2953 <tscreen><verb>
2954 ${HOME}/.mailcap:/usr/local/share/mutt/mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
2955 </verb></tscreen>
2956 where <tt/&dollar;HOME/ is your home directory.
2957
2958 In particular, the metamail distribution will install a mailcap file,
2959 usually as <tt>/usr/local/etc/mailcap</tt>, which contains some baseline
2960 entries.
2961
2962 <sect2>The Basics of the mailcap file
2963 <p>
2964 A mailcap file consists of a series of lines which are comments, blank,
2965 or definitions.
2966
2967 A comment line consists of a &num; character followed by anything you want.
2968
2969 A blank line is blank.
2970
2971 A definition line consists of a content type, a view command, and any
2972 number of optional fields.  Each field of a definition line is divided
2973 by a semicolon ';' character.
2974
2975 The content type is specified in the MIME standard type/subtype method.
2976 For example,
2977 <tt>text/plain, text/html, image/gif, </tt>
2978 etc.  In addition, the mailcap format includes two formats for
2979 wildcards, one using the special '*' subtype, the other is the implicit
2980 wild, where you only include the major type.  For example, <tt>image/*</tt>, or
2981 <tt>video,</tt> will match all image types and video types,
2982 respectively.
2983
2984 The view command is a Unix command for viewing the type specified. There
2985 are two different types of commands supported. The default is to send
2986 the body of the MIME message to the command on stdin. You can change
2987 this behaviour by using &percnt;s as a parameter to your view command.
2988 This will cause Mutt to save the body of the MIME message to a temporary
2989 file, and then call the view command with the &percnt;s replaced by
2990 the name of the temporary file. In both cases, Mutt will turn over the
2991 terminal to the view program until the program quits, at which time Mutt
2992 will remove the temporary file if it exists.
2993
2994 So, in the simplest form, you can send a text/plain message to the
2995 external pager more on stdin:
2996 <tscreen><verb>
2997 text/plain; more
2998 </verb></tscreen>
2999 Or, you could send the message as a file:
3000 <tscreen><verb>
3001 text/plain; more %s
3002 </verb></tscreen>
3003 Perhaps you would like to use lynx to interactively view a text/html 
3004 message:
3005 <tscreen><verb>
3006 text/html; lynx %s
3007 </verb></tscreen>
3008 In this case, lynx does not support viewing a file from stdin, so you
3009 must use the &percnt;s syntax.
3010 <bf/Note:/ <em>Some older versions of lynx contain a bug where they
3011 will check the mailcap file for a viewer for text/html.  They will find
3012 the line which calls lynx, and run it.  This causes lynx to continuously
3013 spawn itself to view the object.</em>
3014
3015 On the other hand, maybe you don't want to use lynx interactively, you
3016 just want to have it convert the text/html to text/plain, then you can
3017 use:
3018 <tscreen><verb>
3019 text/html; lynx -dump %s | more
3020 </verb></tscreen>
3021
3022 Perhaps you wish to use lynx to view text/html files, and a pager on
3023 all other text formats, then you would use the following:
3024 <tscreen><verb>
3025 text/html; lynx %s
3026 text/*; more
3027 </verb></tscreen>
3028 This is the simplest form of a mailcap file.
3029
3030 <sect2>Secure use of mailcap
3031 <p>
3032 The interpretion of shell meta-characters embedded in MIME parameters
3033 can lead to security problems in general.  Mutt tries to quote parameters
3034 in expansion of %s syntaxes properly, and avoids risky characters by
3035 substituting them, see the <ref id="mailcap_sanitize"
3036 name="mailcap&lowbar;sanitize"> variable.
3037
3038 Although mutt's procedures to invoke programs with mailcap seem to be
3039 safe, there are other applications parsing mailcap, maybe taking less care
3040 of it.  Therefore you should pay attention to the following rules:
3041
3042 <em/Keep the %-expandos away from shell quoting./
3043 Don't quote them with single or double quotes.  Mutt does this for
3044 you, the right way, as should any other program which interprets
3045 mailcap.  Don't put them into backtick expansions.  Be highly careful
3046 with eval statements, and avoid them if possible at all.  Trying to fix
3047 broken behaviour with quotes introduces new leaks - there is no
3048 alternative to correct quoting in the first place.
3049
3050 If you have to use the %-expandos' values in context where you need
3051 quoting or backtick expansions, put that value into a shell variable
3052 and reference the shell variable where necessary, as in the following
3053 example (using <tt/&dollar;charset/ inside the backtick expansion is safe,
3054 since it is not itself subject to any further expansion):
3055
3056 <tscreen><verb>
3057 text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
3058         && test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
3059 </verb></tscreen>
3060
3061 <sect2>Advanced mailcap Usage
3062 <p>
3063
3064 <sect3>Optional Fields
3065 <p>
3066 In addition to the required content-type and view command fields, you
3067 can add semi-colon ';' separated fields to set flags and other options.
3068 Mutt recognizes the following optional fields:
3069 <descrip>
3070 <tag/copiousoutput/
3071 This flag tells Mutt that the command passes possibly large amounts of
3072 text on stdout.  This causes Mutt to invoke a pager (either the internal
3073 pager or the external pager defined by the pager variable) on the output
3074 of the view command.  Without this flag, Mutt assumes that the command
3075 is interactive.  One could use this to replace the pipe to <tt>more</tt>
3076 in the <tt>lynx -dump</tt> example in the Basic section:
3077 <tscreen><verb>
3078 text/html; lynx -dump %s ; copiousoutput
3079 </verb></tscreen>
3080 This will cause lynx to format the text/html output as text/plain
3081 and Mutt will use your standard pager to display the results.
3082 <tag/needsterminal/
3083 Mutt uses this flag when viewing attachments with <ref id="auto_view"
3084 name="autoview">, in order to decide whether it should honor the setting
3085 of the <ref id="wait_key" name="&dollar;wait&lowbar;key"> variable or
3086 not.  When an attachment is viewed using an interactive program, and the
3087 corresponding mailcap entry has a <em/needsterminal/ flag, Mutt will use
3088 <ref id="wait_key" name="&dollar;wait&lowbar;key"> and the exit status
3089 of the program to decide if it will ask you to press a key after the
3090 external program has exited.  In all other situations it will not prompt
3091 you for a key.
3092 <tag>compose=&lt;command&gt;</tag>
3093 This flag specifies the command to use to create a new attachment of a
3094 specific MIME type.  Mutt supports this from the compose menu.
3095 <tag>composetyped=&lt;command&gt;</tag>
3096 This flag specifies the command to use to create a new attachment of a
3097 specific MIME type.  This command differs from the compose command in
3098 that mutt will expect standard MIME headers on the data.  This can be
3099 used to specify parameters, filename, description, etc. for a new
3100 attachment.   Mutt supports this from the compose menu.
3101 <tag>print=&lt;command&gt;</tag>
3102 This flag specifies the command to use to print a specific MIME type.
3103 Mutt supports this from the attachment and compose menus.
3104 <tag>edit=&lt;command&gt;</tag>
3105 This flag specifies the command to use to edit a specific MIME type.  
3106 Mutt supports this from the compose menu, and also uses it to compose
3107 new attachments.  Mutt will default to the defined editor for text
3108 attachments.
3109 <tag>nametemplate=&lt;template&gt;</tag>
3110 This field specifies the format for the file denoted by &percnt;s in the
3111 command fields.  Certain programs will require a certain file extension,
3112 for instance, to correctly view a file.  For instance, lynx will only
3113 interpret a file as <tt>text/html</tt> if the file ends in <tt/.html/.
3114 So, you would specify lynx as a <tt>text/html</tt> viewer with a line in
3115 the mailcap file like:
3116 <tscreen><verb>
3117 text/html; lynx %s; nametemplate=%s.html
3118 </verb></tscreen>
3119 <tag>test=&lt;command&gt;</tag>
3120 This field specifies a command to run to test whether this mailcap
3121 entry should be used.  The command is defined with the command expansion
3122 rules defined in the next section.  If the command returns 0, then the
3123 test passed, and Mutt uses this entry.  If the command returns non-zero,
3124 then the test failed, and Mutt continues searching for the right entry.
3125 <bf/Note:/ <em>the content-type must match before Mutt performs the test.</em>
3126 For example:
3127 <tscreen><verb>
3128 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
3129 text/html; lynx %s
3130 </verb></tscreen>
3131 In this example, Mutt will run the program RunningX which will return 0
3132 if the X Window manager is running, and non-zero if it isn't.  If
3133 RunningX returns 0, then Mutt will call netscape to display the
3134 text/html object.  If RunningX doesn't return 0, then Mutt will go on
3135 to the next entry and use lynx to display the text/html object.
3136 </descrip>
3137
3138 <sect3>Search Order
3139 <p>
3140 When searching for an entry in the mailcap file, Mutt will search for
3141 the most useful entry for its purpose.  For instance, if you are
3142 attempting to print an <tt>image/gif</tt>, and you have the following
3143 entries in your mailcap file, Mutt will search for an entry with the
3144 print command:
3145 <tscreen><verb>
3146 image/*;        xv %s
3147 image/gif;      ; print= anytopnm %s | pnmtops | lpr; \
3148                 nametemplate=%s.gif
3149 </verb></tscreen>
3150 Mutt will skip the <tt>image/*</tt> entry and use the <tt>image/gif</tt>
3151 entry with the print command.
3152
3153 In addition, you can use this with <ref id="auto_view" name="Autoview"> 
3154 to denote two commands for viewing an attachment, one to be viewed
3155 automatically, the other to be viewed interactively from the attachment
3156 menu.  In addition, you can then use the test feature to determine which
3157 viewer to use interactively depending on your environment.
3158 <tscreen><verb>
3159 text/html;      netscape -remote 'openURL(%s)' ; test=RunningX
3160 text/html;      lynx %s; nametemplate=%s.html
3161 text/html;      lynx -dump %s; nametemplate=%s.html; copiousoutput
3162 </verb></tscreen>
3163 For <ref id="auto_view" name="Autoview">, Mutt will choose the third
3164 entry because of the copiousoutput tag.  For interactive viewing, Mutt
3165 will run the program RunningX to determine if it should use the first
3166 entry.  If the program returns non-zero, Mutt will use the second entry
3167 for interactive viewing.
3168
3169 <sect3>Command Expansion
3170 <p>
3171 The various commands defined in the mailcap files are passed to the
3172 <tt>/bin/sh</tt> shell using the system() function.  Before the
3173 command is passed to <tt>/bin/sh -c</tt>, it is parsed to expand
3174 various special parameters with information from Mutt.  The keywords
3175 Mutt expands are:
3176 <descrip>
3177 <tag/&percnt;s/
3178 As seen in the basic mailcap section, this variable is expanded
3179 to a filename specified by the calling program.  This file contains
3180 the body of the message to view/print/edit or where the composing
3181 program should place the results of composition.  In addition, the
3182 use of this keyword causes Mutt to not pass the body of the message
3183 to the view/print/edit program on stdin.
3184 <tag/&percnt;t/
3185 Mutt will expand &percnt;t to the text representation of the content
3186 type of the message in the same form as the first parameter of the
3187 mailcap definition line, ie <tt>text/html</tt> or
3188 <tt>image/gif</tt>.
3189 <tag>&percnt;{&lt;parameter&gt;}</tag>
3190 Mutt will expand this to the value of the specified parameter
3191 from the Content-Type: line of the mail message.  For instance, if
3192 Your mail message contains:
3193 <tscreen><verb>
3194 Content-Type: text/plain; charset=iso-8859-1
3195 </verb></tscreen>
3196 then Mutt will expand &percnt;{charset} to iso-8859-1.  The default metamail
3197 mailcap file uses this feature to test the charset to spawn an xterm
3198 using the right charset to view the message.
3199 <tag>&bsol;&percnt;</tag>
3200 This will be replaced by a &percnt;
3201 </descrip>
3202 Mutt does not currently support the &percnt;F and &percnt;n keywords
3203 specified in RFC 1524.  The main purpose of these parameters is for
3204 multipart messages, which is handled internally by Mutt.
3205
3206 <sect2>Example mailcap files
3207 <p>
3208 This mailcap file is fairly simple and standard:
3209 <code>
3210 # I'm always running X :)
3211 video/*;        xanim %s > /dev/null
3212 image/*;        xv %s > /dev/null
3213
3214 # I'm always running netscape (if my computer had more memory, maybe)
3215 text/html;      netscape -remote 'openURL(%s)'
3216 </code>
3217
3218 This mailcap file shows quite a number of examples:
3219
3220 <code>
3221 # Use xanim to view all videos   Xanim produces a header on startup,
3222 # send that to /dev/null so I don't see it
3223 video/*;        xanim %s > /dev/null
3224
3225 # Send html to a running netscape by remote
3226 text/html;      netscape -remote 'openURL(%s)'; test=RunningNetscape
3227
3228 # If I'm not running netscape but I am running X, start netscape on the
3229 # object
3230 text/html;      netscape %s; test=RunningX
3231
3232 # Else use lynx to view it as text
3233 text/html;      lynx %s
3234
3235 # This version would convert the text/html to text/plain
3236 text/html;      lynx -dump %s; copiousoutput
3237
3238 # I use enscript to print text in two columns to a page
3239 text/*;         more %s; print=enscript -2Gr %s
3240
3241 # Netscape adds a flag to tell itself to view jpegs internally
3242 image/jpeg;xv %s; x-mozilla-flags=internal
3243
3244 # Use xv to view images if I'm running X
3245 # In addition, this uses the \ to extend the line and set my editor
3246 # for images
3247 image/*;xv %s; test=RunningX; \
3248         edit=xpaint %s
3249
3250 # Convert images to text using the netpbm tools
3251 image/*;  (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
3252 pbmtoascii -1x2 ) 2>&1 ; copiousoutput
3253
3254 # Send excel spreadsheets to my NT box
3255 application/ms-excel; open.pl %s
3256 </code>
3257
3258 <sect1>MIME Autoview<label id="auto_view">
3259 <p>
3260 In addition to explicitly telling Mutt to view an attachment with the
3261 MIME viewer defined in the mailcap file, Mutt has support for
3262 automatically viewing MIME attachments while in the pager.
3263
3264 To work, you must define a viewer in the mailcap file which uses the 
3265 <tt/copiousoutput/ option to denote that it is non-interactive.
3266 Usually, you also use the entry to convert the attachment to a text
3267 representation which you can view in the pager.
3268
3269 You then use the <tt/auto&lowbar;view/ muttrc command to list the
3270 content-types that you wish to view automatically.
3271
3272 For instance, if you set auto&lowbar;view to:
3273 <tscreen><verb>
3274 auto_view text/html application/x-gunzip application/postscript image/gif application/x-tar-gz
3275 </verb></tscreen>
3276
3277 Mutt could use the following mailcap entries to automatically view
3278 attachments of these types.
3279 <tscreen><verb>
3280 text/html;      lynx -dump %s; copiousoutput; nametemplate=%s.html
3281 image/*;        anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | pgmtopbm | pbmtoascii ; copiousoutput
3282 application/x-gunzip;   gzcat; copiousoutput
3283 application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
3284 application/postscript; ps2ascii %s; copiousoutput
3285 </verb></tscreen>
3286
3287 ``unauto_view'' can be used to remove previous entries from the autoview list.
3288 This can be used with message-hook to autoview messages based on size, etc.
3289 ``unauto_view *'' will remove all previous entries.
3290
3291 <sect1>MIME Multipart/Alternative<label id="alternative_order">
3292 <p>
3293 Mutt has some heuristics for determining which attachment of a
3294 multipart/alternative type to display.  First, mutt will check the 
3295 alternative&lowbar;order list to determine if one of the available types
3296 is preferred.  The alternative&lowbar;order list consists of a number of
3297 mimetypes in order, including support for implicit and explicit
3298 wildcards, for example:
3299 <tscreen><verb>
3300 alternative_order text/enriched text/plain text application/postscript image/*
3301 </verb></tscreen>
3302
3303 Next, mutt will check if any of the types have a defined 
3304 <ref id="auto_view" name="auto&lowbar;view">, and use that.  Failing
3305 that, Mutt will look for any text type.  As a last attempt, mutt will
3306 look for any type it knows how to handle.
3307
3308 To remove a MIME type from the <tt/alternative_order/ list, use the
3309 <tt/unalternative_order/ command.
3310
3311 <sect1>MIME Lookup<label id="mime_lookup">
3312 <p>
3313 Mutt's mime&lowbar;lookup list specifies a list of mime-types that should not
3314 be treated according to their mailcap entry.  This option is designed to
3315 deal with binary types such as application/octet-stream.  When an attachment's
3316 mime-type is listed in mime&lowbar;lookup, then the extension of the filename will
3317 be compared to the list of extensions in the mime.types file.  The mime-type
3318 associated with this extension will then be used to process the attachment
3319 according to the rules in the mailcap file and according to any other configuration
3320 options (such as auto&lowbar;view) specified.  Common usage would be:
3321 <tscreen><verb>
3322 mime_lookup application/octet-stream application/X-Lotus-Manuscript
3323 </verb></tscreen>
3324
3325 In addition, the unmime&lowbar;lookup command may be used to disable this feature
3326 for any particular mime-type if it had been set, for example, in a global
3327 muttrc.
3328
3329 <sect>Reference
3330 <sect1>Command line options<label id="commandline">
3331 <p>
3332 Running <tt/mutt/ with no arguments will make Mutt attempt to read your spool
3333 mailbox.  However, it is possible to read other mailboxes and
3334 to send messages from the command line as well.
3335
3336 <tscreen><verb>
3337 -A      expand an alias
3338 -a      attach a file to a message
3339 -b      specify a blind carbon-copy (BCC) address
3340 -c      specify a carbon-copy (Cc) address
3341 -e      specify a config command to be run after initilization files are read
3342 -f      specify a mailbox to load
3343 -F      specify an alternate file to read initialization commands
3344 -h      print help on command line options
3345 -H      specify a draft file from which to read a header and body
3346 -i      specify a file to include in a message composition
3347 -m      specify a default mailbox type
3348 -n      do not read the system Muttrc
3349 -p      recall a postponed message
3350 -Q      query a configuration variable
3351 -R      open mailbox in read-only mode
3352 -s      specify a subject (enclose in quotes if it contains spaces)
3353 -v      show version number and compile-time definitions
3354 -x      simulate the mailx(1) compose mode
3355 -y      show a menu containing the files specified by the mailboxes command
3356 -z      exit immediately if there are no messages in the mailbox
3357 -Z      open the first folder with new message,exit immediately if none
3358 </verb></tscreen>
3359
3360 To read messages in a mailbox
3361
3362 <tt/mutt/ &lsqb; -nz &rsqb; &lsqb; -F <em/muttrc/ &rsqb; &lsqb; -m <em/type/ &rsqb; &lsqb; -f <em/mailbox/ &rsqb; 
3363
3364 To compose a new message
3365
3366 <tt/mutt/ &lsqb; -n &rsqb; &lsqb; -F <em/muttrc/ &rsqb; &lsqb; -a <em/file/ &rsqb; &lsqb; -c <em/address/ &rsqb; &lsqb; -i <em/filename/ &rsqb; &lsqb; -s <em/subject/ &rsqb; <em/address/ &lsqb; <em/address/ ... &rsqb; 
3367
3368 Mutt also supports a ``batch'' mode to send prepared messages.  Simply redirect
3369 input from the file you wish to send.  For example,
3370
3371 <tt>mutt -s &dquot;data set for run &num;2&dquot; professor@bigschool.edu
3372 &lt; &tilde;/run2.dat</tt>
3373
3374 This command will send a message to ``professor@bigschool.edu'' with a subject
3375 of ``data set for run &num;2''.  In the body of the message will be the contents
3376 of the file ``&tilde;/run2.dat''.
3377
3378 <sect1>Configuration Commands<label id="commands">
3379 <p>
3380 The following are the commands understood by mutt.
3381
3382 <itemize>
3383 <item>
3384 <tt><ref id="account-hook" name="account-hook"></tt> <em/pattern/ <em/command/
3385 <item>
3386 <tt><ref id="alias" name="alias"></tt> <em/key/ <em/address/ &lsqb; , <em/address/, ... &rsqb;
3387 <item>
3388 <tt><ref id="alias" name="unalias"></tt> &lsqb; * | <em/key/ ... &rsqb;
3389 <item>
3390 <tt><ref id="alternates" name="alternates"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;
3391 <item>
3392 <tt><ref id="alternates" name="unalternates"></tt> &lsqb; * | <em/regexp/ ... &rsqb;
3393 <item>
3394 <tt><ref id="alternative_order" name="alternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
3395 <item>
3396 <tt><ref id="alternative_order" name="unalternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
3397 <item>
3398 <tt><ref id="append-hook" name="append-hook"></tt> <em/regexp/ <em/command/
3399 <item>
3400 <tt><ref id="auto_view" name="auto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
3401 <item>
3402 <tt><ref id="auto_view" name="unauto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
3403 <item>
3404 <tt><ref id="bind" name="bind"></tt> <em/map/ <em/key/ <em/function/
3405 <item>
3406 <tt><ref id="charset-hook" name="charset-hook"></tt> <em/alias/ <em/charset/
3407 <item>
3408 <tt><ref id="close-hook" name="close-hook"></tt> <em/regexp/ <em/command/
3409 <item>
3410 <tt><ref id="color" name="color"></tt> <em/object/ <em/foreground/ <em/background/ &lsqb; <em/regexp/ &rsqb;
3411 <item>
3412 <tt><ref id="color" name="uncolor"></tt> <em/index/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
3413 <item>
3414 <tt><ref id="exec" name="exec"></tt> <em/function/ &lsqb; <em/function/ ... &rsqb;
3415 <item>
3416 <tt><ref id="fcc-hook" name="fcc-hook"></tt> <em/pattern/ <em/mailbox/
3417 <item>
3418 <tt><ref id="fcc-save-hook" name="fcc-save-hook"></tt> <em/pattern/ <em/mailbox/
3419 <item>
3420 <tt><ref id="folder-hook" name="folder-hook"></tt> <em/pattern/ <em/command/
3421 <item>
3422 <tt><ref id="hdr_order" name="hdr&lowbar;order"></tt> <em/header/ &lsqb; <em/header/ ... &rsqb;
3423 <item>
3424 <tt><ref id="hdr_order" name="unhdr&lowbar;order"></tt> <em/header/ &lsqb; <em/header/ ... &rsqb;
3425 <item>
3426 <tt><ref id="charset-hook" name="iconv-hook"></tt> <em/charset/ <em/local-charset/
3427 <item>
3428 <tt><ref id="ignore" name="ignore"></tt> <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
3429 <item>
3430 <tt><ref id="ignore" name="unignore"></tt> <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
3431 <item>
3432 <tt><ref id="lists" name="lists"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
3433 <item>
3434 <tt><ref id="lists" name="unlists"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
3435 <item>
3436 <tt><ref id="macro" name="macro"></tt> <em/menu/ <em/key/ <em/sequence/ &lsqb; <em/description/ &rsqb; 
3437 <item>
3438 <tt><ref id="mailboxes" name="mailboxes"></tt> <em/filename/ &lsqb; <em/filename/ ... &rsqb;
3439 <item>
3440 <tt><ref id="mbox-hook" name="mbox-hook"></tt> <em/pattern/ <em/mailbox/
3441 <item>
3442 <tt><ref id="message-hook" name="message-hook"></tt> <em/pattern/ <em/command/
3443 <item>
3444 <tt><ref id="mime_lookup" name="mime&lowbar;lookup"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
3445 <item>
3446 <tt><ref id="mime_lookup" name="unmime&lowbar;lookup"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
3447 <item>
3448 <tt><ref id="color" name="mono"></tt> <em/object attribute/ &lsqb; <em/regexp/ &rsqb;
3449 <item>
3450 <tt><ref id="color" name="unmono"></tt> <em/index/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
3451 <item>
3452 <tt><ref id="my_hdr" name="my&lowbar;hdr"></tt> <em/string/
3453 <item>
3454 <tt><ref id="my_hdr" name="unmy&lowbar;hdr"></tt> <em/field/ &lsqb; <em/field/ ... &rsqb;
3455 <item>
3456 <tt><ref id="open-hook" name="open-hook"></tt> <em/regexp/ <em/command/
3457 <item>
3458 <tt><ref id="crypt-hook" name="crypt-hook"></tt> <em/pattern/ <em/key-id/
3459 <item>
3460 <tt><ref id="push" name="push"></tt> <em/string/
3461 <item>
3462 <tt><ref id="set" name="reset"></tt> <em/variable/ &lsqb;<em/variable/ ... &rsqb;
3463 <item>
3464 <tt><ref id="save-hook" name="save-hook"></tt> <em/regexp/ <em/filename/
3465 <item>
3466 <tt><ref id="score-command" name="score"></tt> <em/pattern/ <em/value/
3467 <item>
3468 <tt><ref id="score-command" name="unscore"></tt> <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
3469 <item>
3470 <tt><ref id="send-hook" name="send-hook"></tt> <em/regexp/ <em/command/
3471 <item>
3472 <tt><ref id="reply-hook" name="reply-hook"></tt> <em/regexp/ <em/command/
3473 <item>
3474 <tt><ref id="set" name="set"></tt> &lsqb;no|inv&rsqb;<em/variable/&lsqb;=<em/value/&rsqb; &lsqb; <em/variable/ ... &rsqb;
3475 <item>
3476 <tt><ref id="set" name="unset"></tt> <em/variable/ &lsqb;<em/variable/ ... &rsqb;
3477 <item>
3478 <tt><ref id="source" name="source"></tt> <em/filename/
3479 <item>
3480 <tt><ref id="spam" name="spam"></tt> <em/pattern/ <em/format/
3481 <item>
3482 <tt><ref id="spam" name="nospam"></tt> <em/pattern/
3483 <item>
3484 <tt><ref id="lists" name="subscribe"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
3485 <item>
3486 <tt><ref id="lists" name="unsubscribe"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
3487 <item>
3488 <tt><ref id="set" name="toggle"></tt> <em/variable/ &lsqb;<em/variable/ ... &rsqb;
3489 <item>
3490 <tt><ref id="unhook" name="unhook"></tt> <em/hook-type/
3491 </itemize>
3492
3493 <sect1>Configuration variables<label id="variables">
3494 <p>
3495