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