Rocco Rutte:
[apps/madmutt.git] / doc / manual.sgml.head
1 <!-- vim:ft=sgml
2 --> 
3 <!doctype linuxdoc system>
4
5 <book>
6
7 <title>The Mutt Next Generation E-Mail Client
8 <author>by Andreas Krennmair <htmlurl url="mailto:ak@synflood.at" name="&lt;ak@synflood.at&gt;"> and others
9         originally based on <em>mutt</em> by Michael Elkins <htmlurl url="mailto:me@cs.hmc.edu" name="&lt;me@cs.hmc.edu&gt;"> and others
10 <date>version @VERSION@
11 <abstract>
12 Michael Elinks on mutt, circa 1995: ``All mail clients suck. 
13 This one just sucks less.'' - Sven Guckes on mutt, ca. 2003: ``But it still sucks!''
14 </abstract>
15
16 <toc>
17
18 <chapt>Introduction <!--{{{--> 
19
20 <sect>Overview <!--{{{--> 
21 <p>
22 <bf/Mutt-ng/ is a small but very powerful text-based MIME mail client.  Mutt-ng is
23 highly configurable, and is well suited to the mail power user with advanced
24 features like key bindings, keyboard macros, mail threading, regular
25 expression searches and a powerful pattern matching language for selecting
26 groups of messages.
27
28 <p>This documentation additionally contains documentation to <bf/Mutt-NG/, a 
29 fork from Mutt with the goal to fix all the little annoyances of Mutt, to
30 integrate all the Mutt patches that are floating around in the web, and to
31 add other new features. Features specific to Mutt-ng will be discussed in
32 an extra section. Don't be confused when most of the documentation talk about
33 Mutt and not Mutt-ng, Mutt-ng contains all Mutt features, plus many more.
34
35 <!--}}}--> 
36
37 <sect>Mutt-ng Home Page <!--{{{--> 
38 <p>
39 <htmlurl url="http://www.muttng.org/"
40 name="http://www.muttng.org">
41
42 <!--}}}--> 
43
44 <sect>Mailing Lists <!--{{{--> 
45 <p>
46
47 <itemize>
48 <item><htmlurl url="https://lists.berlios.de/mailman/listinfo/mutt-ng-users"
49 name="mutt-ng-users@lists.berlios.de"> -- This is where the mutt-ng user support happens.
50 <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
51 </itemize>
52
53 <!--}}}--> 
54
55 <sect>Software Distribution Sites <!--{{{--> 
56 <p>
57 So far, there are no official releases of Mutt-ng, but you can download
58 daily snapshots from <htmlurl url="http://mutt-ng.berlios.de/snapshots/" name="http://mutt-ng.berlios.de/snapshots/">
59
60 <!--}}}--> 
61
62 <sect>IRC <!--{{{--> 
63 <p>
64 Visit channel <em/#muttng/ on <htmlurl
65 url="http://www.freenode.net/" name="irc.freenode.net
66 (www.freenode.net)"> to chat with other people interested in Mutt-ng.
67
68 <!--}}}--> 
69
70 <sect>Weblog <!--{{{--> 
71 <p>
72 If you want to read fresh news about the latest development in Mutt-ng, and get informed
73 about stuff like interesting, Mutt-ng-related articles and packages for your favorite
74 distribution, you can read and/or subscribe to our 
75 <htmlurl url="http://mutt-ng.supersized.org/" name="Mutt-ng development weblog">.
76
77 <!--}}}--> 
78
79 <sect>Copyright <!--{{{--> 
80 <p>
81 Mutt is Copyright (C) 1996-2000 Michael R. Elkins
82 &lt;me@cs.hmc.edu&gt; and others
83
84 This program is free software; you can redistribute it and/or modify
85 it under the terms of the GNU General Public License as published by
86 the Free Software Foundation; either version 2 of the License, or
87 (at your option) any later version.
88
89 This program is distributed in the hope that it will be useful,
90 but WITHOUT ANY WARRANTY; without even the implied warranty of
91 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
92 GNU General Public License for more details.
93
94 You should have received a copy of the GNU General Public License
95 along with this program; if not, write to the Free Software
96 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111, USA.
97
98 <!--}}}--> 
99
100 <!--}}}--> 
101
102 <chapt>Getting Started <!--{{{--> 
103
104   <sect>Basic Concepts <!--{{{--> 
105
106     <sect1>Screens and Menus <!--{{{--> 
107
108       <p>mutt-ng offers different screens of which every has its special
109       purpose:
110
111       <itemize>
112
113         <item>The <em/index/ displays the contents of the currently opened
114         mailbox.
115
116         <item>The <em/pager/ is responsible for displaying messages, that
117         is, the header, the body and all attached parts.
118
119         <item>The <em/file browser/ offers operations on and displays
120         information of all folders mutt-ng should watch for mail.
121
122         <item>The <em/sidebar/ offers a permanent view of which mailboxes
123         contain how many total, new and/or flagged mails.
124
125         <item>The <em/help screen/ lists for all currently available
126         commands how to invoke them as well as a short description.
127
128         <item>The <em/compose/ menu is a comfortable interface take last
129         actions before sending mail: change subjects, attach files, remove
130         attachements, etc.
131
132         <item>The <em/attachement/ menu gives a summary and the tree
133         structure of the attachements of the current message.
134
135         <item>The <em/alias/ menu lists all or a fraction of the aliases
136         a user has defined.
137
138         <item>The <em/key/ menu used in connection with encryption lets
139         users choose the right key to encrypt with.
140
141       </itemize>
142
143       <p>When mutt-ng is started without any further options, it'll open
144       the users default mailbox and display the index.
145
146     <!--}}}--> 
147
148     <sect1>Configuration <!--{{{--> 
149
150       <p>Mutt-ng does <em/not/ feature an internal configuration
151       interface or menu due to the simple fact that this would be too
152       complex to handle (currently there are several <em/hundred/
153       variables which fine-tune the behaviour.)
154
155       <p>Mutt-ng is configured using configuration files which allow
156       users to add comments or manage them via version control systems
157       to ease maintenance.
158
159       <p>Also, mutt-ng comes with a shell script named <tt/grml-muttng/
160       kindly contributed by users which really helps and eases the
161       creation of a user's configuration file. When downloading the
162       source code via a snapshot or via subversion, it can be found in
163       the <tt/contrib/ directory.
164
165     <!--}}}--> 
166
167     <sect1>Functions <!--{{{--> 
168
169       <p>Mutt-ng offers great flexibility due to the use of functions:
170       internally, every action a user can make mutt-ng perform is named
171       ``function.'' Those functions are assigned to keys (or even key
172       sequences) and may be completely adjusted to user's needs. The
173       basic idea is that the impatient users get a very intuitive
174       interface to start off with and advanced users virtually get no
175       limits to adjustments.
176
177     <!--}}}--> 
178
179     <sect1>Interaction <!--{{{--> 
180
181       <p>Mutt-ng has two basic concepts of user interaction:
182
183         <enum>
184
185           <item>There is one dedicated line on the screen used to query
186           the user for input, issue any command, query variables and
187           display error and informational messages. As for every type of
188           user input, this requires manual action leading to the need of
189           input.
190
191           <item>The automatized interface for interaction are the so
192           called <em/hooks/. Hooks specify actions the user wants to be
193           performed at well-defined situations: what to do when entering
194           which folder, what to do when displaying or replying to what
195           kind of message, etc. These are optional, i.e. a user doesn't
196           need to specify them but can do so.
197
198         </enum>
199
200     <!--}}}--> 
201
202     <sect1>Modularization <!--{{{--> 
203
204       <p>Although mutt-ng has many functionality built-in, many
205       features can be delegated to external tools to increase
206       flexibility: users can define programs to filter a message through
207       before displaying, users can use any program they want for
208       displaying a message, message types (such as PDF or PostScript)
209       for which mutt-ng doesn't have a built-in filter can be rendered
210       by arbitrary tools and so forth. Although mutt-ng has an alias
211       mechanism built-in, it features using external tools to query for
212       nearly every type of addresses from sources like LDAP, databases
213       or just the list of locally known users.
214
215     <!--}}}--> 
216
217     <sect1>Patterns <!--{{{--> 
218
219       <p>Mutt-ng has a built-in pattern matching ``language'' which is
220       as widely used as possible to present a consistent interface to
221       users. The same ``pattern terms'' can be used for searching,
222       scoring, message selection and much more.
223
224     <!--}}}--> 
225
226   <!--}}}--> 
227
228   <sect>Screens and Menus <!--{{{--> 
229
230     <sect1>Index <!--{{{--> 
231
232      <p>The index is the screen that you usually see first when you
233      start mutt-ng. It gives an overview over your emails in the
234      currently opened mailbox. By default, this is your system mailbox.
235      The information you see in the index is a list of emails, each with
236      its number on the left, its flags (new email, important email,
237      email that has been forwarded or replied to, tagged email, ...),
238      the date when email was sent, its sender, the email size, and the
239      subject. Additionally, the index also shows thread hierarchies:
240      when you reply to an email, and the other person replies back, you
241      can see the other's person email in a "sub-tree" below.  This is
242      especially useful for personal email between a group of people or
243      when you've subscribed to mailing lists.
244
245     <!--}}}--> 
246
247     <sect1>Pager <!--{{{--> 
248
249      <p>The pager is responsible for showing the email content. On the
250      top of the pager you have an overview over the most important email
251      headers like the sender, the recipient, the subject, and much more
252      information. How much information you actually see depends on your
253      configuration, which we'll describe below.
254
255      <p>Below the headers, you see the email body which usually contains
256      the message. If the email contains any attachments, you will see
257      more information about them below the email body, or, if the
258      attachments are text files, you can view them directly in the
259      pager.
260
261      <p>To give the user a good overview, it is possible to configure
262      mutt-ng to show different things in the pager with different
263      colors. Virtually everything that can be described with a regular
264      expression can be colored, e.g. URLs, email addresses or smileys.
265
266      <!--}}}--> 
267
268     <sect1>File Browser <!--{{{--> 
269
270       <p>The file browser is the interface to the local or remote
271       file system. When selecting a mailbox to open, the browser allows
272       custom sorting of items, limiting the items shown by a regular
273       expression and a freely adjustable format of what to display in
274       which way. It also allows for easy navigation through the
275       file system when selecting file(s) to attach to a message, select
276       multiple files to attach and many more.
277
278     <!--}}}--> 
279
280     <sect1>Sidebar <!--{{{--> 
281
282       <p>The sidebar comes in handy to manage mails which are spread
283       over different folders. All folders users setup mutt-ng to watch
284       for new mail will be listed. The listing includes not only the
285       name but also the number of total messages, the number of new and
286       flagged messages. Items with new mail may be colored different
287       from those with flagged mail, items may be shortened or compress
288       if they're they to long to be printed in full form so that by
289       abbreviated names, user still now what the name stands for.
290
291     <!--}}}--> 
292
293     <sect1>Help <!--{{{--> 
294
295       <p>The help screen is meant to offer a quick help to the user. It
296       lists the current configuration of key bindings and their
297       associated commands including a short description, and currently
298       unbound functions that still need to be associated with a key
299       binding (or alternatively, they can be called via the mutt-ng
300       command prompt).
301
302     <!--}}}--> 
303
304       <sect1>Compose Menu <!--{{{--> 
305
306         <p>The compose menu features a split screen containing the
307         information which really matter before actually sending a
308         message by mail or posting an article to a newsgroup: who gets
309         the message as what (recipient, newsgroup, who gets what kind of
310         copy). Additionally, users may set security options like
311         deciding whether to sign, encrypt or sign and encrypt a message
312         with/for what keys.
313
314         <p>Also, it's used to attach messages, news articles or files to
315         a message, to re-edit any attachment including the message
316         itself.
317
318       <!--}}}--> 
319
320       <sect1>Alias Menu <!--{{{--> 
321
322         <p>The alias menu is used to help users finding the recipients
323         of messages. For users who need to contact many people, there's
324         no need to remember addresses or names completely because it
325         allows for searching, too. The alias mechanism and thus the
326         alias menu also features grouping several addresses by a shorter
327         nickname, the actual alias, so that users don't have to select
328         each single recipient manually.
329
330       <!--}}}--> 
331
332       <sect1>Attachment Menu <!--{{{--> 
333
334         <p>As will be later discussed in detail, mutt-ng features a good
335         and stable MIME implementation, that is, is greatly supports
336         sending and receiving messages of arbitrary type. The
337         attachment menu displays a message's structure in detail: what
338         content parts are attached to which parent part (which gives a
339         true tree structure), which type is of what type and what size.
340         Single parts may saved, deleted or modified to offer great and
341         easy access to message's internals.
342
343       <!--}}}--> 
344
345       <sect1>Key Menu <!--{{{--> 
346
347         <p><tt/FIXME/
348
349       <!--}}}--> 
350
351   <!--}}}--> 
352
353 <sect>Moving Around in Menus <!--{{{--> 
354 <p>
355
356 Information is presented in menus, very similar to ELM.  Here is a table
357 showing the common keys used to navigate menus in Mutt-ng.
358
359 <tscreen><verb>
360 j or Down       next-entry      move to the next entry
361 k or Up         previous-entry  move to the previous entry
362 z or PageDn     page-down       go to the next page
363 Z or PageUp     page-up         go to the previous page
364 = or Home       first-entry     jump to the first entry
365 * or End        last-entry      jump to the last entry
366 q               quit            exit the current menu
367 ?               help            list all key bindings for the current menu
368 </verb></tscreen>
369
370 <!--}}}--> 
371
372 <sect>Editing Input Fields<label id="editing"> <!--{{{--> 
373 <p>
374 Mutt-ng has a builtin line editor which is used as the primary way to input
375 textual data such as email addresses or filenames.  The keys used to move
376 around while editing are very similar to those of Emacs.
377
378 <tscreen><verb>
379 ^A or <Home>    bol             move to the start of the line
380 ^B or <Left>    backward-char   move back one char
381 Esc B           backward-word   move back one word
382 ^D or <Delete>  delete-char     delete the char under the cursor
383 ^E or <End>     eol             move to the end of the line
384 ^F or <Right>   forward-char    move forward one char
385 Esc F           forward-word    move forward one word
386 <Tab>           complete        complete filename or alias
387 ^T              complete-query  complete address with query
388 ^K              kill-eol        delete to the end of the line
389 ESC d           kill-eow        delete to the end of the word
390 ^W              kill-word       kill the word in front of the cursor
391 ^U              kill-line       delete entire line
392 ^V              quote-char      quote the next typed key
393 <Up>            history-up      recall previous string from history
394 <Down>          history-down    recall next string from history
395 <BackSpace>     backspace       kill the char in front of the cursor
396 Esc u           upcase-word     convert word to upper case
397 Esc l           downcase-word   convert word to lower case
398 Esc c           capitalize-word capitalize the word
399 ^G              n/a             abort
400 <Return>        n/a             finish editing
401 </verb></tscreen>
402
403 You can remap the <em/editor/ functions using the <ref id="bind" name="bind">
404 command.  For example, to make the <em/Delete/ key delete the character in
405 front of the cursor rather than under, you could use
406
407 <tt/bind editor &lt;delete&gt; backspace/
408
409 <!--}}}--> 
410
411 <sect>Reading Mail - The Index and Pager <!--{{{--> 
412 <p>
413
414 Similar to many other mail clients, there are two modes in which mail is
415 read in Mutt-ng.  The first is the index of messages in the mailbox, which is
416 called the ``index'' in Mutt-ng.  The second mode is the display of the
417 message contents.  This is called the ``pager.''
418
419 The next few sections describe the functions provided in each of these
420 modes.
421
422 <sect1>The Message Index
423 <p>
424
425 <tscreen><verb>
426 c               change to a different mailbox
427 ESC c           change to a folder in read-only mode
428 C               copy the current message to another mailbox
429 ESC C           decode a message and copy it to a folder
430 ESC s           decode a message and save it to a folder
431 D               delete messages matching a pattern
432 d               delete the current message
433 F               mark as important
434 l               show messages matching a pattern
435 N               mark message as new
436 o               change the current sort method
437 O               reverse sort the mailbox
438 q               save changes and exit
439 s               save-message
440 T               tag messages matching a pattern
441 t               toggle the tag on a message
442 ESC t           toggle tag on entire message thread
443 U               undelete messages matching a pattern
444 u               undelete-message
445 v               view-attachments
446 x               abort changes and exit
447 <Return>        display-message
448 <Tab>           jump to the next new message
449 @               show the author's full e-mail address
450 $               save changes to mailbox
451 /               search
452 ESC /           search-reverse
453 ^L              clear and redraw the screen
454 ^T              untag messages matching a pattern
455 </verb></tscreen>
456
457 <sect2>Status Flags
458 <p>
459
460 In addition to who sent the message and the subject, a short summary of
461 the disposition of each message is printed beside the message number.
462 Zero or more of the following ``flags'' may appear, which mean:
463
464 <p>
465 <descrip>
466 <tag/D/ message is deleted (is marked for deletion)
467 <tag/d/ message have attachments marked for deletion
468 <tag/K/ contains a PGP public key
469 <tag/N/ message is new
470 <tag/O/ message is old
471 <tag/P/ message is PGP encrypted
472 <tag/r/ message has been replied to
473 <tag/S/ message is signed, and the signature is succesfully verified
474 <tag/s/ message is signed
475 <tag/!/ message is flagged
476 <tag/*/ message is tagged
477 </descrip>
478
479 Some of the status flags can be turned on or off using
480 <itemize>
481 <item><bf/set-flag/ (default: w)
482 <item><bf/clear-flag/ (default: W)
483 </itemize>
484
485 <p>
486 Furthermore, the following flags reflect who the message is addressed
487 to.  They can be customized with the
488 <ref id="to_chars" name="&dollar;to&lowbar;chars"> variable.
489
490 <p>
491 <descrip>
492 <tag/+/ message is to you and you only
493 <tag/T/ message is to you, but also to or cc'ed to others
494 <tag/C/ message is cc'ed to you
495 <tag/F/ message is from you
496 <tag/L/ message is sent to a subscribed mailing list
497 </descrip>
498
499 <sect1>The Pager
500 <p>
501
502 By default, Mutt-ng uses its builtin pager to display the body of messages.
503 The pager is very similar to the Unix program <em/less/ though not nearly as
504 featureful.
505
506 <tscreen><verb>
507 <Return>        go down one line
508 <Space>         display the next page (or next message if at the end of a message)
509 -               go back to the previous page
510 n               search for next match
511 S               skip beyond quoted text
512 T               toggle display of quoted text
513 ?               show key bindings
514 /               search for a regular expression (pattern)
515 ESC /           search backwards for a regular expression
516 \               toggle search pattern coloring
517 ^               jump to the top of the message
518 </verb></tscreen>
519
520 In addition, many of the functions from the <em/index/ are available in
521 the pager, such as <em/delete-message/ or <em/copy-message/ (this is one
522 advantage over using an external pager to view messages).
523
524 Also, the internal pager supports a couple other advanced features. For
525 one, it will accept and translate the ``standard'' nroff sequences for
526 bold and underline. These sequences are a series of either the letter,
527 backspace (^H), the letter again for bold or the letter, backspace,
528 ``&lowbar;'' for denoting underline. Mutt-ng will attempt to display these
529 in bold and underline respectively if your terminal supports them. If
530 not, you can use the bold and underline <ref id="color" name="color">
531 objects to specify a color or mono attribute for them.
532
533 Additionally, the internal pager supports the ANSI escape sequences for
534 character attributes.  Mutt-ng translates them into the correct color and
535 character settings.  The sequences Mutt-ng supports are:
536
537 <p>
538 <tscreen><verb>
539 ESC [ Ps;Ps;Ps;...;Ps m
540 where Ps =
541 0    All Attributes Off
542 1    Bold on
543 4    Underline on
544 5    Blink on
545 7    Reverse video on
546 3x   Foreground color is x
547 4x   Background color is x
548
549 Colors are
550 0    black
551 1    red
552 2    green
553 3    yellow
554 4    blue
555 5    magenta
556 6    cyan
557 7    white
558 </verb></tscreen>
559
560 Mutt-ng uses these attributes for handling text/enriched messages, and they
561 can also be used by an external <ref id="auto_view" name="autoview">
562 script for highlighting purposes.  <bf/Note:/ If you change the colors for your
563 display, for example by changing the color associated with color2 for
564 your xterm, then that color will be used instead of green.
565
566 <sect1>Threaded Mode<label id="threads">
567 <p>
568 When the mailbox is <ref id="sort" name="sorted"> by <em/threads/, there are
569 a few additional functions available in the <em/index/ and <em/pager/ modes.
570
571 <tscreen><verb>
572 ^D      delete-thread           delete all messages in the current thread
573 ^U      undelete-thread         undelete all messages in the current thread
574 ^N      next-thread             jump to the start of the next thread
575 ^P      previous-thread         jump to the start of the previous thread
576 ^R      read-thread             mark the current thread as read
577 ESC d   delete-subthread        delete all messages in the current subthread
578 ESC u   undelete-subthread      undelete all messages in the current subthread
579 ESC n   next-subthread          jump to the start of the next subthread
580 ESC p   previous-subthread      jump to the start of the previous subthread
581 ESC r   read-subthread          mark the current subthread as read
582 ESC t   tag-thread              toggle the tag on the current thread
583 ESC v   collapse-thread         toggle collapse for the current thread
584 ESC V   collapse-all            toggle collapse for all threads
585 P       parent-message          jump to parent message in thread
586 </verb></tscreen>
587
588 <bf/Note:/ Collapsing a thread displays only the first message
589 in the thread and hides the others. This is useful when threads
590 contain so many messages that you can only see a handful of threads on
591 the screen. See %M in <ref id="index_format"name="&dollar;index&lowbar;format">.
592 For example, you could use "&percnt;?M?(#&percnt;03M)&amp;(&percnt;4l)?" in <ref
593 id="index_format"name="&dollar;index&lowbar;format"> to optionally
594 display the number of hidden messages if the thread is collapsed.
595
596 See also: <ref id="strict_threads" name="&dollar;strict&lowbar;threads">.
597
598 <sect1>Miscellaneous Functions
599 <p><bf/create-alias/<label id="create-alias"> (default: a)<newline>
600
601 Creates a new alias based upon the current message (or prompts for a
602 new one).  Once editing is complete, an <ref id="alias" name="alias">
603 command is added to the file specified by the <ref id="alias_file"
604 name="&dollar;alias&lowbar;file"> variable for future use. <bf/Note:/
605 Specifying an <ref id="alias_file" name="&dollar;alias&lowbar;file">
606 does not add the aliases specified there-in, you must also <ref
607 id="source" name="source"> the file.
608
609 <p><bf/check-traditional-pgp/<label id="check-traditional-pgp"> (default: ESC P)<newline>
610
611 This function will search the current message for content signed or
612 encrypted with PGP the "traditional" way, that is, without proper
613 MIME tagging.  Technically, this function will temporarily change
614 the MIME content types of the body parts containing PGP data; this
615 is similar to the <ref id="edit-type" name="edit-type"> function's
616 effect.
617
618
619 <p><bf/display-toggle-weed/<label id="display-toggle-weed"> (default: h)<newline>
620
621 Toggles the weeding of message header fields specified by <ref id="ignore"
622 name="ignore"> commands.
623
624 <p><bf/edit/<label id="edit"> (default: e)<newline>
625
626 This command (available in the ``index'' and ``pager'') allows you to
627 edit the raw current message as it's present in the mail folder.
628 After you have finished editing, the changed message will be
629 appended to the current folder, and the original message will be
630 marked for deletion.
631
632 <p><bf/edit-type/<label id="edit-type"><newline>
633 (default: ^E on the attachment menu, and in the pager and index menus; ^T on the
634 compose menu)
635
636 This command is used to temporarily edit an attachment's content
637 type to fix, for instance, bogus character set parameters.  When
638 invoked from the index or from the pager, you'll have the
639 opportunity to edit the top-level attachment's content type.  On the
640 <ref id="attach_menu" name="attachment menu">, you can change any
641 attachment's content type. These changes are not persistent, and get
642 lost upon changing folders.
643
644 Note that this command is also available on the <ref
645 id="compose_menu" name="compose menu">.  There, it's used to
646 fine-tune the properties of attachments you are going to send.
647
648 <p><bf/enter-command/<label id="enter-command"> (default: ``:'')<newline>
649
650 This command is used to execute any command you would normally put in a
651 configuration file.  A common use is to check the settings of variables, or
652 in conjunction with <ref id="macro" name="macros"> to change settings on the
653 fly.
654
655 <p><bf/extract-keys/<label id="extract-keys"> (default: ^K)<newline>
656
657 This command extracts PGP public keys from the current or tagged
658 message(s) and adds them to your PGP public key ring.
659
660 <p><bf/forget-passphrase/<label id="forget-passphrase"> (default:
661 ^F)<newline> 
662
663 This command wipes the passphrase(s) from memory. It is useful, if
664 you misspelled the passphrase.
665
666 <p><bf/list-reply/<label id="list-reply"> (default: L)<newline>
667
668 Reply to the current or tagged message(s) by extracting any addresses which
669 match the regular expressions given by the <ref id="lists" name="lists or subscribe">
670 commands, but also honor any <tt/Mail-Followup-To/ header(s) if the
671 <ref id="honor_followup_to" name="&dollar;honor&lowbar;followup&lowbar;to">
672 configuration variable is set.  Using this when replying to messages posted
673 to mailing lists helps avoid duplicate copies being sent to the author of
674 the message you are replying to.
675
676 <bf/pipe-message/<label id="pipe-message"> (default: |)<newline>
677
678 Asks for an external Unix command and pipes the current or
679 tagged message(s) to it.  The variables <ref id="pipe_decode"
680 name="&dollar;pipe&lowbar;decode">, <ref id="pipe_split"
681 name="&dollar;pipe&lowbar;split">, <ref id="pipe_sep"
682 name="&dollar;pipe&lowbar;sep"> and <ref id="wait_key"
683 name="&dollar;wait&lowbar;key"> control the exact behavior of this
684 function.
685
686 <bf/resend-message/<label id="resend-message"> (default: ESC e)<newline>
687
688 With resend-message, mutt takes the current message as a template for a
689 new message.  This function is best described as "recall from arbitrary
690 folders".  It can conveniently be used to forward MIME messages while
691 preserving the original mail structure. Note that the amount of headers
692 included here depends on the value of the <ref id="weed" name="&dollar;weed">
693 variable.
694
695 This function is also available from the attachment menu. You can use this
696 to easily resend a message which was included with a bounce message
697 as a message/rfc822 body part.
698
699 <bf/shell-escape/<label id="shell-escape"> (default: !)<newline>
700
701 Asks for an external Unix command and executes it.  The <ref
702 id="wait_key" name="&dollar;wait&lowbar;key"> can be used to control
703 whether Mutt-ng will wait for a key to be pressed when the command returns
704 (presumably to let the user read the output of the command), based on
705 the return status of the named command.
706
707 <bf/toggle-quoted/<label id="toggle-quoted"> (default: T)<newline>
708
709 The <em/pager/ uses the <ref id="quote_regexp"
710 name="&dollar;quote&lowbar;regexp"> variable to detect quoted text when
711 displaying the body of the message.  This function toggles the display
712 of the quoted material in the message.  It is particularly useful when
713 are interested in just the response and there is a large amount of
714 quoted text in the way.
715
716 <bf/skip-quoted/<label id="skip-quoted"> (default: S)<newline>
717
718 This function will go to the next line of non-quoted text which come
719 after a line of quoted text in the internal pager.
720
721 <!--}}}--> 
722
723 <sect>Sending Mail <!--{{{--> 
724 <p>
725
726 The following bindings are available in the <em/index/ for sending
727 messages.
728
729 <tscreen><verb>
730 m       compose         compose a new message
731 r       reply           reply to sender
732 g       group-reply     reply to all recipients
733 L       list-reply      reply to mailing list address
734 f       forward         forward message
735 b       bounce          bounce (remail) message
736 ESC k   mail-key        mail a PGP public key to someone
737 </verb></tscreen>
738
739 Bouncing a message sends the message as is to the recipient you
740 specify.  Forwarding a message allows you to add comments or
741 modify the message you are forwarding.  These items are discussed
742 in greater detail in the next chapter <ref id="forwarding_mail"
743 name="``Forwarding and Bouncing Mail''">.
744
745 <sect1>Composing new messages <!--{{{--> 
746
747 <p>When you want to send an email using mutt-ng, simply press <tt/m/ on
748 your keyboard. Then, mutt-ng asks for the recipient via a prompt in
749 the last line:
750
751 <verb>
752 To: 
753 </verb>
754
755 <p>After you've finished entering the recipient(s), press return. If you
756 want to send an email to more than one recipient, separate the email
757 addresses using the comma "<tt/,/". Mutt-ng then asks you for the email
758 subject. Again, press return after you've entered it. After that, mutt-ng
759 got the most important information from you, and starts up an editor
760 where you can then enter your email.
761
762 <p>The editor that is called is selected in the following way: you
763 can e.g. set it in the mutt-ng configuration:
764
765 <verb>
766 set editor = "vim +/^$/ -c ':set tw=72'"
767 set editor = "nano"
768 set editor = "emacs"
769 </verb>
770
771 <p>If you don't set your preferred editor in your configuration, mutt-ng
772 first looks whether the environment variable <tt/$VISUAL/ is set, and if
773 so, it takes its value as editor command. Otherwise, it has a look
774 at <tt/$EDITOR/ and takes its value if it is set. If no editor command
775 can be found, mutt-ng simply assumes <tt/vi/ to be the default editor,
776 since it's the most widespread editor in the Unix world and it's pretty
777 safe to assume that it is installed and available.
778
779 <p>When you've finished entering your message, save it and quit your 
780 editor. Mutt-ng will then present you with a summary screen, the compose menu. 
781 On the top, you see a summary of the most important available key commands.
782 Below that, you see the sender, the recipient(s), Cc and/or Bcc 
783 recipient(s), the subject, the reply-to address, and optionally
784 information where the sent email will be stored and whether it should
785 be digitally signed and/or encrypted.
786
787 <p>Below that, you see a list of "attachments". The mail you've just
788 entered before is also an attachment, but due to its special type
789 (it's plain text), it will be displayed as the normal message on
790 the receiver's side.
791
792 <p>At this point, you can add more attachments, pressing <tt/a/, you
793 can edit the recipient addresses, pressing <tt/t/ for the "To:" field,
794 <tt/c/ for the "Cc:" field, and <tt/b/ for the "Bcc: field. You can
795 also edit the subject the subject by simply pressing <tt/s/ or the
796 email message that you've entered before by pressing <tt/e/. You will
797 then again return to the editor. You can even edit the sender, by pressing
798 <tt/&lt;esc&gt;f/, but this shall only be used with caution.
799
800 <p>Alternatively, you can configure mutt-ng in a way that most of the
801 above settings can be edited using the editor. Therefore, you only
802 need to add the following to your configuration:
803
804 <verb>
805 set edit_headers
806 </verb>
807
808 <p>Once you have finished editing the body of your mail message, you are
809 returned to the <em/compose/ menu.  The following options are available:
810
811 <tscreen><verb>
812 a       attach-file             attach a file
813 A       attach-message          attach message(s) to the message
814 ESC k   attach-key              attach a PGP public key
815 d       edit-description        edit description on attachment
816 D       detach-file             detach a file
817 t       edit-to                 edit the To field
818 ESC f   edit-from               edit the From field
819 r       edit-reply-to           edit the Reply-To field
820 c       edit-cc                 edit the Cc field
821 b       edit-bcc                edit the Bcc field
822 y       send-message            send the message
823 s       edit-subject            edit the Subject
824 S       smime-menu              select S/MIME options
825 f       edit-fcc                specify an ``Fcc'' mailbox
826 p       pgp-menu                select PGP options
827 P       postpone-message        postpone this message until later
828 q       quit                    quit (abort) sending the message
829 w       write-fcc               write the message to a folder
830 i       ispell                  check spelling (if available on your system)
831 ^F      forget-passphrase       wipe passphrase(s) from memory
832 </verb></tscreen>
833
834 <bf/Note:/ The attach-message function will prompt you for a folder to
835 attach messages from. You can now tag messages in that folder and they
836 will be attached to the message you are sending. Note that certain
837 operations like composing a new mail, replying, forwarding, etc. are
838 not permitted when you are in that folder. The %r in <ref
839 id="status_format" name="&dollar;status&lowbar;format"> will change to
840 a 'A' to indicate that you are in attach-message mode.
841
842 <!--}}}--> 
843
844 <sect1>Replying <!--{{{--> 
845
846     <sect2>Simple Replies  <!--{{{--> 
847
848     <p>When you want to reply to an email message, select it in the index
849     menu and then press <tt/r/. Mutt-ng's behaviour is then similar to the 
850     behaviour when you compose a message: first, you will be asked for
851     the recipient, then for the subject, and then, mutt-ng will start
852     the editor with the quote attribution and the quoted message. This
853     can e.g. look like the example below.
854
855     <verb>
856 On Mon, Mar 07, 2005 at 05:02:12PM +0100, Michael Svensson wrote:
857 &gt; Bill, can you please send last month's progress report to Mr. 
858 &gt; Morgan? We also urgently need the cost estimation for the new 
859 &gt; production server that we want to set up before our customer's 
860 &gt; project will go live.
861     </verb>
862
863     <p>You can start editing the email message. It is strongly
864     recommended to put your answer <em/below/ the quoted text and to
865     only quote what is really necessary and that you refer to. Putting
866     your answer on top of the quoted message, is, although very
867     widespread, very often not considered to be a polite way to answer
868     emails.
869
870     <p>The quote attribution is configurable, by default it is set to
871     <verb>
872 set attribution = "On %d, %n wrote:"
873     </verb>
874
875     <p>It can also be set to something more compact, e.g.
876     <verb>
877 set attribution = "attribution="* %n &lt;%a&gt; [%(%y-%m-%d %H:%M)]:"
878     </verb>
879
880     <p>The example above results in the following attribution:
881     <verb>
882 * Michael Svensson &lt;svensson@foobar.com&gt; [05-03-06 17:02]:
883 &gt; Bill, can you please send last month's progress report to Mr. 
884 &gt; Morgan? We also urgently need the cost estimation for the new 
885 &gt; production server that we want to set up before our customer's 
886 &gt; project will go live.
887     </verb>
888
889     <p>Generally, try to keep your attribution short yet
890     information-rich. It is <em/not/ the right place for witty quotes,
891     long "attribution" novels or anything like that: the right place
892     for such things is - if at all - the email signature at the very
893     bottom of the message.
894
895     <p>When you're done with writing your message, save and quit the
896     editor. As before, you will return to the compose menu, which is
897     used in the same way as before.
898
899     <!--}}}--> 
900
901     <sect2>Group Replies <!--{{{--> 
902
903     <p>In the situation where a group of people uses email as a
904     discussion, most of the emails will have one or more recipients,
905     and probably several "Cc:" recipients. The group reply functionality
906     ensures that when you press <tt/g/ instead of <tt/r/ to do a reply,
907     each and every recipient that is contained in the original message
908     will receive a copy of the message, either as normal recipient or
909     as "Cc:" recipient.
910
911     <!--}}}--> 
912
913     <sect2>List Replies <!--{{{--> 
914
915     <p>When you use mailing lists, it's generally better to send your
916     reply to a message only to the list instead of the list and the
917     original author. To make this easy to use, mutt-ng features list
918     replies.
919
920     <p>To do a list reply, simply press <tt/L/. If the email contains
921     a <tt/Mail-Followup-To:/ header, its value will be used as reply
922     address. Otherwise, mutt-ng searches through all mail addresses in
923     the original message and tries to match them a list of regular
924     expressions which can be specified using the <tt/lists/ command. 
925     If any of the regular expression matches, a mailing
926     list address has been found, and it will be used as reply address.
927
928     <verb>
929 lists linuxevent@luga\.at vuln-dev@ mutt-ng-users@
930     </verb>
931
932     <p>Nowadays, most mailing list software like GNU Mailman adds a
933     <tt/Mail-Followup-To:/ header to their emails anyway, so setting
934     <tt/lists/ is hardly ever necessary in practice.
935
936     <!--}}}--> 
937
938 <!--}}}--> 
939
940 <sect1>Editing the message header <!--{{{--> 
941 <p>
942 When editing the header of your outgoing message, there are a couple of
943 special features available.
944
945 If you specify<newline>
946 <tt/Fcc:/ <em/filename/<newline>
947 Mutt-ng will pick up <em/filename/
948 just as if you had used the <em/edit-fcc/ function in the <em/compose/ menu.
949
950 You can also attach files to your message by specifying<newline>
951 <tt/Attach:/ <em/filename/  &lsqb; <em/description/ &rsqb;<newline>
952 where <em/filename/ is the file to attach and <em/description/ is an
953 optional string to use as the description of the attached file.
954
955 When replying to messages, if you remove the <em/In-Reply-To:/ field from
956 the header field, Mutt-ng will not generate a <em/References:/ field, which
957 allows you to create a new message thread.
958
959 Also see <ref id="edit_headers" name="edit&lowbar;headers">.
960
961 <!--}}}--> 
962
963 <sect1>Using Mutt-ng with PGP <!--{{{--> 
964
965 <p>
966 If you want to use PGP, you can specify 
967
968 <tt/Pgp:/ &lsqb; <tt/E/ | <tt/S/ | <tt/S/<em/&lt;id&gt;/ &rsqb; <newline>
969
970 ``E'' encrypts, ``S'' signs and
971 ``S&lt;id&gt;'' signs with the given key, setting <ref
972 id="pgp_sign_as" name="&dollar;pgp&lowbar;sign&lowbar;as"> permanently.
973
974 If you have told mutt to PGP encrypt a message, it will guide you
975 through a key selection process when you try to send the message.
976 Mutt-ng will not ask you any questions about keys which have a
977 certified user ID matching one of the message recipients' mail
978 addresses.  However, there may be situations in which there are
979 several keys, weakly certified user ID fields, or where no matching
980 keys can be found.
981
982 In these cases, you are dropped into a menu with a list of keys from
983 which you can select one.  When you quit this menu, or mutt can't
984 find any matching keys, you are prompted for a user ID.  You can, as
985 usually, abort this prompt using <tt/^G/.  When you do so, mutt will
986 return to the compose screen.
987
988 Once you have successfully finished the key selection, the message
989 will be encrypted using the selected public keys, and sent out.
990
991 Most fields of the entries in the key selection menu (see also <ref
992 id="pgp_entry_format" name="&dollar;pgp&lowbar;entry&lowbar;format">) 
993 have obvious meanings.  But some explanations on the capabilities, flags, 
994 and validity fields are in order.
995
996 The flags sequence (&percnt;f) will expand to one of the following flags:
997 <tscreen><verb>
998 R            The key has been revoked and can't be used.
999 X            The key is expired and can't be used.
1000 d            You have marked the key as disabled.
1001 c            There are unknown critical self-signature 
1002              packets.
1003 </verb></tscreen>
1004
1005 The capabilities field (&percnt;c) expands to a two-character sequence
1006 representing a key's capabilities.  The first character gives
1007 the key's encryption capabilities: A minus sign (<bf/-/) means 
1008 that the key cannot be used for encryption.  A dot (<bf/./) means that
1009 it's marked as a signature key in one of the user IDs, but may 
1010 also be used for encryption.  The letter <bf/e/ indicates that 
1011 this key can be used for encryption.
1012  
1013 The second character indicates the key's signing capabilities.  Once 
1014 again, a ``<bf/-/'' implies ``not for signing'', ``<bf/./'' implies
1015 that the key is marked as an encryption key in one of the user-ids, and
1016 ``<bf/s/'' denotes a key which can be used for signing.
1017
1018 Finally, the validity field (%t) indicates how well-certified a user-id
1019 is.  A question mark (<bf/?/) indicates undefined validity, a minus 
1020 character (<bf/-/) marks an untrusted association, a space character 
1021 means a partially trusted association, and a plus character (<bf/+/) 
1022 indicates complete validity.
1023
1024 <!--}}}--> 
1025
1026 <sect1>Sending anonymous messages via mixmaster <!--{{{--> 
1027
1028 <p>
1029 You may also have configured mutt to co-operate with Mixmaster, an
1030 anonymous remailer.  Mixmaster permits you to send your messages
1031 anonymously using a chain of remailers. Mixmaster support in mutt is for 
1032 mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03. 
1033 It does not support earlier versions or the later so-called version 3 betas, 
1034 of which the latest appears to be called 2.9b23.
1035
1036 To use it, you'll have to obey certain restrictions.  Most
1037 important, you cannot use the <tt/Cc/ and <tt/Bcc/ headers.  To tell
1038 Mutt-ng to use mixmaster, you have to select a remailer chain, using
1039 the mix function on the compose menu.  
1040
1041 The chain selection screen is divided into two parts.  In the
1042 (larger) upper part, you get a list of remailers you may use.  In
1043 the lower part, you see the currently selected chain of remailers.
1044
1045 You can navigate in the chain using the <tt/chain-prev/ and
1046 <tt/chain-next/ functions, which are by default bound to the left
1047 and right arrows and to the <tt/h/ and <tt/l/ keys (think vi
1048 keyboard bindings).  To insert a remailer at the current chain
1049 position, use the <tt/insert/ function.  To append a remailer behind
1050 the current chain position, use <tt/select-entry/ or <tt/append/.
1051 You can also delete entries from the chain, using the corresponding
1052 function.  Finally, to abandon your changes, leave the menu, or
1053 <tt/accept/ them pressing (by default) the <tt/Return/ key.
1054
1055 Note that different remailers do have different capabilities,
1056 indicated in the &percnt;c entry of the remailer menu lines (see
1057 <ref id="mix_entry_format"
1058 name="&dollar;mix&lowbar;entry&lowbar;format">).  Most important is
1059 the ``middleman'' capability, indicated by a capital ``M'': This
1060 means that the remailer in question cannot be used as the final
1061 element of a chain, but will only forward messages to other
1062 mixmaster remailers.  For details on the other capabilities, please
1063 have a look at the mixmaster documentation.
1064
1065 <!--}}}--> 
1066
1067 <!--}}}--> 
1068
1069 <sect>Forwarding and Bouncing Mail<label id="forwarding_mail"> <!--{{{--> 
1070
1071 <p>Often, it is necessary to forward mails to other people.
1072 Therefore, mutt-ng supports forwarding messages in two different
1073 ways.
1074
1075 <p>The first one is regular forwarding, as you probably know it from
1076 other mail clients. You simply press <tt/f/, enter the recipient
1077 email address, the subject of the forwarded email, and then you can
1078 edit the message to be forwarded in the editor. The forwarded
1079 message is separated from the rest of the message via the two
1080 following markers:
1081
1082 <verb>
1083 ----- Forwarded message from Lucas User <luser@example.com> -----
1084
1085 From: Lucas User <luser@example.com>
1086 Date: Thu, 02 Dec 2004 03:08:34 +0100
1087 To: Michael Random <mrandom@example.com>
1088 Subject: Re: blackmail
1089
1090 Pay me EUR 50,000.- cash or your favorite stuffed animal will die
1091 a horrible death.
1092
1093
1094 ----- End forwarded message -----</verb>
1095
1096 <p>When you're done with editing the mail, save and quit the editor,
1097 and you will return to the compose menu, the same menu you also
1098 encounter when composing or replying to mails.
1099
1100 <p>The second mode of forwarding emails with mutt-ng is the
1101 so-called <em/bouncing/: when you bounce an email to another
1102 address, it will be sent in practically the same format you send it
1103 (except for headers that are created during transporting the
1104 message). To bounce a message, press <tt/b/ and enter the recipient
1105 email address. By default, you are then asked whether you really
1106 want to bounce the message to the specified recipient. If you answer
1107 with yes, the message will then be bounced.
1108
1109 <p>To the recipient, the bounced email will look as if he got it
1110 like a regular email where he was <tt/Bcc:/ recipient. The only
1111 possibility to find out whether it was a bounced email is to
1112 carefully study the email headers and to find out which host really
1113 sent the email.
1114
1115 <!--}}}--> 
1116
1117 <sect>Postponing Mail<label id="postponing_mail"> <!--{{{--> 
1118 <p>
1119
1120 At times it is desirable to delay sending a message that you have
1121 already begun to compose.  When the <em/postpone-message/ function is
1122 used in the <em/compose/ menu, the body of your message and attachments
1123 are stored in the mailbox specified by the <ref id="postponed"
1124 name="&dollar;postponed"> variable.  This means that you can recall the
1125 message even if you exit Mutt-ng and then restart it at a later time.
1126
1127 Once a message is postponed, there are several ways to resume it.  From the
1128 command line you can use the ``-p'' option, or if you <em/compose/ a new
1129 message from the <em/index/ or <em/pager/ you will be prompted if postponed
1130 messages exist.  If multiple messages are currently postponed, the
1131 <em/postponed/ menu will pop up and you can select which message you would
1132 like to resume.
1133
1134 <bf/Note:/ If you postpone a reply to a message, the reply setting of
1135 the message is only updated when you actually finish the message and
1136 send it.  Also, you must be in the same folder with the message you
1137 replied to for the status of the message to be updated.
1138
1139 See also the <ref id="postpone" name="&dollar;postpone"> quad-option.
1140
1141 <!--}}}--> 
1142
1143 <!--}}}--> 
1144
1145 <chapt>Configuration <!--{{{--> 
1146
1147 <sect>Locations of Configuration Files <!--{{{--> 
1148 <p>While the default configuration (or ``preferences'') make Mutt-ng usable right out
1149 of the box, it is often desirable to tailor Mutt-ng to suit your own tastes. When
1150 Mutt-ng is first invoked, it will attempt to read the ``system'' configuration
1151 file (defaults set by your local system administrator), unless the ``-n'' <ref
1152 id="commandline" name="command line"> option is specified.  This file is
1153 typically <tt>/usr/local/share/muttng/Muttngrc</tt> or <tt>/etc/Muttngrc</tt>,
1154 Mutt-ng users will find this file in <tt>/usr/local/share/muttng/Muttrc</tt> or
1155 <tt>/etc/Muttngrc</tt>. Mutt will next look for a file named <tt>.muttrc</tt>
1156 in your home directory, Mutt-ng will look for <tt>.muttngrc</tt>.  If this file
1157 does not exist and your home directory has a subdirectory named <tt/.mutt/,
1158 mutt try to load a file named <tt>.muttng/muttngrc</tt>. 
1159
1160 <tt>.muttrc</tt> (or <tt>.muttngrc</tt> for Mutt-ng) is the file where you will
1161 usually place your <ref id="commands" name="commands"> to configure Mutt-ng.
1162
1163 <!--}}}--> 
1164
1165 <sect>Basic Syntax of Initialization Files<label id="muttrc-syntax"> <!--{{{--> 
1166 <p>
1167
1168 An initialization file consists of a series of <ref id="commands"
1169 name="commands">.  Each line of the file may contain one or more commands.
1170 When multiple commands are used, they must be separated by a semicolon (;).
1171 <tscreen><verb>
1172 set realname='Mutt-ng user' ; ignore x-
1173 </verb></tscreen>
1174 The hash mark, or pound sign
1175 (``&num;''), is used as a ``comment'' character. You can use it to
1176 annotate your initialization file. All text after the comment character
1177 to the end of the line is ignored. For example,
1178
1179 <tscreen><verb>
1180 my_hdr X-Disclaimer: Why are you listening to me? &num; This is a comment
1181 </verb></tscreen>
1182
1183 Single quotes (') and double quotes (&dquot;) can be used to quote strings
1184 which contain spaces or other special characters.  The difference between
1185 the two types of quotes is similar to that of many popular shell programs,
1186 namely that a single quote is used to specify a literal string (one that is
1187 not interpreted for shell variables or quoting with a backslash &lsqb;see
1188 next paragraph&rsqb;), while double quotes indicate a string for which
1189 should be evaluated.  For example, backtics are evaluated inside of double
1190 quotes, but <bf/not/ for single quotes.
1191
1192 &bsol; quotes the next character, just as in shells such as bash and zsh.
1193 For example, if want to put quotes ``&dquot;'' inside of a string, you can use
1194 ``&bsol;'' to force the next character to be a literal instead of interpreted
1195 character.
1196 <tscreen><verb>
1197 set realname="Michael \"MuttDude\" Elkins"
1198 </verb></tscreen>
1199
1200 ``&bsol;&bsol;'' means to insert a literal ``&bsol;'' into the line.
1201 ``&bsol;n'' and ``&bsol;r'' have their usual C meanings of linefeed and
1202 carriage-return, respectively.
1203
1204 A &bsol; at the end of a line can be used to split commands over
1205 multiple lines, provided that the split points don't appear in the
1206 middle of command names.
1207
1208 Please note that, unlike the various shells, mutt-ng interprets a ``&bsol;''
1209 at the end of a line also in comments. This allows you to disable a command
1210 split over multiple lines with only one ``&num;''.
1211
1212 <tscreen><verb>
1213 # folder-hook . \
1214   set realname="Michael \"MuttDude\" Elkins"
1215 </verb></tscreen>
1216
1217 When testing your config files, beware the following caveat. The backslash
1218 at the end of the commented line extends the current line with the next line
1219 - then referred to as a ``continuation line''.  As the first line is
1220 commented with a hash (&num;) all following continuation lines are also
1221 part of a comment and therefore are ignored, too. So take care of comments
1222 when continuation lines are involved within your setup files!
1223
1224 Abstract example:
1225  
1226 <tscreen><verb>
1227 line1\
1228 line2a # line2b\
1229 line3\
1230 line4
1231 line5
1232 </verb></tscreen>
1233
1234 line1 ``continues'' until line4. however, the part after the &num; is a
1235 comment which includes line3 and line4. line5 is a new line of its own and
1236 thus is interpreted again.
1237
1238 The commands understood by mutt are explained in the next paragraphs.
1239 For a complete list, see the <ref id="commands" name="command reference">.
1240
1241 <!--}}}--> 
1242
1243 <sect>Expansion within variables <!--{{{--> 
1244
1245   <p>Besides just assign static content to variables, there's plenty of
1246   ways of adding external and more or less dynamic content.
1247
1248   <sect1>Commands' Output 
1249
1250     <p>It is possible to substitute the output of a Unix command in an
1251     initialization file.  This is accomplished by enclosing the command
1252     in backquotes (``) as in, for example:
1253
1254 <tscreen><verb>
1255 my_hdr X-Operating-System: `uname -a`
1256 </verb></tscreen>
1257
1258     <p>The output of the Unix command ``uname -a'' will be substituted
1259     before the line is parsed. Note that since initialization files are
1260     line oriented, only the first line of output from the Unix command
1261     will be substituted.
1262
1263   <sect1>Environment Variables 
1264
1265     <p>UNIX environments can be accessed like the way it is done in
1266     shells like sh and bash: Prepend the name of the environment by a
1267     ``&dollar;'' sign. For example,
1268
1269 <tscreen><verb>
1270 set record=+sent_on_$HOSTNAME
1271 </verb></tscreen>
1272
1273     <p>sets the <ref id="record" name="&dollar;record"> variable to the
1274     string <em/+sent_on_/ and appends the value of the evironment
1275     variable <tt>&dollar;HOSTNAME</tt>.
1276
1277     <p><bf/Note:/ There will be no warning if an environment variable
1278     is not defined. The result will of the expansion will then be empty.
1279
1280   <sect1>Configuration Variables 
1281
1282     <p>As for environment variables, the values of all configuration
1283     variables as string can be used in the same way, too. For example,
1284
1285 <tscreen><verb>
1286 set imap_home_namespace = $folder
1287 </verb></tscreen>
1288
1289     <p>would set the value of <ref id="imap_home_namespace"
1290     name="&dollar;imap&lowbar;home&lowbar;namespace"> to the value to
1291     which <ref id="folder" name="&dollar;folder"> is <em/currently/ set
1292     to.
1293
1294     <p><bf/Note:/ There're no logical links established in such cases so
1295     that the the value for <ref id="imap_home_namespace"
1296     name="&dollar;imap&lowbar;home&lowbar;namespace"> won't change even
1297     if <ref id="folder" name="&dollar;folder"> gets changed.
1298
1299     <p><bf/Note:/ There will be no warning if a configuration variable
1300     is not defined or is empty. The result will of the expansion will
1301     then be empty.
1302
1303   <sect1>Self-Defined Variables 
1304
1305     <p>Mutt-ng flexibly allows users to define their own variables. To
1306     avoid conflicts with the standard set and to prevent misleading
1307     error messages, there's a reserved namespace for them: all
1308     user-defined variables must be prefixed with <tt/user_/ and can be
1309     used just like any ordinary configuration or environment
1310     variable.
1311
1312     <p>For example, to view the manual, users can either define two
1313     macros like the following
1314
1315 <tscreen><verb>
1316 macro generic &lt;F1&gt; "!less -r /path/to/manual" "Show manual"
1317 macro pager &lt;F1&gt; "!less -r /path/to/manual" "Show manual"
1318 </verb></tscreen>
1319
1320     <p>for <tt/generic/, <tt/pager/ and <tt/index/. The alternative is to
1321     define a custom variable like so:
1322
1323 <tscreen><verb>
1324 set user_manualcmd = "!less -r /path/to_manual"
1325 macro generic &lt;F1&gt; "$user_manualcmd&lt;enter&gt;" "Show manual"
1326 macro pager &lt;F1&gt; "$user_manualcmd&lt;enter&gt;" "Show manual"
1327 macro index &lt;F1&gt; "$user_manualcmd&lt;enter&gt;" "Show manual"
1328 </verb></tscreen>
1329
1330     <p>to re-use the command sequence as in:
1331
1332 <tscreen><verb>
1333 macro index &lt;F2&gt; "$user_manualcmd | grep '\^[ ]\\+~. '" "Show Patterns"
1334 </verb></tscreen>
1335
1336     <p>Using this feature, arbitrary sequences can be defined once and
1337     recalled and reused where necessary. More advanced scenarios could
1338     include to save a variable's value at the beginning of macro
1339     sequence and restore it at end.
1340
1341     <p>When the variable is first defined, the first value it gets
1342     assigned is also the initial value to which it can be reset using
1343     the <tt/reset/ command.
1344
1345     <p>The complete removal is done via the <tt/unset/ keyword.
1346
1347     <p>After the following sequence:
1348
1349 <tscreen><verb>
1350 set user_foo = 42
1351 set user_foo = 666
1352 </verb></tscreen>
1353
1354     <p>the variable <tt>$user_foo</tt> has a current value of 666 and an
1355     initial of 42. The query
1356
1357 <tscreen><verb>
1358 set ?user_foo
1359 </verb></tscreen>
1360
1361     <p>will show 666. After doing the reset via
1362
1363 <tscreen><verb>
1364 reset user_foo
1365 </verb></tscreen>
1366
1367     <p>a following query will give 42 as the result. After unsetting it
1368     via
1369
1370 <tscreen><verb>
1371 unset user_foo
1372 </verb></tscreen>
1373
1374     <p>any query or operation (except the noted expansion within other
1375     statements) will lead to an error message.
1376
1377   <sect1>Pre-Defined Variables 
1378
1379     <p>In order to allow users to share one setup over a number of
1380     different machines without having to change its contents, there's a
1381     number of pre-defined variables. These are prefixed with
1382     <tt/muttng_/ and are read-only, i.e. they cannot be set, unset or
1383     reset. The reference chapter lists all available variables.
1384
1385     <p><em> Please consult the local copy of your manual for their
1386     values as they may differ from different manual sources.</em> Where
1387     the manual is installed in can be queried (already using such a
1388     variable) by running:
1389
1390 <tscreen><verb>
1391 muttng -Q muttng_docdir
1392 </verb></tscreen>
1393
1394     <p>To extend the example for viewing the manual via self-defined
1395     variables, it can be made more readable and more portable by
1396     changing the real path in:
1397
1398 <tscreen><verb>
1399 set user_manualcmd = '!less -r /path/to_manual'
1400 </verb></tscreen>
1401
1402     <p>to:
1403
1404 <tscreen><verb>
1405 set user_manualcmd = "!less -r $muttng_docdir/manual.txt"
1406 </verb></tscreen>
1407
1408     <p>which works everywhere if a manual is installed.
1409
1410     <p>Please note that by the type of quoting, muttng determines when
1411     to expand these values: when it finds double quotes, the value will
1412     be expanded during reading the setup files but when it finds single
1413     quotes, it'll expand it at runtime as needed.
1414
1415     <p>For example, the statement
1416
1417 <tscreen><verb>
1418 folder-hook . "set user_current_folder = $muttng_folder_name"
1419 </verb></tscreen>
1420
1421     <p>will be already be translated to the following when reading the
1422     startup files:
1423
1424 <tscreen><verb>
1425 folder-hook . "set user_current_folder = some_folder"
1426 </verb></tscreen>
1427
1428     <p>with <tt/some_folder/ being the name of the first folder muttng
1429     opens. On the contrary,
1430
1431 <tscreen><verb>
1432 folder-hook . 'set user_current_folder = $muttng_folder_name'
1433 </verb></tscreen>
1434
1435     <p>will be executed at runtime because of the single quotes so that
1436     <tt/user_current_folder/ will always have the value of the currently
1437     opened folder.
1438
1439     <p>A more practical example is:
1440
1441 <tscreen><verb>
1442 folder-hook . 'source ~/.mutt/score-$muttng_folder_name'
1443 </verb></tscreen>
1444
1445     <p>which can be used to source files containing score commands
1446     depending on the folder the user enters.
1447
1448   <sect1>Type Conversions 
1449
1450     <p>A note about variable's types during conversion: internally
1451     values are stored in internal types but for any dump/query or set
1452     operation they're converted to and from string. That means that
1453     there's no need to worry about types when referencing any variable.
1454     As an example, the following can be used without harm (besides
1455     makeing muttng very likely behave strange):
1456
1457 <tscreen><verb>
1458 set read_inc = 100
1459 set folder = $read_inc
1460 set read_inc = $folder
1461 set user_magic_number = 42
1462 set folder = $user_magic_number
1463 </verb></tscreen>
1464
1465 <!--}}}-->
1466
1467 <sect>Defining/Using aliases<label id="alias"> <!--{{{--> 
1468 <p>
1469
1470 Usage: <tt/alias/ <em/key/ <em/address/ &lsqb; , <em/address/, ... &rsqb;
1471
1472 It's usually very cumbersome to remember or type out the address of someone
1473 you are communicating with.  Mutt-ng allows you to create ``aliases'' which map
1474 a short string to a full address.
1475
1476 <bf/Note:/ if you want to create an alias for a group (by specifying more than
1477 one address), you <bf/must/ separate the addresses with a comma (``,'').
1478
1479 To remove an alias or aliases (``*'' means all aliases):
1480
1481 <tt/unalias/ &lsqb; * | <em/key/ <em/.../ &rsqb;
1482
1483 <tscreen><verb>
1484 alias muttdude me@cs.hmc.edu (Michael Elkins)
1485 alias theguys manny, moe, jack
1486 </verb></tscreen>
1487
1488 Unlike other mailers, Mutt-ng doesn't require aliases to be defined
1489 in a special file.  The <tt/alias/ command can appear anywhere in
1490 a configuration file, as long as this file is <ref id="source"
1491 name="sourced">.  Consequently, you can have multiple alias files, or
1492 you can have all aliases defined in your muttrc.
1493
1494 On the other hand, the <ref id="create-alias" name="create-alias">
1495 function can use only one file, the one pointed to by the <ref
1496 id="alias_file" name="&dollar;alias&lowbar;file"> variable (which is
1497 <tt>&tilde;/.muttrc</tt> by default). This file is not special either,
1498 in the sense that Mutt-ng will happily append aliases to any file, but in
1499 order for the new aliases to take effect you need to explicitly <ref
1500 id="source" name="source"> this file too.
1501
1502 For example:
1503
1504 <tscreen><verb>
1505 source /usr/local/share/Mutt-ng.aliases
1506 source ~/.mail_aliases
1507 set alias_file=~/.mail_aliases
1508 </verb></tscreen>
1509
1510 To use aliases, you merely use the alias at any place in mutt where mutt
1511 prompts for addresses, such as the <em/To:/ or <em/Cc:/ prompt.  You can
1512 also enter aliases in your editor at the appropriate headers if you have the
1513 <ref id="edit_headers" name="&dollar;edit&lowbar;headers"> variable set.
1514
1515 In addition, at the various address prompts, you can use the tab character
1516 to expand a partial alias to the full alias.  If there are multiple matches,
1517 mutt will bring up a menu with the matching aliases.  In order to be
1518 presented with the full list of aliases, you must hit tab with out a partial
1519 alias, such as at the beginning of the prompt or after a comma denoting
1520 multiple addresses.
1521
1522 In the alias menu, you can select as many aliases as you want with the
1523 <em/select-entry/ key (default: RET), and use the <em/exit/ key
1524 (default: q) to return to the address prompt.
1525
1526 <!--}}}--> 
1527
1528 <sect>Changing the default key bindings<label id="bind"> <!--{{{--> 
1529 <p>
1530 Usage: <tt/bind/ <em/map/ <em/key/ <em/function/
1531
1532 This command allows you to change the default key bindings (operation
1533 invoked when pressing a key).
1534
1535 <em/map/ specifies in which menu the binding belongs.  Multiple maps may
1536 be specified by separating them with commas (no additional whitespace is
1537 allowed). The currently defined maps are:
1538
1539 <label id="maps">
1540 <descrip>
1541 <tag/generic/
1542 This is not a real menu, but is used as a fallback for all of the other
1543 menus except for the pager and editor modes.  If a key is not defined in
1544 another menu, Mutt-ng will look for a binding to use in this menu.  This allows
1545 you to bind a key to a certain function in multiple menus instead of having
1546 multiple bind statements to accomplish the same task.
1547 <tag/alias/
1548 The alias menu is the list of your personal aliases as defined in your
1549 muttrc.  It is the mapping from a short alias name to the full email
1550 address(es) of the recipient(s).
1551 <tag/attach/
1552 The attachment menu is used to access the attachments on received messages.
1553 <tag/browser/
1554 The browser is used for both browsing the local directory structure, and for
1555 listing all of your incoming mailboxes.
1556 <tag/editor/
1557 The editor is the line-based editor the user enters text data.
1558 <tag/index/
1559 The index is the list of messages contained in a mailbox.
1560 <tag/compose/
1561 The compose menu is the screen used when sending a new message.
1562 <tag/pager/
1563 The pager is the mode used to display message/attachment data, and help
1564 listings.
1565 <tag/pgp/
1566 The pgp menu is used to select the OpenPGP keys used for encrypting outgoing
1567 messages.
1568 <tag/postpone/
1569 The postpone menu is similar to the index menu, except is used when
1570 recalling a message the user was composing, but saved until later.
1571 </descrip>
1572
1573 <em/key/ is the key (or key sequence) you wish to bind.  To specify a
1574 control character, use the sequence <em/&bsol;Cx/, where <em/x/ is the
1575 letter of the control character (for example, to specify control-A use
1576 ``&bsol;Ca'').  Note that the case of <em/x/ as well as <em/&bsol;C/ is
1577 ignored, so that <em/&bsol;CA/, <em/&bsol;Ca/, <em/&bsol;cA/ and <em/&bsol;ca/ are all
1578 equivalent.  An alternative form is to specify the key as a three digit
1579 octal number prefixed with a ``&bsol;'' (for example <em/&bsol;177/ is
1580 equivalent to <em/&bsol;c?/).
1581
1582 In addition, <em/key/ may consist of:
1583
1584 <tscreen><verb>
1585 \t              tab
1586 <tab>           tab
1587 <backtab>       backtab / shift-tab
1588 \r              carriage return
1589 \n              newline
1590 \e              escape
1591 <esc>           escape
1592 <up>            up arrow
1593 <down>          down arrow
1594 <left>          left arrow
1595 <right>         right arrow
1596 <pageup>        Page Up
1597 <pagedown>      Page Down
1598 <backspace>     Backspace
1599 <delete>        Delete
1600 <insert>        Insert
1601 <enter>         Enter
1602 <return>        Return
1603 <home>          Home
1604 <end>           End
1605 <space>         Space bar
1606 <f1>            function key 1
1607 <f10>           function key 10
1608 </verb></tscreen>
1609
1610 <em/key/ does not need to be enclosed in quotes unless it contains a
1611 space (`` '').
1612
1613 <em/function/ specifies which action to take when <em/key/ is pressed.
1614 For a complete list of functions, see the <ref id="functions"
1615 name="reference">.  The special function <tt/noop/ unbinds the specified key
1616 sequence.
1617
1618 <!--}}}--> 
1619
1620 <sect>Defining aliases for character sets <label id="charset-hook"> <!--{{{--> 
1621 <p>
1622 Usage: <tt/charset-hook/ <em/alias/ <em/charset/<newline>
1623 Usage: <tt/iconv-hook/ <em/charset/ <em/local-charset/
1624
1625 The <tt/charset-hook/ command defines an alias for a character set.
1626 This is useful to properly display messages which are tagged with a
1627 character set name not known to mutt.
1628
1629 The <tt/iconv-hook/ command defines a system-specific name for a
1630 character set.  This is helpful when your systems character
1631 conversion library insists on using strange, system-specific names
1632 for character sets.
1633
1634 <!--}}}--> 
1635
1636 <sect>Setting variables based upon mailbox<label id="folder-hook"> <!--{{{--> 
1637 <p>
1638 Usage: <tt/folder-hook/ &lsqb;!&rsqb;<em/regexp/ <em/command/
1639
1640 It is often desirable to change settings based on which mailbox you are
1641 reading.  The folder-hook command provides a method by which you can execute
1642 any configuration command.  <em/regexp/ is a regular expression specifying
1643 in which mailboxes to execute <em/command/ before loading.  If a mailbox
1644 matches multiple folder-hook's, they are executed in the order given in the
1645 muttrc.
1646
1647 <bf/Note:/ if you use the ``!'' shortcut for <ref id="spoolfile"
1648 name="&dollar;spoolfile"> at the beginning of the pattern, you must place it
1649 inside of double or single quotes in order to distinguish it from the
1650 logical <em/not/ operator for the expression.
1651
1652 Note that the settings are <em/not/ restored when you leave the mailbox.
1653 For example, a command action to perform is to change the sorting method
1654 based upon the mailbox being read:
1655
1656 <tscreen><verb>
1657 folder-hook mutt set sort=threads
1658 </verb></tscreen>
1659
1660 However, the sorting method is not restored to its previous value when
1661 reading a different mailbox.  To specify a <em/default/ command, use the
1662 pattern ``.'':
1663
1664 <p>
1665 <tscreen><verb>
1666 folder-hook . set sort=date-sent
1667 </verb></tscreen>
1668
1669 <!--}}}--> 
1670
1671 <sect>Keyboard macros<label id="macro"> <!--{{{--> 
1672 <p>
1673 Usage: <tt/macro/ <em/menu/ <em/key/ <em/sequence/ &lsqb; <em/description/ &rsqb;
1674
1675 Macros are useful when you would like a single key to perform a series of
1676 actions.  When you press <em/key/ in menu <em/menu/, Mutt-ng will behave as if
1677 you had typed <em/sequence/.  So if you have a common sequence of commands
1678 you type, you can create a macro to execute those commands with a single
1679 key.
1680
1681 <em/menu/ is the <ref id="maps" name="map"> which the macro will be bound.
1682 Multiple maps may be specified by separating multiple menu arguments by
1683 commas. Whitespace may not be used in between the menu arguments and the
1684 commas separating them.
1685
1686 <em/key/ and <em/sequence/ are expanded by the same rules as the <ref
1687 id="bind" name="key bindings">.  There are some additions however.  The
1688 first is that control characters in <em/sequence/ can also be specified
1689 as <em/&circ;x/.  In order to get a caret (`&circ;'') you need to use
1690 <em/&circ;&circ;/.  Secondly, to specify a certain key such as <em/up/
1691 or to invoke a function directly, you can use the format
1692 <em/&lt;key name&gt;/ and <em/&lt;function name&gt;/.  For a listing of key
1693 names see the section on <ref id="bind" name="key bindings">.  Functions
1694 are listed in the <ref id="functions" name="function reference">.
1695
1696 The advantage with using function names directly is that the macros will
1697 work regardless of the current key bindings, so they are not dependent on
1698 the user having particular key definitions.  This makes them more robust
1699 and portable, and also facilitates defining of macros in files used by more
1700 than one user (eg. the system Muttngrc).
1701
1702 Optionally you can specify a descriptive text after <em/sequence/,
1703 which is shown in the help screens.
1704
1705 <bf/Note:/ Macro definitions (if any) listed in the help screen(s), are
1706 silently truncated at the screen width, and are not wrapped.   
1707
1708 <!--}}}--> 
1709
1710 <sect>Using color and mono video attributes<label id="color"> <!--{{{--> 
1711 <p>
1712 Usage: <tt/color/ <em/object/ <em/foreground/ <em/background/ &lsqb; <em/regexp/ &rsqb;<newline>
1713 Usage: <tt/color/ index <em/foreground/ <em/background/ <em/pattern/<newline>
1714 Usage: <tt/uncolor/ index <em/pattern/ &lsqb; <em/pattern/ ...  &rsqb;<newline>
1715
1716 If your terminal supports color, you can spice up Mutt-ng by creating your own
1717 color scheme.  To define the color of an object (type of information), you
1718 must specify both a foreground color <bf/and/ a background color (it is not
1719 possible to only specify one or the other).
1720
1721 <em/object/ can be one of:
1722
1723 <itemize>
1724 <item>attachment
1725 <item>body (match <em/regexp/ in the body of messages)
1726 <item>bold (highlighting bold patterns in the body of messages)
1727 <item>error (error messages printed by Mutt-ng)
1728 <item>header (match <em/regexp/ in the message header)
1729 <item>hdrdefault (default color of the message header in the pager)
1730 <item>index (match <em/pattern/ in the message index)
1731 <item>indicator (arrow or bar used to indicate the current item in a menu)
1732 <item>markers (the ``+'' markers at the beginning of wrapped lines in the pager)
1733 <item>message (informational messages)
1734 <item>normal
1735 <item>quoted (text matching <ref id="quote_regexp"
1736 name="&dollar;quote&lowbar;regexp"> in the body of a message)
1737 <item>quoted1, quoted2, ..., quoted<bf/N/ (higher levels of quoting)
1738 <item>search (highlighting of words in the pager)
1739 <item>signature
1740 <item>status (mode lines used to display info about the mailbox or message)
1741 <item>tilde (the ``&tilde;'' used to pad blank lines in the pager)
1742 <item>tree (thread tree drawn in the message index and attachment menu)
1743 <item>underline (highlighting underlined patterns in the body of messages)
1744 </itemize>
1745
1746 <em/foreground/ and <em/background/ can be one of the following:
1747
1748 <itemize>
1749 <item>white
1750 <item>black
1751 <item>green
1752 <item>magenta
1753 <item>blue
1754 <item>cyan
1755 <item>yellow
1756 <item>red
1757 <item>default
1758 <item>color<em/x/
1759 </itemize>
1760
1761 <em/foreground/ can optionally be prefixed with the keyword <tt/bright/ to make
1762 the foreground color boldfaced (e.g., <tt/brightred/).
1763
1764 If your terminal supports it, the special keyword <em/default/ can be
1765 used as a transparent color.  The value <em/brightdefault/ is also valid.
1766 If Mutt-ng is linked against the <em/S-Lang/ library, you also need to set
1767 the <em/COLORFGBG/ environment variable to the default colors of your
1768 terminal for this to work; for example (for Bourne-like shells):
1769
1770 <tscreen><verb>
1771 set COLORFGBG="green;black"
1772 export COLORFGBG
1773 </verb></tscreen>
1774
1775 <bf/Note:/ The <em/S-Lang/ library requires you to use the <em/lightgray/
1776 and <em/brown/ keywords instead of <em/white/ and <em/yellow/ when
1777 setting this variable.
1778
1779 <bf/Note:/ The uncolor command can be applied to the index object only.  It
1780 removes entries from the list. You <bf/must/ specify the same pattern
1781 specified in the color command for it to be removed.  The pattern ``*'' is
1782 a special token which means to clear the color index list of all entries.
1783
1784 Mutt-ng also recognizes the keywords <em/color0/, <em/color1/, &hellip;,
1785 <em/color/<bf/N-1/ (<bf/N/ being the number of colors supported
1786 by your terminal).  This is useful when you remap the colors for your
1787 display (for example by changing the color associated with <em/color2/
1788 for your xterm), since color names may then lose their normal meaning.
1789
1790 If your terminal does not support color, it is still possible change the video
1791 attributes through the use of the ``mono'' command:
1792
1793 Usage: <tt/mono/ <em/&lt;object&gt; &lt;attribute&gt;/ &lsqb; <em/regexp/ &rsqb;<newline>
1794 Usage: <tt/mono/ index <em/attribute/ <em/pattern/<newline>
1795 Usage: <tt/unmono/ index <em/pattern/ &lsqb; <em/pattern/ ...  &rsqb;<newline>
1796
1797 where <em/attribute/ is one of the following:
1798
1799 <itemize>
1800 <item>none
1801 <item>bold
1802 <item>underline
1803 <item>reverse
1804 <item>standout
1805 </itemize>
1806
1807 <!--}}}--> 
1808
1809 <sect>Ignoring (weeding) unwanted message headers<label id="ignore"> <!--{{{--> 
1810 <p>
1811 Usage: <tt/&lsqb;un&rsqb;ignore/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
1812
1813 Messages often have many header fields added by automatic processing systems,
1814 or which may not seem useful to display on the screen.  This command allows
1815 you to specify header fields which you don't normally want to see.
1816
1817 You do not need to specify the full header field name.  For example,
1818 ``ignore content-'' will ignore all header fields that begin with the pattern
1819 ``content-''. ``ignore *'' will ignore all headers.
1820
1821 To remove a previously added token from the list, use the ``unignore'' command.
1822 The ``unignore'' command will make Mutt-ng display headers with the given pattern.
1823 For example, if you do ``ignore x-'' it is possible to ``unignore x-mailer''.
1824
1825 ``unignore *'' will remove all tokens from the ignore list.
1826
1827 For example:
1828 <tscreen><verb>
1829 # Sven's draconian header weeding
1830 ignore *
1831 unignore from date subject to cc
1832 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
1833 unignore posted-to:
1834 </verb></tscreen>
1835
1836 <!--}}}--> 
1837
1838 <sect>Alternative addresses<label id="alternates"> <!--{{{--> 
1839 <p>
1840 Usage: <tt/&lsqb;un&rsqb;alternates/ <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;<newline>
1841
1842 With various functions, mutt will treat messages differently,
1843 depending on whether you sent them or whether you received them from
1844 someone else.  For instance, when replying to a message that you
1845 sent to a different party, mutt will automatically suggest to send
1846 the response to the original message's recipients -- responding to
1847 yourself won't make much sense in many cases.  (See <ref
1848 id="reply_to" name="&dollar;reply&lowbar;to">.)
1849
1850 Many users receive e-mail under a number of different addresses. To
1851 fully use mutt's features here, the program must be able to
1852 recognize what e-mail addresses you receive mail under. That's the
1853 purpose of the <tt/alternates/ command: It takes a list of regular
1854 expressions, each of which can identify an address under which you
1855 receive e-mail.
1856
1857 The <tt/unalternates/ command can be used to write exceptions to
1858 <tt/alternates/ patterns. If an address matches something in an
1859 <tt/alternates/ command, but you nonetheless do not think it is
1860 from you, you can list a more precise pattern under an <tt/unalternates/
1861 command.
1862
1863 To remove a regular expression from the <tt/alternates/ list, use the
1864 <tt/unalternates/ command with exactly the same <em/regexp/.
1865 Likewise, if the <em/regexp/ for a <tt/alternates/ command matches
1866 an entry on the <tt/unalternates/ list, that <tt/unalternates/
1867 entry will be removed. If the <em/regexp/ for <tt/unalternates/
1868 is ``*'', <em/all entries/ on <tt/alternates/ will be removed.
1869
1870 <!--}}}--> 
1871
1872 <sect>Format = Flowed <!--{{{--> 
1873
1874   <sect1>Introduction <!--{{{--> 
1875
1876     <p>Mutt-ng contains support for so-called <tt/format=flowed/ messages.
1877     In the beginning of email, each message had a fixed line width, and
1878     it was enough for displaying them on fixed-size terminals. But times
1879     changed, and nowadays hardly anybody still uses fixed-size terminals:
1880     more people nowaydays use graphical user interfaces, with dynamically
1881     resizable windows. This led to the demand of a new email format that
1882     makes it possible for the email client to make the email look nice
1883     in a resizable window without breaking quoting levels and creating
1884     an incompatible email format that can also be displayed nicely on
1885     old fixed-size terminals.
1886
1887     <p>For introductory information on <tt/format=flowed/ messages, see
1888     <htmlurl url="http://www.joeclark.org/ffaq.html"
1889     name="&lt;http://www.joeclark.org/ffaq.html&gt;">.
1890
1891   <!--}}}-->
1892
1893   <sect1>Receiving: Display Setup <!--{{{--> 
1894
1895     <p>When you receive emails that are marked as <tt/format=flowed/
1896     messages, and is formatted correctly, mutt-ng will try to reformat
1897     the message to optimally fit on your terminal. If you want a fixed
1898     margin on the right side of your terminal, you can set the
1899     following:
1900
1901     <verb>
1902     set wrapmargin = 10
1903     </verb>
1904
1905     <p>The code above makes the line break 10 columns before the right
1906     side of the terminal.
1907
1908     <p>If your terminal is so wide that the lines are embarrassingly long,
1909     you can also set a maximum line length:
1910
1911     <verb>
1912     set max_line_length = 120
1913     </verb>
1914
1915     <p>The example above will give you lines not longer than 120
1916     characters.
1917
1918     <p>When you view at <tt/format=flowed/ messages, you will often see
1919     the quoting hierarchy like in the following example:
1920
1921     <verb>
1922     &gt;Bill, can you please send last month's progress report to Mr. 
1923     &gt;Morgan? We also urgently need the cost estimation for the new 
1924     &gt;production server that we want to set up before our customer's 
1925     &gt;project will go live.
1926     </verb>
1927
1928     <p>This obviously doesn't look very nice, and it makes it very
1929     hard to differentiate between text and quoting character. The
1930     solution is to configure mutt-ng to "stuff" the quoting:
1931
1932     <verb>
1933     set stuff_quoted
1934     </verb>
1935
1936     <p>This will lead to a nicer result that is easier to read:
1937
1938     <verb>
1939     &gt; Bill, can you please send last month's progress report to Mr. 
1940     &gt; Morgan? We also urgently need the cost estimation for the new 
1941     &gt; production server that we want to set up before our customer's 
1942     &gt; project will go live.
1943     </verb>
1944
1945   <!--}}}-->
1946
1947   <sect1>Sending <!--{{{--> 
1948
1949     <p>If you want mutt-ng to send emails with <tt/format=flowed/ set, you
1950     need to explicitly set it:
1951
1952     <verb>
1953     set text_flowed
1954     </verb>
1955
1956     <p>Additionally, you have to use an editor which supports writing
1957     <tt/format=flowed/-conforming emails. For vim, this is done by
1958     adding <tt/w/ to the formatoptions (see <tt/:h formatoptions/ and
1959     <tt/:h fo-table/) when writing emails.
1960
1961     <p>Also note that <em/format=flowed/ knows about ``space-stuffing'',
1962     that is, when sending messages, some kinds of lines have to be
1963     indented with a single space on the sending side. On the receiving
1964     side, the first space (if any) is removed. As a consequence and in
1965     addition to the above simple setting, please keep this in mind when
1966     making manual formattings within the editor. Also note that mutt-ng
1967     currently violates the standard (RfC 3676) as it does not
1968     space-stuff lines starting with:
1969
1970     <itemize>
1971
1972       <item><tt/&gt;/ This is <em/not/ the quote character but a right
1973         angle used for other reasons
1974
1975       <item><tt/From/ with a trailing space.
1976
1977       <item>just a space for formatting reasons
1978
1979     </itemize>
1980
1981     Please make sure that you manually prepend a space to each of them.
1982
1983   <!--}}}-->
1984
1985   <sect1>Additional Notes <!--{{{-->
1986
1987     <p> For completeness, the <ref id="delete_space"
1988     name="&dollar;delete&lowbar;space"> variable provides the mechanism
1989     to generate a <tt/DelSp=yes/ parameter on <em/outgoing/ messages.
1990     According to the standard, clients receiving a <tt/format=flowed/
1991     messages should delete the last space of a flowed line but still
1992     interpret the line as flowed. Because flowed lines usually contain
1993     only one space at the end, this parameter would make the receiving
1994     client concatenate the last word of the previous with the first of
1995     the current line <em/without/ a space. This makes ordinary text
1996     unreadable and is intended for languages rarely using spaces. So
1997     please use this setting only if you're sure what you're doing.
1998
1999   <!--}}}-->
2000
2001 <!--}}}--> 
2002
2003 <sect>Mailing lists<label id="lists"> <!--{{{--> 
2004 <p>
2005 Usage: <tt/&lsqb;un&rsqb;lists/ <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;<newline>
2006 Usage: <tt/&lsqb;un&rsqb;subscribe/ <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;
2007
2008 Mutt-ng has a few nice features for <ref id="using_lists" name="handling
2009 mailing lists">.  In order to take advantage of them, you must
2010 specify which addresses belong to mailing lists, and which mailing
2011 lists you are subscribed to.  Once you have done this, the <ref
2012 id="list-reply" name="list-reply"> function will work for all known lists.
2013 Additionally, when you send a message to a subscribed list, mutt will
2014 add a Mail-Followup-To header to tell other users' mail user agents
2015 not to send copies of replies to your personal address.   Note that
2016 the Mail-Followup-To header is a non-standard extension which is not
2017 supported by all mail user agents.  Adding it is not bullet-proof against
2018 receiving personal CCs of list messages.  Also note that the generation
2019 of the Mail-Followup-To header is controlled by the <ref id="followup_to"
2020 name="&dollar;followup&lowbar;to"> configuration variable.
2021
2022 More precisely, Mutt-ng maintains lists of patterns for the addresses
2023 of known and subscribed mailing lists.  Every subscribed mailing
2024 list is known. To mark a mailing list as known, use the ``lists''
2025 command.  To mark it as subscribed, use ``subscribe''.
2026
2027 You can use regular expressions with both commands.  To mark all
2028 messages sent to a specific bug report's address on mutt's bug
2029 tracking system as list mail, for instance, you could say
2030 ``subscribe [0-9]*@bugs.guug.de''.  Often, it's sufficient to just
2031 give a portion of the list's e-mail address.
2032
2033 Specify as much of the address as you need to to remove ambiguity.  For
2034 example, if you've subscribed to the Mutt-ng mailing list, you will receive mail
2035 addressed to <em/mutt-users@mutt.org/.  So, to tell Mutt-ng that this is a
2036 mailing list, you could add ``lists mutt-users'' to your
2037 initialization file.  To tell mutt that you are subscribed to it,
2038 add ``subscribe mutt-users'' to your initialization file instead.
2039 If you also happen to get mail from someone whose address is
2040 <em/mutt-users@example.com/, you could use ``lists mutt-users@mutt&bsol;&bsol;.org'' 
2041 or ``subscribe mutt-users@mutt&bsol;&bsol;.org'' to
2042 match only mail from the actual list.
2043
2044 The ``unlists'' command is used to remove a token from the list of
2045 known and subscribed mailing-lists. Use ``unlists *'' to remove all
2046 tokens.
2047
2048 To remove a mailing list from the list of subscribed mailing lists,
2049 but keep it on the list of known mailing lists, use ``unsubscribe''.
2050
2051 <!--}}}--> 
2052
2053 <sect>Using Multiple spool mailboxes<label id="mbox-hook"> <!--{{{--> 
2054 <p>
2055 Usage: <tt/mbox-hook/ &lsqb;!&rsqb;<em/pattern/ <em/mailbox/
2056
2057 This command is used to move read messages from a specified mailbox to a
2058 different mailbox automatically when you quit or change folders.
2059 <em/pattern/ is a regular expression specifying the mailbox to treat as a
2060 ``spool'' mailbox and <em/mailbox/ specifies where mail should be saved when
2061 read.
2062
2063 Unlike some of the other <em/hook/ commands, only the <em/first/ matching
2064 pattern is used (it is not possible to save read mail in more than a single
2065 mailbox).
2066
2067 <!--}}}--> 
2068
2069 <sect>Defining mailboxes which receive mail<label id="mailboxes"> <!--{{{--> 
2070 <p>
2071 Usage: <tt/&lsqb;un&rsqb;mailboxes/ &lsqb;!&rsqb;<em/filename/ &lsqb; <em/filename/ ... &rsqb;
2072
2073 This command specifies folders which can receive mail and
2074 which will be checked for new messages.  By default, the
2075 main menu status bar displays how many of these folders have
2076 new messages.
2077 <p>
2078 When changing folders, pressing <em/space/ will cycle
2079 through folders with new mail.
2080 <p>
2081 Pressing TAB in the directory browser will bring up a menu showing the files
2082 specified by the <tt/mailboxes/ command, and indicate which contain new
2083 messages.  Mutt-ng will automatically enter this mode when invoked from the
2084 command line with the <tt/-y/ option.
2085
2086 The ``unmailboxes'' command is used to remove a token from the list
2087 of folders which receive mail. Use ``unmailboxes *'' to remove all
2088 tokens.
2089
2090 <p>
2091 <bf/Note:/ new mail is detected by comparing the last modification time to
2092 the last access time.  Utilities like <tt/biff/ or <tt/frm/ or any other
2093 program which accesses the mailbox might cause Mutt-ng to never detect new mail
2094 for that mailbox if they do not properly reset the access time.  Backup
2095 tools are another common reason for updated access times.
2096 <p>
2097
2098 <bf/Note:/ the filenames in the <tt/mailboxes/ command are resolved when
2099 the command is executed, so if these names contain <ref id="shortcuts"
2100 name="shortcut characters"> (such as ``='' and ``!''), any variable
2101 definition that affect these characters (like <ref id="folder"
2102 name="&dollar;folder"> and <ref id="spoolfile" name="&dollar;spoolfile">)
2103 should be executed before the <tt/mailboxes/ command.
2104
2105 <!--}}}--> 
2106
2107 <sect>User defined headers<label id="my_hdr"> <!--{{{--> 
2108 <p>
2109 Usage:<newline>
2110 <tt/my_hdr/ <em/string/<newline>
2111 <tt/unmy_hdr/ <em/field/ &lsqb; <em/field/ ... &rsqb;
2112
2113 The ``my&lowbar;hdr'' command allows you to create your own header
2114 fields which will be added to every message you send.
2115
2116 For example, if you would like to add an ``Organization:'' header field to
2117 all of your outgoing messages, you can put the command
2118
2119 <quote>
2120 my_hdr Organization: A Really Big Company, Anytown, USA
2121 </quote>
2122
2123 in your <tt/.muttrc/.
2124
2125 <bf/Note:/  space characters are <em/not/ allowed between the keyword and
2126 the colon (``:'').  The standard for electronic mail (RFC822) says that
2127 space is illegal there, so Mutt-ng enforces the rule.
2128
2129 If you would like to add a header field to a single message, you should
2130 either set the <ref id="edit_headers" name="edit&lowbar;headers"> variable,
2131 or use the <em/edit-headers/ function (default: ``E'') in the send-menu so
2132 that you can edit the header of your message along with the body.
2133
2134 To remove user defined header fields, use the ``unmy&lowbar;hdr''
2135 command.  You may specify an asterisk (``*'') to remove all header
2136 fields, or the fields to remove.  For example, to remove all ``To'' and
2137 ``Cc'' header fields, you could use:
2138
2139 <quote>
2140 unmy_hdr to cc
2141 </quote>
2142
2143 <!--}}}--> 
2144
2145 <sect>Defining the order of headers when viewing messages<label id="hdr_order"> <!--{{{--> 
2146 <p>
2147 Usage: <tt/hdr&lowbar;order/ <em/header1/ <em/header2/ <em/header3/
2148
2149 With this command, you can specify an order in which mutt will attempt
2150 to present headers to you when viewing messages.
2151
2152 ``unhdr_order *'' will clear all previous headers from the order list,
2153 thus removing the header order effects set by the system-wide startup
2154 file.
2155
2156 <tscreen><verb>
2157 hdr&lowbar;order From Date: From: To: Cc: Subject:
2158 </verb></tscreen>
2159
2160 <!--}}}--> 
2161
2162 <sect>Specify default save filename<label id="save-hook"> <!--{{{--> 
2163 <p>
2164 Usage: <tt/save-hook/ &lsqb;!&rsqb;<em/pattern/ <em/filename/
2165
2166 This command is used to override the default filename used when saving
2167 messages.  <em/filename/ will be used as the default filename if the message is
2168 <em/From:/ an address matching <em/regexp/ or if you are the author and the
2169 message is addressed <em/to:/ something matching <em/regexp/.
2170
2171 See <ref id="pattern_hook" name="Message Matching in Hooks"> for information on the exact format of <em/pattern/.
2172
2173 Examples:
2174
2175 <tscreen><verb>
2176 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
2177 save-hook aol\\.com$ +spam
2178 </verb></tscreen>
2179
2180 Also see the <ref id="fcc-save-hook" name="fcc-save-hook"> command.
2181
2182 <!--}}}--> 
2183
2184 <sect>Specify default Fcc: mailbox when composing<label id="fcc-hook"> <!--{{{--> 
2185 <p>
2186 Usage: <tt/fcc-hook/ &lsqb;!&rsqb;<em/pattern/ <em/mailbox/
2187
2188 This command is used to save outgoing mail in a mailbox other than
2189 <ref id="record" name="&dollar;record">.  Mutt-ng searches the initial list of
2190 message recipients for the first matching <em/regexp/ and uses <em/mailbox/
2191 as the default Fcc: mailbox.  If no match is found the message will be saved
2192 to <ref id="record" name="&dollar;record"> mailbox.
2193
2194 See <ref id="pattern_hook" name="Message Matching in Hooks"> for information on the exact format of <em/pattern/.
2195
2196 Example: <tt/fcc-hook &lsqb;@.&rsqb;aol&bsol;&bsol;.com&dollar; +spammers/
2197
2198 The above will save a copy of all messages going to the aol.com domain to
2199 the `+spammers' mailbox by default.  Also see the <ref id="fcc-save-hook" 
2200 name="fcc-save-hook"> command.
2201
2202 <!--}}}--> 
2203
2204 <sect>Specify default save filename and default Fcc: mailbox at once<label id="fcc-save-hook"> <!--{{{--> 
2205 <p>
2206 Usage: <tt/fcc-save-hook/ &lsqb;!&rsqb;<em/pattern/ <em/mailbox/
2207
2208 This command is a shortcut, equivalent to doing both a <ref id="fcc-hook" name="fcc-hook">
2209 and a <ref id="save-hook" name="save-hook"> with its arguments.
2210
2211 <!--}}}--> 
2212
2213 <sect>Change settings based upon message recipients<label id="send-hook"><label id="reply-hook"><label id="send2-hook"> <!--{{{--> 
2214 <p>
2215 Usage: <tt/reply-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/<newline>
2216 Usage: <tt/send-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/<newline>
2217 Usage: <tt/send2-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/
2218
2219 These commands can be used to execute arbitrary configuration commands based
2220 upon recipients of the message.  <em/pattern/ is a regular expression
2221 matching the desired address.  <em/command/ is executed when <em/regexp/
2222 matches recipients of the message.
2223
2224 <tt/reply-hook/ is matched against the message you are <em/replying/
2225 <bf/to/, instead of the message you are <em/sending/.  <tt/send-hook/ is
2226 matched against all messages, both <em/new/ and <em/replies/.  <bf/Note:/
2227 <tt/reply-hook/s are matched <bf/before/ the <tt/send-hook/, <bf/regardless/
2228 of the order specified in the users's configuration file.
2229
2230 <tt/send2-hook/ is matched every time a message is changed, either
2231 by editing it, or by using the compose menu to change its recipients
2232 or subject.  <tt/send2-hook/ is executed after <tt/send-hook/, and
2233 can, e.g., be used to set parameters such as the <ref id="sendmail"
2234 name="&dollar;sendmail"> variable depending on the message's sender
2235 address.
2236
2237 For each type of <tt/send-hook/ or <tt/reply-hook/, when multiple matches
2238 occur, commands are executed in the order they are specified in the muttrc
2239 (for that type of hook).
2240
2241 See <ref id="pattern_hook" name="Message Matching in Hooks"> for information on the exact format of <em/pattern/.
2242
2243 Example: <tt/send-hook mutt &dquot;set mime&lowbar;forward signature=''&dquot;/
2244
2245 Another typical use for this command is to change the values of the
2246 <ref id="attribution" name="&dollar;attribution">, <ref id="signature"
2247 name="&dollar;signature"> and <ref id="locale" name="&dollar;locale">
2248 variables in order to change the language of the attributions and
2249 signatures based upon the recipients.
2250
2251 <bf/Note:/ the send-hook's are only executed ONCE after getting the initial
2252 list of recipients.  Adding a recipient after replying or editing the
2253 message will NOT cause any send-hook to be executed.  Also note that
2254 my_hdr commands which modify recipient headers, or the message's
2255 subject, don't have any effect on the current message when executed
2256 from a send-hook.
2257
2258 <!--}}}--> 
2259
2260 <sect>Change settings before formatting a message<label id="message-hook"> <!--{{{--> 
2261 <p>
2262 Usage: <tt/message-hook/ &lsqb;!&rsqb;<em/pattern/ <em/command/
2263
2264 This command can be used to execute arbitrary configuration commands
2265 before viewing or formatting a message based upon information about the message.
2266 <em/command/ is executed if the <em/pattern/ matches the message to be
2267 displayed. When multiple matches occur, commands are executed in the order
2268 they are specified in the muttrc.
2269
2270 See <ref id="pattern_hook" name="Message Matching in Hooks"> for
2271 information on the exact format of <em/pattern/.
2272
2273 Example:
2274 <tscreen><verb>
2275 message-hook ~A 'set pager=builtin'
2276 message-hook '~f freshmeat-news' 'set pager="less \"+/^  subject: .*\""'
2277 </verb></tscreen>
2278
2279 <!--}}}--> 
2280
2281 <sect>Choosing the cryptographic key of the recipient<label id="crypt-hook"> <!--{{{--> 
2282 <p>
2283 Usage: <tt/crypt-hook/ <em/pattern/ <em/keyid/
2284
2285 When encrypting messages with PGP or OpenSSL, you may want to associate a certain
2286 key with a given e-mail address automatically, either because the
2287 recipient's public key can't be deduced from the destination address,
2288 or because, for some reasons, you need to override the key Mutt-ng would
2289 normally use.  The crypt-hook command provides a method by which you can
2290 specify the ID of the public key to be used when encrypting messages to
2291 a certain recipient.
2292
2293 The meaning of "key id" is to be taken broadly in this context:  You
2294 can either put a numerical key ID here, an e-mail address, or even
2295 just a real name.
2296
2297 <!--}}}--> 
2298
2299 <sect>Adding key sequences to the keyboard buffer<label id="push"> <!--{{{--> 
2300 <p>
2301 Usage: <tt/push/ <em/string/
2302
2303 This command adds the named string to the keyboard buffer. The string may
2304 contain control characters, key names and function names like the sequence
2305 string in the <ref id="macro" name="macro"> command. You may use it to
2306 automatically run a sequence of commands at startup, or when entering
2307 certain folders.
2308
2309 <!--}}}--> 
2310
2311 <sect>Executing functions<label id="exec"> <!--{{{--> 
2312 <p>
2313 Usage: <tt/exec/ <em/function/ &lsqb; <em/function/ ... &rsqb;
2314
2315 This command can be used to execute any function. Functions are
2316 listed in the <ref id="functions" name="function reference">.
2317 ``exec function'' is equivalent to ``push &lt;function&gt;''.
2318
2319 <!--}}}--> 
2320
2321 <sect>Message Scoring<label id="score-command"> <!--{{{--> 
2322
2323 <p>
2324 Usage: <tt/score/ <em/pattern/ <em/value/<newline>
2325 Usage: <tt/unscore/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
2326
2327 <p>
2328 In situations where you have to cope with a lot of emails, e.g.
2329 when you read many different mailing lists, and take part in
2330 discussions, it is always useful to have the important messages
2331 marked and the annoying messages or the ones that you aren't
2332 interested in deleted. For this purpose, mutt-ng features a
2333 mechanism called ``scoring''.
2334
2335 <p>
2336 When you use scoring, every message has a base score of 0. You
2337 can then use the <tt/score/ command to define patterns and a
2338 positive or negative value associated with it. When a pattern
2339 matches a message, the message's score will be raised or lowered by
2340 the amount of the value associated with the pattern.
2341
2342 <verb>
2343 score "~f nion@muttng\.org" 50
2344 score "~f @sco\.com" -100</verb>
2345
2346 <p>If the pattern matches, it is also possible to set the score
2347 value of the current message to a certain value and then stop
2348 evaluation:
2349
2350 <verb>
2351 score "~f santaclaus@northpole\.int" =666</verb>
2352
2353 <p>What is important to note is that negative score values will be
2354 rounded up to 0.
2355
2356 <p>To make scoring actually useful, the score must be applied in
2357 some way.  That's what the <em/score thresholds/ are for. Currently,
2358 there are three score thresholds:
2359
2360 <itemize>
2361
2362   <item>flag threshold: when a message has a score value equal or higher
2363   than the flag threshold, it will be flagged.
2364
2365   <item>read threshold: when a message has a score value equal or lower
2366   than the read threshold, it will be marked as read.
2367
2368   <item>delete threshold: when a message has a score value equal or
2369   lower than the delete threshold, it will be marked as deleted.
2370
2371 </itemize>
2372
2373 <p>These three thresholds can be set via the variables <ref
2374 id="score_threshold_flag"
2375 name="&dollar;score&lowbar;threshold&lowbar;flag">, <ref
2376 id="score_threshold_read"
2377 name="&dollar;score&lowbar;threshold&lowbar;read">, <ref
2378 id="score_threshold_delete"
2379 name="&dollar;score&lowbar;threshold&lowbar;delete"> and.  By
2380 default, <ref id="score_threshold_read"
2381 name="&dollar;score&lowbar;threshold&lowbar;read"> and <ref
2382 id="score_threshold_delete"
2383 name="&dollar;score&lowbar;threshold&lowbar;delete"> are set to
2384 <tt/-1/, which means that in the default threshold configuration no
2385 message will ever get marked as read or deleted.
2386
2387 <p>Scoring gets especially interesting when combined with the <tt/color/ command
2388 and the <tt>&tilde;n</tt> pattern:
2389
2390 <verb>
2391 color index  black   yellow  "~n 10-"
2392 color index  red     yellow  "~n 100-"</verb>
2393
2394 <p>The rules above mark all messages with a score between 10 and 99
2395 with black and yellow, and messages with a score greater or equal
2396 100 with red and yellow. This might be unusual to you if you're used
2397 to e.g. slrn's scoring mechanism, but it is more flexible, as it
2398 visually marks different scores.
2399
2400 <!--}}}--> 
2401
2402 <sect>Spam detection<label id="spam"> <!--{{{--> 
2403 <p>
2404 Usage: <tt/spam/ <em/pattern/ <em/format/<newline>
2405 Usage: <tt/nospam/ <em/pattern/
2406
2407 Mutt-ng has generalized support for external spam-scoring filters.
2408 By defining your spam patterns with the <tt/spam/ and <tt/nospam/
2409 commands, you can <em/limit/, <em/search/, and <em/sort/ your
2410 mail based on its spam attributes, as determined by the external
2411 filter. You also can display the spam attributes in your index
2412 display using the <tt/%H/ selector in the <ref id="index_format"
2413 name="&dollar;index&lowbar;format"> variable. (Tip: try <tt/%?H?[%H] ?/
2414 to display spam tags only when they are defined for a given message.)
2415
2416 Your first step is to define your external filter's spam patterns using
2417 the <tt/spam/ command. <em/pattern/ should be a regular expression
2418 that matches a header in a mail message. If any message in the mailbox
2419 matches this regular expression, it will receive a ``spam tag'' or
2420 ``spam attribute'' (unless it also matches a <tt/nospam/ pattern -- see
2421 below.) The appearance of this attribute is entirely up to you, and is
2422 governed by the <em/format/ parameter. <em/format/ can be any static
2423 text, but it also can include back-references from the <em/pattern/
2424 expression. (A regular expression ``back-reference'' refers to a
2425 sub-expression contained within parentheses.) <tt/%1/ is replaced with
2426 the first back-reference in the regex, <tt/%2/ with the second, etc.
2427
2428 If you're using multiple spam filters, a message can have more than
2429 one spam-related header. You can define <tt/spam/ patterns for each
2430 filter you use. If a message matches two or more of these patterns, and
2431 the &dollar;spam&lowbar;separator variable is set to a string, then the
2432 message's spam tag will consist of all the <em/format/ strings joined
2433 together, with the value of &dollar;spam&lowbar;separator separating
2434 them.
2435
2436 For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
2437 define these spam settings:
2438 <tscreen><verb>
2439 spam "X-DCC-.*-Metrics:.*(....)=many"         "90+/DCC-%1"
2440 spam "X-Spam-Status: Yes"                     "90+/SA"
2441 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
2442 set spam_separator=", "
2443 </verb></tscreen>
2444
2445 If I then received a message that DCC registered with ``many'' hits
2446 under the ``Fuz2'' checksum, and that PureMessage registered with a
2447 97% probability of being spam, that message's spam tag would read
2448 <tt>90+/DCC-Fuz2, 97/PM</tt>. (The four characters before ``=many'' in a
2449 DCC report indicate the checksum used -- in this case, ``Fuz2''.)
2450
2451 If the &dollar;spam&lowbar;separator variable is unset, then each
2452 spam pattern match supersedes the previous one. Instead of getting
2453 joined <em/format/ strings, you'll get only the last one to match.
2454
2455 The spam tag is what will be displayed in the index when you use
2456 <tt/%H/ in the <tt/&dollar;index&lowbar;format/ variable. It's also the
2457 string that the <tt/~H/ pattern-matching expression matches against for
2458 <em/search/ and <em/limit/ functions. And it's what sorting by spam
2459 attribute will use as a sort key.
2460
2461 That's a pretty complicated example, and most people's actual
2462 environments will have only one spam filter. The simpler your
2463 configuration, the more effective mutt can be, especially when it comes
2464 to sorting.
2465
2466 Generally, when you sort by spam tag, mutt will sort <em/lexically/ --
2467 that is, by ordering strings alphnumerically. However, if a spam tag
2468 begins with a number, mutt will sort numerically first, and lexically
2469 only when two numbers are equal in value. (This is like UNIX's
2470 <tt/sort -n/.) A message with no spam attributes at all -- that is, one
2471 that didn't match <em/any/ of your <tt/spam/ patterns -- is sorted at
2472 lowest priority. Numbers are sorted next, beginning with 0 and ranging
2473 upward. Finally, non-numeric strings are sorted, with ``a'' taking lower
2474 priority than ``z''. Clearly, in general, sorting by spam tags is most
2475 effective when you can coerce your filter to give you a raw number. But
2476 in case you can't, mutt can still do something useful.
2477
2478 The <tt/nospam/ command can be used to write exceptions to <tt/spam/
2479 patterns. If a header pattern matches something in a <tt/spam/ command,
2480 but you nonetheless do not want it to receive a spam tag, you can list a
2481 more precise pattern under a <tt/nospam/ command.
2482
2483 If the <em/pattern/ given to <tt/nospam/ is exactly the same as the
2484 <em/pattern/ on an existing <tt/spam/ list entry, the effect will be to
2485 remove the entry from the spam list, instead of adding an exception.
2486 Likewise, if the <em/pattern/ for a <tt/spam/ command matches an entry
2487 on the <tt/nospam/ list, that <tt/nospam/ entry will be removed. If the
2488 <em/pattern/ for <tt/nospam/ is ``*'', <em/all entries on both lists/
2489 will be removed. This might be the default action if you use <tt/spam/
2490 and <tt/nospam/ in conjunction with a <tt/folder-hook/.
2491
2492 You can have as many <tt/spam/ or <tt/nospam/ commands as you like.
2493 You can even do your own primitive spam detection within mutt -- for
2494 example, if you consider all mail from <tt/MAILER-DAEMON/ to be spam,
2495 you can use a <tt/spam/ command like this:
2496
2497 <tscreen><verb>
2498 spam "^From: .*MAILER-DAEMON"       "999"
2499 </verb></tscreen>
2500
2501 <!--}}}--> 
2502
2503 <sect>Setting variables<label id="set"> <!--{{{--> 
2504 <p>
2505 Usage: <tt/set/ &lsqb;no|inv&rsqb;<em/variable/&lsqb;=<em/value/&rsqb; &lsqb; <em/variable/ ... &rsqb;<newline>
2506 Usage: <tt/toggle/ <em/variable/ &lsqb;<em/variable/ ... &rsqb;<newline>
2507 Usage: <tt/unset/ <em/variable/ &lsqb;<em/variable/ ... &rsqb;<newline>
2508 Usage: <tt/reset/ <em/variable/ &lsqb;<em/variable/ ... &rsqb;
2509
2510 This command is used to set (and unset) <ref id="variables"
2511 name="configuration variables">.  There are four basic types of variables:
2512 boolean, number, string and quadoption.  <em/boolean/ variables can be
2513 <em/set/ (true) or <em/unset/ (false).  <em/number/ variables can be
2514 assigned a positive integer value.
2515
2516 <em/string/ variables consist of any number of printable characters.
2517 <em/strings/ must be enclosed in quotes if they contain spaces or tabs.  You
2518 may also use the ``C'' escape sequences <bf/&bsol;n/ and <bf/&bsol;t/ for
2519 newline and tab, respectively.
2520
2521 <em/quadoption/ variables are used to control whether or not to be prompted
2522 for certain actions, or to specify a default action.  A value of <em/yes/
2523 will cause the action to be carried out automatically as if you had answered
2524 yes to the question.  Similarly, a value of <em/no/ will cause the the
2525 action to be carried out as if you had answered ``no.''  A value of
2526 <em/ask-yes/ will cause a prompt with a default answer of ``yes'' and
2527 <em/ask-no/ will provide a default answer of ``no.''
2528
2529 Prefixing a variable with ``no'' will unset it.  Example: <tt/set noaskbcc/.
2530
2531 For <em/boolean/ variables, you may optionally prefix the variable name with
2532 <tt/inv/ to toggle the value (on or off).  This is useful when writing
2533 macros.  Example: <tt/set invsmart&lowbar;wrap/.
2534
2535 The <tt/toggle/ command automatically prepends the <tt/inv/ prefix to all
2536 specified variables.
2537
2538 The <tt/unset/ command automatically prepends the <tt/no/ prefix to all
2539 specified variables.
2540
2541 Using the enter-command function in the <em/index/ menu, you can query the
2542 value of a variable by prefixing the name of the variable with a question
2543 mark:
2544
2545 <tscreen><verb>
2546 set ?allow_8bit
2547 </verb></tscreen>
2548
2549 The question mark is actually only required for boolean and quadoption 
2550 variables.
2551
2552 The <tt/reset/ command resets all given variables to the compile time
2553 defaults (hopefully mentioned in this manual). If you use the command
2554 <tt/set/ and prefix the variable with ``&amp;'' this has the same
2555 behavior as the reset command.
2556
2557 With the <tt/reset/ command there exists the special variable ``all'',
2558 which allows you to reset all variables to their system defaults.
2559
2560 <!--}}}--> 
2561
2562 <sect>Reading initialization commands from another file<label id="source"> <!--{{{--> 
2563 <p>
2564 Usage: <tt/source/ <em/filename/ &lsqb; <em/filename/ ... &rsqb;
2565
2566 This command allows the inclusion of initialization commands
2567 from other files.  For example, I place all of my aliases in
2568 <tt>&tilde;/.mail&lowbar;aliases</tt> so that I can make my
2569 <tt>&tilde;/.muttrc</tt> readable and keep my aliases private.
2570
2571 If the filename begins with a tilde (``&tilde;''), it will be expanded to the
2572 path of your home directory.
2573
2574 If the filename ends with a vertical bar (|), then <em/filename/ is
2575 considered to be an executable program from which to read input (eg.
2576 <tt>source ~/bin/myscript|</tt>).
2577
2578 <!--}}}--> 
2579
2580 <sect>Removing hooks<label id="unhook"> <!--{{{--> 
2581 <p>
2582 Usage: <tt/unhook/ &lsqb; * | <em/hook-type/ &rsqb;
2583
2584 This command permits you to flush hooks you have previously defined.
2585 You can either remove all hooks by giving the ``*'' character as an
2586 argument, or you can remove all hooks of a specific type by saying
2587 something like <tt/unhook send-hook/.
2588
2589 <!--}}}--> 
2590
2591   <sect>Sharing Setups<label id="sect:sharingsetups"> <!--{{{--> 
2592
2593     <sect1>Character Sets <!--{{{--> 
2594
2595     <p>As users may run mutt-ng on different systems, the configuration
2596     must be maintained because it's likely that people want to use the
2597     setup everywhere they use mutt-ng. And mutt-ng tries to help where it
2598     can.
2599
2600     <p>To not produce conflicts with different character sets, mutt-ng
2601     allows users to specify in which character set their configuration
2602     files are encoded. Please note that while reading the configuration
2603     files, this is only respected after the corresponding declaration
2604     appears. It's advised to put the following at the very beginning of a
2605     users muttngrc:
2606
2607     <verb>
2608 set config_charset = "..."</verb>
2609
2610     <p>and replacing the dots with the actual character set. To avoid
2611     problems while maintaining the setup, vim user's may want to use
2612     modelines as show in:
2613
2614     <verb>
2615 # vim:fileencoding=...:</verb>
2616
2617     <p>while, again, replacing the dots with the appropriate name. This
2618     tells vim as which character set to read and save the file.
2619
2620     <!--}}}--> 
2621
2622     <sect1>Modularization <!--{{{--> 
2623
2624       <p>``Modularization'' means to divide the setup into several files
2625       while sorting the options or commands by topic. Especially for
2626       longer setups (e.g. with many hooks), this helps maintaining it
2627       and solving trouble.
2628
2629       <p>When using separation, setups may be, as a whole or in
2630       fractions, shared over different systems.
2631
2632     <!--}}}--> 
2633
2634     <sect1>Conditional parts <!--{{{--> 
2635
2636     <p>When using a configuration on different systems, the user may not
2637     always have influence on how mutt-ng is installed and which features
2638     it includes.
2639
2640     <p>To solve this, mutt-ng contain a feature based on the ``ifdef''
2641     patch written for mutt. Its basic syntax is:
2642
2643     <verb>
2644 ifdef &lt;item&gt; &lt;command&gt;
2645 ifndef &lt;item&gt; &lt;command&gt;</verb>
2646
2647     <p>...whereby <tt/&lt;item&gt;/ can be one of:
2648
2649     <itemize>
2650
2651       <item>a function name
2652
2653       <item>a variable name
2654
2655       <item>a menu name
2656
2657       <item>a feature name
2658
2659     </itemize>
2660
2661     <p>All available functions, variables and menus are documented
2662     elsewhere in this manual but ``features'' is specific to these two
2663     commands. To test for one, prefix one of the following keywords with
2664     <tt/feature&lowbar;/:
2665
2666     <verb>
2667 ncurses, slang, iconv, idn, dotlock, standalone, pop, nntp, imap, ssl,
2668 gnutls, sasl, sasl2, libesmtp, compressed, color, classic_pgp,
2669 classic_smime, gpgme, header_cache</verb>
2670
2671     <p>As an example, one can use the following in
2672     <tt>&tilde;/.muttngrc</tt>:
2673
2674     <verb>
2675 ifdef feature_imap 'source ~/.mutt-ng/setup-imap'
2676 ifdef feature_pop  'source ~/.mutt-ng/setup-pop'
2677 ifdef feature_nntp 'source ~/.mutt-ng/setup-nntp'</verb>
2678
2679     <p>...to only source <tt>&tilde;/.mutt-ng/setup-imap</tt> if IMAP
2680     support is built in, only source <tt>&tilde;/.mutt-ng/setup-pop</tt>
2681     if POP support is built in and only source
2682     <tt>&tilde;/.mutt-ng/setup-nntp</tt> if NNTP support is built in.
2683
2684     <p>An example for testing for variable names can be used if users
2685     use different revisions of mutt-ng whereby the older one may not
2686     have a certain variable. To test for the availability of <ref
2687     id="imap_mail_check" name="&dollar;imap&lowbar;mail&lowbar;check">,
2688     use:
2689
2690     <verb>
2691 ifdef imap_mail_check 'set imap_mail_check = 300'</verb>
2692
2693     <p>Provided for completeness is the test for menu names. To set <ref
2694     id="pager_index_lines"
2695     name="&dollar;pager&lowbar;index&lowbar;lines"> only if the pager
2696     menu is available, use:
2697
2698     <verb>
2699 ifdef pager 'set pager_index_lines = 10'</verb>
2700
2701     <p>For completeness, too, the opposite of <tt/ifdef/ is provided:
2702     <tt/ifndef/ which only executes the command if the test fails. For
2703     example, the following two examples are equivalent:
2704
2705     <verb>
2706 ifdef feature_ncurses 'source ~/.mutt-ng/setup-ncurses'
2707 ifndef feature_ncurses 'source ~/.mutt-ng/setup-slang'</verb>
2708
2709     <p>...and...
2710
2711     <verb>
2712 ifdef feature_slang 'source ~/.mutt-ng/setup-slang'
2713 ifndef feature_slang 'source ~/.mutt-ng/setup-ncurses'</verb>
2714
2715   <!--}}}--> 
2716
2717
2718   <!--}}}--> 
2719
2720 <sect>Obsolete Variables <!--{{{--> 
2721
2722 <p>In the process of ensuring and creating more consistency, many
2723 variables have been renamed and some of the old names were already
2724 removed. Please see <ref id="sect_obsolete" name="Obsolete Variables">
2725 for a complete list.
2726
2727 <!--}}}--> 
2728
2729 <!--}}}--> 
2730
2731 <chapt>Advanced Usage <!--{{{--> 
2732
2733 <sect>Regular Expressions<label id="regexp"> <!--{{{--> 
2734 <p>
2735 All string patterns in Mutt-ng including those in more complex
2736 <ref id="patterns" name="patterns"> must be specified
2737 using regular expressions (regexp) in the ``POSIX extended'' syntax (which
2738 is more or less the syntax used by egrep and GNU awk).  For your
2739 convenience, we have included below a brief description of this syntax.
2740
2741 The search is case sensitive if the pattern contains at least one upper
2742 case letter, and case insensitive otherwise. Note that ``&bsol;''
2743 must be quoted if used for a regular expression in an initialization
2744 command: ``&bsol;&bsol;''.
2745
2746 A regular expression is a pattern that describes a set of strings.
2747 Regular expressions are constructed analogously to arithmetic
2748 expressions, by using various operators to combine smaller expressions.
2749
2750 Note that the regular expression can be enclosed/delimited by either &dquot;
2751 or ' which is useful if the regular expression includes a white-space
2752 character.  See <ref id="muttrc-syntax" name="Syntax of Initialization Files">
2753 for more information on &dquot; and ' delimiter processing.  To match a
2754 literal &dquot; or ' you must preface it with \ (backslash).
2755
2756 The fundamental building blocks are the regular expressions that match
2757 a single character.  Most characters, including all letters and digits,
2758 are regular expressions that match themselves.  Any metacharacter with
2759 special meaning may be quoted by preceding it with a backslash.
2760
2761 The period ``.'' matches any single character.  The caret ``&circ;'' and
2762 the dollar sign ``&dollar'' are metacharacters that respectively match
2763 the empty string at the beginning and end of a line.
2764
2765 A list of characters enclosed by ``&lsqb;'' and ``&rsqb;'' matches any
2766 single character in that list; if the first character of the list
2767 is a caret ``&circ;'' then it matches any character <bf/not/ in the
2768 list.  For example, the regular expression <bf/&lsqb;0123456789&rsqb;/
2769 matches any single digit.  A range of ASCII characters may be specified
2770 by giving the first and last characters, separated by a hyphen
2771 ``-''.  Most metacharacters lose their special meaning inside
2772 lists.  To include a literal ``&rsqb;'' place it first in the list.
2773 Similarly, to include a literal ``&circ;'' place it anywhere but first.
2774 Finally, to include a literal hyphen ``-'' place it last.
2775
2776 Certain named classes of characters are predefined.  Character classes
2777 consist of ``&lsqb;:'', a keyword denoting the class, and ``:&rsqb;''.
2778 The following classes are defined by the POSIX standard:
2779
2780 <descrip>
2781 <tag/&lsqb;:alnum:&rsqb;/
2782 Alphanumeric characters.
2783 <tag/&lsqb;:alpha:&rsqb;/
2784 Alphabetic characters.
2785 <tag/&lsqb;:blank:&rsqb;/
2786 Space or tab characters.
2787 <tag/&lsqb;:cntrl:&rsqb;/
2788 Control characters.
2789 <tag/&lsqb;:digit:&rsqb;/
2790 Numeric characters.
2791 <tag/&lsqb;:graph:&rsqb;/
2792 Characters that are both printable and visible.  (A space is printable,
2793 but not visible, while an ``a'' is both.)
2794 <tag/&lsqb;:lower:&rsqb;/
2795 Lower-case alphabetic characters.
2796 <tag/&lsqb;:print:&rsqb;/
2797 Printable characters (characters that are not control characters.)
2798 <tag/&lsqb;:punct:&rsqb;/
2799 Punctuation characters (characters that are not letter, digits, control
2800 characters, or space characters).
2801 <tag/&lsqb;:space:&rsqb;/
2802 Space characters (such as space, tab and formfeed, to name a few).
2803 <tag/&lsqb;:upper:&rsqb;/
2804 Upper-case alphabetic characters.
2805 <tag/&lsqb;:xdigit:&rsqb;/
2806 Characters that are hexadecimal digits.
2807 </descrip>
2808
2809 A character class is only valid in a regular expression inside the
2810 brackets of a character list.  Note that the brackets in these
2811 class names are part of the symbolic names, and must be included
2812 in addition to the brackets delimiting the bracket list.  For
2813 example, <bf/&lsqb;&lsqb;:digit:&rsqb;&rsqb;/ is equivalent to
2814 <bf/&lsqb;0-9&rsqb;/.
2815
2816 Two additional special sequences can appear in character lists.  These
2817 apply to non-ASCII character sets, which can have single symbols (called
2818 collating elements) that are represented with more than one character,
2819 as well as several characters that are equivalent for collating or
2820 sorting purposes:
2821
2822 <descrip>
2823 <tag/Collating Symbols/
2824 A collating symbol is a multi-character collating element enclosed in
2825 ``&lsqb;.'' and ``.&rsqb;''.  For example, if ``ch'' is a collating
2826 element, then <bf/&lsqb;&lsqb;.ch.&rsqb;&rsqb;/ is a regexp that matches
2827 this collating element, while <bf/&lsqb;ch&rsqb;/ is a regexp that
2828 matches either ``c'' or ``h''.
2829 <tag/Equivalence Classes/
2830 An equivalence class is a locale-specific name for a list of
2831 characters that are equivalent. The name is enclosed in ``&lsqb;=''
2832 and ``=&rsqb;''.  For example, the name ``e'' might be used to
2833 represent all of ``&egrave;'' ``&eacute;'' and ``e''.  In this case,
2834 <bf/&lsqb;&lsqb;=e=&rsqb;&rsqb;/ is a regexp that matches any of
2835 ``&egrave;'', ``&eacute;'' and ``e''.
2836 </descrip>
2837
2838 A regular expression matching a single character may be followed by one
2839 of several repetition operators:
2840
2841 <descrip>
2842 <tag/?/
2843 The preceding item is optional and matched at most once.
2844 <tag/*/
2845 The preceding item will be matched zero or more times.
2846 <tag/+/
2847 The preceding item will be matched one or more times.
2848 <tag/&lcub;n&rcub;/
2849 The preceding item is matched exactly <em/n/ times.
2850 <tag/&lcub;n,&rcub;/
2851 The preceding item is matched <em/n/ or more times.
2852 <tag/&lcub;,m&rcub;/
2853 The preceding item is matched at most <em/m/ times.
2854 <tag/&lcub;n,m&rcub;/
2855 The preceding item is matched at least <em/n/ times, but no more than
2856 <em/m/ times.
2857 </descrip>
2858
2859 Two regular expressions may be concatenated; the resulting regular
2860 expression matches any string formed by concatenating two substrings
2861 that respectively match the concatenated subexpressions.
2862
2863 Two regular expressions may be joined by the infix operator ``|'';
2864 the resulting regular expression matches any string matching either
2865 subexpression.
2866
2867 Repetition takes precedence over concatenation, which in turn takes
2868 precedence over alternation.  A whole subexpression may be enclosed in
2869 parentheses to override these precedence rules.
2870
2871 <bf/Note:/ If you compile Mutt-ng with the GNU <em/rx/ package, the
2872 following operators may also be used in regular expressions:
2873
2874 <descrip>
2875 <tag/&bsol;&bsol;y/
2876 Matches the empty string at either the beginning or the end of a word.
2877 <tag/&bsol;&bsol;B/
2878 Matches the empty string within a word.
2879 <tag/&bsol;&bsol;&lt;/
2880 Matches the empty string at the beginning of a word.
2881 <tag/&bsol;&bsol;&gt;/
2882 Matches the empty string at the end of a word.
2883 <tag/&bsol;&bsol;w/
2884 Matches any word-constituent character (letter, digit, or underscore).
2885 <tag/&bsol;&bsol;W/
2886 Matches any character that is not word-constituent.
2887 <tag/&bsol;&bsol;`/
2888 Matches the empty string at the beginning of a buffer (string).
2889 <tag/&bsol;&bsol;'/
2890 Matches the empty string at the end of a buffer.
2891 </descrip>
2892
2893 Please note however that these operators are not defined by POSIX, so
2894 they may or may not be available in stock libraries on various systems.
2895
2896 <!--}}}--> 
2897
2898 <sect>Patterns <!--{{{--> 
2899
2900 <p>Mutt-ng's pattern language provides a simple yet effective way to
2901 set up rules to match messages, e.g. for operations like tagging and
2902 scoring. A pattern consists of one or more sub-pattern, which can be
2903 logically grouped, ORed, and negated. For a complete listing of
2904 these patterns, please refer to table <ref id="patterns"
2905 name="Patterns"> in the Reference chapter.
2906
2907 <p>It must be noted that in this table, <tt/EXPR/, <tt/USER/,
2908 <tt/ID/ and <tt/SUBJECT/ are regular expressions. For ranges, the
2909 forms <tt/&lt;[MAX]/, <tt/&gt;>[MIN]/, <tt/[MIN]-/ and <tt/-[MAX]/
2910 are also possible.
2911
2912 <sect1>Complex Patterns 
2913
2914 <p>It is possible to combine several sub-patterns to a more complex
2915 pattern. The most simple possibility is to logically AND several
2916 patterns by stringing them together:
2917
2918 <verb>
2919 ~s 'SPAM' ~U</verb>
2920
2921 <p>The pattern above matches all messages that contain ``SPAM'' in
2922 the subject and are unread.
2923
2924 <p>To logical OR patterns, simply use the <tt/|/ operator. This one
2925 especially useful when using local groups:
2926
2927 <verb>
2928 ~f ("nion@muttng\.org"|"ak@muttng\.org"|"pdmef@muttng\.org")
2929 (~b mutt-ng|~s Mutt-ng)
2930 !~x '@synflood\.at'</verb>
2931
2932 <p>The first pattern matches all messages that were sent by one of
2933 the mutt-ng maintainers, while the seconds pattern matches all
2934 messages that contain ``mutt-ng'' in the message body or ``Mutt-ng''
2935 in the subject. The third pattern matches all messages that do not
2936 contain ``@synflood\.at'' in the <tt/References:/ header, i.e.
2937 messages that are not an (indirect) reply to one of my messages. A
2938 pattern can be logicall negated using the <tt/!/ operator.
2939
2940 <sect1>Patterns and Dates 
2941
2942 <p>When using dates in patterns, the dates must be specified in a
2943 special format, i.e.  <tt>DD/MM/YYYY</tt>. If you don't specify
2944 month or year, they default to the current month or year. When using
2945 date ranges, and you specify only the minimum or the maximum, the
2946 specified date will be excluded, e.g. <tt>01/06/2005-</tt> matches
2947 against all messages <em/after/ Juni 1st, 2005.
2948
2949 <p>It is also possible to use so-called ``error margins'' when
2950 specifying date ranges.  You simply specify a date, and then the
2951 error margin. This margin needs to contain the information whether
2952 it goes ``forth'' or ``back'' in time, by using <tt/+/ and <tt/-/.
2953 Then follows a number and a unit, i.e. <tt/y/ for years, <tt/m/ for
2954 months, <tt/w/ for weeks and <tt/d/ for days. If you use the special
2955 <tt/*/ sign, it means that the error margin goes to both
2956 ``directions'' in time.
2957
2958 <verb>
2959 ~d 01/01/2005+1y
2960 ~d 18/10/2004-2w
2961 ~d 28/12/2004*1d</verb>
2962
2963 <p>The first pattern matches all dates between January 1st, 2005 and
2964 January 1st 2006.  The second pattern matches all dates between
2965 October 18th, 2004 and October 4th 2004 (2 weeks before 18/10/2004),
2966 while the third pattern matches all dates 1 day around December
2967 28th, 2004 (i.e. Dec 27th, 28th and 29th).
2968
2969 <p>Relative dates are also very important, as they make it possible
2970 to specify date ranges between a fixed number of units and the
2971 current date. How this works can be seen in the following example:
2972
2973 <verb>
2974 ~d &gt;2w # messages older than two weeks
2975 ~d &lt;3d # messages newer than 3 days
2976 ~d =1m # messages that are exactly one month old</verb>
2977
2978 <!--}}}--> 
2979
2980   <sect>Format Strings <!--{{{--> 
2981
2982     <sect1>Introduction <!--{{{--> 
2983   
2984       <p>The so called <em/Format Strings/ offer great flexibility when
2985       configuring mutt-ng. In short, they describe what items to print
2986       out how in menus and status messages.
2987
2988       <p>Basically, they work as this: for different menus and bars,
2989       there's a variable specifying the layout. For every item
2990       available, there is a so called <em/expando/.
2991       
2992       <p>For example, when running mutt-ng on different machines or
2993       different versions for testing purposes, it may be interesting to
2994       have the following information always printed on screen when one
2995       is in the index:
2996
2997       <itemize>
2998
2999         <item>the current hostname
3000
3001         <item>the current mutt-ng version number
3002
3003       </itemize>
3004
3005       <p>The setting for the status bar of the index is controlled via the
3006       <ref id="status_format" name="&dollar;status&lowbar;format">
3007       variable. For the hostname and version string, there's an expando
3008       for <tt>&dollar;status&lowbar;format</tt>: <tt/%h/ expands to the
3009       hostname and <tt/%v/ to the version string. When just configuring:
3010
3011       <verb>
3012 set status_format = "%v on %h: ..."</verb>
3013
3014       <p>mutt-ng will replace the sequence <tt/%v/ with the version string
3015       and <tt/%h/ with the host's name. When you are, for example, running
3016       mutt-ng version <tt/1.5.9i/ on host <tt/mailhost/, you'll see the
3017       following when you're in the index:
3018
3019       <verb>
3020 Mutt-ng 1.5.9i on mailhost: ...</verb>
3021
3022       <p>In the index, there're more useful information one could want to 
3023       see:
3024
3025       <itemize>
3026
3027         <item>which mailbox is open
3028
3029         <item>how man new, flagged or postponed messages
3030
3031         <item>...
3032
3033       </itemize>
3034
3035       <p>To include the mailbox' name is as easy as:
3036
3037       <verb>
3038 set status_format = "%v on %h: %B: ...</verb>
3039
3040       <p>When the currently opened mailbox is <tt/Inbox/, this will be expanded
3041       to:
3042
3043       <verb>
3044 Mutt-ng 1.5.9i on mailhost: Inbox: ...</verb>
3045       
3046       <p>For the number of certain types of messages, one more feature of the format
3047       strings is extremely useful. If there aren't messages of a certain type, it
3048       may not be desired to print just that there aren't any but instead only
3049       print something if there are any.
3050
3051     <!--}}}--> 
3052
3053     <sect1>Conditional Expansion <!--{{{--> 
3054       
3055       <p>To only print the number of messages if there are new messages in
3056       the current mailbox, further extend
3057       <tt/&dollar;status&lowbar;format/ to:
3058
3059       <verb>
3060 set status_format = "%v on %h: %B %?n?%n new? ...</verb>
3061
3062       <p>This feature is called <em/nonzero-printing/ and works as this:
3063       some expandos may be optionally printed nonzero, i.e.  a portion
3064       of the format string is only evaluated if the value of the expando
3065       is different from zero. The basic syntax is:
3066
3067       <verb>
3068 %?<item>?<string if nonzero>?</verb>
3069
3070       <p>which tells mutt-ng to only look at <tt>&lt;string if
3071       nonzero&gt;</tt> if the value of the <tt>%&lt;item%gt;</tt>
3072       expando is different from zero. In our example, we used <tt/n/ as
3073       the expando to check for and <tt/%n new/ as the optional nonzero
3074       string.
3075
3076       <p>But this is not all: this feature only offers one alternative: 
3077       ``print something if not zero.'' Mutt-ng does, as you might guess, 
3078       also provide a logically complete version: ``if zero, print 
3079       something and else print something else.'' This is achieved by the 
3080       following syntax for those expandos which may be printed nonzero:
3081
3082       <verb>
3083 %?<item>?<string if nonzero>&<string if zero>?</verb>
3084
3085       <p>Using this we can make mutt-ng to do the following:
3086
3087       <itemize>
3088
3089         <item> make it print ``<em/n/ new messages'' whereby <em/n/ is the
3090           count but only if there new ones
3091
3092         <item> and make it print ``no new messages'' if there aren't any
3093
3094       </itemize>
3095
3096       <p>The corresponding configuration is:
3097
3098       <verb>
3099 set status_format = "%v on %h: %B: %?n?%n new messages&amp;no new messages? ...</verb>
3100
3101       <p>This doubles the use of the ``new messages'' string because it'll get
3102       always printed. Thus, it can be shortened to:
3103
3104       <verb>
3105 set status_format = "%v on %h: %B: %?n?%n&amp;no? new messages ...</verb>
3106
3107       <p>As you might see from this rather simple example, one can create
3108       very complex but fancy status messages. Please see the reference
3109       chapter for expandos and those which may be printed nonzero.
3110
3111     <!--}}}--> 
3112  
3113     <sect1>Modifications and Padding <!--{{{--> 
3114
3115       <p>Besides the information given so far, there're even more features of
3116       format strings:
3117
3118       <itemize>
3119
3120         <item>When specifying <tt>%&lowbar;&lt;item&gt;</tt> instead of
3121           just <tt>%&lt;item&gt;</tt>, mutt-ng will convert all
3122           characters in the expansion of <tt>&lt;item&gt;</tt> to
3123           lowercase.
3124
3125         <item>When specifying <tt>%:&lt;item&gt;</tt> instead of just
3126           <tt>%&lt;item&gt;</tt>, mutt-ng will convert all dots in the
3127           expansion of <tt>&lt;item&gt;</tt> to underscores
3128           (<tt>&lowbar;</tt>).
3129
3130       </itemize>
3131     
3132       <p>Also, there's a feature called <em/Padding/ supplied by the
3133       following two expandos: <tt/%|X/ and <tt/%&gt;X/.
3134
3135       <descrip>
3136
3137         <tag><tt>%|X</tt></tag> When this occurs, mutt-ng will fill the
3138           rest of the line with the character <tt/X/. In our example,
3139           filling the rest of the line with dashes is done by setting:
3140
3141           <verb>
3142 set status_format = "%v on %h: %B: %?n?%n&amp;no? new messages %|-"</verb>
3143
3144         <tag><tt>%&gt;X</tt></tag> Since the previous expando stops at
3145           the end of line, there must be a way to fill the gap between
3146           two items via the <tt>%&gt;X</tt> expando: it puts as many
3147           characters <tt>X</tt> in between two items so that the rest of
3148           the line will be right-justified. For example, to not put the
3149           version string and hostname of our example on the left but on
3150           the right and fill the gap with spaces, one might use (note
3151           the space after <tt>%&gt;</tt>):
3152
3153           <verb>
3154 set status_format = "%B: %?n?%n&amp;no? new messages %> (%v on %h)"</verb>
3155
3156       </descrip>
3157
3158     <!--}}}--> 
3159  
3160   <!--}}}--> 
3161  
3162 <sect>Using Tags <!--{{{--> 
3163 <p>
3164
3165 Sometimes it is desirable to perform an operation on a group of
3166 messages all at once rather than one at a time.  An example might be
3167 to save messages to a mailing list to a separate folder, or to
3168 delete all messages with a given subject.  To tag all messages
3169 matching a pattern, use the tag-pattern function, which is bound to
3170 ``shift-T'' by default.  Or you can select individual messages by
3171 hand using the ``tag-message'' function, which is bound to ``t'' by
3172 default.  See <ref id="patterns" name="patterns"> for Mutt-ng's pattern
3173 matching syntax.
3174
3175 Once you have tagged the desired messages, you can use the
3176 ``tag-prefix'' operator, which is the ``;'' (semicolon) key by default.
3177 When the ``tag-prefix'' operator is used, the <bf/next/ operation will
3178 be applied to all tagged messages if that operation can be used in that
3179 manner.  If the <ref id="auto_tag" name="&dollar;auto&lowbar;tag">
3180 variable is set, the next operation applies to the tagged messages
3181 automatically, without requiring the ``tag-prefix''.
3182
3183 In <ref id="macro" name="macros"> or <ref id="push" name="push"> commands,
3184 you can use the ``tag-prefix-cond'' operator.  If there are no tagged
3185 messages, mutt will "eat" the rest of the macro to abort it's execution.
3186 Mutt-ng will stop "eating" the macro when it encounters the ``end-cond''
3187 operator;  after this operator the rest of the macro will be executed as
3188 normal.
3189
3190 <!--}}}--> 
3191
3192 <sect>Using Hooks<label id="hooks"> <!--{{{--> 
3193 <p>
3194 A <em/hook/ is a concept borrowed from the EMACS editor which allows you to
3195 execute arbitrary commands before performing some operation.  For example,
3196 you may wish to tailor your configuration based upon which mailbox you are
3197 reading, or to whom you are sending mail.  In the Mutt-ng world, a <em/hook/
3198 consists of a <ref id="regexp" name="regular expression"> or
3199 <ref id="patterns" name="pattern"> along with a
3200 configuration option/command.  See
3201 <itemize>
3202 <item><ref id="folder-hook" name="folder-hook">
3203 <item><ref id="send-hook" name="send-hook">
3204 <item><ref id="message-hook" name="message-hook">
3205 <item><ref id="save-hook" name="save-hook">
3206 <item><ref id="mbox-hook" name="mbox-hook">
3207 <item><ref id="fcc-hook" name="fcc-hook">
3208 <item><ref id="fcc-save-hook" name="fcc-save-hook">
3209 </itemize>
3210 for specific details on each type of <em/hook/ available.
3211
3212 <bf/Note:/ if a hook changes configuration settings, these changes remain
3213 effective until the end of the current mutt session. As this is generally
3214 not desired, a default hook needs to be added before all other hooks to
3215 restore configuration defaults. Here is an example with send-hook and the
3216 my_hdr directive:
3217
3218 <tscreen><verb>
3219 send-hook . 'unmy_hdr From:'
3220 send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
3221 </verb></tscreen>
3222
3223 <sect1>Message Matching in Hooks<label id="pattern_hook">
3224 <p>
3225 Hooks that act upon messages (<tt/send-hook, save-hook, fcc-hook,
3226 message-hook/) are evaluated in a slightly different manner.  For the other
3227 types of hooks, a <ref id="regexp" name="regular expression"> is
3228 sufficient.  But in dealing with messages a finer grain of control is
3229 needed for matching since for different purposes you want to match
3230 different criteria.
3231
3232 Mutt-ng allows the use of the <ref id="patterns" name="search pattern">
3233 language for matching messages in hook commands.  This works in
3234 exactly the same way as it would when <em/limiting/ or
3235 <em/searching/ the mailbox, except that you are restricted to those
3236 operators which match information mutt extracts from the header of
3237 the message (i.e.  from, to, cc, date, subject, etc.).
3238
3239 For example, if you wanted to set your return address based upon sending
3240 mail to a specific address, you could do something like:
3241 <tscreen><verb>
3242 send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt-ng User <user@host>'
3243 </verb></tscreen>
3244 which would execute the given command when sending mail to
3245 <em/me@cs.hmc.edu/.
3246
3247 However, it is not required that you write the pattern to match using the
3248 full searching language.  You can still specify a simple <em/regular
3249 expression/ like the other hooks, in which case Mutt-ng will translate your
3250 pattern into the full language, using the translation specified by the 
3251 <ref id="default_hook" name="&dollar;default&lowbar;hook"> variable.  The
3252 pattern is translated at the time the hook is declared, so the value of 
3253 <ref id="default_hook" name="&dollar;default&lowbar;hook"> that is in effect
3254 at that time will be used.
3255
3256 <!--}}}--> 
3257
3258 <sect>Using the sidebar<label id="sidebar"> <!--{{{--> 
3259 <p>
3260 The sidebar, a feature specific to Mutt-ng, allows you to use a mailbox listing 
3261 which looks very similar to the ones you probably know from GUI mail clients.
3262 The sidebar lists all specified mailboxes, shows the number in each
3263 and highlights the ones with new email
3264 Use the following configuration commands:
3265 <tscreen><verb>
3266 set sidebar_visible="yes"
3267 set sidebar_width=25
3268 </verb></tscreen>
3269
3270 If you want to specify the mailboxes you can do so with:
3271 <tscreen><verb>
3272 set mbox='=INBOX'
3273 mailboxes INBOX \
3274           MBOX1 \
3275           MBOX2 \
3276           ...
3277 </verb></tscreen>
3278
3279 You can also specify the colors for mailboxes with new mails by using:
3280 <tscreen><verb>
3281 color sidebar_new red black
3282 color sidebar white black
3283 </verb></tscreen>
3284
3285 The available functions are:
3286 <tscreen><verb>
3287 sidebar-scroll-up      Scrolls the mailbox list up 1 page
3288 sidebar-scroll-down    Scrolls the mailbox list down 1 page
3289 sidebar-next           Highlights the next mailbox
3290 sidebar-next-new       Highlights the next mailbox with new mail
3291 sidebar-previous       Highlights the previous mailbox
3292 sidebar-open           Opens the currently highlighted mailbox
3293 </verb></tscreen>
3294
3295 Reasonable key bindings look e.g. like this:
3296 <tscreen><verb>
3297 bind index \Cp sidebar-prev
3298 bind index \Cn sidebar-next
3299 bind index \Cb sidebar-open
3300 bind pager \Cp sidebar-prev
3301 bind pager \Cn sidebar-next
3302 bind pager \Cb sidebar-open
3303
3304 macro index B ':toggle sidebar_visible^M'
3305 macro pager B ':toggle sidebar_visible^M'
3306 </verb></tscreen>
3307
3308 You can then go up and down by pressing Ctrl-P and Ctrl-N, and 
3309 switch on and off the sidebar simply by pressing 'B'.
3310
3311 <!--}}}--> 
3312
3313 <sect>External Address Queries<label id="query"> <!--{{{--> 
3314 <p>
3315 Mutt-ng supports connecting to external directory databases such as LDAP,
3316 ph/qi, bbdb, or NIS through a wrapper script which connects to mutt
3317 using a simple interface.  Using the <ref id="query_command"
3318 name="&dollar;query&lowbar;command"> variable, you specify the wrapper
3319 command to use.  For example:
3320
3321 <tscreen><verb>
3322 set query_command = "mutt_ldap_query.pl '%s'"
3323 </verb></tscreen>
3324
3325 The wrapper script should accept the query on the command-line.  It
3326 should return a one line message, then each matching response on a
3327 single line, each line containing a tab separated address then name then
3328 some other optional information.  On error, or if there are no matching
3329 addresses, return a non-zero exit code and a one line error message.
3330
3331 An example multiple response output:
3332 <tscreen><verb>
3333 Searching database ... 20 entries ... 3 matching:
3334 me@cs.hmc.edu           Michael Elkins  mutt dude
3335 blong@fiction.net       Brandon Long    mutt and more
3336 roessler@guug.de        Thomas Roessler mutt pgp
3337 </verb></tscreen>
3338
3339 There are two mechanisms for accessing the query function of mutt.  One
3340 is to do a query from the index menu using the query function (default: Q).
3341 This will prompt for a query, then bring up the query menu which will
3342 list the matching responses.  From the query menu, you can select
3343 addresses to create aliases, or to mail.  You can tag multiple addresses
3344 to mail, start a new query, or have a new query appended to the current
3345 responses.
3346
3347 The other mechanism for accessing the query function is for address
3348 completion, similar to the alias completion.  In any prompt for address
3349 entry, you can use the complete-query function (default: ^T) to run a
3350 query based on the current address you have typed.  Like aliases, mutt
3351 will look for what you have typed back to the last space or comma.  If
3352 there is a single response for that query, mutt will expand the address
3353 in place.  If there are multiple responses, mutt will activate the query
3354 menu.  At the query menu, you can select one or more addresses to be
3355 added to the prompt.
3356
3357 <!--}}}--> 
3358
3359 <sect>Mailbox Formats <!--{{{--> 
3360 <p>
3361 Mutt-ng supports reading and writing of four different mailbox formats:
3362 mbox, MMDF, MH and Maildir.  The mailbox type is autodetected, so there
3363 is no need to use a flag for different mailbox types.  When creating new
3364 mailboxes, Mutt-ng uses the default specified with the <ref id="mbox_type"
3365 name="&dollar;mbox&lowbar;type"> variable.
3366
3367 <bf/mbox/.  This is the most widely used mailbox format for UNIX.  All
3368 messages are stored in a single file.  Each message has a line of the form:
3369
3370 <tscreen><verb>
3371 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
3372 </verb></tscreen>
3373
3374 to denote the start of a new message (this is often referred to as the
3375 ``From&lowbar;'' line).
3376
3377 <bf/MMDF/.  This is a variant of the <em/mbox/ format.  Each message is
3378 surrounded by lines containing ``^A^A^A^A'' (four control-A's).
3379
3380 <bf/MH/. A radical departure from <em/mbox/ and <em/MMDF/, a mailbox
3381 consists of a directory and each message is stored in a separate file.
3382 The filename indicates the message number (however, this is may not
3383 correspond to the message number Mutt-ng displays). Deleted messages are
3384 renamed with a comma (,) prepended to the filename. <bf/Note:/ Mutt
3385 detects this type of mailbox by looking for either <tt/.mh&lowbar;sequences/
3386 or <tt/.xmhcache/ (needed to distinguish normal directories from MH
3387 mailboxes).
3388
3389 <bf/Maildir/.  The newest of the mailbox formats, used by the Qmail MTA (a
3390 replacement for sendmail).  Similar to <em/MH/, except that it adds three
3391 subdirectories of the mailbox: <em/tmp/, <em/new/ and <em/cur/.  Filenames
3392 for the messages are chosen in such a way they are unique, even when two
3393 programs are writing the mailbox over NFS, which means that no file locking
3394 is needed.
3395
3396 <!--}}}--> 
3397
3398 <sect>Mailbox Shortcuts<label id="shortcuts"> <!--{{{--> 
3399 <p>
3400 There are a number of built in shortcuts which refer to specific mailboxes.
3401 These shortcuts can be used anywhere you are prompted for a file or mailbox
3402 path.
3403
3404 <itemize>
3405 <item>! -- refers to your <ref id="spoolfile" name="&dollar;spoolfile"> (incoming) mailbox
3406 <item>&gt; -- refers to your <ref id="mbox" name="&dollar;mbox"> file
3407 <item>&lt; -- refers to your <ref id="record" name="&dollar;record"> file
3408 <item>^ -- refers to the current mailbox
3409 <item>- or !! -- refers to the file you've last visited
3410 <item>&tilde; -- refers to your home directory
3411 <item>= or + -- refers to your <ref id="folder" name="&dollar;folder"> directory
3412 <item>@<em/alias/ -- refers to the <ref id="save-hook" 
3413 name="default save folder"> as determined by the address of the alias
3414 </itemize>
3415
3416 <!--}}}--> 
3417
3418 <sect>Handling Mailing Lists<label id="using_lists"> <!--{{{--> 
3419 <p>
3420
3421 Mutt-ng has a few configuration options that make dealing with large
3422 amounts of mail easier.  The first thing you must do is to let Mutt
3423 know what addresses you consider to be mailing lists (technically
3424 this does not have to be a mailing list, but that is what it is most
3425 often used for), and what lists you are subscribed to.  This is
3426 accomplished through the use of the <ref id="lists"
3427 name="lists and subscribe"> commands in your muttrc.
3428
3429 Now that Mutt-ng knows what your mailing lists are, it can do several
3430 things, the first of which is the ability to show the name of a list
3431 through which you received a message (i.e., of a subscribed list) in
3432 the <em/index/ menu display.  This is useful to distinguish between
3433 personal and list mail in the same mailbox.  In the <ref id="index_format"
3434 name="&dollar;index&lowbar;format"> variable, the escape ``&percnt;L''
3435 will return the string ``To &lt;list&gt;'' when ``list'' appears in the
3436 ``To'' field, and ``Cc &lt;list&gt;'' when it appears in the ``Cc''
3437 field (otherwise it returns the name of the author).
3438
3439 Often times the ``To'' and ``Cc'' fields in mailing list messages
3440 tend to get quite large. Most people do not bother to remove the
3441 author of the message they are reply to from the list, resulting in
3442 two or more copies being sent to that person.  The ``list-reply''
3443 function, which by default is bound to ``L'' in the <em/index/ menu
3444 and <em/pager/, helps reduce the clutter by only replying to the
3445 known mailing list addresses instead of all recipients (except as
3446 specified by <tt/Mail-Followup-To/, see below).
3447
3448 Mutt-ng also supports the <tt/Mail-Followup-To/ header.  When you send
3449 a message to a list of recipients which includes one or several
3450 subscribed mailing lists, and if the <ref id="followup_to"
3451 name="&dollar;followup&lowbar;to"> option is set, mutt will generate
3452 a Mail-Followup-To header which contains all the recipients to whom
3453 you send this message, but not your address. This indicates that
3454 group-replies or list-replies (also known as ``followups'') to this
3455 message should only be sent to the original recipients of the
3456 message, and not separately to you - you'll receive your copy through
3457 one of the mailing lists you are subscribed to.
3458
3459 Conversely, when group-replying or list-replying to a message which
3460 has a <tt/Mail-Followup-To/ header, mutt will respect this header if
3461 the <ref id="honor_followup_to"
3462 name="&dollar;honor&lowbar;followup&lowbar;to"> configuration
3463 variable is set.  Using list-reply will in this case also make sure
3464 that the reply goes to the mailing list, even if it's not specified
3465 in the list of recipients in the <tt/Mail-Followup-To/.
3466
3467 Note that, when header editing is enabled, you can create a
3468 <tt/Mail-Followup-To/ header manually.  Mutt-ng will only auto-generate
3469 this header if it doesn't exist when you send the message.
3470
3471
3472 The other method some mailing list admins use is to generate a
3473 ``Reply-To'' field which points back to the mailing list address rather
3474 than the author of the message.  This can create problems when trying
3475 to reply directly to the author in private, since most mail clients
3476 will automatically reply to the address given in the ``Reply-To''
3477 field.  Mutt-ng uses the <ref id="reply_to" name="&dollar;reply&lowbar;to">
3478 variable to help decide which address to use.  If set to <em/ask-yes/ or
3479 <em/ask-no/, you will be
3480 prompted as to whether or not you would like to use the address given in
3481 the ``Reply-To'' field, or reply directly to the address given in the
3482 ``From'' field.  When set to <em/yes/, the ``Reply-To'' field will be used when
3483 present.
3484
3485 The ``X-Label:'' header field can be used to further identify mailing
3486 lists or list subject matter (or just to annotate messages
3487 individually).  The <ref id="index_format"
3488 name="&dollar;index&lowbar;format"> variable's ``&percnt;y'' and
3489 ``&percnt;Y'' escapes can be used to expand ``X-Label:'' fields in the
3490 index, and Mutt-ng's pattern-matcher can match regular expressions to
3491 ``X-Label:'' fields with the ``&tilde;y'' selector.  ``X-Label:'' is not a
3492 standard message header field, but it can easily be inserted by procmail
3493 and other mail filtering agents.
3494
3495 Lastly, Mutt-ng has the ability to <ref id="sort" name="sort"> the mailbox into
3496 <ref id="threads" name="threads">.  A thread is a group of messages which all relate to the same
3497 subject.  This is usually organized into a tree-like structure where a
3498 message and all of its replies are represented graphically.  If you've ever
3499 used a threaded news client, this is the same concept.  It makes dealing
3500 with large volume mailing lists easier because you can easily delete
3501 uninteresting threads and quickly find topics of value.
3502
3503 <!--}}}--> 
3504
3505 <sect>Editing threads <!--{{{--> 
3506 <p>
3507 Mutt-ng has the ability to dynamically restructure threads that are broken
3508 either by misconfigured software or bad behavior from some
3509 correspondents. This allows to clean your mailboxes formats) from these
3510 annoyances which make it hard to follow a discussion.
3511
3512 <sect1>Linking threads
3513 <p>
3514
3515 Some mailers tend to "forget" to correctly set the "In-Reply-To:" and
3516 "References:" headers when replying to a message. This results in broken
3517 discussions because Mutt-ng has not enough information to guess the correct
3518 threading.
3519 You can fix this by tagging the reply, then moving to the parent message
3520 and using the ``link-threads'' function (bound to & by default). The
3521 reply will then be connected to this "parent" message.
3522
3523 You can also connect multiple children at once, tagging them and using the
3524 tag-prefix command (';') or the auto_tag option.
3525
3526 <sect1>Breaking threads
3527 <p>
3528
3529 On mailing lists, some people are in the bad habit of starting a new
3530 discussion by hitting "reply" to any message from the list and changing
3531 the subject to a totally unrelated one.
3532 You can fix such threads by using the ``break-thread'' function (bound
3533 by default to #), which will turn the subthread starting from the
3534 current message into a whole different thread.
3535
3536 <!--}}}--> 
3537
3538 <sect>Delivery Status Notification (DSN) Support<label id="dsn"> <!--{{{--> 
3539 <p>
3540
3541 RFC1894 defines a set of MIME content types for relaying information
3542 about the status of electronic mail messages.  These can be thought of as
3543 ``return receipts.''
3544
3545 Users can make use of it in one of the following two ways:
3546
3547 <itemize>
3548   <item>Berkeley sendmail 8.8.x currently has some command line options
3549     in which the mail client can make requests as to what type of status
3550     messages should be returned.
3551   <item>The SMTP support via libESMTP supports it, too.
3552 </itemize>
3553
3554 To support this, there are two variables:
3555
3556 <itemize>
3557
3558   <item><ref id="dsn_notify" name="&dollar;dsn&lowbar;notify"> is used
3559     to request receipts for different results (such as failed message,
3560     message delivered, etc.).
3561
3562   <item><ref id="dsn_return" name="&dollar;dsn&lowbar;return"> requests
3563     how much of your message should be returned with the receipt
3564     (headers or full message).
3565
3566 </itemize>
3567
3568 Please see the reference chapter for possible values.
3569
3570 <!--}}}--> 
3571
3572 <sect>POP3 Support (OPTIONAL) <!--{{{--> 
3573 <p>
3574
3575 If Mutt-ng was compiled with POP3 support (by running the <em/configure/
3576 script with the <em/--enable-pop/ flag), it has the ability to work
3577 with mailboxes located on a remote POP3 server and fetch mail for local
3578 browsing.
3579
3580 You can access the remote POP3 mailbox by selecting the folder
3581 <tt>pop://popserver/</tt>.
3582
3583 You can select an alternative port by specifying it with the server, i.e.:
3584 <tt>pop://popserver:port/</tt>.
3585
3586 You can also specify different username for each folder, i.e.:
3587 <tt>pop://username@popserver[:port]/</tt>.
3588
3589 Polling for new mail is more expensive over POP3 than locally. For this
3590 reason the frequency at which Mutt-ng will check for mail remotely can be
3591 controlled by the
3592 <ref id="pop_mail_check" name="&dollar;pop&lowbar;mail&lowbar;check">
3593 variable, which defaults to every 60 seconds.
3594
3595 If Mutt-ng was compiled with SSL support (by running the <em/configure/
3596 script with the <em/--with-ssl/ flag), connections to POP3 servers
3597 can be encrypted. This naturally requires that the server supports
3598 SSL encrypted connections. To access a folder with POP3/SSL, you should
3599 use pops: prefix, ie:
3600 <tt>pops://[username@]popserver[:port]/</tt>.
3601
3602 Another way to access your POP3 mail is the <em/fetch-mail/ function
3603 (default: G).  It allows to connect to <ref id="pop_host"
3604 name="pop&lowbar;host">, fetch all your new mail and place it in the
3605 local <ref id="spoolfile" name="spoolfile">.  After this
3606 point, Mutt-ng runs exactly as if the mail had always been local.
3607
3608 <bf/Note:/ If you only need to fetch all messages to local mailbox
3609 you should consider using a specialized program, such as <htmlurl
3610 url="http://www.ccil.org/~esr/fetchmail" name="fetchmail">
3611
3612 <!--}}}--> 
3613
3614 <sect>IMAP Support (OPTIONAL) <!--{{{--> 
3615 <p>
3616
3617 If Mutt-ng was compiled with IMAP support (by running the <em/configure/
3618 script with the <em/--enable-imap/ flag), it has the ability to work
3619 with folders located on a remote IMAP server.
3620
3621 You can access the remote inbox by selecting the folder
3622 <tt>imap://imapserver/INBOX</tt>, where <tt/imapserver/ is the name of the
3623 IMAP server and <tt/INBOX/ is the special name for your spool mailbox on
3624 the IMAP server. If you want to access another mail folder at the IMAP
3625 server, you should use <tt>imap://imapserver/path/to/folder</tt> where
3626 <tt>path/to/folder</tt> is the path of the folder you want to access.
3627
3628 You can select an alternative port by specifying it with the server, i.e.:
3629 <tt>imap://imapserver:port/INBOX</tt>.
3630
3631 You can also specify different username for each folder, i.e.:
3632 <tt>imap://username@imapserver[:port]/INBOX</tt>.
3633
3634 If Mutt-ng was compiled with SSL support (by running the <em/configure/
3635 script with the <em/--with-ssl/ flag), connections to IMAP servers
3636 can be encrypted. This naturally requires that the server supports
3637 SSL encrypted connections. To access a folder with IMAP/SSL, you should
3638 use <tt>imaps://[username@]imapserver[:port]/path/to/folder</tt> as your 
3639 folder path.
3640
3641 Pine-compatible notation is also supported, i.e.
3642 <tt>{[username@]imapserver[:port][/ssl]}path/to/folder</tt>
3643
3644 Note that not all servers use / as the hierarchy separator.  Mutt-ng should
3645 correctly notice which separator is being used by the server and convert
3646 paths accordingly.
3647
3648 When browsing folders on an IMAP server, you can toggle whether to look
3649 at only the folders you are subscribed to, or all folders with the
3650 <em/toggle-subscribed/ command.  See also the 
3651 <ref id="imap_list_subscribed"
3652 name="&dollar;imap&lowbar;list&lowbar;subscribed"> variable.
3653
3654 Polling for new mail on an IMAP server can cause noticeable delays. So, you'll
3655 want to carefully tune the
3656 <ref id="imap_mail_check" name="&dollar;imap&lowbar;mail&lowbar;check">
3657 and
3658 <ref id="timeout" name="&dollar;timeout">
3659 variables.
3660
3661 Note that if you are using mbox as the mail store on UW servers prior to
3662 v12.250, the server has been reported to disconnect a client if another client
3663 selects the same folder.
3664
3665 <sect1>The Folder Browser
3666 <p>
3667
3668 As of version 1.2, mutt supports browsing mailboxes on an IMAP
3669 server. This is mostly the same as the local file browser, with the
3670 following differences:
3671 <itemize>
3672 <item>Instead of file permissions, mutt displays the string "IMAP",
3673   possibly followed by the symbol "+", indicating
3674   that the entry contains both messages and subfolders. On
3675   Cyrus-like servers folders will often contain both messages and
3676   subfolders. 
3677 <item>For the case where an entry can contain both messages and
3678   subfolders, the selection key (bound to <tt>enter</tt> by default)
3679   will choose to descend into the subfolder view. If you wish to view
3680   the messages in that folder, you must use <tt>view-file</tt> instead
3681   (bound to <tt>space</tt> by default).
3682 <item>You can create, delete and rename mailboxes with the
3683   <tt>create-mailbox</tt>, <tt>delete-mailbox</tt>, and
3684   <tt>rename-mailbox</tt> commands (default bindings: <tt>C</tt>,
3685   <tt>d</tt> and <tt>r</tt>, respectively). You may also
3686   <tt>subscribe</tt> and <tt>unsubscribe</tt> to mailboxes (normally
3687   these are bound to <tt>s</tt> and <tt>u</tt>, respectively).
3688 </itemize>
3689
3690 <sect1>Authentication
3691 <p>
3692
3693 Mutt-ng supports four authentication methods with IMAP servers: SASL,
3694 GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
3695 NTLM authentication for you poor exchange users out there, but it has
3696 yet to be integrated into the main tree). There is also support for
3697 the pseudo-protocol ANONYMOUS, which allows you to log in to a public
3698 IMAP server without having an account. To use ANONYMOUS, simply make
3699 your username blank or "anonymous".
3700 <p>
3701 SASL is a special super-authenticator, which selects among several protocols
3702 (including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most secure
3703 method available on your host and the server. Using some of these methods
3704 (including DIGEST-MD5 and possibly GSSAPI), your entire session will be
3705 encrypted and invisible to those teeming network snoops. It is the best
3706 option if you have it. To use it, you must have the Cyrus SASL library
3707 installed on your system and compile mutt with the <em/--with-sasl/ flag.
3708 <p>
3709 Mutt-ng will try whichever methods are compiled in and available on the server,
3710 in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.
3711
3712 There are a few variables which control authentication: 
3713 <itemize>
3714 <item><ref id="imap_user" name="&dollar;imap&lowbar;user"> - controls
3715   the username under which you request authentication on the IMAP server,
3716   for all authenticators. This is overridden by an explicit username in
3717   the mailbox path (i.e. by using a mailbox name of the form
3718   <tt/{user@host}/).
3719 <item><ref id="imap_pass" name="&dollar;imap&lowbar;pass"> - a
3720   password which you may preset, used by all authentication methods where
3721   a password is needed.
3722 <item><ref id="imap_authenticators"
3723   name="&dollar;imap&lowbar;authenticators"> - a colon-delimited list of IMAP
3724   authentication methods to try, in the order you wish to try them. If
3725   specified, this overrides mutt's default (attempt everything, in the order
3726   listed above).
3727 </itemize>
3728
3729 <!--}}}--> 
3730
3731 <sect>NNTP Support (OPTIONAL)<label id="reading_news"> <!--{{{--> 
3732
3733 <p>If compiled with ``--enable-nntp'' option, Mutt-ng can read news from
3734 a newsserver via NNTP.  You can open a newsgroup with the
3735 ``change-newsgroup'' function from the index/pager which is by default
3736 bound to <tt/i/.
3737
3738 <p>The Default newsserver can be obtained from the
3739 <tt/&dollar;NNTPSERVER/ environment variable. Like other news readers,
3740 info about subscribed newsgroups is saved in a file as specified by the
3741 <ref id="nntp_newsrc" name="&dollar;nntp&lowbar;newsrc"> variable.
3742 Article headers are cached and can be loaded from a file when a
3743 newsgroup is entered instead loading from newsserver; currently, this
3744 caching mechanism still is different from the header caching for
3745 maildir/IMAP.
3746
3747 <sect1>Again: Scoring <!--{{{--> 
3748
3749   <p>Especially for Usenet, people often ask for advanced filtering
3750   and scoring functionality. Of course, mutt-ng has scoring and
3751   allows a killfile, too. How to use a killfile has been discussed
3752   in <ref id="score-command" name="Message scoring">.
3753
3754   <p>What has not been discusses in detail is mutt-ng's built-in
3755   realname filter. For may newsreaders including those for
3756   ``advanced users'' like <em/slrn/ or <em/tin/, there are frequent
3757   request for such functionality. The solutions offered often are
3758   complicated regular expressions.
3759
3760   <p>In mutt-ng this is as easy as
3761
3762   <verb>
3763 score ~* =42
3764   </verb>
3765
3766   <p>This tells mutt-ng to apply a score of 42 to all messages whose
3767   sender specified a valid realname and a valid email address. Using
3768
3769   <verb>
3770 score !~* =42
3771   </verb>
3772
3773   <p>on the contrary applies a score of 42 to all messages <em/not/
3774   matching those criteria which are very strict:
3775
3776   <itemize>
3777
3778     <item>Email addresses must be valid according to RFC 2822, see
3779     <htmlurl url="ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt"
3780     name="&lt;ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt&gt;">
3781
3782     <item>the name must consist of at least 2 fields whereby a field
3783     must not end in a dot. This means that ``Joe User'' and ``Joe A.
3784     User'' are valid while ``J. User'' and ``J. A. User'' aren't.
3785
3786     <item>it's assumed that users are interested in reading their
3787     own mail and mail from people who they have defined an alias for
3788     so that those 2 groups of messages are excluded from the strict
3789     rules.
3790
3791   </itemize>
3792
3793   <!--}}}--> 
3794
3795 <!--}}}--> 
3796
3797 <sect>SMTP Support (OPTIONAL) <!--{{{--> 
3798
3799 <p>Mutt-ng can be built using a library called ``libESMTP'' which
3800 provides SMTP functionality. When <tt/configure/ was called with
3801 <tt/--with-libesmtp/ or the output <tt>muttng -v</tt> contains
3802 <tt>+USE_LIBESMTP</tt>, this will be or is the case already. The SMTP
3803 support includes support for Delivery Status Notification (see <ref
3804 id="dsn" name="Delivery Status Notification"> section) as well as
3805 handling the <tt/8BITMIME/ flag controlled via <ref id="use_8bitmime"
3806 name="&dollar;use&lowbar;8bitmime">.
3807
3808 <p>To enable sending mail directly via SMTP without an MTA such as
3809 Postfix or SSMTP and the like, simply set the <ref id="smtp_host"
3810 name="&dollar;smtp&lowbar;host"> variable pointing to your SMTP server.
3811
3812 <p>Authentication mechanisms are available via the <ref id="smtp_user"
3813 name="&dollar;smtp&lowbar;user"> and <ref id="smtp_pass"
3814 name="&dollar;smtp&lowbar;pass"> variables.
3815
3816 <p>Transport Encryption via the StartTLS command is also available. For
3817 this to work, first of all Mutt-ng must be built with SSL or GNUTLS.
3818 Secondly, the <ref id="smtp_use_tls"
3819 name="&dollar;smtp&lowbar;use&lowbar;tls"> variable must be either set
3820 to ``enabled'' or ``required.'' In both cases, StartTLS will be used if
3821 the server supports it: for the second case, the connection will fail if
3822 it doesn't while switching back to unencrypted communication for the
3823 first one.
3824
3825 <p>Some mail providers require user's to set a particular envelope
3826 sender, i.e. they allow for only one value which may not be what the
3827 user wants to send as the <tt/From:/ header. In this case, the variable
3828 <ref id="smtp_envelope" name="&dollar;smtp&lowbar;envelope"> may be used
3829 to set the envelope different from the <tt/From:/ header.
3830
3831 <!-- }}} -->
3832
3833 <sect>Managing multiple IMAP/POP/NNTP accounts (OPTIONAL)<label id="account-hook"> <!--{{{--> 
3834 <p>
3835
3836 If you happen to have accounts on multiple IMAP and/or POP servers,
3837 you may find managing all the authentication settings inconvenient and
3838 error-prone.  The account-hook command may help. This hook works like
3839 folder-hook but is invoked whenever you access a remote mailbox
3840 (including inside the folder browser), not just when you open the
3841 mailbox.
3842 <p>
3843 Some examples:
3844
3845 <tscreen><verb>
3846 account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
3847 account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
3848 account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'
3849 </verb></tscreen>
3850
3851 <!--}}}--> 
3852
3853 <sect>Start a WWW Browser on URLs (EXTERNAL)<label id="urlview"> <!--{{{--> 
3854 <p>
3855 If a message contains URLs (<em/unified resource locator/ = address in the
3856 WWW space like <em>http://www.mutt.org/</em>), it is efficient to get
3857 a menu with all the URLs and start a WWW browser on one of them.  This
3858 functionality is provided by the external urlview program which can be
3859 retrieved at <htmlurl url="ftp://ftp.mutt.org/mutt/contrib/"
3860 name="ftp://ftp.mutt.org/mutt/contrib/"> and the configuration commands:
3861 <tscreen><verb>
3862 macro index \cb |urlview\n
3863 macro pager \cb |urlview\n
3864 </verb></tscreen>
3865
3866 <!--}}}--> 
3867
3868 <sect>Compressed folders Support (OPTIONAL) <!--{{{--> 
3869 <p>
3870
3871 If Mutt-ng was compiled with compressed folders support (by running the
3872 <em/configure/ script with the <em/--enable-compressed/ flag), Mutt
3873 can open folders stored in an arbitrary format, provided that the user
3874 has a script to convert from/to this format to one of the accepted.
3875
3876 The most common use is to open compressed archived folders e.g. with
3877 gzip.
3878
3879 In addition, the user can provide a script that gets a folder in an
3880 accepted format and appends its context to the folder in the
3881 user-defined format, which may be faster than converting the entire
3882 folder to the accepted format, appending to it and converting back to
3883 the user-defined format.
3884
3885 There are three hooks defined (<ref id="open-hook" name="open-hook">,
3886 <ref id="close-hook" name="close-hook"> and <ref id="append-hook"
3887 name="append-hook">) which define commands to uncompress and compress
3888 a folder and to append messages to an existing compressed folder 
3889 respectively.
3890
3891 For example:
3892
3893 <tscreen><verb>
3894 open-hook \\.gz$ "gzip -cd %f > %t" 
3895 close-hook \\.gz$ "gzip -c %t > %f"
3896 append-hook \\.gz$ "gzip -c %t >> %f" 
3897 </verb></tscreen>
3898
3899 You do not have to specify all of the commands. If you omit <ref
3900 id="append-hook" name="append-hook">, the folder will be open and
3901 closed again each time you will add to it. If you omit <ref
3902 id="close-hook" name="close-hook"> (or give empty command) , the
3903 folder will be open in the  mode. If you specify <ref
3904 id="append-hook" name="append-hook"> though you'll be able to append
3905 to the folder.
3906
3907 Note that Mutt-ng will only try to use hooks if the file is not in one of
3908 the accepted formats. In particular, if the file is empty, mutt
3909 supposes it is not compressed. This is important because it allows the
3910 use of programs that do not have well defined extensions. Just use
3911 &dquot;.&dquot; as a regexp. But this may be surprising if your
3912 compressing script produces empty files. In this situation, unset <ref
3913 id="save_empty" name="&dollar;save&lowbar;empty">, so that the compressed file
3914 will be removed if you delete all of the messages.
3915
3916 <sect1>Open a compressed mailbox for reading<label id="open-hook">
3917 <p>
3918 Usage: <tt/open-hook/ <em/regexp/ &dquot;<em/command/&dquot;
3919
3920 The <em/command/ is the command that can be used for opening the
3921 folders whose names match <em/regexp/.
3922
3923 The <em/command/ string is the printf-like format string, and it
3924 should accept two parameters: &percnt;f, which is replaced with the
3925 (compressed) folder name, and &percnt;t which is replaced with the
3926 name of the temporary folder to which to write.
3927
3928 &percnt;f and &percnt;t can be repeated any number of times in the
3929 command string, and all of the entries are replaced with the
3930 appropriate folder name. In addition, &percnt;&percnt; is replaced by
3931 &percnt;, as in printf, and any other &percnt;anything is left as is.
3932
3933 The <em/command/ should <bf/not/ remove the original compressed file.
3934 The <em/command/ should return non-zero exit status if it fails, so
3935 mutt knows something's wrong.
3936
3937 Example:
3938
3939 <tscreen><verb>
3940 open-hook \\.gz$ "gzip -cd %f > %t" 
3941 </verb></tscreen>
3942
3943 If the <em/command/ is empty, this operation is disabled for this file
3944 type.
3945
3946 <sect1>Write a compressed mailbox<label id="close-hook">
3947 <p>
3948 Usage: <tt/close-hook/ <em/regexp/ &dquot;<em/command/&dquot;
3949
3950 This is used to close the folder that was open with the <ref id="open-hook" 
3951 name="open-hook"> command after some changes were made to it.
3952
3953 The <em/command/ string is the command that can be used for closing the
3954 folders whose names match <em/regexp/. It has the same format as in 
3955 the <ref id="open-hook" name="open-hook"> command. Temporary folder
3956 in this case is the folder previously produced by the <<ref id="open-hook"
3957 name="open-hook"> command.
3958
3959 The <em/command/ should <bf/not/ remove the decompressed file. The
3960 <em/command/ should return non-zero exit status if it fails, so mutt
3961 knows something's wrong.
3962
3963 Example:
3964
3965 <tscreen><verb>
3966 close-hook \\.gz$ "gzip -c %t > %f"
3967 </verb></tscreen>
3968
3969 If the <em/command/ is empty, this operation is disabled for this file
3970 type, and the file can only be open in the readonly mode.
3971
3972 <ref id="close-hook" name ="close-hook"> is not called when you exit
3973 from the folder if the folder was not changed.
3974
3975 <sect1>Append a message to a compressed mailbox<label id="append-hook">
3976 <p>
3977 Usage: <tt/append-hook/ <em/regexp/ &dquot;<em/command/&dquot;
3978
3979 This command is used for saving to an existing compressed folder.
3980 The <em/command/ is the command that can be used for appending to the
3981 folders whose names match <em/regexp/. It has the same format as in 
3982  the <ref id="open-hook" name="open-hook"> command.
3983 The temporary folder in this case contains the messages that are being
3984 appended. 
3985
3986 The <em/command/ should <bf/not/ remove the decompressed file. The
3987 <em/command/ should return non-zero exit status if it fails, so mutt
3988 knows something's wrong.
3989
3990 Example:
3991
3992 <tscreen><verb>
3993 append-hook \\.gz$ "gzip -c %t >> %f" 
3994 </verb></tscreen>
3995
3996 When <ref id="append-hook" name="append-hook"> is used, the folder is
3997 not opened, which saves time, but this means that we can not find out
3998 what the folder type is. Thus the default (<ref id="mbox_type"
3999 name="&dollar;mbox&lowbar;type">) type is always supposed (i.e.
4000 this is the format used for the temporary folder).
4001
4002 If the file does not exist when you save to it, <ref id="close-hook"
4003 name="close-hook"> is called, and not <ref id="append-hook"
4004 name="append-hook">. <ref id="append-hook" name="append-hook"> is only
4005 for appending to existing folders.
4006
4007 If the <em/command/ is empty, this operation is disabled for this file
4008 type. In this case, the folder will be open and closed again (using
4009 <ref id="open-hook" name="open-hook"> and <ref id="close-hook" 
4010 name="close-hook">respectively) each time you will add to it.
4011
4012 <sect1>Encrypted folders
4013 <p>
4014 The compressed folders support can also be used to handle encrypted
4015 folders. If you want to encrypt a folder with PGP, you may want to use
4016 the following hooks:
4017
4018 <tscreen><verb>
4019 open-hook  \\.pgp$ "pgp -f < %f > %t"
4020 close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId < %t > %f"
4021 </verb></tscreen>
4022
4023 Please note, that PGP does not support appending to an encrypted
4024 folder, so there is no append-hook defined.
4025
4026 <bf/Note:/ the folder is temporary stored decrypted in the /tmp
4027 directory, where it can be read by your system administrator. So think
4028 about the security aspects of this.
4029
4030 <!--}}}--> 
4031
4032 <!--}}}--> 
4033
4034 <chapt>Mutt-ng's MIME Support <!--{{{--> 
4035 <p>
4036 Quite a bit of effort has been made to make Mutt-ng the premier text-mode
4037 MIME MUA.  Every effort has been made to provide the functionality that
4038 the discerning MIME user requires, and the conformance to the standards
4039 wherever possible.  When configuring Mutt-ng for MIME, there are two extra
4040 types of configuration files which Mutt-ng uses.  One is the
4041 <tt/mime.types/ file, which contains the mapping of file extensions to 
4042 IANA MIME types.  The other is the <tt/mailcap/ file, which specifies
4043 the external commands to use for handling specific MIME types.
4044
4045 <sect>Using MIME in Mutt <!--{{{--> 
4046 <p>
4047 There are three areas/menus in Mutt-ng which deal with MIME, they are the
4048 pager (while viewing a message), the attachment menu and the compose
4049 menu.
4050
4051 <sect1>Viewing MIME messages in the pager
4052 <p>
4053 When you select a message from the index and view it in the pager, Mutt
4054 decodes the message to a text representation.  Mutt-ng internally supports
4055 a number of MIME types, including <tt>text/plain, text/enriched,
4056 message/rfc822, and message/news</tt>.  In addition, the export
4057 controlled version of Mutt-ng recognizes a variety of PGP MIME types,
4058 including PGP/MIME and application/pgp.
4059
4060 Mutt-ng will denote attachments with a couple lines describing them.
4061 These lines are of the form:
4062 <tscreen><verb>
4063 [-- Attachment #1: Description --]
4064 [-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
4065 </verb></tscreen>
4066 Where the <tt/Description/ is the description or filename given for the
4067 attachment, and the <tt/Encoding/ is one of
4068 <tt>7bit/8bit/quoted-printable/base64/binary</tt>.
4069
4070 If Mutt-ng cannot deal with a MIME type, it will display a message like:
4071 <tscreen><verb>
4072 [-- image/gif is unsupported (use 'v' to view this part) --]
4073 </verb></tscreen>
4074
4075 <sect1>The Attachment Menu<label id="attach_menu">
4076 <p>
4077 The default binding for <tt/view-attachments/ is `v', which displays the
4078 attachment menu for a message.  The attachment menu displays a list of
4079 the attachments in a message.  From the attachment menu, you can save,
4080 print, pipe, delete, and view attachments.  You can apply these
4081 operations to a group of attachments at once, by tagging the attachments
4082 and by using the ``tag-prefix'' operator.  You can also reply to the
4083 current message from this menu, and only the current attachment (or the
4084 attachments tagged) will be quoted in your reply.  You can view
4085 attachments as text, or view them using the mailcap viewer definition.
4086
4087 Finally, you can apply the usual message-related functions (like 
4088 <ref id="resend-message" name="resend-message">, and the reply
4089 and forward functions) to attachments of type <tt>message/rfc822</tt>.
4090
4091 See the help on the attachment menu for more information.
4092
4093 <sect1>The Compose Menu<label id="compose_menu">
4094 <p>
4095 The compose menu is the menu you see before you send a message.  It
4096 allows you to edit the recipient list, the subject, and other aspects
4097 of your message.  It also contains a list of the attachments of your
4098 message, including the main body.  From this menu, you can print, copy,
4099 filter, pipe, edit, compose, review, and rename an attachment or a
4100 list of tagged attachments.  You can also modifying the attachment
4101 information, notably the type, encoding and description.
4102
4103 Attachments appear as follows:
4104 <verb>
4105 -   1 [text/plain, 7bit, 1K]             /tmp/mutt-euler-8082-0 <no description>
4106     2 [applica/x-gunzip, base64, 422K]   ~/src/mutt-0.85.tar.gz <no description>
4107 </verb>
4108
4109 The '-' denotes that Mutt-ng will delete the file after sending (or
4110 postponing, or canceling) the message.  It can be toggled with the
4111 <tt/toggle-unlink/ command (default: u).  The next field is the MIME
4112 content-type, and can be changed with the <tt/edit-type/ command
4113 (default: ^T).  The next field is the encoding for the attachment,
4114 which allows a binary message to be encoded for transmission on 7bit
4115 links.  It can be changed with the <tt/edit-encoding/ command
4116 (default: ^E).  The next field is the size of the attachment,
4117 rounded to kilobytes or megabytes.  The next field is the filename,
4118 which can be changed with the <tt/rename-file/ command (default: R).
4119 The final field is the description of the attachment, and can be
4120 changed with the <tt/edit-description/ command (default: d).
4121
4122 <!--}}}--> 
4123
4124 <sect>MIME Type configuration with <tt/mime.types/ <!--{{{--> 
4125 <p>
4126 When you add an attachment to your mail message, Mutt-ng searches your
4127 personal mime.types file at <tt>&dollar;{HOME}/.mime.types</tt>, and then
4128 the system mime.types file at <tt>/usr/local/share/mutt/mime.types</tt> or
4129 <tt>/etc/mime.types</tt>
4130
4131 The mime.types file consist of lines containing a MIME type and a space
4132 separated list of extensions.  For example:
4133 <tscreen><verb>
4134 application/postscript          ps eps
4135 application/pgp                 pgp
4136 audio/x-aiff                    aif aifc aiff
4137 </verb></tscreen>
4138 A sample <tt/mime.types/ file comes with the Mutt-ng distribution, and
4139 should contain most of the MIME types you are likely to use.  
4140
4141 If Mutt-ng can not determine the mime type by the extension of the file you
4142 attach, it will look at the file.  If the file is free of binary
4143 information, Mutt-ng will assume that the file is plain text, and mark it
4144 as <tt>text/plain</tt>.  If the file contains binary information, then Mutt-ng will
4145 mark it as <tt>application/octet-stream</tt>.  You can change the MIME
4146 type that Mutt-ng assigns to an attachment by using the <tt/edit-type/
4147 command from the compose menu (default: ^T). The MIME type is actually a
4148 major mime type followed by the sub-type, separated by a '/'. 6 major
4149 types: application, text, image, video, audio, and model have been approved
4150 after various internet discussions. Mutt-ng recognises all of these if the 
4151 appropriate entry is found in the mime.types file. It also recognises other
4152 major mime types, such as the chemical type that is widely used in the 
4153 molecular modelling community to pass molecular data in various forms to 
4154 various molecular viewers. Non-recognised mime types should only be used 
4155 if the recipient of the message is likely to be expecting such attachments.
4156
4157 <!--}}}--> 
4158
4159 <sect>MIME Viewer configuration with <tt/mailcap/ <!--{{{--> 
4160 <p>
4161 Mutt-ng supports RFC 1524 MIME Configuration, in particular the Unix
4162 specific format specified in Appendix A of RFC 1524.  This file format
4163 is commonly referred to as the mailcap format.  Many MIME compliant
4164 programs utilize the mailcap format, allowing you to specify handling
4165 for all MIME types in one place for all programs.  Programs known to
4166 use this format include Netscape, XMosaic, lynx and metamail.
4167
4168 In order to handle various MIME types that Mutt-ng can not handle
4169 internally, Mutt-ng parses a series of external configuration files to
4170 find an external handler.  The default search string for these files
4171 is a colon delimited list set to
4172 <tscreen><verb>
4173 ${HOME}/.mailcap:/usr/local/share/mutt/mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
4174 </verb></tscreen>
4175 where <tt/&dollar;HOME/ is your home directory.
4176
4177 In particular, the metamail distribution will install a mailcap file,
4178 usually as <tt>/usr/local/etc/mailcap</tt>, which contains some baseline
4179 entries.
4180
4181 <sect1>The Basics of the mailcap file
4182 <p>
4183 A mailcap file consists of a series of lines which are comments, blank,
4184 or definitions.
4185
4186 A comment line consists of a &num; character followed by anything you want.
4187
4188 A blank line is blank.
4189
4190 A definition line consists of a content type, a view command, and any
4191 number of optional fields.  Each field of a definition line is divided
4192 by a semicolon ';' character.
4193
4194 The content type is specified in the MIME standard type/subtype method.
4195 For example,
4196 <tt>text/plain, text/html, image/gif, </tt>
4197 etc.  In addition, the mailcap format includes two formats for
4198 wildcards, one using the special '*' subtype, the other is the implicit
4199 wild, where you only include the major type.  For example, <tt>image/*</tt>, or
4200 <tt>video,</tt> will match all image types and video types,
4201 respectively.
4202
4203 The view command is a Unix command for viewing the type specified. There
4204 are two different types of commands supported. The default is to send
4205 the body of the MIME message to the command on stdin. You can change
4206 this behavior by using &percnt;s as a parameter to your view command.
4207 This will cause Mutt-ng to save the body of the MIME message to a temporary
4208 file, and then call the view command with the &percnt;s replaced by
4209 the name of the temporary file. In both cases, Mutt-ng will turn over the
4210 terminal to the view program until the program quits, at which time Mutt
4211 will remove the temporary file if it exists.
4212
4213 So, in the simplest form, you can send a text/plain message to the
4214 external pager more on stdin:
4215 <tscreen><verb>
4216 text/plain; more
4217 </verb></tscreen>
4218 Or, you could send the message as a file:
4219 <tscreen><verb>
4220 text/plain; more %s
4221 </verb></tscreen>
4222 Perhaps you would like to use lynx to interactively view a text/html 
4223 message:
4224 <tscreen><verb>
4225 text/html; lynx %s
4226 </verb></tscreen>
4227 In this case, lynx does not support viewing a file from stdin, so you
4228 must use the &percnt;s syntax.
4229 <bf/Note:/ <em>Some older versions of lynx contain a bug where they
4230 will check the mailcap file for a viewer for text/html.  They will find
4231 the line which calls lynx, and run it.  This causes lynx to continuously
4232 spawn itself to view the object.</em>
4233
4234 On the other hand, maybe you don't want to use lynx interactively, you
4235 just want to have it convert the text/html to text/plain, then you can
4236 use:
4237 <tscreen><verb>
4238 text/html; lynx -dump %s | more
4239 </verb></tscreen>
4240
4241 Perhaps you wish to use lynx to view text/html files, and a pager on
4242 all other text formats, then you would use the following:
4243 <tscreen><verb>
4244 text/html; lynx %s
4245 text/*; more
4246 </verb></tscreen>
4247 This is the simplest form of a mailcap file.
4248
4249 <sect1>Secure use of mailcap
4250 <p>
4251 The interpretation of shell meta-characters embedded in MIME parameters
4252 can lead to security problems in general.  Mutt-ng tries to quote parameters
4253 in expansion of %s syntaxes properly, and avoids risky characters by
4254 substituting them, see the <ref id="mailcap_sanitize"
4255 name="mailcap&lowbar;sanitize"> variable.
4256
4257 Although mutt's procedures to invoke programs with mailcap seem to be
4258 safe, there are other applications parsing mailcap, maybe taking less care
4259 of it.  Therefore you should pay attention to the following rules:
4260
4261 <em/Keep the %-expandos away from shell quoting./
4262 Don't quote them with single or double quotes.  Mutt-ng does this for
4263 you, the right way, as should any other program which interprets
4264 mailcap.  Don't put them into backtick expansions.  Be highly careful
4265 with eval statements, and avoid them if possible at all.  Trying to fix
4266 broken behaviour with quotes introduces new leaks - there is no
4267 alternative to correct quoting in the first place.
4268
4269 If you have to use the %-expandos' values in context where you need
4270 quoting or backtick expansions, put that value into a shell variable
4271 and reference the shell variable where necessary, as in the following
4272 example (using <tt/&dollar;charset/ inside the backtick expansion is safe,
4273 since it is not itself subject to any further expansion):
4274
4275 <tscreen><verb>
4276 text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
4277         && test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
4278 </verb></tscreen>
4279
4280 <sect1>Advanced mailcap Usage
4281 <p>
4282
4283 <sect2>Optional Fields
4284 <p>
4285 In addition to the required content-type and view command fields, you
4286 can add semi-colon ';' separated fields to set flags and other options.
4287 Mutt-ng recognizes the following optional fields:
4288 <descrip>
4289 <tag/copiousoutput/
4290 This flag tells Mutt-ng that the command passes possibly large amounts of
4291 text on stdout.  This causes Mutt-ng to invoke a pager (either the internal
4292 pager or the external pager defined by the pager variable) on the output
4293 of the view command.  Without this flag, Mutt-ng assumes that the command
4294 is interactive.  One could use this to replace the pipe to <tt>more</tt>
4295 in the <tt>lynx -dump</tt> example in the Basic section:
4296 <tscreen><verb>
4297 text/html; lynx -dump %s ; copiousoutput
4298 </verb></tscreen>
4299 This will cause lynx to format the text/html output as text/plain
4300 and Mutt-ng will use your standard pager to display the results.
4301 <tag/needsterminal/
4302 Mutt-ng uses this flag when viewing attachments with <ref id="auto_view"
4303 name="autoview">, in order to decide whether it should honor the setting
4304 of the <ref id="wait_key" name="&dollar;wait&lowbar;key"> variable or
4305 not.  When an attachment is viewed using an interactive program, and the
4306 corresponding mailcap entry has a <em/needsterminal/ flag, Mutt-ng will use
4307 <ref id="wait_key" name="&dollar;wait&lowbar;key"> and the exit status
4308 of the program to decide if it will ask you to press a key after the
4309 external program has exited.  In all other situations it will not prompt
4310 you for a key.
4311 <tag>compose=&lt;command&gt;</tag>
4312 This flag specifies the command to use to create a new attachment of a
4313 specific MIME type.  Mutt-ng supports this from the compose menu.
4314 <tag>composetyped=&lt;command&gt;</tag>
4315 This flag specifies the command to use to create a new attachment of a
4316 specific MIME type.  This command differs from the compose command in
4317 that mutt will expect standard MIME headers on the data.  This can be
4318 used to specify parameters, filename, description, etc. for a new
4319 attachment.   Mutt-ng supports this from the compose menu.
4320 <tag>print=&lt;command&gt;</tag>
4321 This flag specifies the command to use to print a specific MIME type.
4322 Mutt-ng supports this from the attachment and compose menus.
4323 <tag>edit=&lt;command&gt;</tag>
4324 This flag specifies the command to use to edit a specific MIME type.  
4325 Mutt-ng supports this from the compose menu, and also uses it to compose
4326 new attachments.  Mutt-ng will default to the defined editor for text
4327 attachments.
4328 <tag>nametemplate=&lt;template&gt;</tag>
4329 This field specifies the format for the file denoted by &percnt;s in the
4330 command fields.  Certain programs will require a certain file extension,
4331 for instance, to correctly view a file.  For instance, lynx will only
4332 interpret a file as <tt>text/html</tt> if the file ends in <tt/.html/.
4333 So, you would specify lynx as a <tt>text/html</tt> viewer with a line in
4334 the mailcap file like:
4335 <tscreen><verb>
4336 text/html; lynx %s; nametemplate=%s.html
4337 </verb></tscreen>
4338 <tag>test=&lt;command&gt;</tag>
4339 This field specifies a command to run to test whether this mailcap
4340 entry should be used.  The command is defined with the command expansion
4341 rules defined in the next section.  If the command returns 0, then the
4342 test passed, and Mutt-ng uses this entry.  If the command returns non-zero,
4343 then the test failed, and Mutt-ng continues searching for the right entry.
4344 <bf/Note:/ <em>the content-type must match before Mutt-ng performs the test.</em>
4345 For example:
4346 <tscreen><verb>
4347 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
4348 text/html; lynx %s
4349 </verb></tscreen>
4350 In this example, Mutt-ng will run the program RunningX which will return 0
4351 if the X Window manager is running, and non-zero if it isn't.  If
4352 RunningX returns 0, then Mutt-ng will call netscape to display the
4353 text/html object.  If RunningX doesn't return 0, then Mutt-ng will go on
4354 to the next entry and use lynx to display the text/html object.
4355 </descrip>
4356
4357 <sect2>Search Order
4358 <p>
4359 When searching for an entry in the mailcap file, Mutt-ng will search for
4360 the most useful entry for its purpose.  For instance, if you are
4361 attempting to print an <tt>image/gif</tt>, and you have the following
4362 entries in your mailcap file, Mutt-ng will search for an entry with the
4363 print command:
4364 <tscreen><verb>
4365 image/*;        xv %s
4366 image/gif;      ; print= anytopnm %s | pnmtops | lpr; \
4367                 nametemplate=%s.gif
4368 </verb></tscreen>
4369 Mutt-ng will skip the <tt>image/*</tt> entry and use the <tt>image/gif</tt>
4370 entry with the print command.
4371
4372 In addition, you can use this with <ref id="auto_view" name="Autoview"> 
4373 to denote two commands for viewing an attachment, one to be viewed
4374 automatically, the other to be viewed interactively from the attachment
4375 menu.  In addition, you can then use the test feature to determine which
4376 viewer to use interactively depending on your environment.
4377 <tscreen><verb>
4378 text/html;      netscape -remote 'openURL(%s)' ; test=RunningX
4379 text/html;      lynx %s; nametemplate=%s.html
4380 text/html;      lynx -dump %s; nametemplate=%s.html; copiousoutput
4381 </verb></tscreen>
4382 For <ref id="auto_view" name="Autoview">, Mutt-ng will choose the third
4383 entry because of the copiousoutput tag.  For interactive viewing, Mutt
4384 will run the program RunningX to determine if it should use the first
4385 entry.  If the program returns non-zero, Mutt-ng will use the second entry
4386 for interactive viewing.
4387
4388 <sect2>Command Expansion
4389 <p>
4390 The various commands defined in the mailcap files are passed to the
4391 <tt>/bin/sh</tt> shell using the system() function.  Before the
4392 command is passed to <tt>/bin/sh -c</tt>, it is parsed to expand
4393 various special parameters with information from Mutt-ng.  The keywords
4394 Mutt-ng expands are:
4395 <descrip>
4396 <tag/&percnt;s/
4397 As seen in the basic mailcap section, this variable is expanded
4398 to a filename specified by the calling program.  This file contains
4399 the body of the message to view/print/edit or where the composing
4400 program should place the results of composition.  In addition, the
4401 use of this keyword causes Mutt-ng to not pass the body of the message
4402 to the view/print/edit program on stdin.
4403 <tag/&percnt;t/
4404 Mutt-ng will expand &percnt;t to the text representation of the content
4405 type of the message in the same form as the first parameter of the
4406 mailcap definition line, ie <tt>text/html</tt> or
4407 <tt>image/gif</tt>.
4408 <tag>&percnt;{&lt;parameter&gt;}</tag>
4409 Mutt-ng will expand this to the value of the specified parameter
4410 from the Content-Type: line of the mail message.  For instance, if
4411 Your mail message contains:
4412 <tscreen><verb>
4413 Content-Type: text/plain; charset=iso-8859-1
4414 </verb></tscreen>
4415 then Mutt-ng will expand &percnt;{charset} to iso-8859-1.  The default metamail
4416 mailcap file uses this feature to test the charset to spawn an xterm
4417 using the right charset to view the message.
4418 <tag>&bsol;&percnt;</tag>
4419 This will be replaced by a &percnt;
4420 </descrip>
4421 Mutt-ng does not currently support the &percnt;F and &percnt;n keywords
4422 specified in RFC 1524.  The main purpose of these parameters is for
4423 multipart messages, which is handled internally by Mutt-ng.
4424
4425 <sect1>Example mailcap files
4426 <p>
4427 This mailcap file is fairly simple and standard:
4428 <code>
4429 # I'm always running X :)
4430 video/*;        xanim %s > /dev/null
4431 image/*;        xv %s > /dev/null
4432
4433 # I'm always running netscape (if my computer had more memory, maybe)
4434 text/html;      netscape -remote 'openURL(%s)'
4435 </code>
4436
4437 This mailcap file shows quite a number of examples:
4438
4439 <code>
4440 # Use xanim to view all videos   Xanim produces a header on startup,
4441 # send that to /dev/null so I don't see it
4442 video/*;        xanim %s > /dev/null
4443
4444 # Send html to a running netscape by remote
4445 text/html;      netscape -remote 'openURL(%s)'; test=RunningNetscape
4446
4447 # If I'm not running netscape but I am running X, start netscape on the
4448 # object
4449 text/html;      netscape %s; test=RunningX
4450
4451 # Else use lynx to view it as text
4452 text/html;      lynx %s
4453
4454 # This version would convert the text/html to text/plain
4455 text/html;      lynx -dump %s; copiousoutput
4456
4457 # I use enscript to print text in two columns to a page
4458 text/*;         more %s; print=enscript -2Gr %s
4459
4460 # Netscape adds a flag to tell itself to view jpegs internally
4461 image/jpeg;xv %s; x-mozilla-flags=internal
4462
4463 # Use xv to view images if I'm running X
4464 # In addition, this uses the \ to extend the line and set my editor
4465 # for images
4466 image/*;xv %s; test=RunningX; \
4467         edit=xpaint %s
4468
4469 # Convert images to text using the netpbm tools
4470 image/*;  (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
4471 pbmtoascii -1x2 ) 2>&1 ; copiousoutput
4472
4473 # Send excel spreadsheets to my NT box
4474 application/ms-excel; open.pl %s
4475 </code>
4476
4477 <!--}}}--> 
4478
4479 <sect>MIME Autoview<label id="auto_view"> <!--{{{--> 
4480 <p>
4481 In addition to explicitly telling Mutt-ng to view an attachment with the
4482 MIME viewer defined in the mailcap file, Mutt-ng has support for
4483 automatically viewing MIME attachments while in the pager.
4484
4485 To work, you must define a viewer in the mailcap file which uses the 
4486 <tt/copiousoutput/ option to denote that it is non-interactive.
4487 Usually, you also use the entry to convert the attachment to a text
4488 representation which you can view in the pager.
4489
4490 You then use the <tt/auto&lowbar;view/ muttrc command to list the
4491 content-types that you wish to view automatically.
4492
4493 For instance, if you set auto&lowbar;view to:
4494 <tscreen><verb>
4495 auto_view text/html application/x-gunzip application/postscript image/gif application/x-tar-gz
4496 </verb></tscreen>
4497
4498 Mutt-ng could use the following mailcap entries to automatically view
4499 attachments of these types.
4500 <tscreen><verb>
4501 text/html;      lynx -dump %s; copiousoutput; nametemplate=%s.html
4502 image/*;        anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | pgmtopbm | pbmtoascii ; copiousoutput
4503 application/x-gunzip;   gzcat; copiousoutput
4504 application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
4505 application/postscript; ps2ascii %s; copiousoutput
4506 </verb></tscreen>
4507
4508 ``unauto_view'' can be used to remove previous entries from the autoview list.
4509 This can be used with message-hook to autoview messages based on size, etc.
4510 ``unauto_view *'' will remove all previous entries.
4511
4512 <!--}}}--> 
4513
4514 <sect>MIME Multipart/Alternative<label id="alternative_order"> <!--{{{--> 
4515 <p>
4516 Mutt-ng has some heuristics for determining which attachment of a
4517 multipart/alternative type to display.  First, mutt will check the 
4518 alternative&lowbar;order list to determine if one of the available types
4519 is preferred.  The alternative&lowbar;order list consists of a number of
4520 MIME types in order, including support for implicit and explicit
4521 wildcards, for example:
4522 <tscreen><verb>
4523 alternative_order text/enriched text/plain text application/postscript image/*
4524 </verb></tscreen>
4525
4526 Next, mutt will check if any of the types have a defined 
4527 <ref id="auto_view" name="auto&lowbar;view">, and use that.  Failing
4528 that, Mutt-ng will look for any text type.  As a last attempt, mutt will
4529 look for any type it knows how to handle.
4530
4531 To remove a MIME type from the <tt/alternative_order/ list, use the
4532 <tt/unalternative_order/ command.
4533
4534 <!--}}}--> 
4535
4536 <sect>MIME Lookup<label id="mime_lookup"> <!--{{{--> 
4537 <p>
4538 Mutt-ng's mime&lowbar;lookup list specifies a list of mime-types that should not
4539 be treated according to their mailcap entry.  This option is designed to
4540 deal with binary types such as application/octet-stream.  When an attachment's
4541 mime-type is listed in mime&lowbar;lookup, then the extension of the filename will
4542 be compared to the list of extensions in the mime.types file.  The mime-type
4543 associated with this extension will then be used to process the attachment
4544 according to the rules in the mailcap file and according to any other configuration
4545 options (such as auto&lowbar;view) specified.  Common usage would be:
4546 <tscreen><verb>
4547 mime_lookup application/octet-stream application/X-Lotus-Manuscript
4548 </verb></tscreen>
4549
4550 In addition, the unmime&lowbar;lookup command may be used to disable this feature
4551 for any particular mime-type if it had been set, for example, in a global
4552 muttrc.
4553
4554 <!--}}}--> 
4555
4556 <!--}}}--> 
4557
4558 <chapt>Security Considerations <!--{{{--> 
4559
4560   <p>First of all, mutt-ng contains no security holes included by
4561   intention but may contain unknown security holes. As a consequence,
4562   please run mutt-ng only with as few permissions as possible.
4563
4564   <p>Please do not run mutt-ng as the super user.
4565
4566   <p>When configuring mutt-ng, there're some points to note about secure
4567   setups.
4568
4569   <p>In practice, mutt-ng can be easily made as vulnerable as even the
4570   most insecure mail user agents (in their default configuration) just
4571   by changing mutt-ng's configuration files: it then can execute
4572   arbitrary programs and scripts attached to messages, send out private
4573   data on its own, etc. Although this is not believed to the common type
4574   of setup, please read this chapter carefully.
4575
4576   <sect>Passwords <!--{{{--> 
4577
4578     <p>Although mutt-ng can be told the various passwords for accounts,
4579     please never store passwords in configuration files. Besides the
4580     fact that the system's operator can always read them, you could
4581     forget to replace the actual password with asterisks when reporting
4582     a bug or asking for help via, for example, a mailing list so that
4583     your mail including your password could be archived by internet
4584     search engines, etc. Please never store passwords on disk.
4585
4586   <!--}}}-->
4587
4588   <sect>Temporary Files <!--{{{--> 
4589
4590     <p>Mutt-ng uses many temporary files for viewing messages, verifying
4591     digital signatures, etc. The <ref id="umask" name="&dollar;umask">
4592     variable can be used to change the default permissions of these
4593     files. Please only change it if you really know what you are doing.
4594     Also, a different location for these files may be desired which can
4595     be changed via the <ref id="tmpdir" name="&dollar;tmpdir"> variable.
4596
4597   <!--}}}-->
4598
4599   <sect>Information Leaks <!--{{{--> 
4600
4601   <sect1>Message-ID: headers <!--{{{--> 
4602
4603     <p>In the default configuration, mutt-ng will leak some information
4604     to the outside world when sending messages: the generation of
4605     <tt/Message-ID:/ headers includes a step counter which is increased
4606     (and rotated) with every message sent. If you'd like to hide this
4607     information probably telling others how many mail you sent in which
4608     time, you at least need to remove the <tt/%P/ expando from the
4609     default setting of the <ref id="msgid_format"
4610     name="&dollar;msgid&lowbar;format"> variable. Please make sure that
4611     you really know how local parts of these <tt/Message-ID:/ headers
4612     are composed.
4613
4614   <!--}}}-->
4615
4616   <sect1>mailto:-style links <!--{{{--> 
4617
4618     <p>As mutt-ng be can be set up to be the mail client to handle
4619     <tt/mailto:/ style links in websites, there're security
4620     considerations, too. To keep the old behavior by default, mutt-ng
4621     will be strict in interpreting them which means that arbitrary
4622     header fields can be embedded in these links which could override
4623     existing header fields or attach arbitrary files. This may be
4624     problematic if the <ref id="edit_headers"
4625     name="&dollar;edit&lowbar;headers"> variable is <em/unset/, i.e. the
4626     user doesn't want to see header fields while editing the message.
4627
4628     <p>For example, following a link like
4629
4630     <verb>
4631 mailto:joe@host?Attach=~/.gnupg/secring.gpg</verb>
4632
4633     will send out the user's private gnupg keyring to <tt/joe@host/ if
4634     the user doesn't follow the information on screen carefully
4635     enough.
4636
4637     <p>When <em/unsetting/ the <ref id="strict_mailto"
4638     name="&dollar;strict&lowbar;mailto"> variable, mutt-ng will
4639
4640     <itemize>
4641
4642       <item>be less strict when interpreting these links by
4643         prepending a <tt/X-Mailto-/ string to all header fields
4644         embedded in such a link <em/and/
4645
4646       <item>turn on the <ref id="edit_headers"
4647         name="&dollar;edit&lowbar;headers"> variable by
4648         force to let the user see all the headers
4649         (because they still may leak information.)
4650
4651     </itemize>
4652
4653   <!--}}}-->
4654
4655   <!--}}}-->
4656
4657   <sect>External applications <!--{{{--> 
4658
4659     <p>Mutt-ng in many places has to rely on external applications or
4660     for convenience supports mechanisms involving external
4661     applications.
4662
4663     <sect1>mailcap <!--{{{--> 
4664
4665       <p>One of these is the <tt/mailcap/ mechanism as defined by RfC
4666       1524. Mutt-ng can be set up to <em/automatically/ execute any
4667       given utility as listed in one of the mailcap files (see the
4668       <ref id="mailcap_path" name="&dollar;mailcap&lowbar;path">
4669       variable for details.) 
4670
4671       These utilities may have a variety of security vulnerabilities,
4672       including overwriting of arbitrary files, information leaks or
4673       other exploitable bugs.  These vulnerabilities may go unnoticed by
4674       the user, especially when they are called automatically (and
4675       without interactive prompting) from the mailcap file(s). When
4676       using mutt-ng's autoview mechanism in combination with mailcap
4677       files, please be sure to...
4678
4679       <itemize>
4680
4681         <item>manually select trustworth applications with a reasonable
4682         calling sequence
4683
4684         <item>periodically check the contents of mailcap files,
4685         especially after software installations or upgrades
4686
4687         <item>keep the software packages referenced in the mailcap file up to date
4688
4689         <item>leave the <ref id="mailcap_sanitize"
4690         name="&dollar;mailcap&lowbar;sanitize"> variable in its default
4691         state to restrict mailcap expandos to a safe set of characters
4692
4693       </itemize>
4694
4695     <!--}}}-->
4696
4697     <sect1>Other <!--{{{--> 
4698
4699       <p>Besides the mailcap mechanism, mutt-ng uses a number of other
4700       external utilities for operation.
4701
4702       <p>The same security considerations apply for these as for tools
4703       involved via mailcap (for example, mutt-ng is vulnerable to Denial
4704       of Service Attacks with compressed folders support if the
4705       uncompressed mailbox is too large for the disk it is saved to.)
4706
4707       <p>As already noted, most of these problems are not built in but
4708       caused by wrong configuration, so please check your configuration.
4709
4710     <!--}}}-->
4711
4712   <!--}}}-->
4713
4714 <!--}}}-->
4715
4716 <chapt>Reference <!--{{{--> 
4717
4718 <sect>Command line options<label id="commandline"> <!--{{{--> 
4719 <p>
4720 Running <tt/mutt/ with no arguments will make Mutt-ng attempt to read your spool
4721 mailbox.  However, it is possible to read other mailboxes and
4722 to send messages from the command line as well.
4723
4724 <tscreen><verb>
4725 -A      expand an alias
4726 -a      attach a file to a message
4727 -b      specify a blind carbon-copy (BCC) address
4728 -c      specify a carbon-copy (Cc) address
4729 -e      specify a config command to be run after initialization files are read
4730 -f      specify a mailbox to load
4731 -F      specify an alternate file to read initialization commands
4732 -h      print help on command line options
4733 -H      specify a draft file from which to read a header and body
4734 -i      specify a file to include in a message composition
4735 -m      specify a default mailbox type
4736 -n      do not read the system Muttngrc
4737 -p      recall a postponed message
4738 -Q      query a configuration variable
4739 -R      open mailbox in read-only mode
4740 -s      specify a subject (enclose in quotes if it contains spaces)
4741 -t      dump the value of all variables to stdout
4742 -T      dump the value of all changed variables to stdout
4743 -v      show version number and compile-time definitions
4744 -x      simulate the mailx(1) compose mode
4745 -y      show a menu containing the files specified by the mailboxes command
4746 -z      exit immediately if there are no messages in the mailbox
4747 -Z      open the first folder with new message,exit immediately if none
4748 </verb></tscreen>
4749
4750 To read messages in a mailbox
4751
4752 <tt/mutt/ &lsqb; -nz &rsqb; &lsqb; -F <em/muttrc/ &rsqb; &lsqb; -m <em/type/ &rsqb; &lsqb; -f <em/mailbox/ &rsqb; 
4753
4754 To compose a new message
4755
4756 <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; 
4757
4758 Mutt-ng also supports a ``batch'' mode to send prepared messages.  Simply redirect
4759 input from the file you wish to send.  For example,
4760
4761 <tt>mutt -s &dquot;data set for run &num;2&dquot; professor@bigschool.edu
4762 &lt; &tilde;/run2.dat</tt>
4763
4764 This command will send a message to ``professor@bigschool.edu'' with a subject
4765 of ``data set for run &num;2''.  In the body of the message will be the contents
4766 of the file ``&tilde;/run2.dat''.
4767
4768 <!--}}}--> 
4769
4770 <sect>Patterns<label id="patterns"> <!--{{{--> 
4771
4772 <p>
4773 <tscreen><verb>
4774 ~A              all messages
4775 ~b EXPR         messages which contain EXPR in the message body
4776 ~B EXPR         messages which contain EXPR in the whole message
4777 ~c USER         messages carbon-copied to USER
4778 ~C EXPR         message is either to: or cc: EXPR
4779 ~D              deleted messages
4780 ~d [MIN]-[MAX]  messages with ``date-sent'' in a Date range
4781 ~E              expired messages
4782 ~e EXPR         message which contains EXPR in the ``Sender'' field
4783 ~F              flagged messages
4784 ~f USER         messages originating from USER
4785 ~g              cryptographically signed messages
4786 ~G              cryptographically encrypted messages
4787 ~H EXPR         messages with a spam attribute matching EXPR
4788 ~h EXPR         messages which contain EXPR in the message header
4789 ~k              message contains PGP key material
4790 ~i ID           message which match ID in the ``Message-ID'' field
4791 ~L EXPR         message is either originated or received by EXPR
4792 ~l              message is addressed to a known mailing list
4793 ~m [MIN]-[MAX]  message in the range MIN to MAX *)
4794 ~M              multipart messages
4795 ~n [MIN]-[MAX]  messages with a score in the range MIN to MAX *)
4796 ~N              new messages
4797 ~O              old messages
4798 ~p              message is addressed to you (consults alternates)
4799 ~P              message is from you (consults alternates)
4800 ~Q              messages which have been replied to
4801 ~R              read messages
4802 ~r [MIN]-[MAX]  messages with ``date-received'' in a Date range
4803 ~S              superseded messages
4804 ~s SUBJECT      messages having SUBJECT in the ``Subject'' field.
4805 ~T              tagged messages
4806 ~t USER         messages addressed to USER
4807 ~U              unread messages
4808 ~v              message is part of a collapsed thread.
4809 ~V              cryptographically verified messages
4810 ~w EXPR         messages which contain EXPR in the `Newsgroups' field
4811                 (if compiled with NNTP support)
4812 ~x EXPR         messages which contain EXPR in the `References' field
4813 ~y EXPR         messages which contain EXPR in the `X-Label' field
4814 ~z [MIN]-[MAX]  messages with a size in the range MIN to MAX *)
4815 ~=              duplicated messages (see $duplicate_threads)
4816 ~$              unreferenced messages (requires threaded view)
4817 ~*              ``From'' contains realname and (syntactically) valid
4818                 address (excluded are addresses matching against
4819                 alternates or any alias)
4820 </verb></tscreen>
4821
4822 Where EXPR, USER, ID, and SUBJECT are 
4823 <ref id="regexp" name="regular expressions">.  Special attention has to be
4824 made when using regular expressions inside of patterns.  Specifically,
4825 Mutt-ng's parser for these patterns will strip one level of backslash (\),
4826 which is normally used for quoting.  If it is your intention to use a
4827 backslash in the regular expression, you will need to use two backslashes
4828 instead (\\).
4829
4830 *) The forms <tt/&lt;&lsqb;MAX&rsqb;/, <tt/&gt;&lsqb;MIN&rsqb;/,
4831 <tt/&lsqb;MIN&rsqb;-/ and <tt/-&lsqb;MAX&rsqb;/
4832 are allowed, too.
4833
4834 <!--}}}--> 
4835
4836 <sect>Configuration Commands<label id="commands"> <!--{{{--> 
4837 <p>
4838 The following are the commands understood by mutt.
4839
4840 <itemize>
4841 <item>
4842 <tt><ref id="account-hook" name="account-hook"></tt> <em/pattern/ <em/command/
4843 <item>
4844 <tt><ref id="alias" name="alias"></tt> <em/key/ <em/address/ &lsqb; , <em/address/, ... &rsqb;
4845 <item>
4846 <tt><ref id="alias" name="unalias"></tt> &lsqb; * | <em/key/ ... &rsqb;
4847 <item>
4848 <tt><ref id="alternates" name="alternates"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb;
4849 <item>
4850 <tt><ref id="alternates" name="unalternates"></tt> &lsqb; * | <em/regexp/ ... &rsqb;
4851 <item>
4852 <tt><ref id="alternative_order" name="alternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
4853 <item>
4854 <tt><ref id="alternative_order" name="unalternative&lowbar;order"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
4855 <item>
4856 <tt><ref id="append-hook" name="append-hook"></tt> <em/regexp/ <em/command/
4857 <item>
4858 <tt><ref id="auto_view" name="auto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
4859 <item>
4860 <tt><ref id="auto_view" name="unauto&lowbar;view"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
4861 <item>
4862 <tt><ref id="bind" name="bind"></tt> <em/map/ <em/key/ <em/function/
4863 <item>
4864 <tt><ref id="charset-hook" name="charset-hook"></tt> <em/alias/ <em/charset/
4865 <item>
4866 <tt><ref id="close-hook" name="close-hook"></tt> <em/regexp/ <em/command/
4867 <item>
4868 <tt><ref id="color" name="color"></tt> <em/object/ <em/foreground/ <em/background/ &lsqb; <em/regexp/ &rsqb;
4869 <item>
4870 <tt><ref id="color" name="uncolor"></tt> <em/index/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
4871 <item>
4872 <tt><ref id="exec" name="exec"></tt> <em/function/ &lsqb; <em/function/ ... &rsqb;
4873 <item>
4874 <tt><ref id="fcc-hook" name="fcc-hook"></tt> <em/pattern/ <em/mailbox/
4875 <item>
4876 <tt><ref id="fcc-save-hook" name="fcc-save-hook"></tt> <em/pattern/ <em/mailbox/
4877 <item>
4878 <tt><ref id="folder-hook" name="folder-hook"></tt> <em/pattern/ <em/command/
4879 <item>
4880 <tt><ref id="hdr_order" name="hdr&lowbar;order"></tt> <em/header/ &lsqb; <em/header/ ... &rsqb;
4881 <item>
4882 <tt><ref id="hdr_order" name="unhdr&lowbar;order"></tt> <em/header/ &lsqb; <em/header/ ... &rsqb;
4883 <item>
4884 <tt><ref id="charset-hook" name="iconv-hook"></tt> <em/charset/ <em/local-charset/
4885 <item>
4886 <tt><ref id="ignore" name="ignore"></tt> <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
4887 <item>
4888 <tt><ref id="ignore" name="unignore"></tt> <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
4889 <item>
4890 <tt><ref id="lists" name="lists"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
4891 <item>
4892 <tt><ref id="lists" name="unlists"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
4893 <item>
4894 <tt><ref id="macro" name="macro"></tt> <em/menu/ <em/key/ <em/sequence/ &lsqb; <em/description/ &rsqb; 
4895 <item>
4896 <tt><ref id="mailboxes" name="mailboxes"></tt> <em/filename/ &lsqb; <em/filename/ ... &rsqb;
4897 <item>
4898 <tt><ref id="mbox-hook" name="mbox-hook"></tt> <em/pattern/ <em/mailbox/
4899 <item>
4900 <tt><ref id="message-hook" name="message-hook"></tt> <em/pattern/ <em/command/
4901 <item>
4902 <tt><ref id="mime_lookup" name="mime&lowbar;lookup"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
4903 <item>
4904 <tt><ref id="mime_lookup" name="unmime&lowbar;lookup"></tt> <em/mimetype/ &lsqb; <em/mimetype/ ... &rsqb;
4905 <item>
4906 <tt><ref id="color" name="mono"></tt> <em/object attribute/ &lsqb; <em/regexp/ &rsqb;
4907 <item>
4908 <tt><ref id="color" name="unmono"></tt> <em/index/ <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
4909 <item>
4910 <tt><ref id="my_hdr" name="my&lowbar;hdr"></tt> <em/string/
4911 <item>
4912 <tt><ref id="my_hdr" name="unmy&lowbar;hdr"></tt> <em/field/ &lsqb; <em/field/ ... &rsqb;
4913 <item>
4914 <tt><ref id="open-hook" name="open-hook"></tt> <em/regexp/ <em/command/
4915 <item>
4916 <tt><ref id="crypt-hook" name="crypt-hook"></tt> <em/pattern/ <em/key-id/
4917 <item>
4918 <tt><ref id="push" name="push"></tt> <em/string/
4919 <item>
4920 <tt><ref id="set" name="reset"></tt> <em/variable/ &lsqb;<em/variable/ ... &rsqb;
4921 <item>
4922 <tt><ref id="save-hook" name="save-hook"></tt> <em/regexp/ <em/filename/
4923 <item>
4924 <tt><ref id="score-command" name="score"></tt> <em/pattern/ <em/value/
4925 <item>
4926 <tt><ref id="score-command" name="unscore"></tt> <em/pattern/ &lsqb; <em/pattern/ ... &rsqb;
4927 <item>
4928 <tt><ref id="send-hook" name="send-hook"></tt> <em/regexp/ <em/command/
4929 <item>
4930 <tt><ref id="reply-hook" name="reply-hook"></tt> <em/regexp/ <em/command/
4931 <item>
4932 <tt><ref id="set" name="set"></tt> &lsqb;no|inv&rsqb;<em/variable/&lsqb;=<em/value/&rsqb; &lsqb; <em/variable/ ... &rsqb;
4933 <item>
4934 <tt><ref id="set" name="unset"></tt> <em/variable/ &lsqb;<em/variable/ ... &rsqb;
4935 <item>
4936 <tt><ref id="source" name="source"></tt> <em/filename/
4937 <item>
4938 <tt><ref id="spam" name="spam"></tt> <em/pattern/ <em/format/
4939 <item>
4940 <tt><ref id="spam" name="nospam"></tt> <em/pattern/
4941 <item>
4942 <tt><ref id="lists" name="subscribe"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
4943 <item>
4944 <tt><ref id="lists" name="unsubscribe"></tt> <em/regexp/ &lsqb; <em/regexp/ ... &rsqb; 
4945 <item>
4946 <tt><ref id="set" name="toggle"></tt> <em/variable/ &lsqb;<em/variable/ ... &rsqb;
4947 <item>
4948 <tt><ref id="unhook" name="unhook"></tt> <em/hook-type/
4949 </itemize>
4950
4951 <sect>Configuration variables<label id="variables">
4952
4953 <p>The following list contains all variables which, in the process of
4954 providing more consistency, have been renamed and are partially even
4955 removed already. The left column contains the old synonym variables,
4956 the right column the full/new name:
4957
4958 <label id="sect_obsolete">
4959 <tscreen><verb>
4960 edit_hdrs               edit_headers
4961 forw_decode             forward_decode
4962 forw_format             forward_format
4963 forw_quote              forward_quote
4964 hdr_format              index_format
4965 indent_str              indent_string
4966 mime_fwd                mime_forward
4967 msg_format              message_format
4968 pgp_autosign            crypt_autosign
4969 pgp_autoencrypt         crypt_autoencrypt
4970 pgp_replyencrypt        crypt_replyencrypt
4971 pgp_replysign           crypt_replysign
4972 pgp_replysignencrypted  crypt_replysignencrypted
4973 pgp_verify_sig          crypt_verify_sig
4974 pgp_create_traditional  pgp_autoinline
4975 pgp_auto_traditional    pgp_replyinline
4976 forw_decrypt            forward_decrypt
4977 smime_sign_as           smime_default_key
4978 post_indent_str         post_indent_string
4979 print_cmd               print_command
4980 shorten_hierarchy       sidebar_shorten_hierarchy
4981 ask_followup_to         nntp_ask_followup_to
4982 ask_x_comment_to        nntp_ask_x_comment_to
4983 catchup_newsgroup       nntp_catchup
4984 followup_to_poster      nntp_followup_to_poster
4985 group_index_format      nntp_group_index_format
4986 inews                   nntp_inews
4987 mime_subject            nntp_mime_subject
4988 news_cache_dir          nntp_cache_dir
4989 news_server             nntp_host
4990 newsrc                  nntp_newsrc
4991 nntp_poll               nntp_mail_check
4992 pop_checkinterval       pop_mail_check
4993 post_moderated          nntp_post_moderated
4994 save_unsubscribed       nntp_save_unsubscribed
4995 show_new_news           nntp_show_new_news
4996 show_only_unread        nntp_show_only_unread
4997 x_comment_to            nntp_x_comment_to
4998 smtp_auth_username      smtp_user
4999 smtp_auth_password      smtp_pass
5000 </verb></tscreen>
5001
5002 The <tt/contrib/ subdirectory contains a script named
5003 <tt/update-config.pl/ which eases migration.
5004
5005 A complete list of current variables follows.
5006
5007 <p>
5008