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