Use m_tempfile and better errors msg
[apps/madmutt.git] / doc / manual.xml.head
1 <?xml version="1.0" encoding="utf-8"?>
2 <!-- THIS FILE IST NOT VALID DOCBOOK ! DTD REMOVED -->                                                           
3 <!-- Please don't use html entities like [, ] ^  -->                                                   
4 <!-- etc. they don't work with xml!                             -->                                              
5 <book xmlns:madmutt-doc="http://Madmutt.berlios.de/doc/#NS">
6
7 <bookinfo> <!--{{{-->
8   <title>The Mutt Next Generation E-Mail Client</title>
9   <author>
10     <firstname>Andreas</firstname><surname>Krennmair</surname>
11     <email>ak@synflood.at</email>
12   </author>
13   <author>
14     <firstname>Michael</firstname><surname>Elkins</surname>
15     <email>me@cs.hmc.edu</email>
16   </author>
17   <pubdate>version @VERSION@</pubdate>
18   <abstract>
19     <para>
20       Michael Elinks on mutt, circa 1995:
21       ``All mail clients suck. This one just sucks less.''
22     </para>
23     <para>
24       Sven Guckes on mutt, ca. 2003: ``But it still sucks!''
25     </para>
26   </abstract>
27 </bookinfo> <!--}}}-->
28
29 <chapter id="introduction"> <!--{{{-->
30   <title>Introduction</title>
31
32   <sect1 id="overview">
33     <title>Overview</title>
34     
35     <para>
36       <emphasis role="bold">Madmutt</emphasis> is a small but very
37       powerful text-based MIME mail client.  Madmutt is highly
38       configurable, and is well suited to the mail power user with
39       advanced features like key bindings, keyboard macros, mail
40       threading, regular expression searches and a powerful pattern
41       matching language for selecting groups of messages.
42     </para>
43     
44     <para>
45       This documentation additionally contains documentation to
46       <emphasis role="bold"> Madmutt </emphasis> ,a fork from Mutt
47       with the goal to fix all the little annoyances of Mutt, to
48       integrate all the Mutt patches that are floating around in the
49       web, and to add other new features. Features specific to Madmutt
50       will be discussed in an extra section. Don't be confused when
51       most of the documentation talk about Mutt and not Madmutt,
52       Madmutt contains all Mutt features, plus many more.
53     </para>
54     
55     <para>
56       
57     </para>
58     
59   </sect1>
60   
61   <sect1 id="homepage">
62     <title>Madmutt Home Page</title>
63     
64     <para>
65       <madmutt-doc:web url="http://www.madmutt.org/"/>
66     </para>
67     
68     <para>
69       
70     </para>
71     
72   </sect1>
73   
74   <sect1 id="mailinglists">
75     <title>Mailing Lists</title>
76     
77     <para>
78       
79       <itemizedlist>
80         <listitem>
81           
82           <para>
83             <email>Madmutt-users@lists.berlios.de</email>: This is
84             where the Madmutt user support happens.
85           </para>
86         </listitem>
87         <listitem>
88           
89           <para>
90             <email>Madmutt-devel@lists.berlios.de</email>: The
91             development mailing list for Madmutt
92           </para>
93         </listitem>
94         
95       </itemizedlist>
96       
97     </para>
98     
99     <para>
100       
101     </para>
102     
103   </sect1>
104   
105   <sect1 id="distrib-sites">
106     <title>Software Distribution Sites</title>
107     
108     <para>
109       So far, there are no official releases of Madmutt, but you can
110       download daily snapshots from <madmutt-doc:web url="http://Madmutt.berlios.de/snapshots/"/>
111     </para>
112     
113     <para>
114       
115     </para>
116     
117   </sect1>
118   
119   <sect1 id="irc">
120     <title>IRC</title>
121     
122     <para>
123       Visit channel <emphasis>#madmutt</emphasis> on <ulink
124         url="http://www.freenode.net/">irc.freenode.net
125         (www.freenode.net) </ulink> to chat with other people
126       interested in Madmutt.  
127     </para>
128     
129   </sect1>
130   
131   <sect1 id="weblog">
132     <title>Weblog</title>
133     
134     <para>
135       If you want to read fresh news about the latest development in
136       Madmutt, and get informed about stuff like interesting,
137       Madmutt-related articles and packages for your favorite
138       distribution, you can read and/or subscribe to our <ulink
139         url="http://Madmutt.supersized.org/">Madmutt development
140         weblog</ulink>.
141     </para>
142     
143   </sect1>
144   
145   <sect1 id="copyright">
146     <title>Copyright</title>
147     
148     <para>
149       Mutt is Copyright (C) 1996-2000 Michael R. Elkins
150       &lt;me@cs.hmc.edu&gt; and others
151     </para>
152     
153     <para>
154       This program is free software; you can redistribute it and/or modify
155       it under the terms of the GNU General Public License as published by
156       the Free Software Foundation; either version 2 of the License, or
157       (at your option) any later version.
158     </para>
159     
160     <para>
161       This program is distributed in the hope that it will be useful,
162       but WITHOUT ANY WARRANTY; without even the implied warranty of
163       MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
164       GNU General Public License for more details.
165     </para>
166     
167     <para>
168       You should have received a copy of the GNU General Public License
169       along with this program; if not, write to the Free Software
170       Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
171     </para>
172     
173   </sect1>
174
175   <sect1 id="conventions">
176     <title>Manual Conventions</title>
177
178     <para>
179       This manual contains several (hopefully consistent) conventions to
180       specially layout different items in different fashions.
181     </para>
182
183     <para>
184       <itemizedlist>
185         <listitem>
186           <para>Configuration and environment variables will be printed
187             in a typewriter font and both prefixed with a dollar sign as
188             it's common for UNIX-like environments. Configuration
189             variables are lower-case only while environment variables
190             are upper-case only. <madmutt-doc:varref
191               name="imap-mail-check"/> is a configuration variable while
192             <madmutt-doc:envvar name="EDITOR"/> is an environment
193             variable.</para>
194         </listitem>
195         <listitem>
196           <para>madmutt-specific functions are enclosed in
197           <literal>&lt;&gt;</literal> and printed in a typewriter font,
198           too, as in <madmutt-doc:funcref name="sync-mailbox"/>.</para>
199         </listitem>
200         <listitem>
201           <para>As common for UNIX-like environments, references to
202             manual pages are printed with the section enclosed in
203             braces, as in <madmutt-doc:man name="vi"/> or <madmutt-doc:man
204               name="madmuttrc" sect="5"/>. Execute <literal>man [section]
205               [name]</literal> to view the manual page.</para>
206         </listitem>
207         <listitem>
208           <para>Keys are presented in the following way: ordinary keys
209             are just given as-is, e.g.
210             <madmutt-doc:key>q</madmutt-doc:key>. Control characters are
211             prefixed with <literal>C-</literal> (e.g. the screen can be
212             redraw by pressing <madmutt-doc:key
213               mod="C">L</madmutt-doc:key>) and <literal>E-</literal> for
214             Escape, e.g. a folder can be opened read-only with
215             <madmutt-doc:key mod="E">c</madmutt-doc:key>.
216           </para>
217         </listitem>
218       </itemizedlist>
219     </para>
220
221     <para>
222       If, while reading this fine manual, you find any inconsistencies
223       of whatever kind, please contact the developers via
224       <email>Madmutt-devel@lists.berlios.de</email> to report it.
225     </para>
226
227   </sect1>
228
229 </chapter>
230 <!--}}}-->
231
232 <chapter id="getting-started"> <!--{{{-->
233   <title>Getting Started</title>
234   
235   <sect1 id="basic-concepts"> <!--{{{-->
236     <title>Basic Concepts</title>
237     
238     <sect2 id="concept-screens-and-menus"> <!--{{{-->
239       <title>Screens and Menus</title>
240       
241       <para>
242         Madmutt offers different screens of which every has its special
243         purpose:
244       </para>
245       
246       <para>
247         
248         <itemizedlist>
249           <listitem>
250             
251             <para>
252               The <emphasis>index</emphasis> displays the contents of the
253               currently opened
254               mailbox.
255               
256             </para>
257           </listitem>
258           <listitem>
259             
260             <para>
261               The <emphasis>pager</emphasis> is responsible for displaying
262               messages, that
263               is, the header, the body and all attached parts.
264               
265             </para>
266           </listitem>
267           <listitem>
268             
269             <para>
270               The <emphasis>file browser</emphasis> offers operations on and
271               displays
272               information of all folders Madmutt should watch for mail.
273               
274             </para>
275           </listitem>
276           <listitem>
277             
278             <para>
279               The <emphasis>sidebar</emphasis> offers a permanent view of
280               which mailboxes
281               contain how many total, new and/or flagged mails.
282               
283             </para>
284           </listitem>
285           <listitem>
286             
287             <para>
288               The <emphasis>help screen</emphasis> lists for all currently
289               available
290               commands how to invoke them as well as a short description.
291               
292             </para>
293           </listitem>
294           <listitem>
295             
296             <para>
297               The <emphasis>compose</emphasis> menu is a comfortable
298               interface take last
299               actions before sending mail: change subjects, attach files,
300               remove
301               attachements, etc.
302               
303             </para>
304           </listitem>
305           <listitem>
306             
307             <para>
308               The <emphasis>attachement</emphasis> menu gives a summary and
309               the tree
310               structure of the attachements of the current message.
311               
312             </para>
313           </listitem>
314           <listitem>
315             
316             <para>
317               The <emphasis>alias</emphasis> menu lists all or a fraction of
318               the aliases
319               a user has defined.
320               
321             </para>
322           </listitem>
323           <listitem>
324             
325             <para>
326               The <emphasis>key</emphasis> menu used in connection with
327               encryption lets
328               users choose the right key to encrypt with.
329               
330             </para>
331           </listitem>
332           
333         </itemizedlist>
334         
335       </para>
336       
337       <para>
338         When Madmutt is started without any further options, it'll open
339         the users default mailbox and display the index.
340       </para>
341       
342       <para>
343         
344       </para>
345       
346     </sect2>
347       <!--}}}-->
348     
349     <sect2 id="concept-configuration"> <!--{{{-->
350       <title>Configuration</title>
351       
352       <para>
353         Madmutt does <emphasis>not</emphasis> feature an internal
354         configuration
355         interface or menu due to the simple fact that this would be too
356         complex to handle (currently there are several <emphasis>hundred</emphasis>
357         variables which fine-tune the behaviour.)
358       </para>
359       
360       <para>
361         Madmutt is configured using configuration files which allow
362         users to add comments or manage them via version control systems
363         to ease maintenance.
364       </para>
365       
366       <para>
367         Also, Madmutt comes with a shell script named <literal>grml-madmutt</literal>
368         kindly contributed by users which really helps and eases the
369         creation of a user's configuration file. When downloading the
370         source code via a snapshot or via subversion, it can be found in
371         the <literal>contrib</literal> directory.
372       </para>
373       
374       <para>
375         
376       </para>
377       
378     </sect2>
379       <!--}}}-->
380     
381     <sect2 id="concept-functions"> <!--{{{-->
382       <title>Functions</title>
383       
384       <para>
385         Madmutt offers great flexibility due to the use of functions:
386         internally, every action a user can make Madmutt perform is named
387         ``function.'' Those functions are assigned to keys (or even key
388         sequences) and may be completely adjusted to user's needs. The
389         basic idea is that the impatient users get a very intuitive
390         interface to start off with and advanced users virtually get no
391         limits to adjustments.
392       </para>
393       
394       <para>
395         
396       </para>
397       
398     </sect2>
399       <!--}}}-->
400     
401     <sect2 id="concept-interaction"> <!--{{{-->
402       <title>Interaction</title>
403       
404       <para>
405         Madmutt has two basic concepts of user interaction:
406       </para>
407       
408       <para>
409         
410         <orderedlist>
411           <listitem>
412             
413             <para>
414               There is one dedicated line on the screen used to query
415               the user for input, issue any command, query variables and
416               display error and informational messages. As for every type of
417               user input, this requires manual action leading to the need of
418               input.
419               
420             </para>
421           </listitem>
422           <listitem>
423             
424             <para>
425               The automatized interface for interaction are the so
426               called <emphasis>hooks</emphasis>. Hooks specify actions the
427               user wants to be
428               performed at well-defined situations: what to do when entering
429               which folder, what to do when displaying or replying to what
430               kind of message, etc. These are optional, i.e. a user doesn't
431               need to specify them but can do so.
432               
433             </para>
434           </listitem>
435           
436         </orderedlist>
437         
438       </para>
439       
440       <para>
441         
442       </para>
443       
444     </sect2>
445       <!--}}}-->
446     
447     <sect2 id="concept-modularization"> <!--{{{-->
448       <title>Modularization</title>
449       
450       <para>
451         Although Madmutt has many functionality built-in, many
452         features can be delegated to external tools to increase
453         flexibility: users can define programs to filter a message through
454         before displaying, users can use any program they want for
455         displaying a message, message types (such as PDF or PostScript)
456         for which Madmutt doesn't have a built-in filter can be rendered
457         by arbitrary tools and so forth. Although Madmutt has an alias
458         mechanism built-in, it features using external tools to query for
459         nearly every type of addresses from sources like LDAP, databases
460         or just the list of locally known users.
461       </para>
462       
463       <para>
464         
465       </para>
466       
467     </sect2>
468       <!--}}}-->
469     
470     <sect2 id="concept-patterns"> <!--{{{-->
471       <title>Patterns</title>
472       
473       <para>
474         Madmutt has a built-in pattern matching ``language'' which is
475         as widely used as possible to present a consistent interface to
476         users. The same ``pattern terms'' can be used for searching,
477         scoring, message selection and much more.
478       </para>
479       
480       <para>
481         
482       </para>
483       
484       <para>
485         
486       </para>
487       
488     </sect2>
489       <!--}}}-->
490     
491   </sect1>
492   
493   <!--}}}-->
494   
495   <sect1 id="screens-and-menus"> <!--{{{-->
496     <title>Screens and Menus</title>
497     
498     <sect2 id="intro-index">
499       <title>Index</title>
500       
501       <para>
502         The index is the screen that you usually see first when you
503         start Madmutt. It gives an overview over your emails in the
504         currently opened mailbox. By default, this is your system mailbox.
505         The information you see in the index is a list of emails, each with
506         its number on the left, its flags (new email, important email,
507         email that has been forwarded or replied to, tagged email, ...),
508         the date when email was sent, its sender, the email size, and the
509         subject. Additionally, the index also shows thread hierarchies:
510         when you reply to an email, and the other person replies back, you
511         can see the other's person email in a "sub-tree" below.  This is
512         especially useful for personal email between a group of people or
513         when you've subscribed to mailing lists.
514       </para>
515       
516       <para>
517         
518       </para>
519       
520     </sect2>
521     
522     <sect2 id="intro-pager">
523       <title>Pager</title>
524       
525       <para>
526         The pager is responsible for showing the email content. On the
527         top of the pager you have an overview over the most important email
528         headers like the sender, the recipient, the subject, and much more
529         information. How much information you actually see depends on your
530         configuration, which we'll describe below.
531       </para>
532       
533       <para>
534         Below the headers, you see the email body which usually contains
535         the message. If the email contains any attachments, you will see
536         more information about them below the email body, or, if the
537         attachments are text files, you can view them directly in the
538         pager.
539       </para>
540       
541       <para>
542         To give the user a good overview, it is possible to configure
543         Madmutt to show different things in the pager with different
544         colors. Virtually everything that can be described with a regular
545         expression can be colored, e.g. URLs, email addresses or smileys.
546       </para>
547       
548       <para>
549         
550       </para>
551       
552     </sect2>
553     
554     <sect2 id="intro-browser">
555       <title>File Browser</title>
556       
557       <para>
558         The file browser is the interface to the local or remote
559         file system. When selecting a mailbox to open, the browser allows
560         custom sorting of items, limiting the items shown by a regular
561         expression and a freely adjustable format of what to display in
562         which way. It also allows for easy navigation through the
563         file system when selecting file(s) to attach to a message, select
564         multiple files to attach and many more.
565       </para>
566       
567       <para>
568         
569       </para>
570       
571     </sect2>
572     
573     <sect2 id="intro-sidebar">
574       <title>Sidebar</title>
575       
576       <para>
577         The sidebar comes in handy to manage mails which are spread
578         over different folders. All folders users setup Madmutt to watch
579         for new mail will be listed. The listing includes not only the
580         name but also the number of total messages, the number of new and
581         flagged messages. Items with new mail may be colored different
582         from those with flagged mail, items may be shortened or compress
583         if they're they to long to be printed in full form so that by
584         abbreviated names, user still now what the name stands for.
585       </para>
586       
587       <para>
588         
589       </para>
590       
591     </sect2>
592     
593     <sect2 id="intro-help">
594       <title>Help</title>
595       
596       <para>
597         The help screen is meant to offer a quick help to the user. It
598         lists the current configuration of key bindings and their
599         associated commands including a short description, and currently
600         unbound functions that still need to be associated with a key
601         binding (or alternatively, they can be called via the Madmutt
602         command prompt).
603       </para>
604       
605       <para>
606         
607       </para>
608       
609     </sect2>
610     
611     <sect2 id="intro-compose">
612       <title>Compose Menu</title>
613       
614       <para>
615         The compose menu features a split screen containing the
616         information which really matter before actually sending a
617         message by mail or posting an article to a newsgroup: who gets
618         the message as what (recipient, newsgroup, who gets what kind of
619         copy). Additionally, users may set security options like
620         deciding whether to sign, encrypt or sign and encrypt a message
621         with/for what keys.
622       </para>
623       
624       <para>
625         Also, it's used to attach messages, news articles or files to
626         a message, to re-edit any attachment including the message
627         itself.
628       </para>
629       
630       <para>
631         
632       </para>
633       
634     </sect2>
635     
636     <sect2 id="intro-alias">
637       <title>Alias Menu</title>
638       
639       <para>
640         The alias menu is used to help users finding the recipients
641         of messages. For users who need to contact many people, there's
642         no need to remember addresses or names completely because it
643         allows for searching, too. The alias mechanism and thus the
644         alias menu also features grouping several addresses by a shorter
645         nickname, the actual alias, so that users don't have to select
646         each single recipient manually.
647       </para>
648       
649       <para>
650         
651       </para>
652       
653     </sect2>
654     
655     <sect2 id="intro-attach">
656       <title>Attachment Menu</title>
657       
658       <para>
659         As will be later discussed in detail, Madmutt features a good
660         and stable MIME implementation, that is, is greatly supports
661         sending and receiving messages of arbitrary type. The
662         attachment menu displays a message's structure in detail: what
663         content parts are attached to which parent part (which gives a
664         true tree structure), which type is of what type and what size.
665         Single parts may saved, deleted or modified to offer great and
666         easy access to message's internals.
667       </para>
668       
669       <para>
670         
671       </para>
672       
673     </sect2>
674     
675     <sect2 id="intro-keysel">
676       <title>Key Menu</title>
677       
678       <para>
679         <literal>FIXME</literal>
680       </para>
681       
682       <para>
683         
684       </para>
685       
686       <para>
687         
688       </para>
689       
690     </sect2>
691     
692   </sect1>
693     <!--}}}-->
694   
695   <sect1 id="moving"> <!--{{{-->
696     <title>Moving Around in Menus</title>
697     
698     <para>
699       Information is presented in menus, very similar to ELM.  Here is a
700       tableshowing the common keys used to navigate menus in Madmutt.
701     </para>
702     
703     <para>
704
705       <table frame="none" rowsep="1" texstr="l|l|l">
706         <title>Most commonly used movement bindings</title>
707         <tgroup cols="3" align="left" colsep="1" rowsep="1">
708         <thead>
709           <row>
710             <entry>Key</entry>
711             <entry>Function</entry>
712             <entry>Description</entry>
713           </row>
714         </thead>
715         <tbody>
716           <row>
717             <entry><madmutt-doc:key>j</madmutt-doc:key> or <madmutt-doc:key>Down</madmutt-doc:key></entry>
718             <entry><madmutt-doc:funcref name="next-entry"/></entry>
719             <entry>move to the next entry</entry>
720           </row>
721           <row>
722             <entry><madmutt-doc:key>k</madmutt-doc:key> or <madmutt-doc:key>Up</madmutt-doc:key></entry>
723             <entry><madmutt-doc:funcref name="previous-entry"/></entry>
724             <entry>move to the previous entry</entry>
725           </row>
726           <row>
727             <entry><madmutt-doc:key>z</madmutt-doc:key> or <madmutt-doc:key>PageDn</madmutt-doc:key></entry>
728             <entry><madmutt-doc:funcref name="page-down"/></entry>
729             <entry>go to the next page</entry>
730           </row>
731           <row>
732             <entry><madmutt-doc:key>Z</madmutt-doc:key> or <madmutt-doc:key>PageUp</madmutt-doc:key></entry>
733             <entry><madmutt-doc:funcref name="page-up"/></entry>
734             <entry>go to the previous page</entry>
735           </row>
736           <row>
737             <entry><madmutt-doc:key>=</madmutt-doc:key> or <madmutt-doc:key>Home</madmutt-doc:key></entry>
738             <entry><madmutt-doc:funcref name="first-entry"/></entry>
739             <entry>jump to the first entry</entry>
740           </row>
741           <row>
742             <entry><madmutt-doc:key>*</madmutt-doc:key> or <madmutt-doc:key>End</madmutt-doc:key></entry>
743             <entry><madmutt-doc:funcref name="last-entry"/></entry>
744             <entry>jump to the last entry</entry>
745           </row>
746           <row>
747             <entry><madmutt-doc:key>q</madmutt-doc:key></entry>
748             <entry><madmutt-doc:funcref name="quit"/></entry>
749             <entry>exit the current menu</entry>
750           </row>
751           <row>
752             <entry><madmutt-doc:key>?</madmutt-doc:key></entry>
753             <entry><madmutt-doc:funcref name="help"/></entry>
754             <entry>list all key bindings for the current menu</entry>
755           </row>
756         </tbody>
757       </tgroup>
758     </table>
759
760
761     </para>
762     
763     <para>
764       
765     </para>
766     
767   </sect1>
768     <!--}}}-->
769   
770   <sect1 id="editing"> <!--{{{-->
771     <title>Editing Input Fields</title>
772     
773     <para>
774       Madmutt has a builtin line editor which is used as the primary way to
775       input
776       textual data such as email addresses or filenames.  The keys used to
777       move
778       around while editing are very similar to those of Emacs.
779     </para>
780     
781     <para>
782
783       <table frame="none" rowsep="1" texstr="l|l|l">
784         <title>Line Editor Functions</title>
785         <tgroup cols="3" align="left" colsep="1" rowsep="1">
786         <thead>
787           <row>
788             <entry>Key</entry>
789             <entry>Function</entry>
790             <entry>Description</entry>
791           </row>
792         </thead>
793         <tbody>
794           <row>
795             <entry><madmutt-doc:key mod="C">A</madmutt-doc:key> or <madmutt-doc:key>Home</madmutt-doc:key></entry>
796             <entry><madmutt-doc:funcref name="bol"/></entry>
797             <entry>move to the start of the line</entry>
798           </row>
799           <row>
800             <entry><madmutt-doc:key mod="C">B</madmutt-doc:key> or <madmutt-doc:key>Left</madmutt-doc:key></entry>
801             <entry><madmutt-doc:funcref name="backward-char"/>
802             </entry><entry>move back one char</entry>
803           </row>
804           <row>
805             <entry><madmutt-doc:key mod="E">B</madmutt-doc:key></entry>
806             <entry><madmutt-doc:funcref name="backward-word"/></entry>
807             <entry>move back one word</entry>
808           </row>
809           <row>
810             <entry><madmutt-doc:key mod="C">D</madmutt-doc:key> or <madmutt-doc:key>Delete</madmutt-doc:key></entry>
811             <entry><madmutt-doc:funcref name="delete-char"/></entry>
812             <entry>delete the char under the cursor</entry>
813           </row>
814           <row>
815             <entry><madmutt-doc:key mod="C">E</madmutt-doc:key> or <madmutt-doc:key>End</madmutt-doc:key></entry>
816             <entry><madmutt-doc:funcref name="eol"/></entry>
817             <entry>move to the end of the line</entry>
818           </row>
819           <row>
820             <entry><madmutt-doc:key mod="C">F</madmutt-doc:key> or <madmutt-doc:key>Right</madmutt-doc:key></entry>
821             <entry><madmutt-doc:funcref name="forward-char"/></entry>
822             <entry>move forward one char</entry>
823           </row>
824           <row>
825             <entry><madmutt-doc:key mod="E">F</madmutt-doc:key></entry>
826             <entry><madmutt-doc:funcref name="forward-word"/></entry>
827             <entry>move forward one word</entry>
828           </row>
829           <row>
830             <entry><madmutt-doc:key>Tab</madmutt-doc:key></entry>
831             <entry><madmutt-doc:funcref name="complete"/></entry>
832             <entry>complete filename or alias</entry>
833           </row>
834           <row>
835             <entry><madmutt-doc:key mod="C">T</madmutt-doc:key></entry>
836             <entry><madmutt-doc:funcref name="complete-query"/></entry>
837             <entry>complete address with query</entry>
838           </row>
839           <row>
840             <entry><madmutt-doc:key mod="C">K</madmutt-doc:key></entry>
841             <entry><madmutt-doc:funcref name="kill-eol"/></entry>
842             <entry>delete to the end of the line</entry>
843           </row>
844           <row>
845             <entry><madmutt-doc:key mod="E">d</madmutt-doc:key></entry>
846             <entry><madmutt-doc:funcref name="kill-eow"/></entry>
847             <entry>delete to the end of the word</entry>
848           </row>
849           <row>
850             <entry><madmutt-doc:key mod="C">W</madmutt-doc:key></entry>
851             <entry><madmutt-doc:funcref name="kill-word"/></entry>
852             <entry>kill the word in front of the cursor</entry>
853           </row>
854           <row>
855             <entry><madmutt-doc:key mod="C">U</madmutt-doc:key></entry>
856             <entry><madmutt-doc:funcref name="kill-line"/></entry>
857             <entry>delete entire line</entry>
858           </row>
859           <row>
860             <entry><madmutt-doc:key mod="C">V</madmutt-doc:key></entry>
861             <entry><madmutt-doc:funcref name="quote-char"/></entry>
862             <entry>quote the next typed key</entry>
863           </row>
864           <row>
865             <entry><madmutt-doc:key>Up</madmutt-doc:key></entry>
866             <entry><madmutt-doc:funcref name="history-up"/></entry>
867             <entry>recall previous string from history</entry>
868           </row>
869           <row>
870             <entry><madmutt-doc:key>Down</madmutt-doc:key></entry>
871             <entry><madmutt-doc:funcref name="history-down"/></entry>
872             <entry>recall next string from history</entry>
873           </row>
874           <row>
875             <entry><madmutt-doc:key>BackSpace</madmutt-doc:key></entry>
876             <entry><madmutt-doc:funcref name="backspace"/></entry>
877             <entry>kill the char in front of the cursor</entry>
878           </row>
879           <row>
880             <entry><madmutt-doc:key mod="E">u</madmutt-doc:key></entry>
881             <entry><madmutt-doc:funcref name="upcase-word"/></entry>
882             <entry>convert word to upper case</entry>
883           </row>
884           <row>
885             <entry><madmutt-doc:key mod="E">l</madmutt-doc:key></entry>
886             <entry><madmutt-doc:funcref name="downcase-word"/></entry>
887             <entry>convert word to lower case</entry>
888           </row>
889           <row>
890             <entry><madmutt-doc:key mod="E">c</madmutt-doc:key></entry>
891             <entry><madmutt-doc:funcref name="capitalize-word"/></entry>
892             <entry>capitalize the word</entry>
893           </row>
894           <row>
895             <entry><madmutt-doc:key mod="C">G</madmutt-doc:key></entry>
896             <entry></entry>
897             <entry>abort</entry>
898           </row>
899           <row>
900             <entry><madmutt-doc:key>Return</madmutt-doc:key></entry>
901             <entry></entry>
902             <entry>finish editing</entry>
903           </row>
904         </tbody>
905       </tgroup>
906     </table>
907
908     </para>
909     
910     <para>
911       You can remap the <emphasis>editor</emphasis> functions using the
912       <madmutt-doc:cmdref name="bind"/> command.  For example, to make
913       the <emphasis>Delete</emphasis> key delete the character in front
914       of the cursor rather than under, you could use
915     </para>
916     
917     <para>
918       <literal>bind editor &lt;delete&gt; backspace</literal>
919     </para>
920     
921   </sect1>
922     <!--}}}-->
923   
924   <sect1 id="reading"> <!--{{{-->
925     <title>Reading Mail - The Index and Pager</title>
926     
927     <para>
928       Similar to many other mail clients, there are two modes in which mail
929       isread in Madmutt.  The first is the index of messages in the mailbox,
930       which is
931       called the ``index'' in Madmutt.  The second mode is the display of the
932       message contents.  This is called the ``pager.''
933     </para>
934     
935     <para>
936       The next few sections describe the functions provided in each of these
937       modes.
938     </para>
939     
940     <sect2 id="reading-index">
941       <title>The Message Index</title>
942       
943       <para>
944
945       <table frame="none" rowsep="1" texstr="l|l|l">
946         <title>Most commonly used Index Bindings</title>
947         <tgroup cols="3" align="left" colsep="1" rowsep="1">
948         <thead>
949           <row>
950             <entry>Key</entry>
951             <entry>Function</entry>
952             <entry>Description</entry>
953           </row>
954         </thead>
955         <tbody>
956           <row>
957             <entry><madmutt-doc:key>c</madmutt-doc:key></entry>
958             <entry><literal></literal></entry>
959             <entry>change to a different mailbox</entry>
960           </row>
961           <row>
962             <entry><madmutt-doc:key mod="E">c</madmutt-doc:key></entry>
963             <entry><literal></literal></entry>
964             <entry>change to a folder in read-only mode</entry>
965           </row>
966           <row>
967             <entry><madmutt-doc:key>C</madmutt-doc:key></entry>
968             <entry><literal></literal></entry>
969             <entry>copy the current message to another mailbox</entry>
970           </row>
971           <row>
972             <entry><madmutt-doc:key mod="E">C</madmutt-doc:key></entry>
973             <entry><literal></literal></entry>
974             <entry>decode a message and copy it to a folder</entry>
975           </row>
976           <row>
977             <entry><madmutt-doc:key mod="E">s</madmutt-doc:key></entry>
978             <entry><literal></literal></entry>
979             <entry>decode a message and save it to a folder</entry>
980           </row>
981           <row>
982             <entry><madmutt-doc:key>D</madmutt-doc:key></entry>
983             <entry><literal></literal></entry>
984             <entry>delete messages matching a pattern</entry>
985           </row>
986           <row>
987             <entry><madmutt-doc:key>d</madmutt-doc:key></entry>
988             <entry><literal></literal></entry>
989             <entry>delete the current message</entry>
990           </row>
991           <row>
992             <entry><madmutt-doc:key>F</madmutt-doc:key></entry>
993             <entry><literal></literal></entry>
994             <entry>mark as important</entry>
995           </row>
996           <row>
997             <entry><madmutt-doc:key>l</madmutt-doc:key></entry>
998             <entry><literal></literal></entry>
999             <entry>show messages matching a pattern</entry>
1000           </row>
1001           <row>
1002             <entry><madmutt-doc:key>N</madmutt-doc:key></entry>
1003             <entry><literal></literal></entry>
1004             <entry>mark message as new</entry>
1005           </row>
1006           <row>
1007             <entry><madmutt-doc:key>o</madmutt-doc:key></entry>
1008             <entry><literal></literal></entry>
1009             <entry>change the current sort method</entry>
1010           </row>
1011           <row>
1012             <entry><madmutt-doc:key>O</madmutt-doc:key></entry>
1013             <entry><literal></literal></entry>
1014             <entry>reverse sort the mailbox</entry>
1015           </row>
1016           <row>
1017             <entry><madmutt-doc:key>q</madmutt-doc:key></entry>
1018             <entry><literal></literal></entry>
1019             <entry>save changes and exit</entry>
1020           </row>
1021           <row>
1022             <entry><madmutt-doc:key>s</madmutt-doc:key></entry>
1023             <entry><literal></literal></entry>
1024             <entry>save-message</entry>
1025           </row>
1026           <row>
1027             <entry><madmutt-doc:key>T</madmutt-doc:key></entry>
1028             <entry><literal></literal></entry>
1029             <entry>tag messages matching a pattern</entry>
1030           </row>
1031           <row>
1032             <entry><madmutt-doc:key>t</madmutt-doc:key></entry>
1033             <entry><literal></literal></entry>
1034             <entry>toggle the tag on a message</entry>
1035           </row>
1036           <row>
1037             <entry><madmutt-doc:key mod="E">t</madmutt-doc:key></entry>
1038             <entry><literal></literal></entry>
1039             <entry>toggle tag on entire message thread</entry>
1040           </row>
1041           <row>
1042             <entry><madmutt-doc:key>U</madmutt-doc:key></entry>
1043             <entry><literal></literal></entry>
1044             <entry>undelete messages matching a pattern</entry>
1045           </row>
1046           <row>
1047             <entry><madmutt-doc:key>u</madmutt-doc:key></entry>
1048             <entry><literal></literal></entry>
1049             <entry>undelete-message</entry>
1050           </row>
1051           <row>
1052             <entry><madmutt-doc:key>v</madmutt-doc:key></entry>
1053             <entry><literal></literal></entry>
1054             <entry>view-attachments</entry>
1055           </row>
1056           <row>
1057             <entry><madmutt-doc:key>x</madmutt-doc:key></entry>
1058             <entry><literal></literal></entry>
1059             <entry>abort changes and exit</entry>
1060           </row>
1061           <row>
1062             <entry><madmutt-doc:key>Return</madmutt-doc:key></entry>
1063             <entry><literal></literal></entry>
1064             <entry>display-message</entry>
1065           </row>
1066           <row>
1067             <entry><madmutt-doc:key>Tab</madmutt-doc:key></entry>
1068             <entry><literal></literal></entry>
1069             <entry>jump to the next new or unread message</entry>
1070           </row>
1071           <row>
1072             <entry><madmutt-doc:key>@</madmutt-doc:key></entry>
1073             <entry><literal></literal></entry>
1074             <entry>show the author's full e-mail address</entry>
1075           </row>
1076           <row>
1077             <entry><madmutt-doc:key>$</madmutt-doc:key></entry>
1078             <entry><literal></literal></entry>
1079             <entry>save changes to mailbox</entry>
1080           </row>
1081           <row>
1082             <entry><madmutt-doc:key>/</madmutt-doc:key></entry>
1083             <entry><literal></literal></entry>
1084             <entry>search</entry>
1085           </row>
1086           <row>
1087             <entry><madmutt-doc:key mod="E">/</madmutt-doc:key></entry>
1088             <entry><literal></literal></entry>
1089             <entry>search-reverse</entry>
1090           </row>
1091           <row>
1092             <entry><madmutt-doc:key mod="C">L</madmutt-doc:key></entry>
1093             <entry><literal></literal></entry>
1094             <entry>clear and redraw the screen</entry>
1095           </row>
1096           <row>
1097             <entry><madmutt-doc:key mod="C">T</madmutt-doc:key></entry>
1098             <entry><literal></literal></entry>
1099             <entry>untag messages matching a pattern</entry>
1100           </row>
1101         </tbody>
1102       </tgroup>
1103     </table>
1104
1105       </para>
1106       
1107       <sect3>
1108         <title>Status Flags</title> <!--{{{-->
1109         
1110         <para>
1111           In addition to who sent the message and the subject, a short
1112           summary of
1113           the disposition of each message is printed beside the message
1114           number.
1115           Zero or more of the following ``flags'' may appear, which mean:
1116         </para>
1117         
1118         <para>
1119
1120           <variablelist>
1121             
1122             <varlistentry>
1123               <term>D</term>
1124               <listitem>
1125                 <para>
1126                   message is deleted (is marked for deletion)
1127                 </para>
1128               </listitem>
1129             </varlistentry>
1130             <varlistentry>
1131               <term>d</term>
1132               <listitem>
1133                 <para>
1134                   message have attachments marked for deletion
1135                 </para>
1136               </listitem>
1137             </varlistentry>
1138             <varlistentry>
1139               <term>K</term>
1140               <listitem>
1141                 <para>
1142                   contains a PGP public key
1143                 </para>
1144               </listitem>
1145             </varlistentry>
1146             <varlistentry>
1147               <term>N</term>
1148               <listitem>
1149                 <para>
1150                   message is new
1151                 </para>
1152               </listitem>
1153             </varlistentry>
1154             <varlistentry>
1155               <term>O</term>
1156               <listitem>
1157                 <para>
1158                   message is old
1159                 </para>
1160               </listitem>
1161             </varlistentry>
1162             <varlistentry>
1163               <term>P</term>
1164               <listitem>
1165                 <para>
1166                   message is PGP encrypted
1167                 </para>
1168               </listitem>
1169             </varlistentry>
1170             <varlistentry>
1171               <term>r</term>
1172               <listitem>
1173                 <para>
1174                   message has been replied to
1175                 </para>
1176               </listitem>
1177             </varlistentry>
1178             <varlistentry>
1179               <term>S</term>
1180               <listitem>
1181                 <para>
1182                   message is signed, and the signature is succesfully
1183                   verified
1184                 </para>
1185               </listitem>
1186             </varlistentry>
1187             <varlistentry>
1188               <term>s</term>
1189               <listitem>
1190                 <para>
1191                   message is signed
1192                 </para>
1193               </listitem>
1194             </varlistentry>
1195             <varlistentry>
1196               <term>!</term>
1197               <listitem>
1198                 <para>
1199                   message is flagged
1200                 </para>
1201               </listitem>
1202             </varlistentry>
1203             <varlistentry>
1204               <term>*</term>
1205               <listitem>
1206                 <para>
1207                   message is tagged
1208                 </para>
1209               </listitem>
1210             </varlistentry>
1211           </variablelist>
1212         </para>
1213         
1214         <para>
1215           Some of the status flags can be turned on or off using
1216           
1217           <itemizedlist>
1218             <listitem>
1219               
1220               <para>
1221                 <emphasis role="bold">set-flag</emphasis> (default: w)
1222               </para>
1223             </listitem>
1224             <listitem>
1225               
1226               <para>
1227                 <emphasis role="bold">clear-flag</emphasis> (default: W)
1228               </para>
1229             </listitem>
1230             
1231           </itemizedlist>
1232           
1233         </para>
1234         
1235         <para>
1236           Furthermore, the following flags reflect who the message is
1237           addressed
1238           to.  They can be customized with the
1239           <madmutt-doc:varref name="to-chars"/> variable.
1240         </para>
1241         
1242         <para>
1243           <variablelist>
1244             
1245             <varlistentry>
1246               <term>+</term>
1247               <listitem>
1248                 <para>
1249                   message is to you and you only
1250                 </para>
1251               </listitem>
1252             </varlistentry>
1253             <varlistentry>
1254               <term>T</term>
1255               <listitem>
1256                 <para>
1257                   message is to you, but also to or cc'ed to others
1258                 </para>
1259               </listitem>
1260             </varlistentry>
1261             <varlistentry>
1262               <term>C</term>
1263               <listitem>
1264                 <para>
1265                   message is cc'ed to you
1266                 </para>
1267               </listitem>
1268             </varlistentry>
1269             <varlistentry>
1270               <term>F</term>
1271               <listitem>
1272                 <para>
1273                   message is from you
1274                 </para>
1275               </listitem>
1276             </varlistentry>
1277             <varlistentry>
1278               <term>L</term>
1279               <listitem>
1280                 <para>
1281                   message is sent to a subscribed mailing list
1282                 </para>
1283               </listitem>
1284             </varlistentry>
1285           </variablelist>
1286         </para>
1287         
1288       </sect3>
1289       
1290     </sect2>
1291     
1292     <sect2 id="reading-pager">
1293       <title>The Pager</title>
1294       
1295       <para>
1296         By default, Madmutt uses its builtin pager to display the body of
1297         messages.
1298         The pager is very similar to the Unix program <emphasis>less</emphasis> though not nearly as
1299         featureful.
1300       </para>
1301       
1302       <para>
1303
1304       <table frame="none" rowsep="1" texstr="l|l|l">
1305         <title>Most commonly used Pager Bindings</title>
1306         <tgroup cols="3" align="left" colsep="1" rowsep="1">
1307         <thead>
1308           <row>
1309             <entry>Key</entry>
1310             <entry>Function</entry>
1311             <entry>Description</entry>
1312           </row>
1313         </thead>
1314         <tbody>
1315           <row>
1316             <entry><madmutt-doc:key>Return</madmutt-doc:key></entry>
1317             <entry><literal></literal></entry>
1318             <entry>go down one line</entry>
1319           </row>
1320           <row>
1321             <entry><madmutt-doc:key>Space</madmutt-doc:key></entry>
1322             <entry><literal></literal></entry>
1323             <entry>display the next page (or next message if at the end of a message)</entry>
1324           </row>
1325           <row>
1326             <entry><madmutt-doc:key>-</madmutt-doc:key></entry>
1327             <entry><literal></literal></entry>
1328             <entry>go back to the previous page</entry>
1329           </row>
1330           <row>
1331             <entry><madmutt-doc:key>n</madmutt-doc:key></entry>
1332             <entry><literal></literal></entry>
1333             <entry>search for next match</entry>
1334           </row>
1335           <row>
1336             <entry><madmutt-doc:key>S</madmutt-doc:key></entry>
1337             <entry><literal></literal></entry>
1338             <entry>skip beyond quoted text</entry>
1339           </row>
1340           <row>
1341             <entry><madmutt-doc:key>T</madmutt-doc:key></entry>
1342             <entry><literal></literal></entry>
1343             <entry>toggle display of quoted text</entry>
1344           </row>
1345           <row>
1346             <entry><madmutt-doc:key>?</madmutt-doc:key></entry>
1347             <entry><literal></literal></entry>
1348             <entry>show key bindings</entry>
1349           </row>
1350           <row>
1351             <entry><madmutt-doc:key>/</madmutt-doc:key></entry>
1352             <entry><literal></literal></entry>
1353             <entry>search for a regular expression (pattern)</entry>
1354           </row>
1355           <row>
1356             <entry><madmutt-doc:key mod="E">/</madmutt-doc:key></entry>
1357             <entry><literal></literal></entry>
1358             <entry>search backwards for a regular expression</entry>
1359           </row>
1360           <row>
1361             <entry><madmutt-doc:key>\</madmutt-doc:key></entry>
1362             <entry><literal></literal></entry>
1363             <entry>toggle search pattern coloring</entry>
1364           </row>
1365           <row>
1366             <entry><madmutt-doc:key>^</madmutt-doc:key></entry>
1367             <entry><literal></literal></entry>
1368             <entry>jump to the top of the message</entry>
1369           </row>
1370         </tbody>
1371       </tgroup>
1372     </table>
1373
1374
1375       </para>
1376       
1377       <para>
1378         In addition, many of the functions from the <emphasis>index</emphasis> are available in
1379         the pager, such as <emphasis>delete-message</emphasis> or <emphasis>
1380           copy-message
1381         </emphasis>
1382         (this is one
1383         advantage over using an external pager to view messages).
1384       </para>
1385       
1386       <para>
1387         Also, the internal pager supports a couple other advanced
1388         features.  For one, it will accept and translate the
1389         ``standard'' nroff sequences forbold and underline. These
1390         sequences are a series of either the letter, backspace
1391         (<madmutt-doc:key mod="C">H</madmutt-doc:key>), the letter again for bold
1392         or the letter, backspace, <madmutt-doc:key>_</madmutt-doc:key> for denoting
1393         underline. Madmutt will attempt to display these in bold and
1394         underline respectively if your terminal supports them. If not,
1395         you can use the bold and underline <madmutt-doc:cmdref
1396           name="color"/> objects to specify a color or mono attribute
1397         for them.
1398       </para>
1399       
1400       <para>
1401         Additionally, the internal pager supports the ANSI escape
1402         sequences for character attributes.  Madmutt translates them
1403         into the correct color and character settings.  The sequences
1404         Madmutt supports are: <literal>ESC [ Ps;Ps;Ps;...;Ps
1405           m</literal> (see table below for possible values for
1406         <literal>Ps</literal>).
1407       </para>
1408       
1409       <para>
1410
1411       <table frame="none" rowsep="1" texstr="l|l">
1412         <title>ANSI Escape Sequences</title>
1413         <tgroup cols="2" align="left" colsep="1" rowsep="1">
1414         <thead>
1415           <row>
1416             <entry>Value</entry>
1417             <entry>Attribute</entry>
1418           </row>
1419         </thead>
1420         <tbody>
1421           <row>
1422             <entry><literal>0</literal></entry>
1423             <entry>All Attributes Off</entry>
1424           </row>
1425           <row>
1426             <entry><literal>1</literal></entry>
1427             <entry>Bold on</entry>
1428           </row>
1429           <row>
1430             <entry><literal>4</literal></entry>
1431             <entry>Underline on</entry>
1432           </row>
1433           <row>
1434             <entry><literal>5</literal></entry>
1435             <entry>Blink on</entry>
1436           </row>
1437           <row>
1438             <entry><literal>7</literal></entry>
1439             <entry>Reverse video on</entry>
1440           </row>
1441           <row>
1442             <entry><literal>3x</literal></entry>
1443             <entry>Foreground color is x (see table below)</entry>
1444           </row>
1445           <row>
1446             <entry><literal>4x</literal></entry>
1447             <entry>Background color is x (see table below)</entry>
1448           </row>
1449         </tbody>
1450       </tgroup>
1451     </table>
1452
1453     
1454       <table frame="none" rowsep="1" texstr="l|l">
1455         <title>ANSI Colors</title>
1456         <tgroup cols="2" align="left" colsep="1" rowsep="1">
1457         <thead>
1458           <row>
1459             <entry>Number</entry>
1460             <entry>Color</entry>
1461           </row>
1462         </thead>
1463         <tbody>
1464           <row>
1465             <entry><literal>0</literal></entry>
1466             <entry>black</entry>
1467           </row>
1468           <row>
1469             <entry><literal>1</literal></entry>
1470             <entry>red</entry>
1471           </row>
1472           <row>
1473             <entry><literal>2</literal></entry>
1474             <entry>green</entry>
1475           </row>
1476           <row>
1477             <entry><literal>3</literal></entry>
1478             <entry>yellow</entry>
1479           </row>
1480           <row>
1481             <entry><literal>4</literal></entry>
1482             <entry>blue</entry>
1483           </row>
1484           <row>
1485             <entry><literal>5</literal></entry>
1486             <entry>magenta</entry>
1487           </row>
1488           <row>
1489             <entry><literal>6</literal></entry>
1490             <entry>cyan</entry>
1491           </row>
1492           <row>
1493             <entry><literal>7</literal></entry>
1494             <entry>white</entry>
1495           </row>
1496         </tbody>
1497       </tgroup>
1498     </table>
1499
1500
1501         </para>
1502         
1503         <para>
1504           Madmutt uses these attributes for handling text/enriched messages,
1505           and they
1506           can also be used by an external <madmutt-doc:cmdref name="auto_view"/>
1507           script for highlighting purposes.  <emphasis role="bold">Note:</emphasis> If you change the colors for your
1508           display, for example by changing the color associated with color2 for
1509           your xterm, then that color will be used instead of green.
1510         </para>
1511         
1512       </sect2>
1513       
1514       <sect2 id="threads">
1515         <title>Threaded Mode</title>
1516         
1517         <para>
1518           When the mailbox is <link linkend="sort">sorted</link> by <emphasis>
1519             threads
1520           </emphasis>
1521           ,there are
1522           a few additional functions available in the <emphasis>index</emphasis> and <emphasis>
1523             pager
1524           </emphasis>
1525           modes.
1526         </para>
1527         
1528         <para>
1529
1530         <table frame="none" rowsep="1" texstr="l|l|l">
1531           <title>Most commonly used thread-related bindings</title>
1532           <tgroup cols="3" align="left" colsep="1" rowsep="1">
1533           <thead>
1534             <row>
1535               <entry>Key</entry>
1536               <entry>Function</entry>
1537               <entry>Description</entry>
1538             </row>
1539           </thead>
1540           <tbody>
1541             <row>
1542               <entry><madmutt-doc:key mod="C">D</madmutt-doc:key></entry>
1543               <entry><madmutt-doc:funcref name="delete-thread"/></entry>
1544                 <entry>delete all messages in the current  thread</entry>
1545               </row>
1546             <row>
1547               <entry><madmutt-doc:key mod="C">U</madmutt-doc:key></entry>
1548               <entry><madmutt-doc:funcref name="undelete-thread"/></entry>
1549                 <entry>undelete all messages in the current thread</entry>
1550               </row>
1551             <row>
1552               <entry><madmutt-doc:key mod="C">N</madmutt-doc:key></entry>
1553               <entry><madmutt-doc:funcref name="next-thread"/></entry>
1554                 <entry>jump to the start of the next thread</entry>
1555               </row>
1556             <row>
1557               <entry><madmutt-doc:key mod="C">P</madmutt-doc:key></entry>
1558               <entry><madmutt-doc:funcref name="previous-thread"/></entry>
1559                 <entry>jump to the start of the previous thread</entry>
1560               </row>
1561             <row>
1562               <entry><madmutt-doc:key mod="C">R</madmutt-doc:key></entry>
1563               <entry><madmutt-doc:funcref name="read-thread"/></entry>
1564                 <entry>mark the current thread as read</entry>
1565               </row>
1566             <row>
1567               <entry><madmutt-doc:key mod="E">d</madmutt-doc:key></entry>
1568               <entry><madmutt-doc:funcref name="delete-subthread"/></entry>
1569                 <entry>delete all messages in the current subthread</entry>
1570               </row>
1571             <row>
1572               <entry><madmutt-doc:key mod="E">u</madmutt-doc:key></entry>
1573               <entry><madmutt-doc:funcref name="undelete-subthread"/></entry>
1574                 <entry>undelete all messages in the current subthread</entry>
1575               </row>
1576             <row>
1577               <entry><madmutt-doc:key mod="E">n</madmutt-doc:key></entry>
1578               <entry><madmutt-doc:funcref name="next-subthread"/></entry>
1579                 <entry>jump to the start of the next subthread</entry>
1580               </row>
1581             <row>
1582               <entry><madmutt-doc:key mod="E">p</madmutt-doc:key></entry>
1583               <entry><madmutt-doc:funcref name="previous-subthread"/></entry>
1584                 <entry>jump to the start of the previous subthread</entry>
1585               </row>
1586             <row>
1587               <entry><madmutt-doc:key mod="E">r</madmutt-doc:key></entry>
1588               <entry><madmutt-doc:funcref name="read-subthread"/></entry>
1589                 <entry>mark the current subthread as read </entry>
1590               </row>
1591             <row>
1592               <entry><madmutt-doc:key mod="E">t</madmutt-doc:key></entry>
1593               <entry><madmutt-doc:funcref name="tag-thread"/></entry>
1594                 <entry>toggle the tag on the current thread</entry>
1595               </row>
1596             <row>
1597               <entry><madmutt-doc:key mod="E">v</madmutt-doc:key></entry>
1598               <entry><madmutt-doc:funcref name="collapse-thread"/></entry>
1599                 <entry>toggle collapse for the current thread</entry>
1600               </row>
1601             <row>
1602               <entry><madmutt-doc:key mod="E">V</madmutt-doc:key></entry>
1603               <entry><madmutt-doc:funcref name="collapse-all"/></entry>
1604                 <entry>toggle collapse for all threads</entry>
1605               </row>
1606             <row>
1607               <entry><madmutt-doc:key>P</madmutt-doc:key></entry>
1608               <entry><madmutt-doc:funcref name="parent-message"/></entry>
1609                 <entry>jump to parent message in thread</entry>
1610               </row>
1611           </tbody>
1612         </tgroup>
1613       </table>
1614
1615           
1616         </para>
1617         
1618         <para>
1619           <emphasis role="bold">Note:</emphasis> Collapsing a thread displays
1620           only the first message
1621           in the thread and hides the others. This is useful when threads
1622           contain so many messages that you can only see a handful of threads
1623           onthe screen. See <literal>%M</literal> in
1624           <madmutt-doc:varref name="index-format"/>.
1625         </para>
1626
1627         <para>
1628           For example, you could use
1629           <literal>%?M?(#%03M)&amp;(%4l)?</literal> in <madmutt-doc:varref name="index-format"/>
1630           to optionally
1631           display the number of hidden messages if the thread is collapsed.
1632         </para>
1633         
1634         <para>
1635           See also the <madmutt-doc:varref name="strict-threads"/> variable.
1636         </para>
1637         
1638       </sect2>
1639       
1640       <sect2 id="pager-functions">
1641         <title>Miscellaneous Functions</title>
1642         
1643         <para>
1644           <madmutt-doc:funcdef name="create-alias"><madmutt-doc:key>a</madmutt-doc:key></madmutt-doc:funcdef>
1645         </para>
1646         
1647         <para>
1648           Creates a new alias based upon the current message (or prompts for a
1649           new one).  Once editing is complete, an <madmutt-doc:cmdref name="alias"/>
1650           command is added to the file specified by the <madmutt-doc:varref name="alias-file"/>
1651           variable for future use. <emphasis role="bold">Note:</emphasis>
1652           Specifying an <madmutt-doc:varref name="alias-file"/>
1653           does not add the aliases specified there-in, you must also <madmutt-doc:cmdref name="source"/>
1654           the file.
1655         </para>
1656         
1657         <para>
1658           <madmutt-doc:funcdef name="check-traditional-pgp"><madmutt-doc:key mod="E">P</madmutt-doc:key></madmutt-doc:funcdef>
1659         </para>
1660         
1661         <para>
1662           This function will search the current message for content signed or
1663           encrypted with PGP the "traditional" way, that is, without proper
1664           MIME tagging.  Technically, this function will temporarily change
1665           the MIME content types of the body parts containing PGP data; this
1666           is similar to the <madmutt-doc:funcref name="edit-type"/>
1667           function's
1668           effect.
1669         </para>
1670         
1671         <para>
1672           <madmutt-doc:funcdef name="display-toggle-weed"><madmutt-doc:key>h</madmutt-doc:key></madmutt-doc:funcdef>
1673         </para>
1674         
1675         <para>
1676           Toggles the weeding of message header fields specified by <madmutt-doc:cmdref name="ignore"/>
1677           commands.
1678         </para>
1679         
1680         <para>
1681           <madmutt-doc:funcdef name="edit"><madmutt-doc:key>e</madmutt-doc:key></madmutt-doc:funcdef>
1682         </para>
1683         
1684         <para>
1685           This command (available in the ``index'' and ``pager'') allows you to
1686           edit the raw current message as it's present in the mail folder.
1687           After you have finished editing, the changed message will be
1688           appended to the current folder, and the original message will be
1689           marked for deletion.
1690         </para>
1691         
1692         <para>
1693           <madmutt-doc:funcdef name="edit-type"/>
1694           (default: <madmutt-doc:key mod="C">E</madmutt-doc:key> on the attachment menu, and in the pager and index
1695           menus; <madmutt-doc:key mod="C">T</madmutt-doc:key> on the compose menu)
1696         </para>
1697         
1698         <para>
1699           This command is used to temporarily edit an attachment's content
1700           type to fix, for instance, bogus character set parameters.  When
1701           invoked from the index or from the pager, you'll have the
1702           opportunity to edit the top-level attachment's content type.  On the
1703           <link linkend="attach-menu">attach-menu</link>, you can change any
1704           attachment's content type. These changes are not persistent, and get
1705           lost upon changing folders.
1706         </para>
1707         
1708         <para>
1709           Note that this command is also available on the <link linkend="compose-menu">compose-menu</link>
1710           .There, it's used to
1711           fine-tune the properties of attachments you are going to send.
1712         </para>
1713         
1714         <para>
1715           <madmutt-doc:funcdef name="enter-command"><madmutt-doc:key>:</madmutt-doc:key></madmutt-doc:funcdef>
1716         </para>
1717         
1718         <para>
1719           This command is used to execute any command you would normally put in
1720           a
1721           configuration file.  A common use is to check the settings of
1722           variables, or
1723           in conjunction with <madmutt-doc:cmdref name="macro"/> to change
1724           settings on the
1725           fly.
1726         </para>
1727         
1728         <para>
1729           <madmutt-doc:funcdef name="extract-keys"><madmutt-doc:key mod="C">K</madmutt-doc:key></madmutt-doc:funcdef>
1730         </para>
1731         
1732         <para>
1733           This command extracts PGP public keys from the current or tagged
1734           message(s) and adds them to your PGP public key ring.
1735         </para>
1736         
1737         <para>
1738           <madmutt-doc:funcdef name="forget-passphrase"><madmutt-doc:key mod="C">F</madmutt-doc:key></madmutt-doc:funcdef>
1739         </para>
1740         
1741         <para>
1742           This command wipes the passphrase(s) from memory. It is useful, if
1743           you misspelled the passphrase.
1744         </para>
1745         
1746         <para>
1747           <madmutt-doc:funcdef name="list-reply"><madmutt-doc:key>L</madmutt-doc:key></madmutt-doc:funcdef>
1748         </para>
1749         
1750         <para>
1751           Reply to the current or tagged message(s) by extracting any addresses
1752           which
1753           match the regular expressions given by the <madmutt-doc:cmdref name="lists"/>
1754           commands, but also honor any <literal>Mail-Followup-To</literal>
1755           header(s) if the
1756           <madmutt-doc:varref name="honor-followup-to"/>
1757           configuration variable is set.  Using this when replying to messages
1758           posted
1759           to mailing lists helps avoid duplicate copies being sent to the
1760           author of
1761           the message you are replying to.
1762         </para>
1763         
1764         <para>
1765           <madmutt-doc:funcdef name="pipe-message" default="|"/>
1766         </para>
1767         
1768         <para>
1769           Asks for an external Unix command and pipes the current or
1770           tagged message(s) to it. The variables
1771           <madmutt-doc:varref name="pipe-decode"/>,
1772           <madmutt-doc:varref name="pipe-split"/>,
1773           <madmutt-doc:varref name="pipe-decode"/> and
1774           <madmutt-doc:varref name="wait-key"/> 
1775           control the exact behavior of this function.
1776         </para>
1777         
1778         <para>
1779           <madmutt-doc:funcdef name="resend-message"><madmutt-doc:key mod="E">e</madmutt-doc:key></madmutt-doc:funcdef>
1780         </para>
1781         
1782         <para>
1783           With resend-message, mutt takes the current message as a template for
1784           a
1785           new message.  This function is best described as "recall from
1786           arbitrary
1787           folders".  It can conveniently be used to forward MIME messages while
1788           preserving the original mail structure. Note that the amount of
1789           headers
1790           included here depends on the value of the <madmutt-doc:varref name="weed"/>
1791           variable.
1792         </para>
1793         
1794         <para>
1795           This function is also available from the attachment menu. You can use
1796           this
1797           to easily resend a message which was included with a bounce message
1798           as a message/rfc822 body part.
1799         </para>
1800         
1801         <para>
1802           <madmutt-doc:funcdef name="shell-escape"><madmutt-doc:key>!</madmutt-doc:key></madmutt-doc:funcdef>
1803         </para>
1804         
1805         <para>
1806           Asks for an external Unix command and executes it.  The
1807           <madmutt-doc:varref name="wait-key"/>
1808           can be used to control
1809           whether Madmutt will wait for a key to be pressed when the command
1810           returns
1811           (presumably to let the user read the output of the command), based on
1812           the return status of the named command.
1813         </para>
1814         
1815         <para>
1816           <madmutt-doc:funcdef name="toggle-quoted"><madmutt-doc:key>T</madmutt-doc:key></madmutt-doc:funcdef>
1817         </para>
1818         
1819         <para>
1820           The <emphasis>pager</emphasis> uses the
1821           <madmutt-doc:varref name="quote-regexp"/>
1822           variable to detect quoted text when
1823           displaying the body of the message.  This function toggles the
1824           displayof the quoted material in the message.  It is particularly
1825           useful when
1826           are interested in just the response and there is a large amount of
1827           quoted text in the way.
1828         </para>
1829         
1830         <para>
1831           <madmutt-doc:funcdef name="skip-quoted"><madmutt-doc:key>S</madmutt-doc:key></madmutt-doc:funcdef>
1832         </para>
1833         
1834         <para>
1835           This function will go to the next line of non-quoted text which come
1836           after a line of quoted text in the internal pager.
1837         </para>
1838         
1839         <para>
1840           
1841         </para>
1842         
1843       </sect2>
1844       
1845     </sect1>
1846     <!--}}}-->
1847     
1848     <sect1 id="sending"> <!--{{{-->
1849       <title>Sending Mail</title>
1850       
1851       <para>
1852         The following bindings are available in the <emphasis>index</emphasis>
1853         for sending
1854         messages.
1855       </para>
1856       
1857       <para>
1858
1859         <table frame="none" rowsep="1" texstr="l|l|l">
1860           <title>Most commonly used Mail Composition Bindings</title>
1861           <tgroup cols="3" align="left" colsep="1" rowsep="1">
1862           <thead>
1863             <row>
1864               <entry>Key</entry>
1865               <entry>Function</entry>
1866               <entry>Description</entry>
1867             </row>
1868           </thead>
1869           <tbody>
1870             <row>
1871               <entry><madmutt-doc:key>m</madmutt-doc:key></entry>
1872               <entry><madmutt-doc:funcref name="compose"/></entry>
1873               <entry>compose a new message</entry>
1874             </row>
1875             <row>
1876               <entry><madmutt-doc:key>r</madmutt-doc:key></entry>
1877               <entry><madmutt-doc:funcref name="reply"/></entry>
1878               <entry>reply to sender</entry>
1879             </row>
1880             <row>
1881               <entry><madmutt-doc:key>g</madmutt-doc:key></entry>
1882               <entry><madmutt-doc:funcref name="group-reply"/></entry>
1883               <entry>reply to all recipients</entry>
1884             </row>
1885             <row>
1886               <entry><madmutt-doc:key>L</madmutt-doc:key></entry>
1887               <entry><madmutt-doc:funcref name="list-reply"/></entry>
1888               <entry>reply to mailing list address</entry>
1889             </row>
1890             <row>
1891               <entry><madmutt-doc:key>f</madmutt-doc:key></entry>
1892               <entry><madmutt-doc:funcref name="forward"/></entry>
1893               <entry>forward message</entry>
1894             </row>
1895             <row>
1896               <entry><madmutt-doc:key>b</madmutt-doc:key></entry>
1897               <entry><madmutt-doc:funcref name="bounce"/></entry>
1898               <entry>bounce (remail) message</entry>
1899             </row>
1900             <row>
1901               <entry><madmutt-doc:key mod="E">k</madmutt-doc:key></entry>
1902               <entry><madmutt-doc:funcref name="mail-key"/></entry>
1903               <entry>mail a PGP public key to someone</entry>
1904             </row>
1905           </tbody>
1906         </tgroup>
1907       </table>
1908
1909       </para>
1910       
1911       <para>
1912         Bouncing a message sends the message as is to the recipient you
1913         specify.  Forwarding a message allows you to add comments or
1914         modify the message you are forwarding.  These items are discussed
1915         in greater detail in the next chapter <link linkend="forwarding-mail">forwarding-mail</link>.
1916       </para>
1917       
1918       <sect2 id="sending-compose">
1919         <title>Composing new messages</title>
1920         
1921         <para>
1922           When you want to send an email using Madmutt, simply press <madmutt-doc:key>m</madmutt-doc:key> on
1923           your keyboard. Then, Madmutt asks for the recipient via a prompt in
1924           the last line:
1925         </para>
1926         
1927         <para>
1928           
1929           <madmutt-doc:lstmail>
1930 To:</madmutt-doc:lstmail>
1931           
1932         </para>
1933         
1934         <para>
1935           After you've finished entering the recipient(s), press return. If you
1936           want to send an email to more than one recipient, separate the email
1937           addresses using the comma "<literal>,</literal>". Madmutt then asks
1938           you for the email
1939           subject. Again, press return after you've entered it. After that,
1940           Madmutt
1941           got the most important information from you, and starts up an editor
1942           where you can then enter your email.
1943         </para>
1944         
1945         <para>
1946           The editor that is called is selected in the following way: you
1947           can e.g. set it in the Madmutt configuration:
1948         </para>
1949         
1950         <para>
1951           
1952           <madmutt-doc:lstconf>
1953 set editor = "vim +/^$/ -c ':set tw=72'"
1954 set editor = "nano"
1955 set editor = "emacs"</madmutt-doc:lstconf>
1956           
1957         </para>
1958         
1959         <para>
1960           If you don't set your preferred editor in your configuration, Madmutt
1961           first looks whether the environment variable <madmutt-doc:envvar name="VISUAL"/> is set, and if
1962           so, it takes its value as editor command. Otherwise, it has a look
1963           at <madmutt-doc:envvar name="EDITOR"/> and takes its value if it is set. If no
1964           editor command
1965           can be found, Madmutt simply assumes <madmutt-doc:man name="vi"/> to be the
1966           default editor,
1967           since it's the most widespread editor in the Unix world and it's
1968           pretty
1969           safe to assume that it is installed and available.
1970         </para>
1971         
1972         <para>
1973           When you've finished entering your message, save it and quit your 
1974           editor. Madmutt will then present you with a summary screen, the
1975           compose menu. 
1976           On the top, you see a summary of the most important available key
1977           commands.
1978           Below that, you see the sender, the recipient(s), Cc and/or Bcc 
1979           recipient(s), the subject, the reply-to address, and optionally
1980           information where the sent email will be stored and whether it should
1981           be digitally signed and/or encrypted.
1982         </para>
1983         
1984         <para>
1985           Below that, you see a list of "attachments". The mail you've just
1986           entered before is also an attachment, but due to its special type
1987           (it's plain text), it will be displayed as the normal message on
1988           the receiver's side.
1989         </para>
1990         
1991         <para>
1992           At this point, you can add more attachments, pressing <madmutt-doc:key>a</madmutt-doc:key>, you
1993           can edit the recipient addresses, pressing <madmutt-doc:key>t</madmutt-doc:key> for
1994           the "To:" field,
1995           <madmutt-doc:key>c</madmutt-doc:key> for the "Cc:" field, and <madmutt-doc:key>b</madmutt-doc:key>
1996           for the "Bcc: field. You can
1997           also edit the subject the subject by simply pressing <madmutt-doc:key>s</madmutt-doc:key> or the
1998           email message that you've entered before by pressing <madmutt-doc:key>e</madmutt-doc:key>. You will
1999           then again return to the editor. You can even edit the sender, by
2000           pressing
2001           <literal>&lt;esc&gt;f</literal>, but this shall only be used with
2002           caution.
2003         </para>
2004         
2005         <para>
2006           Alternatively, you can configure Madmutt in a way that most of the
2007           above settings can be edited using the editor. Therefore, you only
2008           need to add the following to your configuration:
2009         </para>
2010         
2011         <para>
2012           
2013           <madmutt-doc:lstconf>
2014 set edit_headers</madmutt-doc:lstconf>
2015           
2016         </para>
2017         
2018         <para>
2019           Once you have finished editing the body of your mail message, you are
2020           returned to the <emphasis>compose</emphasis> menu.  The following
2021           options are available:
2022         </para>
2023         
2024         <para>
2025
2026         <table frame="none" rowsep="1" texstr="l|l|l">
2027           <title>Most commonly used Compose Menu Bindings</title>
2028           <tgroup cols="3" align="left" colsep="1" rowsep="1">
2029           <thead>
2030             <row>
2031               <entry>Key</entry>
2032               <entry>Function</entry>
2033               <entry>Description</entry>
2034             </row>
2035           </thead>
2036           <tbody>
2037             <row>
2038               <entry><madmutt-doc:key>a</madmutt-doc:key></entry>
2039               <entry><madmutt-doc:funcref name="attach-file"/></entry>
2040               <entry>attach a file</entry>
2041             </row>
2042             <row>
2043               <entry><madmutt-doc:key>A</madmutt-doc:key></entry>
2044               <entry><madmutt-doc:funcref name="attach-message"/></entry>
2045               <entry>attach message(s) to the message</entry>
2046             </row>
2047             <row>
2048               <entry><madmutt-doc:key mod="E">k</madmutt-doc:key></entry>
2049               <entry><madmutt-doc:funcref name="attach-key"/></entry>
2050               <entry>attach a PGP public key</entry>
2051             </row>
2052             <row>
2053               <entry><madmutt-doc:key>d</madmutt-doc:key></entry>
2054               <entry><madmutt-doc:funcref name="edit-description"/></entry>
2055               <entry>edit description on attachment</entry>
2056             </row>
2057             <row>
2058               <entry><madmutt-doc:key>D</madmutt-doc:key></entry>
2059               <entry><madmutt-doc:funcref name="detach-file"/></entry>
2060               <entry>detach a file</entry>
2061             </row>
2062             <row>
2063               <entry><madmutt-doc:key>t</madmutt-doc:key></entry>
2064               <entry><madmutt-doc:funcref name="edit-to"/></entry>
2065               <entry>edit the To field</entry>
2066             </row>
2067             <row>
2068               <entry><madmutt-doc:key mod="E">f</madmutt-doc:key></entry>
2069               <entry><madmutt-doc:funcref name="edit-from"/></entry>
2070               <entry>edit the From field</entry>
2071             </row>
2072             <row>
2073               <entry><madmutt-doc:key>r</madmutt-doc:key></entry>
2074               <entry><madmutt-doc:funcref name="edit-reply-to"/></entry>
2075               <entry>edit the Reply-To field</entry>
2076             </row>
2077             <row>
2078               <entry><madmutt-doc:key>c</madmutt-doc:key></entry>
2079               <entry><madmutt-doc:funcref name="edit-cc"/></entry>
2080               <entry>edit the Cc field</entry>
2081             </row>
2082             <row>
2083               <entry><madmutt-doc:key>b</madmutt-doc:key></entry>
2084               <entry><madmutt-doc:funcref name="edit-bcc"/></entry>
2085               <entry>edit the Bcc field</entry>
2086             </row>
2087             <row>
2088               <entry><madmutt-doc:key>y</madmutt-doc:key></entry>
2089               <entry><madmutt-doc:funcref name="send-message"/></entry>
2090               <entry>send the message</entry>
2091             </row>
2092             <row>
2093               <entry><madmutt-doc:key>s</madmutt-doc:key></entry>
2094               <entry><madmutt-doc:funcref name="edit-subject"/></entry>
2095               <entry>edit the Subject</entry>
2096             </row>
2097             <row>
2098               <entry><madmutt-doc:key>S</madmutt-doc:key></entry>
2099               <entry><madmutt-doc:funcref name="smime-menu"/></entry>
2100               <entry>select S/MIME options</entry>
2101             </row>
2102             <row>
2103               <entry><madmutt-doc:key>f</madmutt-doc:key></entry>
2104               <entry><madmutt-doc:funcref name="edit-fcc"/></entry>
2105               <entry>specify an ``Fcc'' mailbox</entry>
2106             </row>
2107             <row>
2108               <entry><madmutt-doc:key>p</madmutt-doc:key></entry>
2109               <entry><madmutt-doc:funcref name="pgp-menu"/></entry>
2110               <entry>select PGP options</entry>
2111             </row>
2112             <row>
2113               <entry><madmutt-doc:key>P</madmutt-doc:key></entry>
2114               <entry><madmutt-doc:funcref name="postpone-message"/></entry>
2115               <entry>postpone this message until later</entry>
2116             </row>
2117             <row>
2118               <entry><madmutt-doc:key>q</madmutt-doc:key></entry>
2119               <entry><madmutt-doc:funcref name="quit"/></entry>
2120               <entry>quit (abort) sending the message</entry>
2121             </row>
2122             <row>
2123               <entry><madmutt-doc:key>w</madmutt-doc:key></entry>
2124               <entry><madmutt-doc:funcref name="write-fcc"/></entry>
2125               <entry>write the message to a folder</entry>
2126             </row>
2127             <row>
2128               <entry><madmutt-doc:key>i</madmutt-doc:key></entry>
2129               <entry><madmutt-doc:funcref name="ispell"/></entry>
2130               <entry>check spelling (if available on your system)</entry>
2131             </row>
2132             <row>
2133               <entry><madmutt-doc:key mod="C">F</madmutt-doc:key></entry>
2134               <entry><madmutt-doc:funcref name="forget-passphrase"/></entry>
2135               <entry>wipe passphrase(s) from memory</entry>
2136             </row>
2137           </tbody>
2138         </tgroup>
2139       </table>
2140
2141         </para>
2142         
2143         <para>
2144           <emphasis role="bold">Note:</emphasis> The attach-message function
2145           will prompt you for a folder to
2146           attach messages from. You can now tag messages in that folder and
2147           theywill be attached to the message you are sending. Note that
2148           certainoperations like composing a new mail, replying, forwarding,
2149           etc. are
2150           not permitted when you are in that folder. The <literal>%r</literal>
2151           in <madmutt-doc:varref name="status-format"/>
2152           will change to
2153           a 'A' to indicate that you are in attach-message mode.
2154         </para>
2155         
2156         <para>
2157           
2158         </para>
2159         
2160       </sect2>
2161       
2162       <sect2 id="sending-reply">
2163         <title>Replying</title>
2164         
2165         <sect3 id="sending-simple-reply">
2166           <title>Simple Replies</title>
2167           
2168           <para>
2169             When you want to reply to an email message, select it in the index
2170             menu and then press <madmutt-doc:key>r</madmutt-doc:key>. Madmutt's behaviour is
2171             then similar to the 
2172             behaviour when you compose a message: first, you will be asked for
2173             the recipient, then for the subject, and then, Madmutt will start
2174             the editor with the quote attribution and the quoted message. This
2175             can e.g. look like the example below.
2176           </para>
2177           
2178           <para>
2179             
2180             <madmutt-doc:lstmail>
2181 On Mon, Mar 07, 2005 at 05:02:12PM +0100, Michael Svensson wrote:
2182 &gt; Bill, can you please send last month's progress report to Mr. 
2183 &gt; Morgan? We also urgently need the cost estimation for the new 
2184 &gt; production server that we want to set up before our customer's 
2185 &gt; project will go live.</madmutt-doc:lstmail>
2186             
2187           </para>
2188           
2189           <para>
2190             You can start editing the email message. It is strongly
2191             recommended to put your answer <emphasis>below</emphasis> the
2192             quoted text and to
2193             only quote what is really necessary and that you refer to. Putting
2194             your answer on top of the quoted message, is, although very
2195             widespread, very often not considered to be a polite way to answer
2196             emails.
2197           </para>
2198           
2199           <para>
2200             The quote attribution is configurable, by default it is set to
2201             
2202             <madmutt-doc:lstconf>
2203 set attribution = "On %d, %n wrote:"</madmutt-doc:lstconf>
2204             
2205           </para>
2206           
2207           <para>
2208             It can also be set to something more compact, e.g.
2209             
2210             <madmutt-doc:lstconf>
2211 set attribution = "attribution="* %n &lt;%a&gt; [%(%y-%m-%d %H:%M)]:"</madmutt-doc:lstconf>
2212             
2213           </para>
2214           
2215           <para>
2216             The example above results in the following attribution:
2217             
2218             <madmutt-doc:lstmail>
2219 * Michael Svensson &lt;svensson@foobar.com&gt; [05-03-06 17:02]:
2220 &gt; Bill, can you please send last month's progress report to Mr. 
2221 &gt; Morgan? We also urgently need the cost estimation for the new 
2222 &gt; production server that we want to set up before our customer's 
2223 &gt; project will go live.</madmutt-doc:lstmail>
2224             
2225           </para>
2226           
2227           <para>
2228             Generally, try to keep your attribution short yet
2229             information-rich. It is <emphasis>not</emphasis> the right place
2230             for witty quotes,
2231             long "attribution" novels or anything like that: the right place
2232             for such things is - if at all - the email signature at the very
2233             bottom of the message.
2234           </para>
2235           
2236           <para>
2237             When you're done with writing your message, save and quit the
2238             editor. As before, you will return to the compose menu, which is
2239             used in the same way as before.
2240           </para>
2241           
2242           <para>
2243             
2244           </para>
2245           
2246         </sect3>
2247         
2248         <sect3 id="sending-group-reply">
2249           <title>Group Replies</title>
2250           
2251           <para>
2252             In the situation where a group of people uses email as a
2253             discussion, most of the emails will have one or more recipients,
2254             and probably several "Cc:" recipients. The group reply
2255             functionalityensures that when you press <madmutt-doc:key>g</madmutt-doc:key>
2256             instead of <madmutt-doc:key>r</madmutt-doc:key> to do a reply,
2257             each and every recipient that is contained in the original message
2258             will receive a copy of the message, either as normal recipient or
2259             as "Cc:" recipient.
2260           </para>
2261           
2262           <para>
2263             
2264           </para>
2265           
2266         </sect3>
2267         
2268         <sect3 id="sending-list-reply">
2269           <title>List Replies</title>
2270           
2271           <para>
2272             When you use mailing lists, it's generally better to send your
2273             reply to a message only to the list instead of the list and the
2274             original author. To make this easy to use, Madmutt features list
2275             replies.
2276           </para>
2277           
2278           <para>
2279             To do a list reply, simply press <madmutt-doc:key>L</madmutt-doc:key>. If the email
2280             contains
2281             a <literal>Mail-Followup-To:</literal> header, its value will be
2282             used as reply
2283             address. Otherwise, Madmutt searches through all mail addresses in
2284             the original message and tries to match them a list of regular
2285             expressions which can be specified using the <literal>lists</literal> command. 
2286             If any of the regular expression matches, a mailing
2287             list address has been found, and it will be used as reply address.
2288           </para>
2289           
2290           <para>
2291             
2292             <madmutt-doc:lstconf>
2293 lists linuxevent@luga\.at vuln-dev@ Madmutt-users@</madmutt-doc:lstconf>
2294             
2295           </para>
2296           
2297           <para>
2298             Nowadays, most mailing list software like GNU Mailman adds a
2299             <literal>Mail-Followup-To:</literal> header to their emails anyway,
2300             so setting
2301             <literal>lists</literal> is hardly ever necessary in practice.
2302           </para>
2303           
2304           <para>
2305             
2306           </para>
2307           
2308           <para>
2309             
2310           </para>
2311           
2312         </sect3>
2313         
2314       </sect2>
2315       
2316       <sect2 id="sending-edit-header">
2317         <title>Editing the message header</title>
2318         
2319         <para>
2320           When editing the header of your outgoing message, there are a couple
2321           of
2322           special features available.
2323         </para>
2324         
2325         <para>
2326           If you specify
2327           
2328           <literal>Fcc:</literal> <emphasis>filename</emphasis>
2329           
2330           Madmutt will pick up <emphasis>filename</emphasis>
2331           just as if you had used the <emphasis>edit-fcc</emphasis> function in
2332           the <emphasis>compose</emphasis> menu.
2333         </para>
2334         
2335         <para>
2336           You can also attach files to your message by specifying
2337
2338           <madmutt-doc:lstmail>
2339 Attach: filename [description]</madmutt-doc:lstmail>
2340
2341           where <emphasis>filename</emphasis> is the file to attach and <emphasis>
2342             description
2343           </emphasis>
2344           is an
2345           optional string to use as the description of the attached file.
2346         </para>
2347         
2348         <para>
2349           When replying to messages, if you remove the <emphasis>In-Reply-To:</emphasis> field from
2350           the header field, Madmutt will not generate a <emphasis>References:</emphasis> field, which
2351           allows you to create a new message thread.
2352         </para>
2353         
2354         <para>
2355           Also see the <madmutt-doc:varref name="edit-headers"/> and
2356           <madmutt-doc:varref name="editor-headers"/> variables
2357         </para>
2358         
2359         <para>
2360           
2361         </para>
2362         
2363       </sect2>
2364       
2365       <sect2 id="sending-crypto">
2366         <title>Using Madmutt with PGP</title>
2367         
2368         <para>
2369           If you want to use PGP, you can specify 
2370         
2371           <madmutt-doc:lstmail>
2372 Pgp: [E | S | S id]</madmutt-doc:lstmail>
2373
2374           ``E'' encrypts, ``S'' signs and
2375           ``S&lt;id&gt;'' signs with the given key, setting
2376           <madmutt-doc:varref name="pgp-sign-as"/>
2377           permanently.
2378         </para>
2379         
2380         <para>
2381           If you have told mutt to PGP encrypt a message, it will guide you
2382           through a key selection process when you try to send the message.
2383           Madmutt will not ask you any questions about keys which have a
2384           certified user ID matching one of the message recipients' mail
2385           addresses.  However, there may be situations in which there are
2386           several keys, weakly certified user ID fields, or where no matching
2387           keys can be found.
2388         </para>
2389         
2390         <para>
2391           In these cases, you are dropped into a menu with a list of keys from
2392           which you can select one.  When you quit this menu, or mutt can't
2393           find any matching keys, you are prompted for a user ID.  You can, as
2394           usually, abort this prompt using <madmutt-doc:key mod="C">G</madmutt-doc:key>.  When
2395           you do so, mutt will
2396           return to the compose screen.
2397         </para>
2398         
2399         <para>
2400           Once you have successfully finished the key selection, the message
2401           will be encrypted using the selected public keys, and sent out.
2402         </para>
2403         
2404         <para>
2405           Most fields of the entries in the key selection menu (see also 
2406           <madmutt-doc:varref name="pgp-entry-format"/>)
2407           have obvious meanings.  But some explanations on the capabilities,
2408           flags, 
2409           and validity fields are in order.
2410         </para>
2411         
2412         <para>
2413           The flags sequence (%f) will expand to one of the following
2414           flags:
2415
2416
2417         <table frame="none" rowsep="1" texstr="l|l">
2418           <title>PGP Key Menu Flags</title>
2419           <tgroup cols="2" align="left" colsep="1" rowsep="1">
2420           <thead>
2421             <row>
2422               <entry>Flag</entry>
2423               <entry>Description</entry>
2424             </row>
2425           </thead>
2426           <tbody>
2427             <row>
2428               <entry><literal>R</literal></entry>
2429               <entry>The key has been revoked and can't be used.</entry>
2430             </row>
2431             <row>
2432               <entry><literal>X</literal></entry>
2433               <entry>The key is expired and can't be used.</entry>
2434             </row>
2435             <row>
2436               <entry><literal>d</literal></entry>
2437               <entry>You have marked the key as disabled.</entry>
2438             </row>
2439             <row>
2440               <entry><literal>c</literal></entry>
2441               <entry>There are unknown critical self-signature packets.</entry>
2442             </row>
2443           </tbody>
2444         </tgroup>
2445       </table>
2446
2447         </para>
2448         
2449         <para>
2450           The capabilities field (%c) expands to a two-character
2451           sequencerepresenting a key's capabilities.  The first character gives
2452           the key's encryption capabilities: A minus sign (<emphasis role="bold">
2453             -
2454           </emphasis>
2455           )means 
2456           that the key cannot be used for encryption.  A dot (<emphasis role="bold">
2457             .
2458           </emphasis>
2459           )means that
2460           it's marked as a signature key in one of the user IDs, but may 
2461           also be used for encryption.  The letter <emphasis role="bold">e</emphasis> indicates that 
2462           this key can be used for encryption.
2463         </para>
2464         
2465         <para>
2466           The second character indicates the key's signing capabilities.  Once 
2467           again, a ``<emphasis role="bold">-</emphasis>'' implies ``not for
2468           signing'', ``<emphasis role="bold">.</emphasis>'' implies
2469           that the key is marked as an encryption key in one of the user-ids,
2470           and
2471           ``<emphasis role="bold">s</emphasis>'' denotes a key which can be
2472           used for signing.
2473         </para>
2474         
2475         <para>
2476           Finally, the validity field (%t) indicates how well-certified
2477           a user-id
2478           is.  A question mark (<emphasis role="bold">?</emphasis>) indicates
2479           undefined validity, a minus 
2480           character (<emphasis role="bold">-</emphasis>) marks an untrusted
2481           association, a space character 
2482           means a partially trusted association, and a plus character (<emphasis role="bold">
2483             +
2484           </emphasis>
2485           )
2486           indicates complete validity.
2487         </para>
2488         
2489         <para>
2490           
2491         </para>
2492         
2493       </sect2>
2494       
2495       <sect2 id="sending-mixmaster">
2496         <title>Sending anonymous messages via mixmaster</title>
2497         
2498         <para>
2499           You may also have configured mutt to co-operate with Mixmaster, an
2500           anonymous remailer.  Mixmaster permits you to send your messages
2501           anonymously using a chain of remailers. Mixmaster support in mutt is
2502           for 
2503           mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03. 
2504           It does not support earlier versions or the later so-called version 3
2505           betas, 
2506           of which the latest appears to be called 2.9b23.
2507         </para>
2508         
2509         <para>
2510           To use it, you'll have to obey certain restrictions.  Most
2511           important, you cannot use the <literal>Cc</literal> and <literal>Bcc</literal> headers.  To tell
2512           Madmutt to use mixmaster, you have to select a remailer chain, using
2513           the mix function on the compose menu.  
2514         </para>
2515         
2516         <para>
2517           The chain selection screen is divided into two parts.  In the
2518           (larger) upper part, you get a list of remailers you may use.  In
2519           the lower part, you see the currently selected chain of remailers.
2520         </para>
2521         
2522         <para>
2523           You can navigate in the chain using the <literal>chain-prev</literal>
2524           and
2525           <literal>chain-next</literal> functions, which are by default bound
2526           to the left
2527           and right arrows and to the <madmutt-doc:key>h</madmutt-doc:key> and <madmutt-doc:key>l</madmutt-doc:key> keys (think vi
2528           keyboard bindings).  To insert a remailer at the current chain
2529           position, use the <literal>insert</literal> function.  To append a
2530           remailer behind
2531           the current chain position, use <literal>select-entry</literal> or <literal>
2532             append
2533           </literal>
2534           .
2535           You can also delete entries from the chain, using the corresponding
2536           function.  Finally, to abandon your changes, leave the menu, or
2537           <literal>accept</literal> them pressing (by default) the <literal>
2538             Return
2539           </literal>
2540           key.
2541         </para>
2542         
2543         <para>
2544           Note that different remailers do have different capabilities,
2545           indicated in the <literal>%c</literal> entry of the remailer menu lines (see
2546           <madmutt-doc:varref name="mix-entry-format"/>).
2547           Most important is
2548           the ``middleman'' capability, indicated by a capital ``M'': This
2549           means that the remailer in question cannot be used as the final
2550           element of a chain, but will only forward messages to other
2551           mixmaster remailers.  For details on the other capabilities, please
2552           have a look at the mixmaster documentation.
2553         </para>
2554         
2555         <para>
2556           
2557         </para>
2558         
2559         <para>
2560           
2561         </para>
2562         
2563       </sect2>
2564       
2565     </sect1>
2566     
2567     <sect1 id="forwarding-mail">
2568       <title>Forwarding and Bouncing Mail</title>
2569       
2570       <para>
2571         Often, it is necessary to forward mails to other people.
2572         Therefore, Madmutt supports forwarding messages in two different
2573         ways.
2574       </para>
2575       
2576       <para>
2577         The first one is regular forwarding, as you probably know it from
2578         other mail clients. You simply press <madmutt-doc:key>f</madmutt-doc:key>, enter the
2579         recipient
2580         email address, the subject of the forwarded email, and then you can
2581         edit the message to be forwarded in the editor. The forwarded
2582         message is separated from the rest of the message via the two
2583         following markers:
2584       </para>
2585       
2586       <para>
2587         
2588         <madmutt-doc:lstmail>
2589 ----- Forwarded message from Lucas User &lt;luser@example.com&gt; -----
2590
2591 From: Lucas User &lt;luser@example.com&gt;
2592 Date: Thu, 02 Dec 2004 03:08:34 +0100
2593 To: Michael Random &lt;mrandom@example.com&gt;
2594 Subject: Re: blackmail
2595
2596 Pay me EUR 50,000.- cash or your favorite stuffed animal will die
2597 a horrible death.
2598
2599 ----- End forwarded message -----</madmutt-doc:lstmail>
2600         
2601       </para>
2602       
2603       <para>
2604         When you're done with editing the mail, save and quit the editor,
2605         and you will return to the compose menu, the same menu you also
2606         encounter when composing or replying to mails.
2607       </para>
2608       
2609       <para>
2610         The second mode of forwarding emails with Madmutt is the
2611         so-called <emphasis>bouncing</emphasis>: when you bounce an email to
2612         another
2613         address, it will be sent in practically the same format you send it
2614         (except for headers that are created during transporting the
2615         message). To bounce a message, press <madmutt-doc:key>b</madmutt-doc:key> and enter the
2616         recipient
2617         email address. By default, you are then asked whether you really
2618         want to bounce the message to the specified recipient. If you answer
2619         with yes, the message will then be bounced.
2620       </para>
2621       
2622       <para>
2623         To the recipient, the bounced email will look as if he got it
2624         like a regular email where he was <literal>Bcc:</literal> recipient.
2625         The only
2626         possibility to find out whether it was a bounced email is to
2627         carefully study the email headers and to find out which host really
2628         sent the email.
2629       </para>
2630       
2631       <para>
2632         
2633       </para>
2634       
2635     </sect1>
2636     
2637     <sect1 id="postponing-mail">
2638       <title>Postponing Mail</title>
2639       
2640       <para>
2641         At times it is desirable to delay sending a message that you have
2642         already begun to compose.  When the <emphasis>postpone-message</emphasis> function is
2643         used in the <emphasis>compose</emphasis> menu, the body of your message
2644         and attachments
2645         are stored in the mailbox specified by the
2646         <madmutt-doc:varref name="postponed"/> variable.  This means that you can recall the
2647         message even if you exit Madmutt and then restart it at a later time.
2648       </para>
2649       
2650       <para>
2651         Once a message is postponed, there are several ways to resume it.  From
2652         the
2653         command line you can use the ``-p'' option, or if you <emphasis>compose</emphasis> a new
2654         message from the <emphasis>index</emphasis> or <emphasis>pager</emphasis> you will be prompted if postponed
2655         messages exist.  If multiple messages are currently postponed, the
2656         <emphasis>postponed</emphasis> menu will pop up and you can select
2657         which message you would
2658         like to resume.
2659       </para>
2660       
2661       <para>
2662         <emphasis role="bold">Note:</emphasis> If you postpone a reply to a
2663         message, the reply setting of
2664         the message is only updated when you actually finish the message and
2665         send it.  Also, you must be in the same folder with the message you
2666         replied to for the status of the message to be updated.
2667       </para>
2668       
2669       <para>
2670         See also the <madmutt-doc:varref name="postpone"/> quad-option.
2671       </para>
2672       
2673       <para>
2674         
2675       </para>
2676       
2677       <para>
2678         
2679       </para>
2680       
2681     </sect1>
2682
2683     <!--}}}-->
2684     
2685 </chapter>
2686 <!--}}}-->
2687   
2688 <chapter id="configuration"> <!--{{{-->
2689     <title>Configuration</title>
2690     
2691     <sect1 id="configuration-files">
2692       <title>Locations of Configuration Files</title>
2693       
2694       <para>
2695         While the default configuration (or ``preferences'') make Madmutt
2696         usable right out
2697         of the box, it is often desirable to tailor Madmutt to suit your own
2698         tastes. When
2699         Madmutt is first invoked, it will attempt to read the ``system''
2700         configuration
2701         file (defaults set by your local system administrator), unless the
2702         ``-n'' <link linkend="commandline">commandline</link> option is
2703         specified.  This file is
2704         typically <literal>/usr/local/share/madmutt/madmuttrc</literal> or <literal>
2705           /etc/madmuttrc
2706         </literal>
2707         ,
2708         Madmutt users will find this file in <literal>
2709           /usr/local/share/madmutt/Muttrc
2710         </literal>
2711         or
2712         <literal>/etc/madmuttrc</literal>. Mutt will next look for a file named <literal>
2713           .muttrc
2714         </literal>
2715         in your home directory, Madmutt will look for <literal>.madmuttrc</literal>.  If this file
2716         does not exist and your home directory has a subdirectory named <literal>
2717           .mutt
2718         </literal>
2719         ,
2720         mutt try to load a file named <literal>.madmutt/madmuttrc</literal>. 
2721       </para>
2722       
2723       <para>
2724         <literal>.muttrc</literal> (or <literal>.madmuttrc</literal> for
2725         Madmutt) is the file where you will
2726         usually place your <link linkend="commands">commands</link> to
2727         configure Madmutt.
2728       </para>
2729       
2730       <para>
2731         
2732       </para>
2733       
2734     </sect1>
2735     
2736     <sect1 id="configuration-syntax">
2737       <title>Basic Syntax of Initialization Files</title>
2738       
2739       <para>
2740         An initialization file consists of a series of <link linkend="commands">commands</link>. Each line of the file may contain one or more commands.
2741         When multiple commands are used, they must be separated by a semicolon
2742         (;).
2743         
2744         <madmutt-doc:lstconf>
2745 set realname='Madmutt user' ; ignore x-</madmutt-doc:lstconf>
2746         
2747         The hash mark, or pound sign
2748         (``#''), is used as a ``comment'' character. You can use it to
2749         annotate your initialization file. All text after the comment character
2750         to the end of the line is ignored. For example,
2751       </para>
2752       
2753       <para>
2754         
2755         <madmutt-doc:lstconf>
2756 my_hdr X-Disclaimer: Why are you listening to me? # This is a comment</madmutt-doc:lstconf>
2757         
2758       </para>
2759       
2760       <para>
2761         Single quotes (') and double quotes (&quot;) can be used to quote
2762         strings
2763         which contain spaces or other special characters.  The difference
2764         between
2765         the two types of quotes is similar to that of many popular shell
2766         programs,
2767         namely that a single quote is used to specify a literal string (one
2768         that is
2769         not interpreted for shell variables or quoting with a backslash
2770         (see
2771         next paragraph), while double quotes indicate a string for which
2772         should be evaluated.  For example, backtics are evaluated inside of
2773         double
2774         quotes, but <emphasis role="bold">not</emphasis> for single quotes.
2775       </para>
2776       
2777       <para>
2778         \ quotes the next character, just as in shells such as bash and
2779         zsh.
2780         For example, if want to put quotes ``&quot;'' inside of a string, you
2781         can use
2782         ``\'' to force the next character to be a literal instead of
2783         interpreted
2784         character.
2785         
2786         <madmutt-doc:lstconf>
2787 set realname="Michael \"MuttDude\" Elkins"</madmutt-doc:lstconf>
2788         
2789       </para>
2790       
2791       <para>
2792         ``\\'' means to insert a literal ``\'' into the line.
2793         ``\n'' and ``\r'' have their usual C meanings of linefeed and
2794         carriage-return, respectively.
2795       </para>
2796       
2797       <para>
2798         A \ at the end of a line can be used to split commands over
2799         multiple lines, provided that the split points don't appear in the
2800         middle of command names.
2801       </para>
2802       
2803       <para>
2804         Please note that, unlike the various shells, Madmutt interprets a
2805         ``\''
2806         at the end of a line also in comments. This allows you to disable a
2807         command
2808         split over multiple lines with only one ``#''.
2809       </para>
2810       
2811       <para>
2812         
2813         <madmutt-doc:lstconf>
2814 # folder-hook . \
2815 set realname="Michael \"MuttDude\" Elkins"</madmutt-doc:lstconf>
2816         
2817       </para>
2818       
2819       <para>
2820         When testing your config files, beware the following caveat. The
2821         backslash
2822         at the end of the commented line extends the current line with the next
2823         line
2824         - then referred to as a ``continuation line''.  As the first line is
2825         commented with a hash (#) all following continuation lines are also
2826         part of a comment and therefore are ignored, too. So take care of
2827         comments
2828         when continuation lines are involved within your setup files!
2829       </para>
2830       
2831       <para>
2832         Abstract example:
2833       </para>
2834       
2835       <para>
2836         
2837         <madmutt-doc:lstconf>
2838 line1\
2839 line2a # line2b\
2840 line3\
2841 line4
2842 line5</madmutt-doc:lstconf>
2843         
2844       </para>
2845       
2846       <para>
2847         line1 ``continues'' until line4. however, the part after the # is a
2848         comment which includes line3 and line4. line5 is a new line of its own
2849         and
2850         thus is interpreted again.
2851       </para>
2852       
2853       <para>
2854         The commands understood by mutt are explained in the next paragraphs.
2855         For a complete list, see the <link linkend="commands">commands</link>.
2856       </para>
2857       
2858       <para>
2859         
2860       </para>
2861       
2862     </sect1>
2863     
2864     <sect1 id="configuration-expansion">
2865       <title>Expansion within variables</title>
2866       
2867       <para>
2868         Besides just assign static content to variables, there's plenty of
2869         ways of adding external and more or less dynamic content.
2870       </para>
2871       
2872       <sect2 id="configuration-expansion-commands">
2873         <title>Commands' Output</title>
2874         
2875         <para>
2876           It is possible to substitute the output of a Unix command in an
2877           initialization file.  This is accomplished by enclosing the command
2878           in backquotes (``) as in, for example:
2879         </para>
2880         
2881         <para>
2882           
2883           <madmutt-doc:lstconf>
2884 my_hdr X-Operating-System: `uname -a`</madmutt-doc:lstconf>
2885           
2886         </para>
2887         
2888         <para>
2889           The output of the Unix command ``uname -a'' will be substituted
2890           before the line is parsed. Note that since initialization files are
2891           line oriented, only the first line of output from the Unix command
2892           will be substituted.
2893         </para>
2894         
2895       </sect2>
2896       
2897       <sect2 id="configuration-expansion-environment">
2898         <title>Environment Variables</title>
2899         
2900         <para>
2901           UNIX environments can be accessed like the way it is done in
2902           shells like sh and bash: Prepend the name of the environment by a
2903           ``$'' sign. For example,
2904         </para>
2905         
2906         <para>
2907           
2908           <madmutt-doc:lstconf>
2909 set record=+sent_on_$HOSTNAME</madmutt-doc:lstconf>
2910           
2911         </para>
2912         
2913         <para>
2914           sets the <madmutt-doc:varref name="record"/> variable to the
2915           string <emphasis>+sent_on_</emphasis> and appends the
2916           value of the evironment
2917           variable <madmutt-doc:envvar name="HOSTNAME"/>.
2918         </para>
2919         
2920         <para>
2921           <emphasis role="bold">Note:</emphasis> There will be no warning if an
2922           environment variable
2923           is not defined. The result will of the expansion will then be empty.
2924         </para>
2925         
2926       </sect2>
2927       
2928       <sect2 id="configuration-expansion-config">
2929         <title>Configuration Variables</title>
2930         
2931         <para>
2932           As for environment variables, the values of all configuration
2933           variables as string can be used in the same way, too. For example,
2934         </para>
2935         
2936         <para>
2937           
2938           <madmutt-doc:lstconf>
2939 set imap_home_namespace = $folder</madmutt-doc:lstconf>
2940           
2941         </para>
2942         
2943         <para>
2944           would set the value of <madmutt-doc:varref name="imap-home-namespace"/>
2945           to the value to which <madmutt-doc:varref name="folder"/>
2946           is <emphasis>currently</emphasis> set to.
2947         </para>
2948         
2949         <para>
2950           <emphasis role="bold">Note:</emphasis> There're no logical links
2951           established in such cases so
2952           that the the value for <madmutt-doc:varref name="imap-home-namespace"/>
2953           won't change even
2954           if <madmutt-doc:varref name="folder"/> gets changed.
2955         </para>
2956         
2957         <para>
2958           <emphasis role="bold">Note:</emphasis> There will be no warning if a
2959           configuration variable
2960           is not defined or is empty. The result will of the expansion will
2961           then be empty.
2962         </para>
2963         
2964       </sect2>
2965       
2966       <sect2 id="configuration-expansion-self">
2967         <title>Self-Defined Variables</title>
2968         
2969         <para>
2970           Madmutt flexibly allows users to define their own variables. To
2971           avoid conflicts with the standard set and to prevent misleading
2972           error messages, there's a reserved namespace for them: all
2973           user-defined variables must be prefixed with <literal>user_</literal> and can be
2974           used just like any ordinary configuration or environment
2975           variable.
2976         </para>
2977         
2978         <para>
2979           For example, to view the manual, users can either define two
2980           macros like the following
2981         </para>
2982         
2983         <para>
2984           
2985           <madmutt-doc:lstconf>
2986 macro generic &lt;F1&gt; "!less -r /path/to/manual" "Show manual"
2987 macro pager &lt;F1&gt; "!less -r /path/to/manual" "Show manual"</madmutt-doc:lstconf>
2988           
2989         </para>
2990         
2991         <para>
2992           for <literal>generic</literal>, <literal>pager</literal> and <literal>
2993             index
2994           </literal>
2995           .The alternative is to
2996           define a custom variable like so:
2997         </para>
2998         
2999         <para>
3000           
3001           <madmutt-doc:lstconf>
3002 set user_manualcmd = "!less -r /path/to_manual" 
3003 macro generic &lt;F1&gt; "$user_manualcmd&lt;enter&gt;" "Show manual"
3004 macro pager &lt;F1&gt; "$user_manualcmd&lt;enter&gt;" "Show manual"
3005 macro index &lt;F1&gt; "$user_manualcmd&lt;enter&gt;" "Show manual"</madmutt-doc:lstconf>
3006           
3007         </para>
3008         
3009         <para>
3010           to re-use the command sequence as in:
3011         </para>
3012         
3013         <para>
3014           
3015           <madmutt-doc:lstconf>
3016 macro index &lt;F2&gt; "$user_manualcmd | grep '\^[ ]\\+~. '" "Show Patterns"</madmutt-doc:lstconf>
3017           
3018         </para>
3019         
3020         <para>
3021           Using this feature, arbitrary sequences can be defined once and
3022           recalled and reused where necessary. More advanced scenarios could
3023           include to save a variable's value at the beginning of macro
3024           sequence and restore it at end.
3025         </para>
3026         
3027         <para>
3028           When the variable is first defined, the first value it gets
3029           assigned is also the initial value to which it can be reset using
3030           the <literal>reset</literal> command.
3031         </para>
3032         
3033         <para>
3034           The complete removal is done via the <literal>unset</literal>
3035           keyword.
3036         </para>
3037         
3038         <para>
3039           After the following sequence:
3040         </para>
3041         
3042         <para>
3043           
3044           <madmutt-doc:lstconf>
3045 set user_foo = 42
3046 set user_foo = 666</madmutt-doc:lstconf>
3047           
3048         </para>
3049         
3050         <para>
3051           the variable <literal>$user_foo</literal> has a current value
3052           of 666 and an
3053           initial of 42. The query
3054         </para>
3055         
3056         <para>
3057           
3058           <madmutt-doc:lstconf>
3059 set ?user_foo</madmutt-doc:lstconf>
3060           
3061         </para>
3062         
3063         <para>
3064           will show 666. After doing the reset via
3065         </para>
3066         
3067         <para>
3068           
3069           <madmutt-doc:lstconf>
3070 reset user_foo</madmutt-doc:lstconf>
3071           
3072         </para>
3073         
3074         <para>
3075           a following query will give 42 as the result. After unsetting it
3076           via
3077         </para>
3078         
3079         <para>
3080           
3081           <madmutt-doc:lstconf>
3082 unset user_foo</madmutt-doc:lstconf>
3083           
3084         </para>
3085         
3086         <para>
3087           any query or operation (except the noted expansion within other
3088           statements) will lead to an error message.
3089         </para>
3090         
3091       </sect2>
3092       
3093       <sect2 id="configuration-expansion-predef">
3094         <title>Pre-Defined Variables</title>
3095         
3096         <para>
3097           In order to allow users to share one setup over a number of
3098           different machines without having to change its contents, there's a
3099           number of pre-defined variables. These are prefixed with
3100           <literal>madmutt_</literal> and are read-only, i.e. they cannot
3101           be set, unset or
3102           reset. The reference chapter lists all available variables.
3103         </para>
3104         
3105         <para>
3106           <emphasis> Please consult the local copy of your manual for their
3107             values as they may differ from different manual sources.
3108           </emphasis>
3109           Where
3110           the manual is installed in can be queried (already using such a
3111           variable) by running:
3112         </para>
3113         
3114         <para>
3115           
3116           <madmutt-doc:lstshell>
3117 $ madmutt -Q madmutt_docdir</madmutt-doc:lstshell>
3118           
3119         </para>
3120         
3121         <para>
3122           To extend the example for viewing the manual via self-defined
3123           variables, it can be made more readable and more portable by
3124           changing the real path in:
3125         </para>
3126         
3127         <para>
3128           
3129           <madmutt-doc:lstconf>
3130 set user_manualcmd = '!less -r /path/to_manual'</madmutt-doc:lstconf>
3131           
3132         </para>
3133         
3134         <para>
3135           to:
3136         </para>
3137         
3138         <para>
3139           
3140           <madmutt-doc:lstconf>
3141 set user_manualcmd = "!less -r $madmutt_docdir/manual.txt"</madmutt-doc:lstconf>
3142           
3143         </para>
3144         
3145         <para>
3146           which works everywhere if a manual is installed.
3147         </para>
3148         
3149         <para>
3150           Please note that by the type of quoting, madmutt determines when
3151           to expand these values: when it finds double quotes, the value will
3152           be expanded during reading the setup files but when it finds single
3153           quotes, it'll expand it at runtime as needed.
3154         </para>
3155         
3156         <para>
3157           For example, the statement
3158         </para>
3159         
3160         <para>
3161           
3162           <madmutt-doc:lstconf>
3163 folder-hook . "set user_current_folder = $madmutt_folder_name"</madmutt-doc:lstconf>
3164           
3165         </para>
3166         
3167         <para>
3168           will be already be translated to the following when reading the
3169           startup files:
3170         </para>
3171         
3172         <para>
3173           
3174           <madmutt-doc:lstconf>
3175 folder-hook . "set user_current_folder = some_folder"</madmutt-doc:lstconf>
3176           
3177         </para>
3178         
3179         <para>
3180           with <literal>some_folder</literal> being the name of the
3181           first folder madmutt
3182           opens. On the contrary,
3183         </para>
3184         
3185         <para>
3186           
3187           <madmutt-doc:lstconf>
3188 folder-hook . 'set user_current_folder = $madmutt_folder_name'</madmutt-doc:lstconf>
3189           
3190         </para>
3191         
3192         <para>
3193           will be executed at runtime because of the single quotes so that
3194           <literal>user_current_folder</literal> will always have
3195           the value of the currently
3196           opened folder.
3197         </para>
3198         
3199         <para>
3200           A more practical example is:
3201         </para>
3202         
3203         <para>
3204           
3205           <madmutt-doc:lstconf>
3206 folder-hook . 'source ~/.mutt/score-$madmutt_folder_name'</madmutt-doc:lstconf>
3207           
3208         </para>
3209         
3210         <para>
3211           which can be used to source files containing score commands
3212           depending on the folder the user enters.
3213         </para>
3214         
3215       </sect2>
3216       
3217       <sect2 id="configuration-expansion-typeconv">
3218         <title>Type Conversions</title>
3219         
3220         <para>
3221           A note about variable's types during conversion: internally
3222           values are stored in internal types but for any dump/query or set
3223           operation they're converted to and from string. That means that
3224           there's no need to worry about types when referencing any variable.
3225           As an example, the following can be used without harm (besides
3226           makeing madmutt very likely behave strange):
3227         </para>
3228         
3229         <para>
3230           
3231           <madmutt-doc:lstconf>
3232 set read_inc = 100
3233 set folder = $read_inc
3234 set read_inc = $folder
3235 set user_magic_number = 42
3236 set folder = $user_magic_number</madmutt-doc:lstconf>
3237           
3238         </para>
3239         
3240       </sect2>
3241       
3242     </sect1>
3243     
3244     <sect1>
3245       <title>Defining/Using aliases</title>
3246
3247       <para>
3248         <madmutt-doc:cmddef name="alias">
3249           key address [, address,...]
3250         </madmutt-doc:cmddef>
3251       </para>
3252       
3253       <para>
3254         It's usually very cumbersome to remember or type out the address of
3255         someone
3256         you are communicating with.  Madmutt allows you to create ``aliases''
3257         which map
3258         a short string to a full address.
3259       </para>
3260       
3261       <para>
3262         <emphasis role="bold">Note:</emphasis> if you want to create an alias
3263         for a group (by specifying more than
3264         one address), you <emphasis role="bold">must</emphasis> separate the
3265         addresses with a comma (``,'').
3266       </para>
3267       
3268       <para>
3269         To remove an alias or aliases (``*'' means all aliases):
3270       </para>
3271       
3272       <para>
3273         <madmutt-doc:cmddef name="unalias">
3274           [* | key ... ]
3275         </madmutt-doc:cmddef>
3276       </para>
3277       
3278       <para>
3279         
3280         <madmutt-doc:lstconf>
3281 alias muttdude me@cs.hmc.edu (Michael Elkins)
3282 alias theguys manny, moe, jack</madmutt-doc:lstconf>
3283         
3284       </para>
3285       
3286       <para>
3287         Unlike other mailers, Madmutt doesn't require aliases to be defined
3288         in a special file.  The <literal>alias</literal> command can appear
3289         anywhere in
3290         a configuration file, as long as this file is <madmutt-doc:cmdref name="source"/>.
3291         Consequently, you can have multiple alias files, or
3292         you can have all aliases defined in your muttrc.
3293       </para>
3294       
3295       <para>
3296         On the other hand, the <madmutt-doc:funcref name="create-alias"/>
3297         function can use only one file, the one pointed to by the
3298         <madmutt-doc:varref name="alias-file"/>
3299         variable (which is
3300         <literal>~/.muttrc</literal> by default). This file is not
3301         special either,
3302         in the sense that Madmutt will happily append aliases to any file, but
3303         in
3304         order for the new aliases to take effect you need to explicitly <madmutt-doc:cmdref name="source"/>
3305         this file too.
3306       </para>
3307       
3308       <para>
3309         For example:
3310       </para>
3311       
3312       <para>
3313         
3314         <madmutt-doc:lstconf>
3315 source /usr/local/share/Madmutt.aliases
3316 source ~/.mail_aliases
3317 set alias_file=~/.mail_aliases</madmutt-doc:lstconf>
3318         
3319       </para>
3320       
3321       <para>
3322         To use aliases, you merely use the alias at any place in mutt where
3323         muttprompts for addresses, such as the <emphasis>To:</emphasis> or <emphasis>
3324           Cc:
3325         </emphasis>
3326         prompt.  You can
3327         also enter aliases in your editor at the appropriate headers if you
3328         have the
3329         <madmutt-doc:varref name="editor-headers"/>
3330         variable set.
3331       </para>
3332       
3333       <para>
3334         In addition, at the various address prompts, you can use the tab
3335         character
3336         to expand a partial alias to the full alias.  If there are multiple
3337         matches,
3338         mutt will bring up a menu with the matching aliases.  In order to be
3339         presented with the full list of aliases, you must hit tab with out a
3340         partial
3341         alias, such as at the beginning of the prompt or after a comma denoting
3342         multiple addresses.
3343       </para>
3344       
3345       <para>
3346         In the alias menu, you can select as many aliases as you want with the
3347         <emphasis>select-entry</emphasis> key (default: RET), and use the <emphasis>
3348           exit
3349         </emphasis>
3350         key
3351         (default: q) to return to the address prompt.
3352       </para>
3353       
3354       <para>
3355         
3356       </para>
3357       
3358     </sect1>
3359     
3360     <sect1>
3361       <title>Changing the default key bindings</title>
3362       
3363       <para>
3364         <madmutt-doc:cmddef name="bind">
3365           map key function
3366         </madmutt-doc:cmddef>
3367       </para>
3368       
3369       <para>
3370         This command allows you to change the default key bindings (operation
3371         invoked when pressing a key).
3372       </para>
3373       
3374       <para>
3375         <emphasis>map</emphasis> specifies in which menu the binding belongs. 
3376         Multiple maps may
3377         be specified by separating them with commas (no additional whitespace
3378         isallowed). The currently defined maps are:
3379       </para>
3380       
3381       <para>
3382         <anchor id="maps"/>
3383         <variablelist>
3384           
3385           <varlistentry>
3386             <term>generic</term>
3387             <listitem>
3388               <para>
3389                 This is not a real menu, but is used as a fallback for all of
3390                 the other
3391                 menus except for the pager and editor modes.  If a key is not
3392                 defined in
3393                 another menu, Madmutt will look for a binding to use in this
3394                 menu.  This allows
3395                 you to bind a key to a certain function in multiple menus
3396                 instead of having
3397                 multiple bind statements to accomplish the same task.
3398               </para>
3399             </listitem>
3400           </varlistentry>
3401           <varlistentry>
3402             <term>alias</term>
3403             <listitem>
3404               <para>
3405                 The alias menu is the list of your personal aliases as defined
3406                 in your
3407                 muttrc.  It is the mapping from a short alias name to the full
3408                 email
3409                 address(es) of the recipient(s).
3410               </para>
3411             </listitem>
3412           </varlistentry>
3413           <varlistentry>
3414             <term>attach</term>
3415             <listitem>
3416               <para>
3417                 The attachment menu is used to access the attachments on
3418                 received messages.
3419               </para>
3420             </listitem>
3421           </varlistentry>
3422           <varlistentry>
3423             <term>browser</term>
3424             <listitem>
3425               <para>
3426                 The browser is used for both browsing the local directory
3427                 structure, and for
3428                 listing all of your incoming mailboxes.
3429               </para>
3430             </listitem>
3431           </varlistentry>
3432           <varlistentry>
3433             <term>editor</term>
3434             <listitem>
3435               <para>
3436                 The editor is the line-based editor the user enters text data.
3437               </para>
3438             </listitem>
3439           </varlistentry>
3440           <varlistentry>
3441             <term>index</term>
3442             <listitem>
3443               <para>
3444                 The index is the list of messages contained in a mailbox.
3445               </para>
3446             </listitem>
3447           </varlistentry>
3448           <varlistentry>
3449             <term>compose</term>
3450             <listitem>
3451               <para>
3452                 The compose menu is the screen used when sending a new message.
3453               </para>
3454             </listitem>
3455           </varlistentry>
3456           <varlistentry>
3457             <term>pager</term>
3458             <listitem>
3459               <para>
3460                 The pager is the mode used to display message/attachment data,
3461                 and help
3462                 listings.
3463               </para>
3464             </listitem>
3465           </varlistentry>
3466           <varlistentry>
3467             <term>pgp</term>
3468             <listitem>
3469               <para>
3470                 The pgp menu is used to select the OpenPGP keys used for
3471                 encrypting outgoing
3472                 messages.
3473               </para>
3474             </listitem>
3475           </varlistentry>
3476           <varlistentry>
3477             <term>postpone</term>
3478             <listitem>
3479               <para>
3480                 The postpone menu is similar to the index menu, except is used
3481                 when
3482                 recalling a message the user was composing, but saved until
3483                 later.
3484               </para>
3485             </listitem>
3486           </varlistentry>
3487         </variablelist>
3488       </para>
3489       
3490       <para>
3491         <emphasis>key</emphasis> is the key (or key sequence) you wish to bind.
3492          To specify a
3493         control character, use the sequence <emphasis>\Cx</emphasis>,
3494         where <emphasis>x</emphasis> is the
3495         letter of the control character (for example, to specify control-A use
3496         ``\Ca'').  Note that the case of <emphasis>x</emphasis> as well as
3497         <emphasis>\C</emphasis> is
3498         ignored, so that <emphasis>\CA</emphasis>, <emphasis>\Ca</emphasis>, <emphasis>
3499           \cA
3500         </emphasis>
3501         and <emphasis>\ca</emphasis> are all
3502         equivalent.  An alternative form is to specify the key as a three digit
3503         octal number prefixed with a ``\'' (for example <emphasis>
3504           \177
3505         </emphasis>
3506         is
3507         equivalent to <emphasis>\c?</emphasis>).
3508       </para>
3509       
3510       <para>
3511         In addition, <emphasis>key</emphasis> may consist of:
3512       </para>
3513       
3514       <para>
3515         
3516         <table frame="none" rowsep="1" texstr="l|l">
3517           <title>Alternative Key Names</title>
3518           <tgroup cols="2" align="left" colsep="1" rowsep="1">
3519           <thead>
3520             <row>
3521               <entry>Sequence</entry>
3522               <entry>Description</entry>
3523             </row>
3524           </thead>
3525           <tbody>
3526             <row>
3527               <entry><literal>\t</literal></entry>
3528               <entry>tab</entry>
3529             </row>
3530             <row>
3531               <entry><literal>&lt;tab&gt;</literal></entry>
3532               <entry>tab</entry>
3533             </row>
3534             <row>
3535               <entry><literal>&lt;backtab&gt;</literal></entry>
3536               <entry>backtab / shift-tab</entry>
3537             </row>
3538             <row>
3539               <entry><literal>\r</literal></entry>
3540               <entry>carriage return</entry>
3541             </row>
3542             <row>
3543               <entry><literal>\n</literal></entry>
3544               <entry>newline</entry>
3545             </row>
3546             <row>
3547               <entry><literal>\e</literal></entry>
3548               <entry>escape</entry>
3549             </row>
3550             <row>
3551               <entry><literal>&lt;esc&gt;</literal></entry>
3552               <entry>escape</entry>
3553             </row>
3554             <row>
3555               <entry><literal>&lt;up&gt;</literal></entry>
3556               <entry>up arrow</entry>
3557             </row>
3558             <row>
3559               <entry><literal>&lt;down&gt;</literal></entry>
3560               <entry>down arrow</entry>
3561             </row>
3562             <row>
3563               <entry><literal>&lt;left&gt;</literal></entry>
3564               <entry>left arrow</entry>
3565             </row>
3566             <row>
3567               <entry><literal>&lt;right&gt;</literal></entry>
3568               <entry>right arrow</entry>
3569             </row>
3570             <row>
3571               <entry><literal>&lt;pageup&gt;</literal></entry>
3572               <entry>Page Up</entry>
3573             </row>
3574             <row>
3575               <entry><literal>&lt;pagedown&gt;</literal></entry>
3576               <entry>Page Down</entry>
3577             </row>
3578             <row>
3579               <entry><literal>&lt;backspace&gt;</literal></entry>
3580               <entry>Backspace</entry>
3581             </row>
3582             <row>
3583               <entry><literal>&lt;delete&gt;</literal></entry>
3584               <entry>Delete</entry>
3585             </row>
3586             <row>
3587               <entry><literal>&lt;insert&gt;</literal></entry>
3588               <entry>Insert</entry>
3589             </row>
3590             <row>
3591               <entry><literal>&lt;enter&gt;</literal></entry>
3592               <entry>Enter</entry>
3593             </row>
3594             <row>
3595               <entry><literal>&lt;return&gt;</literal></entry>
3596               <entry>Return</entry>
3597             </row>
3598             <row>
3599               <entry><literal>&lt;home&gt;</literal></entry>
3600               <entry>Home</entry>
3601             </row>
3602             <row>
3603               <entry><literal>&lt;end&gt;</literal></entry>
3604               <entry>End</entry>
3605             </row>
3606             <row>
3607               <entry><literal>&lt;space&gt;</literal></entry>
3608               <entry>Space bar</entry>
3609             </row>
3610             <row>
3611               <entry><literal>&lt;f1&gt;</literal></entry>
3612               <entry>function key 1</entry>
3613             </row>
3614             <row>
3615               <entry><literal>&lt;f10&gt;</literal></entry>
3616               <entry>function key 10</entry>
3617             </row>
3618           </tbody>
3619         </tgroup>
3620       </table>
3621         
3622       </para>
3623       
3624       <para>
3625         <emphasis>key</emphasis> does not need to be enclosed in quotes unless
3626         it contains a
3627         space (`` '').
3628       </para>
3629       
3630       <para>
3631         <emphasis>function</emphasis> specifies which action to take when <emphasis>
3632           key
3633         </emphasis>
3634         is pressed.
3635         For a complete list of functions, see the <link linkend="functions">functions</link>. 
3636         The special function <literal>noop</literal> unbinds the specified key
3637         sequence.
3638       </para>
3639       
3640       <para>
3641         
3642       </para>
3643       
3644     </sect1>
3645     
3646     <sect1 id="charset-hook">
3647       <title>Defining aliases for character sets</title>
3648
3649       <anchor id="iconv-hook"/>
3650       <para>
3651         Usage: <madmutt-doc:hook name="charset"/> <emphasis>alias</emphasis> <emphasis> charset</emphasis>
3652       </para>
3653       <para>
3654         Usage: <madmutt-doc:hook name="iconv"/> <emphasis>charset</emphasis> <emphasis> local-charset </emphasis>
3655       </para>
3656       
3657       <para>
3658         The <madmutt-doc:hook name="charset"/> command defines an alias for a
3659         character set.
3660         This is useful to properly display messages which are tagged with a
3661         character set name not known to mutt.
3662       </para>
3663       
3664       <para>
3665         The <madmutt-doc:hook name="iconv"/> command defines a system-specific
3666         name for a
3667         character set.  This is helpful when your systems character
3668         conversion library insists on using strange, system-specific names
3669         for character sets.
3670       </para>
3671       
3672       <para>
3673         
3674       </para>
3675       
3676     </sect1>
3677     
3678     <sect1 id="folder-hook">
3679       <title>Setting variables based upon mailbox</title>
3680       
3681       <para>
3682         Usage: <madmutt-doc:hook name="folder"/> [!]<emphasis>regexp</emphasis> <emphasis>command</emphasis>
3683       </para>
3684       
3685       <para>
3686         It is often desirable to change settings based on which mailbox you are
3687         reading.  The <madmutt-doc:hook name="folder"/> command provides a method by which you can
3688         execute
3689         any configuration command.  <emphasis>regexp</emphasis> is a regular
3690         expression specifying
3691         in which mailboxes to execute <emphasis>command</emphasis> before
3692         loading.  If a mailbox
3693         matches multiple <madmutt-doc:hook name="folder"/>'s, they are executed in the order given in
3694         the
3695         muttrc.
3696       </para>
3697       
3698       <para>
3699         <emphasis role="bold">Note:</emphasis> if you use the ``!'' shortcut
3700         for <madmutt-doc:varref name="spoolfile"/> at the beginning of the
3701         pattern, you must place it
3702         inside of double or single quotes in order to distinguish it from the
3703         logical <emphasis>not</emphasis> operator for the expression.
3704       </para>
3705       
3706       <para>
3707         Note that the settings are <emphasis>not</emphasis> restored when you
3708         leave the mailbox.
3709         For example, a command action to perform is to change the sorting
3710         methodbased upon the mailbox being read:
3711       </para>
3712       
3713       <para>
3714         
3715         <madmutt-doc:lstconf>
3716 folder-hook mutt set sort=threads</madmutt-doc:lstconf>
3717         
3718       </para>
3719       
3720       <para>
3721         However, the sorting method is not restored to its previous value when
3722         reading a different mailbox.  To specify a <emphasis>default</emphasis>
3723         command, use the
3724         pattern ``.'':
3725       </para>
3726       
3727       <para>
3728         
3729         <madmutt-doc:lstconf>
3730 folder-hook . set sort=date-sent</madmutt-doc:lstconf>
3731         
3732       </para>
3733       
3734       <para>
3735         
3736       </para>
3737       
3738     </sect1>
3739     
3740     <sect1>
3741       <title>Keyboard macros</title>
3742       
3743       <para>
3744         <madmutt-doc:cmddef name="macro">
3745           menu key sequence [description]
3746         </madmutt-doc:cmddef>
3747       </para>
3748       
3749       <para>
3750         Macros are useful when you would like a single key to perform a series
3751         of
3752         actions.  When you press <emphasis>key</emphasis> in menu <emphasis>
3753           menu
3754         </emphasis>
3755         ,Madmutt will behave as if
3756         you had typed <emphasis>sequence</emphasis>.  So if you have a common
3757         sequence of commands
3758         you type, you can create a macro to execute those commands with a
3759         singlekey.
3760       </para>
3761       
3762       <para>
3763         <emphasis>menu</emphasis> is the <link linkend="maps">maps</link> which
3764         the macro will be bound.
3765         Multiple maps may be specified by separating multiple menu arguments by
3766         commas. Whitespace may not be used in between the menu arguments and
3767         thecommas separating them.
3768       </para>
3769       
3770       <para>
3771         <emphasis>key</emphasis> and <emphasis>sequence</emphasis> are
3772         expanded by the same rules as the <madmutt-doc:cmdref
3773           name="bind"/>.  There are some additions however.  The first
3774         is that control characters in <emphasis>sequence</emphasis> can
3775         also be specified as <literal>^x</literal>.  In order to get a
3776         caret (`^'') you need to specify it twice.  Secondly,
3777         to specify a certain key such as <emphasis>up</emphasis> or to
3778         invoke a function directly, you can use the format
3779         <emphasis>&lt;key name&gt;</emphasis> and <emphasis>&lt;function
3780           name&gt; </emphasis> .For a listing of key names see the
3781         section on <madmutt-doc:cmdref name="bind"/>.  Functions are
3782         listed in the <link linkend="functions">functions</link>.
3783       </para>
3784       
3785       <para>
3786         The advantage with using function names directly is that the macros
3787         willwork regardless of the current key bindings, so they are not
3788         dependent on
3789         the user having particular key definitions.  This makes them more
3790         robustand portable, and also facilitates defining of macros in files
3791         used by more
3792         than one user (eg. the system madmuttrc).
3793       </para>
3794       
3795       <para>
3796         Optionally you can specify a descriptive text after <emphasis>sequence</emphasis>,
3797         which is shown in the help screens.
3798       </para>
3799       
3800       <para>
3801         <emphasis role="bold">Note:</emphasis> Macro definitions (if any)
3802         listed in the help screen(s), are
3803         silently truncated at the screen width, and are not wrapped.   
3804       </para>
3805       
3806       <para>
3807         
3808       </para>
3809       
3810     </sect1>
3811     
3812     <sect1>
3813       <title>Using color and mono video attributes</title>
3814
3815       <para>
3816         <madmutt-doc:cmddef name="color">object foreground background [regexp]</madmutt-doc:cmddef>
3817       </para>
3818       <para>
3819         <madmutt-doc:cmddef name="color" noanchor="1">index foreground pattern</madmutt-doc:cmddef>
3820       </para>
3821       <para>
3822         <madmutt-doc:cmddef name="uncolor">index pattern [pattern ...]</madmutt-doc:cmddef>
3823       </para>
3824       
3825       <para>
3826         If your terminal supports color, you can spice up Madmutt by creating
3827         your own
3828         color scheme.  To define the color of an object (type of information),
3829         you
3830         must specify both a foreground color <emphasis role="bold">and</emphasis> a background color (it is not
3831         possible to only specify one or the other).
3832       </para>
3833       
3834       <para>
3835         <emphasis>object</emphasis> can be one of:
3836       </para>
3837       
3838       <para>
3839         
3840         <itemizedlist>
3841           <listitem>
3842             
3843             <para>
3844               attachment
3845             </para>
3846           </listitem>
3847           <listitem>
3848             
3849             <para>
3850               body (match <emphasis>regexp</emphasis> in the body of messages)
3851             </para>
3852           </listitem>
3853           <listitem>
3854             
3855             <para>
3856               bold (highlighting bold patterns in the body of messages)
3857             </para>
3858           </listitem>
3859           <listitem>
3860             
3861             <para>
3862               error (error messages printed by Madmutt)
3863             </para>
3864           </listitem>
3865           <listitem>
3866             
3867             <para>
3868               header (match <emphasis>regexp</emphasis> in the message header)
3869             </para>
3870           </listitem>
3871           <listitem>
3872             
3873             <para>
3874               hdrdefault (default color of the message header in the pager)
3875             </para>
3876           </listitem>
3877           <listitem>
3878             
3879             <para>
3880               index (match <emphasis>pattern</emphasis> in the message index)
3881             </para>
3882           </listitem>
3883           <listitem>
3884             
3885             <para>
3886               indicator (arrow or bar used to indicate the current item in a
3887               menu)
3888             </para>
3889           </listitem>
3890           <listitem>
3891             
3892             <para>
3893               markers (the ``+'' markers at the beginning of wrapped lines in
3894               the pager)
3895             </para>
3896           </listitem>
3897           <listitem>
3898             
3899             <para>
3900               message (informational messages)
3901             </para>
3902           </listitem>
3903           <listitem>
3904             
3905             <para>
3906               normal
3907             </para>
3908           </listitem>
3909           <listitem>
3910             
3911             <para>
3912               quoted (text matching <madmutt-doc:varref name="quote-regexp"/> in the body of a message)
3913             </para>
3914           </listitem>
3915           <listitem>
3916             
3917             <para>
3918               quoted1, quoted2, ..., quoted<emphasis role="bold">N</emphasis>
3919               (higher levels of quoting)
3920             </para>
3921           </listitem>
3922           <listitem>
3923             
3924             <para>
3925               search (highlighting of words in the pager)
3926             </para>
3927           </listitem>
3928           <listitem>
3929             
3930             <para>
3931               signature
3932             </para>
3933           </listitem>
3934           <listitem>
3935             
3936             <para>
3937               status (mode lines used to display info about the mailbox or
3938               message)
3939             </para>
3940           </listitem>
3941           <listitem>
3942             
3943             <para>
3944               tilde (the ``~'' used to pad blank lines in the pager)
3945             </para>
3946           </listitem>
3947           <listitem>
3948             
3949             <para>
3950               tree (thread tree drawn in the message index and attachment menu)
3951             </para>
3952           </listitem>
3953           <listitem>
3954             
3955             <para>
3956               underline (highlighting underlined patterns in the body of
3957               messages)
3958             </para>
3959           </listitem>
3960           
3961         </itemizedlist>
3962         
3963       </para>
3964       
3965       <para>
3966         <emphasis>foreground</emphasis> and <emphasis>background</emphasis> can
3967         be one of the following:
3968       </para>
3969       
3970       <para>
3971         
3972         <itemizedlist>
3973           <listitem>
3974             
3975             <para>
3976               white
3977             </para>
3978           </listitem>
3979           <listitem>
3980             
3981             <para>
3982               black
3983             </para>
3984           </listitem>
3985           <listitem>
3986             
3987             <para>
3988               green
3989             </para>
3990           </listitem>
3991           <listitem>
3992             
3993             <para>
3994               magenta
3995             </para>
3996           </listitem>
3997           <listitem>
3998             
3999             <para>
4000               blue
4001             </para>
4002           </listitem>
4003           <listitem>
4004             
4005             <para>
4006               cyan
4007             </para>
4008           </listitem>
4009           <listitem>
4010             
4011             <para>
4012               yellow
4013             </para>
4014           </listitem>
4015           <listitem>
4016             
4017             <para>
4018               red
4019             </para>
4020           </listitem>
4021           <listitem>
4022             
4023             <para>
4024               default
4025             </para>
4026           </listitem>
4027           <listitem>
4028             
4029             <para>
4030               color<emphasis>x</emphasis>
4031             </para>
4032           </listitem>
4033           
4034         </itemizedlist>
4035         
4036       </para>
4037       
4038       <para>
4039         <emphasis>foreground</emphasis> can optionally be prefixed with the
4040         keyword <literal>bright</literal> to make
4041         the foreground color boldfaced (e.g., <literal>brightred</literal>).
4042       </para>
4043       
4044       <para>
4045         If your terminal supports it, the special keyword <emphasis>default</emphasis> can be
4046         used as a transparent color.  The value <emphasis>brightdefault</emphasis> is also valid.
4047         If Madmutt is linked against the <emphasis>S-Lang</emphasis> library,
4048         you also need to set
4049         the <madmutt-doc:envvar name="COLORFGBG"/> environment variable to the default
4050         colors of your
4051         terminal for this to work; for example (for Bourne-like shells):
4052       </para>
4053       
4054       <para>
4055         
4056         <madmutt-doc:lstshell>
4057 set COLORFGBG="green;black"
4058 export COLORFGBG</madmutt-doc:lstshell>
4059         
4060       </para>
4061       
4062       <para>
4063         <emphasis role="bold">Note:</emphasis> The <emphasis>S-Lang</emphasis>
4064         library requires you to use the <emphasis>lightgray</emphasis>
4065         and <emphasis>brown</emphasis> keywords instead of <emphasis>white</emphasis> and <emphasis>
4066           yellow
4067         </emphasis>
4068         when
4069         setting this variable.
4070       </para>
4071       
4072       <para>
4073         <emphasis role="bold">Note:</emphasis> The uncolor command can be
4074         applied to the index object only.  It
4075         removes entries from the list. You <emphasis role="bold">must</emphasis> specify the same pattern
4076         specified in the color command for it to be removed.  The pattern ``*''
4077         is
4078         a special token which means to clear the color index list of all
4079         entries.
4080       </para>
4081       
4082       <para>
4083         Madmutt also recognizes the keywords <emphasis>color0</emphasis>, <emphasis>
4084           color1
4085         </emphasis>
4086         ,...,
4087         <emphasis>color</emphasis><emphasis role="bold">N-1</emphasis> (<emphasis role="bold">
4088           N
4089         </emphasis>
4090         being the number of colors supported
4091         by your terminal).  This is useful when you remap the colors for your
4092         display (for example by changing the color associated with <emphasis>
4093           color2
4094         </emphasis>
4095         for your xterm), since color names may then lose their normal meaning.
4096       </para>
4097       
4098       <para>
4099         If your terminal does not support color, it is still possible change
4100         the video
4101         attributes through the use of the ``mono'' command:
4102       </para>
4103       
4104       <para>
4105         <madmutt-doc:cmddef name="mono">object attribute [regexp]</madmutt-doc:cmddef>
4106       </para>
4107       <para>
4108         <madmutt-doc:cmddef name="mono" noanchor="1">index attribute pattern</madmutt-doc:cmddef>
4109       </para>
4110       <para>
4111         <madmutt-doc:cmddef name="unmono">index pattern [pattern ...]</madmutt-doc:cmddef>
4112       </para>
4113       
4114       <para>
4115         where <emphasis>attribute</emphasis> is one of the following:
4116       </para>
4117       
4118       <para>
4119         
4120         <itemizedlist>
4121           <listitem>
4122             
4123             <para>
4124               none
4125             </para>
4126           </listitem>
4127           <listitem>
4128             
4129             <para>
4130               bold
4131             </para>
4132           </listitem>
4133           <listitem>
4134             
4135             <para>
4136               underline
4137             </para>
4138           </listitem>
4139           <listitem>
4140             
4141             <para>
4142               reverse
4143             </para>
4144           </listitem>
4145           <listitem>
4146             
4147             <para>
4148               standout
4149             </para>
4150           </listitem>
4151           
4152         </itemizedlist>
4153         
4154       </para>
4155       
4156       <para>
4157         
4158       </para>
4159       
4160     </sect1>
4161     
4162     <sect1>
4163       <title>Ignoring (weeding) unwanted message headers</title>
4164
4165       <para>
4166         <madmutt-doc:cmddef name="ignore">pattern [pattern ...]</madmutt-doc:cmddef>
4167       </para>
4168
4169       <para>
4170         <madmutt-doc:cmddef name="unignore">pattern [pattern ...]</madmutt-doc:cmddef>
4171       </para>
4172  
4173       <para>
4174         Messages often have many header fields added by automatic processing
4175         systems,
4176         or which may not seem useful to display on the screen.  This command
4177         allows
4178         you to specify header fields which you don't normally want to see.
4179       </para>
4180       
4181       <para>
4182         You do not need to specify the full header field name.  For example,
4183         ``ignore content-'' will ignore all header fields that begin with the
4184         pattern
4185         ``content-''. ``ignore *'' will ignore all headers.
4186       </para>
4187       
4188       <para>
4189         To remove a previously added token from the list, use the ``unignore''
4190         command.
4191         The ``unignore'' command will make Madmutt display headers with the
4192         given pattern.
4193         For example, if you do ``ignore x-'' it is possible to ``unignore
4194         x-mailer''.
4195       </para>
4196       
4197       <para>
4198         ``unignore *'' will remove all tokens from the ignore list.
4199       </para>
4200       
4201       <para>
4202         For example:
4203         
4204         <madmutt-doc:lstconf>
4205 # Sven's draconian header weeding
4206 ignore *
4207 unignore from date subject to cc
4208 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
4209 unignore posted-to:</madmutt-doc:lstconf>
4210         
4211       </para>
4212       
4213       <para>
4214         
4215       </para>
4216       
4217     </sect1>
4218     
4219     <sect1>
4220       <title>Alternative addresses</title>
4221       
4222       <para>
4223         <madmutt-doc:cmddef name="alternates">regexp [regexp ...]</madmutt-doc:cmddef>
4224       </para>
4225
4226       <para>
4227         <madmutt-doc:cmddef name="unalternates">regexp [regexp ...]</madmutt-doc:cmddef>
4228       </para>
4229  
4230       <para>
4231         With various functions, mutt will treat messages differently,
4232         depending on whether you sent them or whether you received them from
4233         someone else.  For instance, when replying to a message that you
4234         sent to a different party, mutt will automatically suggest to send
4235         the response to the original message's recipients--responding to
4236         yourself won't make much sense in many cases.
4237         (See <madmutt-doc:varref name="reply-to"/>.)
4238       </para>
4239       
4240       <para>
4241         Many users receive e-mail under a number of different addresses. To
4242         fully use mutt's features here, the program must be able to
4243         recognize what e-mail addresses you receive mail under. That's the
4244         purpose of the <literal>alternates</literal> command: It takes a list
4245         of regular
4246         expressions, each of which can identify an address under which you
4247         receive e-mail.
4248       </para>
4249       
4250       <para>
4251         The <literal>unalternates</literal> command can be used to write
4252         exceptions to
4253         <literal>alternates</literal> patterns. If an address matches something
4254         in an
4255         <literal>alternates</literal> command, but you nonetheless do not think
4256         it is
4257         from you, you can list a more precise pattern under an <literal>
4258           unalternates
4259         </literal>
4260         command.
4261       </para>
4262       
4263       <para>
4264         To remove a regular expression from the <literal>alternates</literal>
4265         list, use the
4266         <literal>unalternates</literal> command with exactly the same <emphasis>
4267           regexp
4268         </emphasis>
4269         .
4270         Likewise, if the <emphasis>regexp</emphasis> for a <literal>alternates</literal> command matches
4271         an entry on the <literal>unalternates</literal> list, that <literal>
4272           unalternates
4273         </literal>
4274         entry will be removed. If the <emphasis>regexp</emphasis> for <literal>
4275           unalternates
4276         </literal>
4277         is ``*'', <emphasis>all entries</emphasis> on <literal>alternates</literal> will be removed.
4278       </para>
4279       
4280       <para>
4281         
4282       </para>
4283       
4284     </sect1>
4285     
4286     <sect1 id="format-flowed">
4287       <title>Format = Flowed</title>
4288       
4289       <sect2 id="format-flowed-intro">
4290         <title>Introduction</title>
4291         
4292         <para>
4293           Madmutt contains support for so-called <literal>format=flowed</literal> messages.
4294           In the beginning of email, each message had a fixed line width, and
4295           it was enough for displaying them on fixed-size terminals. But times
4296           changed, and nowadays hardly anybody still uses fixed-size terminals:
4297           more people nowaydays use graphical user interfaces, with dynamically
4298           resizable windows. This led to the demand of a new email format that
4299           makes it possible for the email client to make the email look nice
4300           in a resizable window without breaking quoting levels and creating
4301           an incompatible email format that can also be displayed nicely on
4302           old fixed-size terminals.
4303         </para>
4304         
4305         <para>
4306           For introductory information on <literal>format=flowed</literal>
4307           messages, see
4308           <madmutt-doc:web url="http://www.joeclark.org/ffaq.html"/>.
4309         </para>
4310         
4311       </sect2>
4312       
4313       <sect2 id="format-flowed-display">
4314         <title>Receiving: Display Setup</title>
4315         
4316         <para>
4317           When you receive emails that are marked as <literal>format=flowed</literal>
4318           messages, and is formatted correctly, Madmutt will try to reformat
4319           the message to optimally fit on your terminal. If you want a fixed
4320           margin on the right side of your terminal, you can set the
4321           following:
4322         </para>
4323         
4324         <para>
4325           
4326           <madmutt-doc:lstconf>
4327 set wrapmargin = 10</madmutt-doc:lstconf>
4328           
4329         </para>
4330         
4331         <para>
4332           The code above makes the line break 10 columns before the right
4333           side of the terminal.
4334         </para>
4335         
4336         <para>
4337           If your terminal is so wide that the lines are embarrassingly long,
4338           you can also set a maximum line length:
4339         </para>
4340         
4341         <para>
4342           
4343           <madmutt-doc:lstconf>
4344 set max_line_length = 120</madmutt-doc:lstconf>
4345           
4346         </para>
4347         
4348         <para>
4349           The example above will give you lines not longer than 120
4350           characters.
4351         </para>
4352         
4353         <para>
4354           When you view at <literal>format=flowed</literal> messages, you will
4355           often see
4356           the quoting hierarchy like in the following example:
4357         </para>
4358         
4359         <para>
4360           
4361           <madmutt-doc:lstmail>
4362 &gt;Bill, can you please send last month's progress report to Mr. 
4363 &gt;Morgan? We also urgently need the cost estimation for the new 
4364 &gt;production server that we want to set up before our customer's 
4365 &gt;project will go live.</madmutt-doc:lstmail>
4366           
4367         </para>
4368         
4369         <para>
4370           This obviously doesn't look very nice, and it makes it very
4371           hard to differentiate between text and quoting character. The
4372           solution is to configure Madmutt to "stuff" the quoting:
4373         </para>
4374         
4375         <para>
4376           
4377           <madmutt-doc:lstconf>
4378 set stuff_quoted</madmutt-doc:lstconf>
4379           
4380         </para>
4381         
4382         <para>
4383           This will lead to a nicer result that is easier to read:
4384         </para>
4385         
4386         <para>
4387           
4388           <madmutt-doc:lstmail>
4389 &gt; Bill, can you please send last month's progress report to Mr. 
4390 &gt; Morgan? We also urgently need the cost estimation for the new 
4391 &gt; production server that we want to set up before our customer's
4392 &gt; project will go live.</madmutt-doc:lstmail>
4393           
4394         </para>
4395         
4396       </sect2>
4397       
4398       <sect2 id="format-flowed-send">
4399         <title>Sending</title>
4400         
4401         <para>
4402           If you want Madmutt to send emails with <literal>format=flowed</literal> set, you
4403           need to explicitly set it:
4404         </para>
4405         
4406         <para>
4407           
4408           <madmutt-doc:lstconf>
4409 set text_flowed</madmutt-doc:lstconf>
4410           
4411         </para>
4412         
4413         <para>
4414           Additionally, you have to use an editor which supports writing
4415           <literal>format=flowed</literal>-conforming emails. For <madmutt-doc:man name="vim"/>, this is
4416           done by
4417           adding <literal>w</literal> to the formatoptions (see <literal>:h
4418             formatoptions
4419           </literal>
4420           and
4421           <literal>:h fo-table</literal>) when writing emails.
4422         </para>
4423         
4424         <para>
4425           Also note that <emphasis>format=flowed</emphasis> knows about
4426           ``space-stuffing'',
4427           that is, when sending messages, some kinds of lines have to be
4428           indented with a single space on the sending side. On the receiving
4429           side, the first space (if any) is removed. As a consequence and in
4430           addition to the above simple setting, please keep this in mind when
4431           making manual formattings within the editor. Also note that Madmutt
4432           currently violates the standard (<madmutt-doc:rfc num="3676"/>) as it does not
4433           space-stuff lines starting with:
4434         </para>
4435         
4436         <para>
4437           
4438           <itemizedlist>
4439             <listitem>
4440               <para>
4441                 <literal>&gt;</literal> This is <emphasis>not</emphasis> the
4442                 quote character but a right
4443                 angle used for other reasons
4444                 
4445               </para>
4446             </listitem>
4447           </itemizedlist>
4448           
4449         </para>
4450         
4451         <para>
4452           Please make sure that you manually prepend a space to each of them.
4453         </para>
4454         
4455       </sect2>
4456       
4457       <sect2 id="format-flowed-notes">
4458         <title>Additional Notes</title>
4459         
4460         <para>
4461           For completeness, the <madmutt-doc:varref name="delete-space"/> variable provides the mechanism
4462           to generate a <literal>DelSp=yes</literal> parameter on <emphasis>
4463             outgoing
4464           </emphasis>
4465           messages.
4466           According to the standard, clients receiving a <literal>format=flowed</literal>
4467           messages should delete the last space of a flowed line but still
4468           interpret the line as flowed. Because flowed lines usually contain
4469           only one space at the end, this parameter would make the receiving
4470           client concatenate the last word of the previous with the first of
4471           the current line <emphasis>without</emphasis> a space. This makes
4472           ordinary text
4473           unreadable and is intended for languages rarely using spaces. So
4474           please use this setting only if you're sure what you're doing.
4475         </para>
4476         
4477         <para>
4478           
4479         </para>
4480         
4481       </sect2>
4482       
4483     </sect1>
4484     
4485     <sect1>
4486       <title>Mailing lists</title>
4487       
4488       <para>
4489         <madmutt-doc:cmddef name="lists">regexp [regexp ...]</madmutt-doc:cmddef>
4490       </para>
4491       <para>
4492         <madmutt-doc:cmddef name="unlists">regexp [regexp ...]</madmutt-doc:cmddef>
4493       </para>
4494       <para>
4495         <madmutt-doc:cmddef name="subscribe">regexp [regexp ...]</madmutt-doc:cmddef>
4496       </para>
4497       <para>
4498         <madmutt-doc:cmddef name="unsubscribe">regexp [regexp ...]</madmutt-doc:cmddef>
4499       </para>
4500       
4501       <para>
4502         Madmutt has a few nice features for <link linkend="using-lists">using-lists</link>. 
4503         In order to take advantage of them, you must
4504         specify which addresses belong to mailing lists, and which mailing
4505         lists you are subscribed to.  Once you have done this, the
4506         <link linkend="func-list-reply">list-reply</link>
4507         function will work for all known lists.
4508         Additionally, when you send a message to a subscribed list, mutt will
4509         add a Mail-Followup-To header to tell other users' mail user agents
4510         not to send copies of replies to your personal address.   Note that
4511         the Mail-Followup-To header is a non-standard extension which is not
4512         supported by all mail user agents.  Adding it is not bullet-proof
4513         against
4514         receiving personal CCs of list messages.  Also note that the generation
4515         of the Mail-Followup-To header is controlled by the
4516         <madmutt-doc:varref name="followup-to"/>
4517         configuration variable.
4518       </para>
4519       
4520       <para>
4521         More precisely, Madmutt maintains lists of patterns for the addresses
4522         of known and subscribed mailing lists.  Every subscribed mailing
4523         list is known. To mark a mailing list as known, use the ``lists''
4524         command.  To mark it as subscribed, use ``subscribe''.
4525       </para>
4526       
4527       <para>
4528         You can use regular expressions with both commands.  To mark all
4529         messages sent to a specific bug report's address on mutt's bug
4530         tracking system as list mail, for instance, you could say
4531         ``subscribe [0-9]*@bugs.guug.de''.  Often, it's sufficient to just
4532         give a portion of the list's e-mail address.
4533       </para>
4534       
4535       <para>
4536         Specify as much of the address as you need to to remove ambiguity.  For
4537         example, if you've subscribed to the Madmutt mailing list, you will
4538         receive mail
4539         addressed to <emphasis>mutt-users@mutt.org</emphasis>.  So, to tell
4540         Madmutt that this is a
4541         mailing list, you could add ``lists mutt-users'' to your
4542         initialization file.  To tell mutt that you are subscribed to it,
4543         add ``subscribe mutt-users'' to your initialization file instead.
4544         If you also happen to get mail from someone whose address is
4545         <emphasis>mutt-users@example.com</emphasis>, you could use ``lists
4546         mutt-users@mutt\\.org'' 
4547         or ``subscribe mutt-users@mutt\\.org'' to
4548         match only mail from the actual list.
4549       </para>
4550       
4551       <para>
4552         The ``unlists'' command is used to remove a token from the list of
4553         known and subscribed mailing-lists. Use ``unlists *'' to remove all
4554         tokens.
4555       </para>
4556       
4557       <para>
4558         To remove a mailing list from the list of subscribed mailing lists,
4559         but keep it on the list of known mailing lists, use ``unsubscribe''.
4560       </para>
4561       
4562       <para>
4563         
4564       </para>
4565       
4566     </sect1>
4567     
4568     <sect1 id="mbox-hook">
4569       <title>Using Multiple spool mailboxes</title>
4570       
4571       <para>
4572         Usage: <madmutt-doc:hook name="mbox"/> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
4573       </para>
4574       
4575       <para>
4576         This command is used to move read messages from a specified mailbox to
4577         adifferent mailbox automatically when you quit or change folders.
4578         <emphasis>pattern</emphasis> is a regular expression specifying the
4579         mailbox to treat as a
4580         ``spool'' mailbox and <emphasis>mailbox</emphasis> specifies where mail
4581         should be saved when
4582         read.
4583       </para>
4584       
4585       <para>
4586         Unlike some of the other <emphasis>hook</emphasis> commands, only the <emphasis>
4587           first
4588         </emphasis>
4589         matching
4590         pattern is used (it is not possible to save read mail in more than a
4591         single
4592         mailbox).
4593       </para>
4594       
4595       <para>
4596         
4597       </para>
4598       
4599     </sect1>
4600     
4601     <sect1>
4602       <title>Defining mailboxes which receive mail</title>
4603
4604       <para>
4605         <madmutt-doc:cmddef name="mailboxes"> [!]filename [filename ... ]</madmutt-doc:cmddef>
4606       </para>
4607       <para>
4608         <madmutt-doc:cmddef name="unmailboxes"> [!]filename [filename ... ]</madmutt-doc:cmddef>
4609       </para>
4610  
4611       <para>
4612         This command specifies folders which can receive mail and
4613         which will be checked for new messages.  By default, the
4614         main menu status bar displays how many of these folders have
4615         new messages.
4616       </para>
4617       
4618       <para>
4619         When changing folders, pressing <emphasis>space</emphasis> will cycle
4620         through folders with new mail.
4621       </para>
4622       
4623       <para>
4624         Pressing TAB in the directory browser will bring up a menu showing the
4625         files
4626         specified by the <literal>mailboxes</literal> command, and indicate
4627         which contain new
4628         messages.  Madmutt will automatically enter this mode when invoked from
4629         the
4630         command line with the <literal>-y</literal> option.
4631       </para>
4632       
4633       <para>
4634         The ``unmailboxes'' command is used to remove a token from the list
4635         of folders which receive mail. Use ``unmailboxes *'' to remove all
4636         tokens.
4637       </para>
4638       
4639       <para>
4640         <emphasis role="bold">Note:</emphasis> new mail is detected by
4641         comparing the last modification time to
4642         the last access time.  Utilities like <literal>biff</literal> or <literal>
4643           frm
4644         </literal>
4645         or any other
4646         program which accesses the mailbox might cause Madmutt to never detect
4647         new mail
4648         for that mailbox if they do not properly reset the access time.  Backup
4649         tools are another common reason for updated access times.
4650       </para>
4651       
4652       <para>
4653         <emphasis role="bold">Note:</emphasis> the filenames in the <literal>
4654           mailboxes
4655         </literal>
4656         command are resolved when
4657         the command is executed, so if these names contain <link linkend="shortcuts">shortcuts</link>
4658         (such as ``='' and ``!''), any variable
4659         definition that affect these characters (like <madmutt-doc:varref name="folder"/>
4660         and <madmutt-doc:varref name="spoolfile"/>)
4661         should be executed before the <literal>mailboxes</literal> command.
4662       </para>
4663       
4664       <para>
4665         
4666       </para>
4667       
4668     </sect1>
4669     
4670     <sect1>
4671       <title>User defined headers</title>
4672       
4673       <para>
4674         <madmutt-doc:cmddef name="my_hdr">string</madmutt-doc:cmddef>
4675       </para>
4676       <para>
4677         <madmutt-doc:cmddef name="unmy_hdr">field [field ...]</madmutt-doc:cmddef>
4678       </para>
4679       
4680       <para>
4681         The ``my_hdr'' command allows you to create your own header
4682         fields which will be added to every message you send.
4683       </para>
4684       
4685       <para>
4686         For example, if you would like to add an ``Organization:'' header field
4687         to
4688         all of your outgoing messages, you can put the command
4689       </para>
4690       
4691       <para>
4692         <madmutt-doc:lstconf>
4693 my_hdr Organization: A Really Big Company, Anytown, USA</madmutt-doc:lstconf>
4694       </para>
4695       
4696       <para>
4697         in your <literal>.muttrc</literal>.
4698       </para>
4699       
4700       <para>
4701         <emphasis role="bold">Note:</emphasis>  space characters are <emphasis>
4702           not
4703         </emphasis>
4704         allowed between the keyword and
4705         the colon (``:'').  The standard for electronic mail (<madmutt-doc:rfc num="822"/>) says that
4706         space is illegal there, so Madmutt enforces the rule.
4707       </para>
4708       
4709       <para>
4710         If you would like to add a header field to a single message, you should
4711         either set the <madmutt-doc:varref name="edit-headers"/>
4712         variable,
4713         or use the <emphasis>edit-headers</emphasis> function (default: ``E'')
4714         in the send-menu so
4715         that you can edit the header of your message along with the body.
4716       </para>
4717       
4718       <para>
4719         To remove user defined header fields, use the ``unmy_hdr''
4720         command.  You may specify an asterisk (``*'') to remove all header
4721         fields, or the fields to remove.  For example, to remove all ``To'' and
4722         ``Cc'' header fields, you could use:
4723       </para>
4724       
4725       <para>
4726         <madmutt-doc:lstconf>
4727 unmy_hdr to cc</madmutt-doc:lstconf>
4728       </para>
4729       
4730       <para>
4731         
4732       </para>
4733       
4734     </sect1>
4735     
4736     <sect1>
4737       <title>Defining the order of headers when viewing messages</title>
4738       
4739       <para>
4740         <madmutt-doc:cmddef name="hdr_order">header header [header ...]</madmutt-doc:cmddef>
4741       </para>
4742
4743       <para>
4744         <madmutt-doc:cmddef name="unhdr_order">[ * | header header ...]</madmutt-doc:cmddef>
4745       </para>
4746  
4747       <para>
4748         With this command, you can specify an order in which mutt will attempt
4749         to present headers to you when viewing messages.
4750       </para>
4751       
4752       <para>
4753         ``unhdr_order *'' will clear all previous headers from the order
4754         list,
4755         thus removing the header order effects set by the system-wide startup
4756         file.
4757       </para>
4758       
4759       <para>
4760         
4761         <madmutt-doc:lstconf>
4762 hdr_order From Date: From: To: Cc: Subject:</madmutt-doc:lstconf>
4763         
4764       </para>
4765       
4766       <para>
4767         
4768       </para>
4769       
4770     </sect1>
4771     
4772     <sect1 id="save-hook">
4773       <title>Specify default save filename</title>
4774       
4775       <para>
4776         Usage: <madmutt-doc:hook name="save"/> [!]<emphasis>pattern</emphasis> <emphasis>filename</emphasis>
4777       </para>
4778       
4779       <para>
4780         This command is used to override the default filename used when saving
4781         messages.  <emphasis>filename</emphasis> will be used as the default
4782         filename if the message is
4783         <emphasis>From:</emphasis> an address matching <emphasis>regexp</emphasis> or if you are the author and the
4784         message is addressed <emphasis>to:</emphasis> something matching <emphasis>
4785           regexp
4786         </emphasis>
4787         .
4788       </para>
4789       
4790       <para>
4791         See <madmutt-doc:hook name="pattern"/> for information on
4792         the exact format of <emphasis>pattern</emphasis>.
4793       </para>
4794       
4795       <para>
4796         Examples:
4797       </para>
4798       
4799       <para>
4800         
4801         <madmutt-doc:lstconf>
4802 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
4803 save-hook aol\\.com$ +spam</madmutt-doc:lstconf>
4804         
4805       </para>
4806       
4807       <para>
4808         Also see the <madmutt-doc:hook name="fcc-save"/>
4809         command.
4810       </para>
4811       
4812       <para>
4813         
4814       </para>
4815       
4816     </sect1>
4817     
4818     <sect1 id="fcc-hook">
4819       <title>Specify default Fcc: mailbox when composing</title>
4820       
4821       <para>
4822         Usage: <madmutt-doc:hook name="fcc"/> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
4823       </para>
4824       
4825       <para>
4826         This command is used to save outgoing mail in a mailbox other than
4827         <madmutt-doc:varref name="record"/>. Madmutt searches the initial
4828         list of
4829         message recipients for the first matching <emphasis>regexp</emphasis>
4830         and uses <emphasis>mailbox</emphasis>
4831         as the default Fcc: mailbox.  If no match is found the message will be
4832         saved
4833         to <madmutt-doc:varref name="record"/> mailbox.
4834       </para>
4835       
4836       <para>
4837         See <madmutt-doc:hook name="pattern"/> for information on
4838         the exact format of <emphasis>pattern</emphasis>.
4839       </para>
4840       
4841       <para>
4842         Example:
4843       </para>
4844
4845       <para>
4846         <madmutt-doc:lstconf>
4847 fcc-hook [@.]aol\\.com$ +spammers</madmutt-doc:lstconf>
4848       </para>
4849       
4850       <para>
4851         The above will save a copy of all messages going to the aol.com
4852         domain to the `+spammers' mailbox by default.  Also see the
4853         <madmutt-doc:hook name="fcc-save"/> command.
4854       </para>
4855       
4856       <para>
4857         
4858       </para>
4859       
4860     </sect1>
4861     
4862     <sect1 id="fcc-save-hook">
4863       <title>Specify default save filename and default Fcc: mailbox at once</title>
4864       
4865       <para>
4866         Usage: <literal><madmutt-doc:hook name="fcc-save"/></literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
4867       </para>
4868       
4869       <para>
4870         This command is a shortcut, equivalent to doing both a <madmutt-doc:hook name="fcc"/>
4871         and a <madmutt-doc:hook name="save"/> with its arguments.
4872       </para>
4873       
4874       <para>
4875         
4876       </para>
4877       
4878     </sect1>
4879     
4880     <sect1 id="send-hook">
4881       <title>Change settings based upon message recipients</title>
4882
4883       <anchor id="reply-hook"/>
4884       <anchor id="send2-hook"/>
4885       <para>
4886         Usage: <madmutt-doc:hook name="reply"/> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
4887       </para>
4888       <para>
4889         Usage: <madmutt-doc:hook name="send"/> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
4890       </para>
4891       <para>
4892         Usage: <madmutt-doc:hook name="send2"/> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
4893       </para>
4894       
4895       <para>
4896         These commands can be used to execute arbitrary configuration commands
4897         based
4898         upon recipients of the message.  <emphasis>pattern</emphasis> is a
4899         regular expression
4900         matching the desired address.  <emphasis>command</emphasis> is executed
4901         when <emphasis>regexp</emphasis>
4902         matches recipients of the message.
4903       </para>
4904       
4905       <para>
4906         <madmutt-doc:hook name="reply"/> is matched against the message you are <emphasis>
4907           replying
4908         </emphasis>
4909         <emphasis role="bold">to</emphasis>, instead of the message you are <emphasis>
4910           sending
4911         </emphasis>
4912         .<madmutt-doc:hook name="send"/> is
4913         matched against all messages, both <emphasis>new</emphasis> and <emphasis>
4914           replies
4915         </emphasis>
4916         .<emphasis role="bold">Note:</emphasis>
4917         <madmutt-doc:hook name="reply"/>s are matched <emphasis role="bold">before</emphasis> the
4918         <madmutt-doc:hook name="send"/>, <emphasis role="bold">regardless</emphasis>
4919         of the order specified in the users's configuration file.
4920       </para>
4921       
4922       <para>
4923         <madmutt-doc:hook name="send2"/> is matched every time a message is
4924         changed, either
4925         by editing it, or by using the compose menu to change its recipients
4926         or subject.  <madmutt-doc:hook name="send2"/> is executed after <madmutt-doc:hook name="send"/>
4927         ,and
4928         can, e.g., be used to set parameters such as the <madmutt-doc:varref name="sendmail"/>
4929         variable depending on the message's sender
4930         address.
4931       </para>
4932       
4933       <para>
4934         For each type of <madmutt-doc:hook name="send"/> or <madmutt-doc:hook name="reply"/>, when multiple matches
4935         occur, commands are executed in the order they are specified in the
4936         muttrc
4937         (for that type of hook).
4938       </para>
4939       
4940       <para>
4941         See <madmutt-doc:hook name="pattern"/> for information on
4942         the exact format of <emphasis>pattern</emphasis>.
4943       </para>
4944       
4945       <para>
4946         Example: <literal>send-hook mutt &quot;set mime_forward
4947           signature=''&quot;
4948         </literal>
4949       </para>
4950       
4951       <para>
4952         Another typical use for this command is to change the values of the
4953         <madmutt-doc:varref name="attribution"/>,
4954         <madmutt-doc:varref name="signature"/> and <madmutt-doc:varref
4955           name="locale"/>
4956         variables in order to change the language of the attributions and
4957         signatures based upon the recipients.
4958       </para>
4959       
4960       <para>
4961         <emphasis role="bold">Note:</emphasis> the <madmutt-doc:hook name="send"/>'s are only
4962         executed ONCE after getting the initial
4963         list of recipients.  Adding a recipient after replying or editing the
4964         message will NOT cause any <madmutt-doc:hook name="send"/> to be executed.  Also note that
4965         my_hdr commands which modify recipient headers, or the message's
4966         subject, don't have any effect on the current message when executed
4967         from a <madmutt-doc:hook name="send"/>.
4968       </para>
4969       
4970       <para>
4971         
4972       </para>
4973       
4974     </sect1>
4975     
4976     <sect1 id="message-hook">
4977       <title>Change settings before formatting a message</title>
4978       
4979       <para>
4980         Usage: <madmutt-doc:hook name="message"/> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
4981       </para>
4982       
4983       <para>
4984         This command can be used to execute arbitrary configuration commands
4985         before viewing or formatting a message based upon information about the
4986         message.
4987         <emphasis>command</emphasis> is executed if the <emphasis>pattern</emphasis> matches the message to be
4988         displayed. When multiple matches occur, commands are executed in the
4989         order
4990         they are specified in the muttrc.
4991       </para>
4992       
4993       <para>
4994         See <madmutt-doc:hook name="pattern"/> for
4995         information on the exact format of <emphasis>pattern</emphasis>.
4996       </para>
4997       
4998       <para>
4999         Example:
5000         
5001         <madmutt-doc:lstconf>
5002 message-hook ~A 'set pager=builtin'
5003 message-hook '~f freshmeat-news' 'set pager="less \"+/^  subject:.*\""'</madmutt-doc:lstconf>
5004         
5005       </para>
5006       
5007       <para>
5008         
5009       </para>
5010       
5011     </sect1>
5012     
5013     <sect1 id="crypt-hook">
5014       <title>Choosing the cryptographic key of the recipient</title>
5015       
5016       <para>
5017         Usage: <madmutt-doc:hook name="crypt"/> <emphasis>pattern</emphasis> <emphasis>keyid</emphasis>
5018       </para>
5019       
5020       <para>
5021         When encrypting messages with PGP or OpenSSL, you may want to associate
5022         a certain
5023         key with a given e-mail address automatically, either because the
5024         recipient's public key can't be deduced from the destination address,
5025         or because, for some reasons, you need to override the key Madmutt
5026         wouldnormally use.  The <madmutt-doc:hook name="crypt"/> command provides a method by which
5027         you can
5028         specify the ID of the public key to be used when encrypting messages to
5029         a certain recipient.
5030       </para>
5031       
5032       <para>
5033         The meaning of "key id" is to be taken broadly in this context:  You
5034         can either put a numerical key ID here, an e-mail address, or even
5035         just a real name.
5036       </para>
5037       
5038       <para>
5039         
5040       </para>
5041       
5042     </sect1>
5043     
5044     <sect1>
5045       <title>Adding key sequences to the keyboard buffer</title>
5046       
5047       <para>
5048         <madmutt-doc:cmddef name="push">string</madmutt-doc:cmddef>
5049       </para>
5050       
5051       <para>
5052
5053         This command adds the named string to the keyboard buffer. The
5054         string may contain control characters, key names and function
5055         names like the sequence string in the <madmutt-doc:cmdref name="macro"/> command. You may use it to
5056         automatically run a sequence of commands at startup, or when
5057         entering certain folders. For example, the following command
5058         will automatically collapse all threads when entering a folder:
5059
5060         <madmutt-doc:lstconf>
5061 folder-hook . 'push &lt;collapse-all&gt;'</madmutt-doc:lstconf>
5062
5063       </para>
5064       
5065       <para>
5066         
5067       </para>
5068       
5069     </sect1>
5070     
5071     <sect1>
5072       <title>Executing functions</title>
5073       
5074       <para>
5075         <madmutt-doc:cmddef name="exec">function [function ... ]</madmutt-doc:cmddef>
5076       </para>
5077       
5078       <para>
5079         This command can be used to execute any function. Functions are
5080         listed in the <link linkend="functions">functions</link>.
5081         ``exec function'' is equivalent to ``push &lt;function&gt;''.
5082       </para>
5083       
5084       <para>
5085         
5086       </para>
5087       
5088     </sect1>
5089     
5090     <sect1>
5091       <title>Message Scoring</title>
5092       
5093       <para>
5094         <madmutt-doc:cmddef name="score">pattern value</madmutt-doc:cmddef>
5095       </para>
5096       <para>
5097         <madmutt-doc:cmddef name="unscore">pattern [pattern ... ]</madmutt-doc:cmddef>
5098       </para>
5099       
5100       <para>
5101         In situations where you have to cope with a lot of emails, e.g.
5102         when you read many different mailing lists, and take part in
5103         discussions, it is always useful to have the important messages
5104         marked and the annoying messages or the ones that you aren't
5105         interested in deleted. For this purpose, Madmutt features a
5106         mechanism called ``scoring''.
5107       </para>
5108       
5109       <para>
5110         When you use scoring, every message has a base score of 0. You
5111         can then use the <literal>score</literal> command to define patterns
5112         and a
5113         positive or negative value associated with it. When a pattern
5114         matches a message, the message's score will be raised or lowered by
5115         the amount of the value associated with the pattern.
5116       </para>
5117       
5118       <para>
5119         
5120         <madmutt-doc:lstconf>
5121 score "~f nion@madmutt\.org" 50
5122 score "~f @sco\.com" -100</madmutt-doc:lstconf>
5123         
5124       </para>
5125       
5126       <para>
5127         If the pattern matches, it is also possible to set the score
5128         value of the current message to a certain value and then stop
5129         evaluation:
5130       </para>
5131       
5132       <para>
5133         
5134         <madmutt-doc:lstconf>
5135 score "~f santaclaus@northpole\.int" =666</madmutt-doc:lstconf>
5136         
5137       </para>
5138       
5139       <para>
5140         What is important to note is that negative score values will be
5141         rounded up to 0.
5142       </para>
5143       
5144       <para>
5145         To make scoring actually useful, the score must be applied in
5146         some way.  That's what the <emphasis>score thresholds</emphasis> are
5147         for. Currently,
5148         there are three score thresholds:
5149       </para>
5150       
5151       <para>
5152         
5153         <itemizedlist>
5154           <listitem>
5155             
5156             <para>
5157               flag threshold: when a message has a score value equal or higher
5158               than the flag threshold, it will be flagged.
5159               
5160             </para>
5161           </listitem>
5162           <listitem>
5163             
5164             <para>
5165               read threshold: when a message has a score value equal or lower
5166               than the read threshold, it will be marked as read.
5167               
5168             </para>
5169           </listitem>
5170           <listitem>
5171             
5172             <para>
5173               delete threshold: when a message has a score value equal or
5174               lower than the delete threshold, it will be marked as deleted.
5175               
5176             </para>
5177           </listitem>
5178           
5179         </itemizedlist>
5180         
5181       </para>
5182       
5183       <para>
5184         These three thresholds can be set via the variables
5185         <madmutt-doc:varref name="score-threshold-read"/>,
5186         <madmutt-doc:varref name="score-threshold-flag"/> and
5187         <madmutt-doc:varref name="score-threshold-delete"/>.
5188       </para>
5189       <para>
5190         By default,
5191         <madmutt-doc:varref name="score-threshold-read"/> and
5192         <madmutt-doc:varref name="score-threshold-delete"/> 
5193         are set to
5194         <literal>-1</literal>, which means that in the default threshold
5195         configuration no
5196         message will ever get marked as read or deleted.
5197       </para>
5198       
5199       <para>
5200         Scoring gets especially interesting when combined with the <literal>
5201           color
5202         </literal>
5203         command
5204         and the <madmutt-doc:pattern name="n"/> pattern:
5205       </para>
5206       
5207       <para>
5208         
5209         <madmutt-doc:lstconf>
5210 color index  black   yellow  "~n 10-"
5211 color index  red     yellow  "~n 100-"</madmutt-doc:lstconf>
5212         
5213       </para>
5214       
5215       <para>
5216         The rules above mark all messages with a score between 10 and 99
5217         with black and yellow, and messages with a score greater or equal
5218         100 with red and yellow. This might be unusual to you if you're used
5219         to e.g. slrn's scoring mechanism, but it is more flexible, as it
5220         visually marks different scores.
5221       </para>
5222       
5223       <para>
5224         
5225       </para>
5226       
5227     </sect1>
5228     
5229     <sect1>
5230       <title>Spam detection</title>
5231
5232       <para>
5233         <madmutt-doc:cmddef name="spam">pattern format</madmutt-doc:cmddef>
5234       </para>
5235       <para>
5236         <madmutt-doc:cmddef name="nospam">pattern</madmutt-doc:cmddef>
5237       </para>
5238       
5239       <para>
5240         Madmutt has generalized support for external spam-scoring filters.
5241         By defining your spam patterns with the <literal>spam</literal> and <literal>
5242           nospam
5243         </literal>
5244         commands, you can <emphasis>limit</emphasis>, <emphasis>search</emphasis>, and <emphasis>
5245           sort
5246         </emphasis>
5247         your
5248         mail based on its spam attributes, as determined by the external
5249         filter. You also can display the spam attributes in your index
5250         display using the <literal>%H</literal> selector in the
5251         <madmutt-doc:varref name="index-format"/>
5252         variable. (Tip: try <literal>%?H?[%H] ?</literal>
5253         to display spam tags only when they are defined for a given message.)
5254       </para>
5255       
5256       <para>
5257         Your first step is to define your external filter's spam patterns using
5258         the <literal>spam</literal> command. <emphasis>pattern</emphasis>
5259         should be a regular expression
5260         that matches a header in a mail message. If any message in the mailbox
5261         matches this regular expression, it will receive a ``spam tag'' or
5262         ``spam attribute'' (unless it also matches a <literal>nospam</literal>
5263         pattern -- see
5264         below.) The appearance of this attribute is entirely up to you, and is
5265         governed by the <emphasis>format</emphasis> parameter. <emphasis>format</emphasis> can be any static
5266         text, but it also can include back-references from the <emphasis>
5267           pattern
5268         </emphasis>
5269         expression. (A regular expression ``back-reference'' refers to a
5270         sub-expression contained within parentheses.) <literal>%1</literal> is replaced with
5271         the first back-reference in the regex, <literal>%2</literal>
5272         with the second, etc.
5273       </para>
5274       
5275       <para>
5276         If you're using multiple spam filters, a message can have more than
5277         one spam-related header. You can define <literal>spam</literal>
5278         patterns for each
5279         filter you use. If a message matches two or more of these patterns, and
5280         the $spam_separator variable is set to a string, then the
5281         message's spam tag will consist of all the <emphasis>format</emphasis>
5282         strings joined
5283         together, with the value of $spam_separator separating
5284         them.
5285       </para>
5286       
5287       <para>
5288         For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
5289         define these spam settings:
5290         
5291         <madmutt-doc:lstconf>
5292 spam "X-DCC-.*-Metrics:.*(....)=many"         "90+/DCC-%1"
5293 spam "X-Spam-Status: Yes"                     "90+/SA"
5294 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
5295 set spam_separator=", "</madmutt-doc:lstconf>
5296         
5297       </para>
5298       
5299       <para>
5300         If I then received a message that DCC registered with ``many'' hits
5301         under the ``Fuz2'' checksum, and that PureMessage registered with a
5302         97% probability of being spam, that message's spam tag would
5303         read<literal>90+/DCC-Fuz2, 97/PM</literal>. (The four characters before
5304         ``=many'' in a
5305         DCC report indicate the checksum used -- in this case, ``Fuz2''.)
5306       </para>
5307       
5308       <para>
5309         If the $spam_separator variable is unset, then each
5310         spam pattern match supersedes the previous one. Instead of getting
5311         joined <emphasis>format</emphasis> strings, you'll get only the last
5312         one to match.
5313       </para>
5314       
5315       <para>
5316         The spam tag is what will be displayed in the index when you use
5317         <literal>%H</literal> in the <literal>
5318           $index_format
5319         </literal>
5320         variable. It's also the
5321         string that the <madmutt-doc:pattern name="H"/> pattern-matching expression
5322         matches against for
5323         <emphasis>search</emphasis> and <emphasis>limit</emphasis> functions.
5324         And it's what sorting by spam
5325         attribute will use as a sort key.
5326       </para>
5327       
5328       <para>
5329         That's a pretty complicated example, and most people's actual
5330         environments will have only one spam filter. The simpler your
5331         configuration, the more effective mutt can be, especially when it comes
5332         to sorting.
5333       </para>
5334       
5335       <para>
5336         Generally, when you sort by spam tag, mutt will sort <emphasis>
5337           lexically
5338         </emphasis>
5339         --
5340         that is, by ordering strings alphnumerically. However, if a spam tag
5341         begins with a number, mutt will sort numerically first, and lexically
5342         only when two numbers are equal in value. (This is like UNIX's
5343         <literal>sort -n</literal>.) A message with no spam attributes at all
5344         -- that is, one
5345         that didn't match <emphasis>any</emphasis> of your <literal>spam</literal> patterns -- is sorted at
5346         lowest priority. Numbers are sorted next, beginning with 0 and ranging
5347         upward. Finally, non-numeric strings are sorted, with ``a'' taking
5348         lowerpriority than ``z''. Clearly, in general, sorting by spam tags is
5349         most
5350         effective when you can coerce your filter to give you a raw number. But
5351         in case you can't, mutt can still do something useful.
5352       </para>
5353       
5354       <para>
5355         The <literal>nospam</literal> command can be used to write exceptions
5356         to <literal>spam</literal>
5357         patterns. If a header pattern matches something in a <literal>spam</literal> command,
5358         but you nonetheless do not want it to receive a spam tag, you can list
5359         amore precise pattern under a <literal>nospam</literal> command.
5360       </para>
5361       
5362       <para>
5363         If the <emphasis>pattern</emphasis> given to <literal>nospam</literal>
5364         is exactly the same as the
5365         <emphasis>pattern</emphasis> on an existing <literal>spam</literal>
5366         list entry, the effect will be to
5367         remove the entry from the spam list, instead of adding an exception.
5368         Likewise, if the <emphasis>pattern</emphasis> for a <literal>spam</literal> command matches an entry
5369         on the <literal>nospam</literal> list, that <literal>nospam</literal>
5370         entry will be removed. If the
5371         <emphasis>pattern</emphasis> for <literal>nospam</literal> is ``*'', <emphasis>
5372           all entries on both lists
5373         </emphasis>
5374         will be removed. This might be the default action if you use <literal>
5375           spam
5376         </literal>
5377         and <literal>nospam</literal> in conjunction with a <madmutt-doc:hook name="folder"/>.
5378       </para>
5379       
5380       <para>
5381         You can have as many <literal>spam</literal> or <literal>nospam</literal> commands as you like.
5382         You can even do your own primitive spam detection within mutt -- for
5383         example, if you consider all mail from <literal>MAILER-DAEMON</literal>
5384         to be spam,
5385         you can use a <literal>spam</literal> command like this:
5386       </para>
5387       
5388       <para>
5389         
5390         <madmutt-doc:lstconf>
5391 spam "^From: .*MAILER-DAEMON"       "999"</madmutt-doc:lstconf>
5392         
5393       </para>
5394       
5395       <para>
5396         
5397       </para>
5398       
5399     </sect1>
5400     
5401     <sect1>
5402       <title>Setting variables</title>
5403
5404       <para>
5405         <madmutt-doc:cmddef name="set">[no|inv]variable [=value] [variable...]</madmutt-doc:cmddef>
5406       </para>
5407       <para>
5408         <madmutt-doc:cmddef name="toggle">variable [variable ...]</madmutt-doc:cmddef>
5409       </para>
5410       <para>
5411         <madmutt-doc:cmddef name="unset">variable [variable ...]</madmutt-doc:cmddef>
5412       </para>
5413       <para>
5414         <madmutt-doc:cmddef name="reset">variable [variable ...]</madmutt-doc:cmddef>
5415       </para>
5416       
5417       <para>
5418         This command is used to set (and unset) <link linkend="variables">variables</link>. 
5419         There are four basic types of variables:
5420         boolean, number, string and quadoption.  <emphasis>boolean</emphasis>
5421         variables can be
5422         <emphasis>set</emphasis> (true) or <emphasis>unset</emphasis> (false). 
5423         <emphasis>number</emphasis> variables can be
5424         assigned a positive integer value.
5425       </para>
5426       
5427       <para>
5428         <emphasis>string</emphasis> variables consist of any number of
5429         printable characters.
5430         <emphasis>strings</emphasis> must be enclosed in quotes if they contain
5431         spaces or tabs.  You
5432         may also use the ``C'' escape sequences <emphasis role="bold">\n</emphasis> and <emphasis role="bold">
5433           \t
5434         </emphasis>
5435         for
5436         newline and tab, respectively.
5437       </para>
5438       
5439       <para>
5440         <emphasis>quadoption</emphasis> variables are used to control whether
5441         or not to be prompted
5442         for certain actions, or to specify a default action.  A value of <emphasis>
5443           yes
5444         </emphasis>
5445         will cause the action to be carried out automatically as if you had
5446         answered
5447         yes to the question.  Similarly, a value of <emphasis>no</emphasis>
5448         will cause the the
5449         action to be carried out as if you had answered ``no.''  A value of
5450         <emphasis>ask-yes</emphasis> will cause a prompt with a default answer
5451         of ``yes'' and
5452         <emphasis>ask-no</emphasis> will provide a default answer of ``no.''
5453       </para>
5454       
5455       <para>
5456         Prefixing a variable with ``no'' will unset it.  Example: <literal>set
5457           noaskbcc
5458         </literal>
5459         .
5460       </para>
5461       
5462       <para>
5463         For <emphasis>boolean</emphasis> variables, you may optionally prefix
5464         the variable name with
5465         <literal>inv</literal> to toggle the value (on or off).  This is useful
5466         when writing
5467         macros.  Example: <literal>set invsmart_wrap</literal>.
5468       </para>
5469       
5470       <para>
5471         The <literal>toggle</literal> command automatically prepends the <literal>
5472           inv
5473         </literal>
5474         prefix to all
5475         specified variables.
5476       </para>
5477       
5478       <para>
5479         The <literal>unset</literal> command automatically prepends the <literal>
5480           no
5481         </literal>
5482         prefix to all
5483         specified variables.
5484       </para>
5485       
5486       <para>
5487         Using the enter-command function in the <emphasis>index</emphasis>
5488         menu, you can query the
5489         value of a variable by prefixing the name of the variable with a
5490         question
5491         mark:
5492       </para>
5493       
5494       <para>
5495         
5496         <madmutt-doc:lstconf>
5497 set ?allow_8bit</madmutt-doc:lstconf>
5498         
5499       </para>
5500       
5501       <para>
5502         The question mark is actually only required for boolean and quadoption 
5503         variables.
5504       </para>
5505       
5506       <para>
5507         The <literal>reset</literal> command resets all given variables to the
5508         compile time
5509         defaults (hopefully mentioned in this manual). If you use the command
5510         <literal>set</literal> and prefix the variable with ``&amp;'' this has
5511         the same
5512         behavior as the reset command.
5513       </para>
5514       
5515       <para>
5516         With the <literal>reset</literal> command there exists the special
5517         variable ``all'',
5518         which allows you to reset all variables to their system defaults.
5519       </para>
5520       
5521       <para>
5522         
5523       </para>
5524       
5525     </sect1>
5526     
5527     <sect1>
5528       <title>Reading initialization commands from another file</title>
5529       
5530       <para>
5531         <madmutt-doc:cmddef name="source">filename [filename ...]</madmutt-doc:cmddef>
5532       </para>
5533       
5534       <para>
5535         This command allows the inclusion of initialization commands
5536         from other files.  For example, I place all of my aliases in
5537         <literal>~/.mail_aliases</literal> so that I can make my
5538         <literal>~/.muttrc</literal> readable and keep my aliases
5539         private.
5540       </para>
5541       
5542       <para>
5543         If the filename begins with a tilde (``~''), it will be expanded
5544         to the
5545         path of your home directory.
5546       </para>
5547       
5548       <para>
5549         If the filename ends with a vertical bar (|), then <emphasis>
5550           filename
5551         </emphasis>
5552         is
5553         considered to be an executable program from which to read input (eg.
5554         <literal>source ~/bin/myscript|</literal>).
5555       </para>
5556       
5557       <para>
5558         
5559       </para>
5560       
5561     </sect1>
5562     
5563     <sect1>
5564       <title>Removing hooks</title>
5565       
5566       <para>
5567         <madmutt-doc:cmddef name="unhook">[* | hook-type]</madmutt-doc:cmddef>
5568       </para>
5569       
5570       <para>
5571         This command permits you to flush hooks you have previously defined.
5572         You can either remove all hooks by giving the ``*'' character as an
5573         argument, or you can remove all hooks of a specific type by saying
5574         something like <literal>unhook send</literal>.
5575       </para>
5576       
5577       <para>
5578         
5579       </para>
5580       
5581     </sect1>
5582     
5583     <sect1 id="share">
5584       <title>Sharing Setups</title>
5585       
5586       <sect2 id="share-charset">
5587         <title>Character Sets</title>
5588         
5589         <para>
5590           As users may run Madmutt on different systems, the configuration
5591           must be maintained because it's likely that people want to use the
5592           setup everywhere they use Madmutt. And Madmutt tries to help where it
5593           can.
5594         </para>
5595         
5596         <para>
5597           To not produce conflicts with different character sets, Madmutt
5598           allows users to specify in which character set their configuration
5599           files are encoded. Please note that while reading the configuration
5600           files, this is only respected after the corresponding declaration
5601           appears. It's advised to put the following at the very beginning of a
5602           users madmuttrc:
5603         </para>
5604         
5605         <para>
5606           
5607           <madmutt-doc:lstconf>
5608 set config_charset = "..."</madmutt-doc:lstconf>
5609           
5610         </para>
5611         
5612         <para>
5613           and replacing the dots with the actual character set. To avoid
5614           problems while maintaining the setup, <madmutt-doc:man name="vim"/> user's may want to use
5615           modelines as show in:
5616         </para>
5617         
5618         <para>
5619           
5620           <screen>
5621 # vim:fileencoding=...:</screen>
5622           
5623         </para>
5624         
5625         <para>
5626           while, again, replacing the dots with the appropriate name. This
5627           tells <madmutt-doc:man name="vim"/> as which character set to read and save the file.
5628         </para>
5629         
5630         <para>
5631           
5632         </para>
5633         
5634       </sect2>
5635       
5636       <sect2 id="share-modularization">
5637         <title>Modularization</title>
5638         
5639         <para>
5640           ``Modularization'' means to divide the setup into several files
5641           while sorting the options or commands by topic. Especially for
5642           longer setups (e.g. with many hooks), this helps maintaining it
5643           and solving trouble.
5644         </para>
5645         
5646         <para>
5647           When using separation, setups may be, as a whole or in
5648           fractions, shared over different systems.
5649         </para>
5650         
5651         <para>
5652           
5653         </para>
5654         
5655       </sect2>
5656       
5657       <sect2 id="share-conditional">
5658         <title>Conditional parts</title>
5659         
5660         <para>
5661           When using a configuration on different systems, the user may not
5662           always have influence on how Madmutt is installed and which features
5663           it includes.
5664         </para>
5665         
5666         <para>
5667           To solve this, Madmutt contain a feature based on the ``ifdef''
5668           patch written for mutt. Its basic syntax is:
5669         </para>
5670         
5671         <para>
5672           
5673           <madmutt-doc:lstconf>
5674 ifdef &lt;item&gt; &lt;command&gt;
5675 ifndef &lt;item&gt; &lt;command&gt;</madmutt-doc:lstconf>
5676           
5677         </para>
5678         
5679         <para>
5680           ...whereby <literal>&lt;item&gt;</literal> can be one of:
5681         </para>
5682         
5683         <para>
5684           
5685           <itemizedlist>
5686             <listitem>
5687               
5688               <para>
5689                 a function name
5690                 
5691               </para>
5692             </listitem>
5693             <listitem>
5694               
5695               <para>
5696                 a variable name
5697                 
5698               </para>
5699             </listitem>
5700             <listitem>
5701               
5702               <para>
5703                 a menu name
5704                 
5705               </para>
5706             </listitem>
5707             <listitem>
5708               
5709               <para>
5710                 a feature name
5711                 
5712               </para>
5713             </listitem>
5714             
5715           </itemizedlist>
5716           
5717         </para>
5718         
5719         <para>
5720           All available functions, variables and menus are documented
5721           elsewhere in this manual but ``features'' is specific to these
5722           two commands. To test for one, prefix one of the following
5723           keywords with <literal>feature_</literal>: ncurses,
5724           slang, iconv, idn, dotlock, standalone, pop, nntp, imap, ssl,
5725           gnutls, sasl, sasl2, libesmtp, compressed, color, classic_pgp,
5726           classic_smime, gpgme, header_cache
5727         </para>
5728         
5729         <para>
5730           As an example, one can use the following in
5731           <literal>~/.madmuttrc</literal>:
5732         </para>
5733         
5734         <para>
5735           
5736           <madmutt-doc:lstconf>
5737 ifdef feature_imap 'source ~/.Madmutt/setup-imap'
5738 ifdef feature_pop  'source ~/.Madmutt/setup-pop'
5739 ifdef feature_nntp 'source ~/.Madmutt/setup-nntp'</madmutt-doc:lstconf>
5740           
5741         </para>
5742         
5743         <para>
5744           ...to only source <literal>~/.Madmutt/setup-imap</literal> if
5745           IMAP
5746           support is built in, only source <literal>~/.Madmutt/setup-pop</literal>
5747           if POP support is built in and only source
5748           <literal>~/.Madmutt/setup-nntp</literal> if NNTP support is
5749           built in.
5750         </para>
5751         
5752         <para>
5753           An example for testing for variable names can be used if users
5754           use different revisions of Madmutt whereby the older one may not
5755           have a certain variable. To test for the availability of
5756           <madmutt-doc:varref name="imap-mail-check"/>
5757           use:
5758         </para>
5759         
5760         <para>
5761           
5762           <madmutt-doc:lstconf>
5763 ifdef imap_mail_check 'set imap_mail_check = 300'</madmutt-doc:lstconf>
5764           
5765         </para>
5766         
5767         <para>
5768           Provided for completeness is the test for menu names. To set
5769           <madmutt-doc:varref name="pager-index-lines"
5770            />
5771           only if the pager
5772           menu is available, use:
5773         </para>
5774         
5775         <para>
5776           
5777           <madmutt-doc:lstconf>
5778 ifdef pager 'set pager_index_lines = 10'</madmutt-doc:lstconf>
5779           
5780         </para>
5781         
5782         <para>
5783           For completeness, too, the opposite of <literal>ifdef</literal> is
5784           provided:
5785           <literal>ifndef</literal> which only executes the command if the test
5786           fails. For
5787           example, the following two examples are equivalent:
5788         </para>
5789         
5790         <para>
5791           
5792           <madmutt-doc:lstconf>
5793 ifdef feature_ncurses 'source ~/.Madmutt/setup-ncurses'
5794 ifndef feature_ncurses 'source ~/.Madmutt/setup-slang'</madmutt-doc:lstconf>
5795           
5796         </para>
5797         
5798         <para>
5799           ...and...
5800         </para>
5801         
5802         <para>
5803           
5804           <madmutt-doc:lstconf>
5805 ifdef feature_slang 'source ~/.Madmutt/setup-slang'
5806 ifndef feature_slang 'source ~/.Madmutt/setup-ncurses'</madmutt-doc:lstconf>
5807           
5808         </para>
5809         
5810         <para>
5811           
5812         </para>
5813         
5814         <para>
5815           
5816         </para>
5817         
5818       </sect2>
5819       
5820     </sect1>
5821     
5822     <sect1 id="vars-obsolete">
5823       <title>Obsolete Variables</title>
5824       
5825       <para>
5826         In the process of ensuring and creating more consistency, many
5827         variables have been renamed and some of the old names were already
5828         removed. Please see <link linkend="sect-obsolete">sect-obsolete</link>
5829         for a complete list.
5830       </para>
5831       
5832       <para>
5833         
5834       </para>
5835       
5836       <para>
5837         
5838       </para>
5839       
5840     </sect1>
5841     
5842   </chapter>
5843   <!--}}}-->
5844   
5845   <chapter id="advanced-usage"> <!--{{{-->
5846     <title>Advanced Usage</title>
5847     
5848     <sect1 id="advanced-regexp">
5849       <title>Regular Expressions</title>
5850       
5851       <para>
5852         All string patterns in Madmutt including those in more complex
5853         <link linkend="tab-patterns">patterns</link> must be specified
5854         using regular expressions (regexp) in the ``POSIX extended'' syntax
5855         (which
5856         is more or less the syntax used by egrep and GNU awk).  For your
5857         convenience, we have included below a brief description of this syntax.
5858       </para>
5859       
5860       <para>
5861         The search is case sensitive if the pattern contains at least one upper
5862         case letter, and case insensitive otherwise. Note that ``\''
5863         must be quoted if used for a regular expression in an initialization
5864         command: ``\\''.
5865       </para>
5866       
5867       <para>
5868         A regular expression is a pattern that describes a set of strings.
5869         Regular expressions are constructed analogously to arithmetic
5870         expressions, by using various operators to combine smaller expressions.
5871       </para>
5872       
5873       <para>
5874         Note that the regular expression can be enclosed/delimited by either
5875         &quot;
5876         or ' which is useful if the regular expression includes a white-space
5877         character.  See <link linkend="configuration-syntax">muttrc-syntax</link>
5878         for more information on &quot; and ' delimiter processing.  To match a
5879         literal &quot; or ' you must preface it with \ (backslash).
5880       </para>
5881       
5882       <para>
5883         The fundamental building blocks are the regular expressions that match
5884         a single character.  Most characters, including all letters and digits,
5885         are regular expressions that match themselves.  Any metacharacter with
5886         special meaning may be quoted by preceding it with a backslash.
5887       </para>
5888       
5889       <para>
5890         The period ``.'' matches any single character.  The caret ``^''
5891         andthe dollar sign ``$'' are metacharacters that respectively
5892         match
5893         the empty string at the beginning and end of a line.
5894       </para>
5895       
5896       <para>
5897         A list of characters enclosed by ``]'' and ``]'' matches any
5898         single character in that list; if the first character of the list
5899         is a caret ``^'' then it matches any character <emphasis role="bold">
5900           not
5901         </emphasis>
5902         in the
5903         list.  For example, the regular expression <emphasis role="bold">
5904           ]0123456789]
5905         </emphasis>
5906         matches any single digit.  A range of ASCII characters may be specified
5907         by giving the first and last characters, separated by a hyphen
5908         ``-''.  Most metacharacters lose their special meaning inside
5909         lists.  To include a literal ``]'' place it first in the list.
5910         Similarly, to include a literal ``^'' place it anywhere but first.
5911         Finally, to include a literal hyphen ``-'' place it last.
5912       </para>
5913       
5914       <para>
5915         Certain named classes of characters are predefined.  Character classes
5916         consist of ``[:'', a keyword denoting the class, and ``:]''.
5917         The following classes are defined by the POSIX standard:
5918       </para>
5919       
5920       <para>
5921         <variablelist>
5922           
5923           <varlistentry>
5924             <term>[:alnum:]</term>
5925             <listitem>
5926               <para>
5927                 Alphanumeric characters.
5928               </para>
5929             </listitem>
5930           </varlistentry>
5931           <varlistentry>
5932             <term>[:alpha:]</term>
5933             <listitem>
5934               <para>
5935                 Alphabetic characters.
5936               </para>
5937             </listitem>
5938           </varlistentry>
5939           <varlistentry>
5940             <term>[:blank:]</term>
5941             <listitem>
5942               <para>
5943                 Space or tab characters.
5944               </para>
5945             </listitem>
5946           </varlistentry>
5947           <varlistentry>
5948             <term>[:cntrl:]</term>
5949             <listitem>
5950               <para>
5951                 Control characters.
5952               </para>
5953             </listitem>
5954           </varlistentry>
5955           <varlistentry>
5956             <term>[:digit:]</term>
5957             <listitem>
5958               <para>
5959                 Numeric characters.
5960               </para>
5961             </listitem>
5962           </varlistentry>
5963           <varlistentry>
5964             <term>[:graph:]</term>
5965             <listitem>
5966               <para>
5967                 Characters that are both printable and visible.  (A space is
5968                 printable,
5969                 but not visible, while an ``a'' is both.)
5970               </para>
5971             </listitem>
5972           </varlistentry>
5973           <varlistentry>
5974             <term>[:lower:]</term>
5975             <listitem>
5976               <para>
5977                 Lower-case alphabetic characters.
5978               </para>
5979             </listitem>
5980           </varlistentry>
5981           <varlistentry>
5982             <term>[:print:]</term>
5983             <listitem>
5984               <para>
5985                 Printable characters (characters that are not control
5986                 characters.)
5987               </para>
5988             </listitem>
5989           </varlistentry>
5990           <varlistentry>
5991             <term>[:punct:]</term>
5992             <listitem>
5993               <para>
5994                 Punctuation characters (characters that are not letter, digits,
5995                 control
5996                 characters, or space characters).
5997               </para>
5998             </listitem>
5999           </varlistentry>
6000           <varlistentry>
6001             <term>[:space:]</term>
6002             <listitem>
6003               <para>
6004                 Space characters (such as space, tab and formfeed, to name a
6005                 few).
6006               </para>
6007             </listitem>
6008           </varlistentry>
6009           <varlistentry>
6010             <term>[:upper:]</term>
6011             <listitem>
6012               <para>
6013                 Upper-case alphabetic characters.
6014               </para>
6015             </listitem>
6016           </varlistentry>
6017           <varlistentry>
6018             <term>[:xdigit:]</term>
6019             <listitem>
6020               <para>
6021                 Characters that are hexadecimal digits.
6022               </para>
6023             </listitem>
6024           </varlistentry>
6025         </variablelist>
6026       </para>
6027       
6028       <para>
6029         A character class is only valid in a regular expression inside the
6030         brackets of a character list.  Note that the brackets in these
6031         class names are part of the symbolic names, and must be included
6032         in addition to the brackets delimiting the bracket list.  For
6033         example, <emphasis role="bold">[[:digit:]]</emphasis> is equivalent to
6034         <emphasis role="bold">[0-9]</emphasis>.
6035       </para>
6036       
6037       <para>
6038         Two additional special sequences can appear in character lists.  These
6039         apply to non-ASCII character sets, which can have single symbols
6040         (calledcollating elements) that are represented with more than one
6041         character,
6042         as well as several characters that are equivalent for collating or
6043         sorting purposes:
6044       </para>
6045       
6046       <para>
6047         <variablelist>
6048           
6049           <varlistentry>
6050             <term>Collating Symbols</term>
6051             <listitem>
6052               <para>
6053                 A collating symbol is a multi-character collating element
6054                 enclosed in
6055                 ``[.'' and ``.]''.  For example, if ``ch'' is a
6056                 collating
6057                 element, then <emphasis role="bold">
6058                   [[.ch.]]
6059                 </emphasis>
6060                 is a regexp that matches
6061                 this collating element, while <emphasis role="bold">
6062                   [ch]
6063                 </emphasis>
6064                 is a regexp that
6065                 matches either ``c'' or ``h''.
6066               </para>
6067             </listitem>
6068           </varlistentry>
6069           <varlistentry>
6070             <term>Equivalence Classes</term>
6071             <listitem>
6072               <para>
6073                 An equivalence class is a locale-specific name for a list of
6074                 characters that are equivalent. The name is enclosed in
6075                 ``[=''
6076                 and ``=]''.  For example, the name ``e'' might be used to
6077                 represent all of ``è'' ``é'' and ``e''.  In this
6078                 case,
6079                 <emphasis role="bold">[[=e=]]</emphasis> is
6080                 a regexp that matches any of
6081                 ``è'', ``é'' and ``e''.
6082               </para>
6083             </listitem>
6084           </varlistentry>
6085         </variablelist>
6086       </para>
6087       
6088       <para>
6089         A regular expression matching a single character may be followed by one
6090         of several repetition operators:
6091       </para>
6092       
6093       <para>
6094         <variablelist>
6095           
6096           <varlistentry>
6097             <term>?</term>
6098             <listitem>
6099               <para>
6100                 The preceding item is optional and matched at most once.
6101               </para>
6102             </listitem>
6103           </varlistentry>
6104           <varlistentry>
6105             <term>*</term>
6106             <listitem>
6107               <para>
6108                 The preceding item will be matched zero or more times.
6109               </para>
6110             </listitem>
6111           </varlistentry>
6112           <varlistentry>
6113             <term>+</term>
6114             <listitem>
6115               <para>
6116                 The preceding item will be matched one or more times.
6117               </para>
6118             </listitem>
6119           </varlistentry>
6120           <varlistentry>
6121             <term>{n}</term>
6122             <listitem>
6123               <para>
6124                 The preceding item is matched exactly <emphasis>n</emphasis>
6125                 times.
6126               </para>
6127             </listitem>
6128           </varlistentry>
6129           <varlistentry>
6130             <term>{n,}</term>
6131             <listitem>
6132               <para>
6133                 The preceding item is matched <emphasis>n</emphasis> or more
6134                 times.
6135               </para>
6136             </listitem>
6137           </varlistentry>
6138           <varlistentry>
6139             <term>{,m}</term>
6140             <listitem>
6141               <para>
6142                 The preceding item is matched at most <emphasis>m</emphasis>
6143                 times.
6144               </para>
6145             </listitem>
6146           </varlistentry>
6147           <varlistentry>
6148             <term>{n,m}</term>
6149             <listitem>
6150               <para>
6151                 The preceding item is matched at least <emphasis>n</emphasis>
6152                 times, but no more than
6153                 <emphasis>m</emphasis> times.
6154               </para>
6155             </listitem>
6156           </varlistentry>
6157         </variablelist>
6158       </para>
6159       
6160       <para>
6161         Two regular expressions may be concatenated; the resulting regular
6162         expression matches any string formed by concatenating two substrings
6163         that respectively match the concatenated subexpressions.
6164       </para>
6165       
6166       <para>
6167         Two regular expressions may be joined by the infix operator
6168         ``|'';
6169         the resulting regular expression matches any string matching either
6170         subexpression.
6171       </para>
6172       
6173       <para>
6174         Repetition takes precedence over concatenation, which in turn takes
6175         precedence over alternation.  A whole subexpression may be enclosed in
6176         parentheses to override these precedence rules.
6177       </para>
6178       
6179       <para>
6180         <emphasis role="bold">Note:</emphasis> If you compile Madmutt with the
6181         GNU <emphasis>rx</emphasis> package, the
6182         following operators may also be used in regular expressions:
6183       </para>
6184       
6185       <para>
6186         <variablelist>
6187           
6188           <varlistentry>
6189             <term>\\y</term>
6190             <listitem>
6191               <para>
6192                 Matches the empty string at either the beginning or the end of
6193                 a word.
6194               </para>
6195             </listitem>
6196           </varlistentry>
6197           <varlistentry>
6198             <term>\\B</term>
6199             <listitem>
6200               <para>
6201                 Matches the empty string within a word.
6202               </para>
6203             </listitem>
6204           </varlistentry>
6205           <varlistentry>
6206             <term>\\&lt;</term>
6207             <listitem>
6208               <para>
6209                 Matches the empty string at the beginning of a word.
6210               </para>
6211             </listitem>
6212           </varlistentry>
6213           <varlistentry>
6214             <term>\\&gt;</term>
6215             <listitem>
6216               <para>
6217                 Matches the empty string at the end of a word.
6218               </para>
6219             </listitem>
6220           </varlistentry>
6221           <varlistentry>
6222             <term>\\w</term>
6223             <listitem>
6224               <para>
6225                 Matches any word-constituent character (letter, digit, or
6226                 underscore).
6227               </para>
6228             </listitem>
6229           </varlistentry>
6230           <varlistentry>
6231             <term>\\W</term>
6232             <listitem>
6233               <para>
6234                 Matches any character that is not word-constituent.
6235               </para>
6236             </listitem>
6237           </varlistentry>
6238           <varlistentry>
6239             <term>\\`</term>
6240             <listitem>
6241               <para>
6242                 Matches the empty string at the beginning of a buffer (string).
6243               </para>
6244             </listitem>
6245           </varlistentry>
6246           <varlistentry>
6247             <term>\\'</term>
6248             <listitem>
6249               <para>
6250                 Matches the empty string at the end of a buffer.
6251               </para>
6252             </listitem>
6253           </varlistentry>
6254         </variablelist>
6255       </para>
6256       
6257       <para>
6258         Please note however that these operators are not defined by POSIX, so
6259         they may or may not be available in stock libraries on various systems.
6260       </para>
6261       
6262       <para>
6263         
6264       </para>
6265       
6266     </sect1>
6267     
6268     <sect1 id="advanced-patterns">
6269       <title>Patterns</title>
6270       
6271       <para>
6272         Madmutt's pattern language provides a simple yet effective way to
6273         set up rules to match messages, e.g. for operations like tagging and
6274         scoring. A pattern consists of one or more sub-pattern, which can be
6275         logically grouped, ORed, and negated. For a complete listing of
6276         these patterns, please refer to table <link linkend="tab-patterns">patterns</link> in the Reference chapter.
6277       </para>
6278       
6279       <para>
6280         It must be noted that in this table, <literal>EXPR</literal> is
6281         a regular expression. For ranges, the forms
6282         <literal>&lt;[MAX]</literal>, <literal>&gt;&gt;[MIN]</literal>,
6283         <literal> [MIN]-</literal> and <literal>-[MAX]</literal> are
6284         also possible.
6285       </para>
6286       
6287       <sect2 id="patterns-complex">
6288         <title>Complex Patterns</title>
6289         
6290         <para>
6291           It is possible to combine several sub-patterns to a more complex
6292           pattern. The most simple possibility is to logically AND several
6293           patterns by stringing them together:
6294         </para>
6295         
6296         <para>
6297           
6298           <screen>
6299 <madmutt-doc:pattern name="s"/> 'SPAM' <madmutt-doc:pattern name="U"/></screen>
6300           
6301         </para>
6302         
6303         <para>
6304           The pattern above matches all messages that contain ``SPAM'' in
6305           the subject and are unread.
6306         </para>
6307         
6308         <para>
6309           To logical OR patterns, simply use the <literal>|</literal>
6310           operator. This one
6311           especially useful when using local groups:
6312         </para>
6313         
6314         <para>
6315           
6316           <screen>
6317 <madmutt-doc:pattern name="f"/> ("nion@madmutt\.org"|"ak@madmutt\.org"|"pdmef@madmutt\.org")
6318 (<madmutt-doc:pattern name="b"/> Madmutt|<madmutt-doc:pattern name="s"/> Madmutt)
6319 !<madmutt-doc:pattern name="x"/> '@synflood\.at'</screen>
6320           
6321         </para>
6322         
6323         <para>
6324           The first pattern matches all messages that were sent by one of
6325           the Madmutt maintainers, while the seconds pattern matches all
6326           messages that contain ``Madmutt'' in the message body or ``Madmutt''
6327           in the subject. The third pattern matches all messages that do not
6328           contain ``@synflood\.at'' in the <literal>References:</literal>
6329           header, i.e.
6330           messages that are not an (indirect) reply to one of my messages. A
6331           pattern can be logicall negated using the <literal>!</literal>
6332           operator.
6333         </para>
6334         
6335       </sect2>
6336       
6337       <sect2 sect="patterns-dates">
6338         <title>Patterns and Dates</title>
6339         
6340         <para>
6341           When using dates in patterns, the dates must be specified in a
6342           special format, i.e.  <literal>DD/MM/YYYY</literal>. If you don't
6343           specify
6344           month or year, they default to the current month or year. When using
6345           date ranges, and you specify only the minimum or the maximum, the
6346           specified date will be excluded, e.g. <literal>01/06/2005-</literal>
6347           matches
6348           against all messages <emphasis>after</emphasis> Juni 1st, 2005.
6349         </para>
6350         
6351         <para>
6352           It is also possible to use so-called ``error margins'' when
6353           specifying date ranges.  You simply specify a date, and then the
6354           error margin. This margin needs to contain the information whether
6355           it goes ``forth'' or ``back'' in time, by using <literal>+</literal>
6356           and <literal>-</literal>.
6357           Then follows a number and a unit, i.e. <literal>y</literal> for
6358           years, <literal>m</literal> for
6359           months, <literal>w</literal> for weeks and <literal>d</literal> for
6360           days. If you use the special
6361           <literal>*</literal> sign, it means that the error margin goes to
6362           both``directions'' in time.
6363         </para>
6364         
6365         <para>
6366           
6367           <screen>
6368 <madmutt-doc:pattern name="d"/> 01/01/2005+1y
6369 <madmutt-doc:pattern name="d"/> 18/10/2004-2w
6370 <madmutt-doc:pattern name="d"/> 28/12/2004*1d</screen>
6371           
6372         </para>
6373         
6374         <para>
6375           The first pattern matches all dates between January 1st, 2005 and
6376           January 1st 2006.  The second pattern matches all dates between
6377           October 18th, 2004 and October 4th 2004 (2 weeks before 18/10/2004),
6378           while the third pattern matches all dates 1 day around December
6379           28th, 2004 (i.e. Dec 27th, 28th and 29th).
6380         </para>
6381         
6382         <para>
6383           Relative dates are also very important, as they make it possible
6384           to specify date ranges between a fixed number of units and the
6385           current date. How this works can be seen in the following example:
6386         </para>
6387         
6388         <para>
6389           
6390           <screen>
6391 <madmutt-doc:pattern name="d"/> &gt;2w # messages older than two weeks
6392 <madmutt-doc:pattern name="d"/> &lt;3d # messages newer than 3 days
6393 <madmutt-doc:pattern name="d"/> =1m # messages that are exactly one month old</screen>
6394           
6395         </para>
6396         
6397         <para>
6398           
6399         </para>
6400         
6401       </sect2>
6402       
6403     </sect1>
6404     
6405     <sect1 id="formatstrings">
6406       <title>Format Strings</title>
6407       
6408       <sect2 id="formatstrings-intro">
6409         <title>Introduction</title>
6410         
6411         <para>
6412           The so called <emphasis>Format Strings</emphasis> offer great
6413           flexibility when
6414           configuring Madmutt. In short, they describe what items to print
6415           out how in menus and status messages.
6416         </para>
6417         
6418         <para>
6419           Basically, they work as this: for different menus and bars,
6420           there's a variable specifying the layout. For every item
6421           available, there is a so called <emphasis>expando</emphasis>.
6422         </para>
6423         
6424         <para>
6425           For example, when running Madmutt on different machines or
6426           different versions for testing purposes, it may be interesting to
6427           have the following information always printed on screen when one
6428           is in the index:
6429         </para>
6430         
6431         <para>
6432           
6433           <itemizedlist>
6434             <listitem>
6435               
6436               <para>
6437                 the current hostname
6438                 
6439               </para>
6440             </listitem>
6441             <listitem>
6442               
6443               <para>
6444                 the current Madmutt version number
6445                 
6446               </para>
6447             </listitem>
6448             
6449           </itemizedlist>
6450           
6451         </para>
6452         
6453         <para>
6454           The setting for the status bar of the index is controlled via the
6455           <madmutt-doc:varref name="status-format"/>
6456           variable. For the hostname and version string, there's an expando
6457           for <literal>$status_format</literal>: <literal>
6458             %h
6459           </literal>
6460           expands to the
6461           hostname and <literal>%v</literal> to the version string. When
6462           just configuring:
6463         </para>
6464         
6465         <para>
6466           
6467           <madmutt-doc:lstconf>
6468 set status_format = "%v on %h: ..."</madmutt-doc:lstconf>
6469           
6470         </para>
6471         
6472         <para>
6473           Madmutt will replace the sequence <literal>%v</literal> with
6474           the version string
6475           and <literal>%h</literal> with the host's name. When you are,
6476           for example, running
6477           Madmutt version <literal>1.5.9i</literal> on host <literal>mailhost</literal>, you'll see the
6478           following when you're in the index:
6479         </para>
6480         
6481         <para>
6482           
6483           <screen>
6484 Madmutt 1.5.9i on mailhost: ...</screen>
6485           
6486         </para>
6487         
6488         <para>
6489           In the index, there're more useful information one could want to 
6490           see:
6491         </para>
6492         
6493         <para>
6494           
6495           <itemizedlist>
6496             <listitem>
6497               
6498               <para>
6499                 which mailbox is open
6500                 
6501               </para>
6502             </listitem>
6503             <listitem>
6504               
6505               <para>
6506                 how man new, flagged or postponed messages
6507                 
6508               </para>
6509             </listitem>
6510             <listitem>
6511               
6512               <para>
6513                 ...
6514                 
6515               </para>
6516             </listitem>
6517             
6518           </itemizedlist>
6519           
6520         </para>
6521         
6522         <para>
6523           To include the mailbox' name is as easy as:
6524         </para>
6525         
6526         <para>
6527           
6528           <madmutt-doc:lstconf>
6529 set status_format = "%v on %h: %B: ...</madmutt-doc:lstconf>
6530           
6531         </para>
6532         
6533         <para>
6534           When the currently opened mailbox is <literal>Inbox</literal>, this
6535           will be expanded
6536           to:
6537         </para>
6538         
6539         <para>
6540           
6541           <screen>
6542 Madmutt 1.5.9i on mailhost: Inbox: ...</screen>
6543           
6544         </para>
6545         
6546         <para>
6547           For the number of certain types of messages, one more feature of the
6548           format
6549           strings is extremely useful. If there aren't messages of a certain
6550           type, it
6551           may not be desired to print just that there aren't any but instead
6552           only
6553           print something if there are any.
6554         </para>
6555         
6556         <para>
6557           
6558         </para>
6559         
6560       </sect2>
6561       
6562       <sect2 id="formatstrings-conditional">
6563         <title>Conditional Expansion</title>
6564         
6565         <para>
6566           To only print the number of messages if there are new messages in
6567           the current mailbox, further extend
6568           <literal>$status_format</literal> to:
6569         </para>
6570         
6571         <para>
6572           
6573           <madmutt-doc:lstconf>
6574 set status_format = "%v on %h: %B %?n?%n new? ...</madmutt-doc:lstconf>
6575           
6576         </para>
6577         
6578         <para>
6579           This feature is called <emphasis>nonzero-printing</emphasis> and
6580           works as this:
6581           some expandos may be optionally printed nonzero, i.e.  a portion
6582           of the format string is only evaluated if the value of the expando
6583           is different from zero. The basic syntax is:
6584         </para>
6585         
6586         <para>
6587           
6588           <screen>
6589 %?&lt;item&gt;?&lt;string if nonzero&gt;?</screen>
6590           
6591         </para>
6592         
6593         <para>
6594           which tells Madmutt to only look at <literal>&lt;string if
6595             nonzero&gt;
6596           </literal>
6597           if the value of the <literal>%&lt;item%gt;</literal>
6598           expando is different from zero. In our example, we used <literal>n</literal> as
6599           the expando to check for and <literal>%n new</literal> as the
6600           optional nonzero
6601           string.
6602         </para>
6603         
6604         <para>
6605           But this is not all: this feature only offers one alternative: 
6606           ``print something if not zero.'' Madmutt does, as you might guess, 
6607           also provide a logically complete version: ``if zero, print 
6608           something and else print something else.'' This is achieved by the 
6609           following syntax for those expandos which may be printed nonzero:
6610         </para>
6611         
6612         <para>
6613           
6614           <screen>
6615 %?&lt;item&gt;?&lt;string if nonzero&gt;&#38;&lt;string if zero&gt;?</screen>
6616           
6617         </para>
6618         
6619         <para>
6620           Using this we can make Madmutt to do the following:
6621         </para>
6622         
6623         <para>
6624           
6625           <itemizedlist>
6626             <listitem>
6627               
6628               <para>
6629                 make it print ``<emphasis>n</emphasis> new messages'' whereby <emphasis>
6630                   n
6631                 </emphasis>
6632                 is the
6633                 count but only if there new ones
6634                 
6635               </para>
6636             </listitem>
6637             <listitem>
6638               
6639               <para>
6640                 and make it print ``no new messages'' if there aren't any
6641                 
6642               </para>
6643             </listitem>
6644             
6645           </itemizedlist>
6646           
6647         </para>
6648         
6649         <para>
6650           The corresponding configuration is:
6651         </para>
6652         
6653         <para>
6654           
6655           <madmutt-doc:lstconf>
6656 set status_format = "%v on %h: %B: %?n?%n new messages&amp;no new messages? ...</madmutt-doc:lstconf>
6657           
6658         </para>
6659         
6660         <para>
6661           This doubles the use of the ``new messages'' string because it'll get
6662           always printed. Thus, it can be shortened to:
6663         </para>
6664         
6665         <para>
6666           
6667           <madmutt-doc:lstconf>
6668 set status_format = "%v on %h: %B: %?n?%n&amp;no? new messages ...</madmutt-doc:lstconf>
6669           
6670         </para>
6671         
6672         <para>
6673           As you might see from this rather simple example, one can create
6674           very complex but fancy status messages. Please see the reference
6675           chapter for expandos and those which may be printed nonzero.
6676         </para>
6677         
6678         <para>
6679           
6680         </para>
6681         
6682       </sect2>
6683       
6684       <sect2 id="formatstrings-padding">
6685         <title>Modifications and Padding</title>
6686         
6687         <para>
6688           Besides the information given so far, there're even more features of
6689           format strings:
6690         </para>
6691         
6692         <para>
6693           
6694           <itemizedlist>
6695             <listitem>
6696               
6697               <para>
6698                 When specifying <literal>%_&lt;item&gt;</literal>
6699                 instead of
6700                 just <literal>%&lt;item&gt;</literal>, Madmutt will
6701                 convert all
6702                 characters in the expansion of <literal>&lt;item&gt;</literal>
6703                 to
6704                 lowercase.
6705                 
6706               </para>
6707             </listitem>
6708             <listitem>
6709               
6710               <para>
6711                 When specifying <literal>%:&lt;item&gt;</literal>
6712                 instead of just
6713                 <literal>%&lt;item&gt;</literal>, Madmutt will convert
6714                 all dots in the
6715                 expansion of <literal>&lt;item&gt;</literal> to underscores
6716                 (<literal>_</literal>).
6717                 
6718               </para>
6719             </listitem>
6720             
6721           </itemizedlist>
6722           
6723         </para>
6724         
6725         <para>
6726           Also, there's a feature called <emphasis>Padding</emphasis> supplied
6727           by the
6728           following two expandos: <literal>%|X</literal> and <literal>
6729             %&gt;X
6730           </literal>
6731           .
6732         </para>
6733         
6734         <para>
6735           <variablelist>
6736             
6737             <varlistentry>
6738               <term>
6739                 <literal>%|X</literal>
6740               </term>
6741               <listitem>
6742                 <para>
6743                   When this occurs, Madmutt will fill the
6744                   rest of the line with the character <literal>X</literal>. In
6745                   our example,
6746                   filling the rest of the line with dashes is done by setting:
6747                 </para>
6748                 
6749                 <para>
6750                   
6751                   <madmutt-doc:lstconf>
6752 set status_format = "%v on %h: %B: %?n?%n&amp;no? new messages %|-"</madmutt-doc:lstconf>
6753                   
6754                 </para>
6755               </listitem>
6756             </varlistentry>
6757             <varlistentry>
6758               <term>
6759                 <literal>%&gt;X</literal>
6760               </term>
6761               <listitem>
6762                 <para>
6763                   Since the previous expando stops at
6764                   the end of line, there must be a way to fill the gap between
6765                   two items via the <literal>%&gt;X</literal> expando:
6766                   it puts as many
6767                   characters <literal>X</literal> in between two items so that
6768                   the rest of
6769                   the line will be right-justified. For example, to not put the
6770                   version string and hostname of our example on the left but on
6771                   the right and fill the gap with spaces, one might use (note
6772                   the space after <literal>%&gt;</literal>):
6773                 </para>
6774                 
6775                 <para>
6776                   
6777                   <madmutt-doc:lstconf>
6778 set status_format = "%B: %?n?%n&amp;no? new messages %&gt; (%v on %h)"</madmutt-doc:lstconf>
6779                   
6780                 </para>
6781               </listitem>
6782             </varlistentry>
6783           </variablelist>
6784         </para>
6785         
6786         <para>
6787           
6788         </para>
6789         
6790         <para>
6791           
6792         </para>
6793         
6794       </sect2>
6795       
6796     </sect1>
6797     
6798     <sect1 id="using-tags">
6799       <title>Using Tags</title>
6800       
6801       <para>
6802         Sometimes it is desirable to perform an operation on a group of
6803         messages all at once rather than one at a time.  An example might be
6804         to save messages to a mailing list to a separate folder, or to
6805         delete all messages with a given subject.  To tag all messages
6806         matching a pattern, use the tag-pattern function, which is bound to
6807         ``shift-T'' by default.  Or you can select individual messages by
6808         hand using the ``tag-message'' function, which is bound to ``t'' by
6809         default.  See <link linkend="tab-patterns">patterns</link> for Madmutt's
6810         pattern
6811         matching syntax.
6812       </para>
6813       
6814       <para>
6815         Once you have tagged the desired messages, you can use the
6816         ``tag-prefix'' operator, which is the ``;'' (semicolon) key by default.
6817         When the ``tag-prefix'' operator is used, the <emphasis role="bold">
6818           next
6819         </emphasis>
6820         operation will
6821         be applied to all tagged messages if that operation can be used in that
6822         manner.  If the <madmutt-doc:varref name="auto-tag"/>
6823         variable is set, the next operation applies to the tagged messages
6824         automatically, without requiring the ``tag-prefix''.
6825       </para>
6826       
6827       <para>
6828         In <madmutt-doc:cmdref name="macro"/> or <madmutt-doc:cmdref name="push"/> commands,
6829         you can use the ``tag-prefix-cond'' operator.  If there are no tagged
6830         messages, mutt will "eat" the rest of the macro to abort it's
6831         execution.Madmutt will stop "eating" the macro when it encounters the
6832         ``end-cond''
6833         operator;  after this operator the rest of the macro will be executed
6834         asnormal.
6835       </para>
6836       
6837       <para>
6838         
6839       </para>
6840       
6841     </sect1>
6842     
6843     <sect1 id="hooks">
6844       <title>Using Hooks</title>
6845       
6846       <para>
6847         A <emphasis>hook</emphasis> is a concept borrowed from the EMACS editor
6848         which allows you to
6849         execute arbitrary commands before performing some operation.  For
6850         example,
6851         you may wish to tailor your configuration based upon which mailbox you
6852         are
6853         reading, or to whom you are sending mail.  In the Madmutt world, a <emphasis>
6854           hook
6855         </emphasis>
6856         consists of a <link linkend="advanced-regexp">regexp</link> or
6857         <link linkend="tab-patterns">patterns</link> along with a
6858         configuration option/command.  See
6859         
6860         <itemizedlist>
6861           <listitem>
6862             
6863             <para>
6864               <madmutt-doc:hook name="folder"/>
6865             </para>
6866           </listitem>
6867           <listitem>
6868             
6869             <para>
6870               <madmutt-doc:hook name="send"/>
6871             </para>
6872           </listitem>
6873           <listitem>
6874             
6875             <para>
6876               <madmutt-doc:hook name="message"/>
6877             </para>
6878           </listitem>
6879           <listitem>
6880             
6881             <para>
6882               <madmutt-doc:hook name="save"/>
6883             </para>
6884           </listitem>
6885           <listitem>
6886             
6887             <para>
6888               <madmutt-doc:hook name="mbox"/>
6889             </para>
6890           </listitem>
6891           <listitem>
6892             
6893             <para>
6894               <madmutt-doc:hook name="fcc"/>
6895             </para>
6896           </listitem>
6897           <listitem>
6898             
6899             <para>
6900               <madmutt-doc:hook name="fcc-save"/>
6901             </para>
6902           </listitem>
6903           
6904         </itemizedlist>
6905         
6906         for specific details on each type of <emphasis>hook</emphasis>
6907         available.
6908       </para>
6909       
6910       <para>
6911         <emphasis role="bold">Note:</emphasis> if a hook changes configuration
6912         settings, these changes remain
6913         effective until the end of the current mutt session. As this is
6914         generally
6915         not desired, a default hook needs to be added before all other hooks to
6916         restore configuration defaults. Here is an example with <madmutt-doc:hook name="send"/> and
6917         the
6918         my_hdr directive:
6919       </para>
6920       
6921       <para>
6922         
6923         <madmutt-doc:lstconf>
6924 send-hook . 'unmy_hdr From:'
6925 send-hook '~C ^b@b\.b$' my-hdr from: c@c.c</madmutt-doc:lstconf>
6926         
6927       </para>
6928       
6929       <sect2 id="pattern-hook">
6930         <title>Message Matching in Hooks</title>
6931         
6932         <para>
6933           Hooks that act upon messages (<literal><madmutt-doc:hook name="send"/>, <madmutt-doc:hook name="save"/>,
6934             <madmutt-doc:hook name="fcc"/>,<madmutt-doc:hook name="message"/>
6935           </literal>
6936           )are evaluated in a slightly different manner.  For the other
6937           types of hooks, a <link linkend="advanced-regexp">regexp</link> is
6938           sufficient.  But in dealing with messages a finer grain of control is
6939           needed for matching since for different purposes you want to match
6940           different criteria.
6941         </para>
6942         
6943         <para>
6944           Madmutt allows the use of the <link linkend="tab-patterns">patterns</link>
6945           language for matching messages in hook commands.  This works in
6946           exactly the same way as it would when <emphasis>limiting</emphasis>
6947           or<emphasis>searching</emphasis> the mailbox, except that you are
6948           restricted to those
6949           operators which match information mutt extracts from the header of
6950           the message (i.e.  from, to, cc, date, subject, etc.).
6951         </para>
6952         
6953         <para>
6954           For example, if you wanted to set your return address based upon
6955           sending
6956           mail to a specific address, you could do something like:
6957           
6958           <madmutt-doc:lstconf>
6959 send-hook '~t ^me@cs\.hmc\.edu$' 'my-hdr From: Madmutt User &lt;user@host&gt;'</madmutt-doc:lstconf>
6960           
6961           which would execute the given command when sending mail to
6962           <emphasis>me@cs.hmc.edu</emphasis>.
6963         </para>
6964         
6965         <para>
6966           However, it is not required that you write the pattern to match using
6967           the
6968           full searching language.  You can still specify a simple <emphasis>
6969             regular
6970             expression
6971           </emphasis>
6972           like the other hooks, in which case Madmutt will translate your
6973           pattern into the full language, using the translation specified by
6974           the 
6975           <madmutt-doc:hook name="default"/> variable.  The
6976           pattern is translated at the time the hook is declared, so the value
6977           of 
6978           <madmutt-doc:hook name="default"/> that is in effect
6979           at that time will be used.
6980         </para>
6981         
6982         <para>
6983           
6984         </para>
6985         
6986       </sect2>
6987       
6988     </sect1>
6989     
6990     <sect1 id="sidebar">
6991       <title>Using the sidebar</title>
6992       
6993       <para>
6994         The sidebar, a feature specific to Madmutt, allows you to use a mailbox
6995         listing 
6996         which looks very similar to the ones you probably know from GUI mail
6997         clients.
6998         The sidebar lists all specified mailboxes, shows the number in each
6999         and highlights the ones with new email
7000         Use the following configuration commands:
7001         
7002         <madmutt-doc:lstconf>
7003 set sidebar_visible="yes"
7004 set sidebar_width=25</madmutt-doc:lstconf>
7005         
7006       </para>
7007       
7008       <para>
7009         If you want to specify the mailboxes you can do so with:
7010         
7011         <madmutt-doc:lstconf>
7012 set mbox='=INBOX'
7013 mailboxes INBOX \
7014 MBOX1 \
7015 MBOX2 \
7016 ...</madmutt-doc:lstconf>
7017         
7018       </para>
7019       
7020       <para>
7021         You can also specify the colors for mailboxes with new mails by using:
7022         
7023         <madmutt-doc:lstconf>
7024 color sidebar_new red black
7025 color sidebar white black</madmutt-doc:lstconf>
7026         
7027       </para>
7028       
7029       <para>
7030         Reasonable key bindings look e.g. like this:
7031         
7032         <madmutt-doc:lstconf>
7033 bind index \Cp sidebar-prev
7034 bind index \Cn sidebar-next
7035 bind index \Cb sidebar-open
7036 bind pager \Cp sidebar-prev
7037 bind pager \Cn sidebar-next
7038 bind pager \Cb sidebar-open
7039
7040 macro index B ':toggle sidebar_visible^M'
7041 macro pager B ':toggle sidebar_visible^M'</madmutt-doc:lstconf>
7042         
7043       </para>
7044       
7045       <para>
7046         You can then go up and down by pressing Ctrl-P and Ctrl-N, and 
7047         switch on and off the sidebar simply by pressing 'B'.
7048       </para>
7049       
7050       <para>
7051         
7052       </para>
7053       
7054     </sect1>
7055     
7056     <sect1 id="query">
7057       <title>External Address Queries</title>
7058       
7059       <para>
7060         Madmutt supports connecting to external directory databases such as
7061         LDAP,
7062         ph/qi, bbdb, or NIS through a wrapper script which connects to mutt
7063         using a simple interface.  Using the
7064         <madmutt-doc:varref name="query-command"/>
7065         variable, you specify the wrapper
7066         command to use.  For example:
7067       </para>
7068       
7069       <para>
7070         
7071         <madmutt-doc:lstconf>
7072 set query_command = "mutt_ldap_query.pl '%s'"</madmutt-doc:lstconf>
7073         
7074       </para>
7075       
7076       <para>
7077         The wrapper script should accept the query on the command-line.  It
7078         should return a one line message, then each matching response on a
7079         single line, each line containing a tab separated address then name
7080         thensome other optional information.  On error, or if there are no
7081         matching
7082         addresses, return a non-zero exit code and a one line error message.
7083       </para>
7084       
7085       <para>
7086         An example multiple response output:
7087         
7088         <screen>
7089 Searching database ... 20 entries ... 3 matching:
7090 me@cs.hmc.edu           Michael Elkins  mutt dude
7091 blong@fiction.net       Brandon Long    mutt and more
7092 roessler@guug.de        Thomas Roessler mutt pgp</screen>
7093         
7094       </para>
7095       
7096       <para>
7097         There are two mechanisms for accessing the query function of mutt.  One
7098         is to do a query from the index menu using the query function (default:
7099         Q).
7100         This will prompt for a query, then bring up the query menu which will
7101         list the matching responses.  From the query menu, you can select
7102         addresses to create aliases, or to mail.  You can tag multiple
7103         addressesto mail, start a new query, or have a new query appended to
7104         the current
7105         responses.
7106       </para>
7107       
7108       <para>
7109         The other mechanism for accessing the query function is for address
7110         completion, similar to the alias completion.  In any prompt for address
7111         entry, you can use the complete-query function (default: ^T) to
7112         run a
7113         query based on the current address you have typed.  Like aliases, mutt
7114         will look for what you have typed back to the last space or comma.  If
7115         there is a single response for that query, mutt will expand the address
7116         in place.  If there are multiple responses, mutt will activate the
7117         querymenu.  At the query menu, you can select one or more addresses to
7118         be
7119         added to the prompt.
7120       </para>
7121       
7122       <para>
7123         
7124       </para>
7125       
7126     </sect1>
7127     
7128     <sect1 id="mailbox-formats">
7129       <title>Mailbox Formats</title>
7130       
7131       <para>
7132         Madmutt supports reading and writing of four different mailbox formats:
7133         mbox, MMDF, MH and Maildir.  The mailbox type is autodetected, so there
7134         is no need to use a flag for different mailbox types.  When creating
7135         newmailboxes, Madmutt uses the default specified with the
7136         <madmutt-doc:varref name="mbox-type"/>
7137         variable.
7138       </para>
7139       
7140       <para>
7141         <emphasis role="bold">mbox</emphasis>.  This is the most widely used
7142         mailbox format for UNIX.  All
7143         messages are stored in a single file.  Each message has a line of the
7144         form:
7145       </para>
7146       
7147       <para>
7148         
7149         <madmutt-doc:lstmail>
7150 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST</madmutt-doc:lstmail>
7151         
7152       </para>
7153       
7154       <para>
7155         to denote the start of a new message (this is often referred to as the
7156         ``From_'' line).
7157       </para>
7158       
7159       <para>
7160         <emphasis role="bold">MMDF</emphasis>.  This is a variant of the <emphasis>
7161           mbox
7162         </emphasis>
7163         format.  Each message is
7164         surrounded by lines containing ``^A^A^A^A'' (four
7165         control-A's).
7166       </para>
7167       
7168       <para>
7169         <emphasis role="bold">MH</emphasis>. A radical departure from <emphasis>
7170           mbox
7171         </emphasis>
7172         and <emphasis>MMDF</emphasis>, a mailbox
7173         consists of a directory and each message is stored in a separate file.
7174         The filename indicates the message number (however, this is may not
7175         correspond to the message number Madmutt displays). Deleted messages
7176         arerenamed with a comma (,) prepended to the filename. <emphasis role="bold">
7177           Note:
7178         </emphasis>
7179         Mutt
7180         detects this type of mailbox by looking for either <literal>
7181           .mh_sequences
7182         </literal>
7183         or <literal>.xmhcache</literal> (needed to distinguish normal
7184         directories from MH
7185         mailboxes).
7186       </para>
7187       
7188       <para>
7189         <emphasis role="bold">Maildir</emphasis>.  The newest of the mailbox
7190         formats, used by the Qmail MTA (a
7191         replacement for sendmail).  Similar to <emphasis>MH</emphasis>, except
7192         that it adds three
7193         subdirectories of the mailbox: <emphasis>tmp</emphasis>, <emphasis>new</emphasis> and <emphasis>
7194           cur
7195         </emphasis>
7196         .Filenames
7197         for the messages are chosen in such a way they are unique, even when
7198         twoprograms are writing the mailbox over NFS, which means that no file
7199         locking
7200         is needed.
7201       </para>
7202       
7203       <para>
7204         
7205       </para>
7206       
7207     </sect1>
7208     
7209     <sect1 id="shortcuts">
7210       <title>Mailbox Shortcuts</title>
7211       
7212       <para>
7213         There are a number of built in shortcuts which refer to specific
7214         mailboxes.
7215         These shortcuts can be used anywhere you are prompted for a file or
7216         mailbox
7217         path.
7218       </para>
7219       
7220       <para>
7221         
7222         <itemizedlist>
7223           <listitem>
7224             
7225             <para>
7226               ! -- refers to your <madmutt-doc:varref name="spoolfile"/>
7227               (incoming) mailbox
7228             </para>
7229           </listitem>
7230           <listitem>
7231             
7232             <para>
7233               &gt; -- refers to your <madmutt-doc:varref name="mbox"/> file
7234             </para>
7235           </listitem>
7236           <listitem>
7237             
7238             <para>
7239               &lt; -- refers to your <madmutt-doc:varref name="record"/> file
7240             </para>
7241           </listitem>
7242           <listitem>
7243             
7244             <para>
7245               ^ -- refers to the current mailbox
7246             </para>
7247           </listitem>
7248           <listitem>
7249             
7250             <para>
7251               - or !! -- refers to the file you've last visited
7252             </para>
7253           </listitem>
7254           <listitem>
7255             
7256             <para>
7257               ~ -- refers to your home directory
7258             </para>
7259           </listitem>
7260           <listitem>
7261             
7262             <para>
7263               = or + -- refers to your <madmutt-doc:varref name="folder"/>
7264               directory
7265             </para>
7266           </listitem>
7267           <listitem>
7268             
7269             <para>
7270               @<emphasis>alias</emphasis> -- refers to the <madmutt-doc:hook name="save"/>
7271               as determined by the address of the alias
7272             </para>
7273           </listitem>
7274           
7275         </itemizedlist>
7276         
7277       </para>
7278       
7279       <para>
7280         
7281       </para>
7282       
7283     </sect1>
7284     
7285     <sect1 id="using-lists">
7286       <title>Handling Mailing Lists</title>
7287       
7288       <para>
7289         Madmutt has a few configuration options that make dealing with large
7290         amounts of mail easier.  The first thing you must do is to let Mutt
7291         know what addresses you consider to be mailing lists (technically
7292         this does not have to be a mailing list, but that is what it is most
7293         often used for), and what lists you are subscribed to.  This is
7294         accomplished through the use of the <madmutt-doc:cmdref name="lists"/>
7295         commands in your muttrc.
7296       </para>
7297       
7298       <para>
7299         Now that Madmutt knows what your mailing lists are, it can do several
7300         things, the first of which is the ability to show the name of a list
7301         through which you received a message (i.e., of a subscribed list) in
7302         the <emphasis>index</emphasis> menu display.  This is useful to
7303         distinguish between
7304         personal and list mail in the same mailbox.  In the
7305         <madmutt-doc:varref name="index-format"/>
7306         variable, the escape ``%L''
7307         will return the string ``To &lt;list&gt;'' when ``list'' appears in the
7308         ``To'' field, and ``Cc &lt;list&gt;'' when it appears in the ``Cc''
7309         field (otherwise it returns the name of the author).
7310       </para>
7311       
7312       <para>
7313         Often times the ``To'' and ``Cc'' fields in mailing list messages
7314         tend to get quite large. Most people do not bother to remove the
7315         author of the message they are reply to from the list, resulting in
7316         two or more copies being sent to that person.  The ``list-reply''
7317         function, which by default is bound to ``L'' in the <emphasis>index</emphasis> menu
7318         and <emphasis>pager</emphasis>, helps reduce the clutter by only
7319         replying to the
7320         known mailing list addresses instead of all recipients (except as
7321         specified by <literal>Mail-Followup-To</literal>, see below).
7322       </para>
7323       
7324       <para>
7325         Madmutt also supports the <literal>Mail-Followup-To</literal> header. 
7326         When you send
7327         a message to a list of recipients which includes one or several
7328         subscribed mailing lists, and if the <madmutt-doc:varref name="followup-to"/>
7329         option is set, mutt will generate
7330         a Mail-Followup-To header which contains all the recipients to whom
7331         you send this message, but not your address. This indicates that
7332         group-replies or list-replies (also known as ``followups'') to this
7333         message should only be sent to the original recipients of the
7334         message, and not separately to you - you'll receive your copy through
7335         one of the mailing lists you are subscribed to.
7336       </para>
7337       
7338       <para>
7339         Conversely, when group-replying or list-replying to a message which
7340         has a <literal>Mail-Followup-To</literal> header, mutt will respect
7341         this header if
7342         the <madmutt-doc:varref name="honor-followup-to"/>
7343         configuration
7344         variable is set.  Using list-reply will in this case also make sure
7345         that the reply goes to the mailing list, even if it's not specified
7346         in the list of recipients in the <literal>Mail-Followup-To</literal>.
7347       </para>
7348       
7349       <para>
7350         Note that, when header editing is enabled, you can create a
7351         <literal>Mail-Followup-To</literal> header manually.  Madmutt will only
7352         auto-generate
7353         this header if it doesn't exist when you send the message.
7354       </para>
7355       
7356       <para>
7357         The other method some mailing list admins use is to generate a
7358         ``Reply-To'' field which points back to the mailing list address rather
7359         than the author of the message.  This can create problems when trying
7360         to reply directly to the author in private, since most mail clients
7361         will automatically reply to the address given in the ``Reply-To''
7362         field.  Madmutt uses the <madmutt-doc:varref name="reply-to"/>
7363         variable to help decide which address to use.  If set to <emphasis>
7364           ask-yes
7365         </emphasis>
7366         or
7367         <emphasis>ask-no</emphasis>, you will be
7368         prompted as to whether or not you would like to use the address given
7369         inthe ``Reply-To'' field, or reply directly to the address given in the
7370         ``From'' field.  When set to <emphasis>yes</emphasis>, the ``Reply-To''
7371         field will be used when
7372         present.
7373       </para>
7374       
7375       <para>
7376         The ``X-Label:'' header field can be used to further identify mailing
7377         lists or list subject matter (or just to annotate messages
7378         individually).  The <madmutt-doc:varref name="index-format"/>
7379         variable's ``%y'' and
7380         ``%Y'' escapes can be used to expand ``X-Label:'' fields in the
7381         index, and Madmutt's pattern-matcher can match regular expressions to
7382         ``X-Label:'' fields with the ``<madmutt-doc:pattern name="y"/>'' selector.  ``X-Label:'' is
7383         not a
7384         standard message header field, but it can easily be inserted by
7385         procmailand other mail filtering agents.
7386       </para>
7387       
7388       <para>
7389         Lastly, Madmutt has the ability to <link linkend="sort">sort</link> the
7390         mailbox into
7391         <link linkend="threads">threads</link>.  A thread is a group of
7392         messages which all relate to the same
7393         subject.  This is usually organized into a tree-like structure where a
7394         message and all of its replies are represented graphically.  If you've
7395         ever
7396         used a threaded news client, this is the same concept.  It makes
7397         dealingwith large volume mailing lists easier because you can easily
7398         delete
7399         uninteresting threads and quickly find topics of value.
7400       </para>
7401       
7402       <para>
7403         
7404       </para>
7405       
7406     </sect1>
7407     
7408     <sect1 id="editing-threads">
7409       <title>Editing threads</title>
7410       
7411       <para>
7412         Madmutt has the ability to dynamically restructure threads that are
7413         broken
7414         either by misconfigured software or bad behavior from some
7415         correspondents. This allows to clean your mailboxes formats) from these
7416         annoyances which make it hard to follow a discussion.
7417       </para>
7418       
7419       <sect2 id="editing-threads-link">
7420         <title>Linking threads</title>
7421         
7422         <para>
7423           Some mailers tend to "forget" to correctly set the "In-Reply-To:" and
7424           "References:" headers when replying to a message. This results in
7425           broken
7426           discussions because Madmutt has not enough information to guess the
7427           correct
7428           threading.
7429           You can fix this by tagging the reply, then moving to the parent
7430           message
7431           and using the ``link-threads'' function (bound to &#38; by default).
7432           The
7433           reply will then be connected to this "parent" message.
7434         </para>
7435         
7436         <para>
7437           You can also connect multiple children at once, tagging them and
7438           using the
7439           tag-prefix command (';') or the auto_tag option.
7440         </para>
7441         
7442       </sect2>
7443       
7444       <sect2 id="editing-threads-break">
7445         <title>Breaking threads</title>
7446         
7447         <para>
7448           On mailing lists, some people are in the bad habit of starting a new
7449           discussion by hitting "reply" to any message from the list and
7450           changing
7451           the subject to a totally unrelated one.
7452           You can fix such threads by using the ``break-thread'' function
7453           (boundby default to #), which will turn the subthread starting
7454           from the
7455           current message into a whole different thread.
7456         </para>
7457         
7458         <para>
7459           
7460         </para>
7461         
7462       </sect2>
7463       
7464     </sect1>
7465     
7466     <sect1 id="dsn">
7467       <title>Delivery Status Notification (DSN) Support</title>
7468       
7469       <para>
7470         <madmutt-doc:rfc num="1894"/> defines a set of MIME content types for relaying information
7471         about the status of electronic mail messages.  These can be thought of
7472         as
7473         ``return receipts.''
7474       </para>
7475       
7476       <para>
7477         Users can make use of it in one of the following two ways:
7478       </para>
7479       
7480       <para>
7481         
7482         <itemizedlist>
7483           <listitem>
7484             
7485             <para>
7486               Berkeley sendmail 8.8.x currently has some command line options
7487               in which the mail client can make requests as to what type of
7488               status
7489               messages should be returned.
7490             </para>
7491           </listitem>
7492           <listitem>
7493             
7494             <para>
7495               The SMTP support via libESMTP supports it, too.
7496             </para>
7497           </listitem>
7498           
7499         </itemizedlist>
7500         
7501       </para>
7502       
7503       <para>
7504         To support this, there are two variables:
7505       </para>
7506       
7507       <para>
7508         
7509         <itemizedlist>
7510           <listitem>
7511             
7512             <para>
7513               <madmutt-doc:varref name="dsn-notify"/> is used
7514               to request receipts for different results (such as failed
7515               message,message delivered, etc.).
7516               
7517             </para>
7518           </listitem>
7519           <listitem>
7520             
7521             <para>
7522               <madmutt-doc:varref name="dsn-return"/> requests
7523               how much of your message should be returned with the receipt
7524               (headers or full message).
7525               
7526             </para>
7527           </listitem>
7528           
7529         </itemizedlist>
7530         
7531       </para>
7532       
7533       <para>
7534         Please see the reference chapter for possible values.
7535       </para>
7536       
7537       <para>
7538         
7539       </para>
7540       
7541     </sect1>
7542     
7543     <sect1 id="pop3">
7544       <title>POP3 Support (OPTIONAL)</title>
7545       
7546       <para>
7547         If Madmutt was compiled with POP3 support (by running the <emphasis>
7548           configure
7549         </emphasis>
7550         script with the <emphasis>--enable-pop</emphasis> flag), it has the
7551         ability to work
7552         with mailboxes located on a remote POP3 server and fetch mail for local
7553         browsing.
7554       </para>
7555       
7556       <para>
7557         You can access the remote POP3 mailbox by selecting the folder
7558         <literal>pop://popserver/</literal>.
7559       </para>
7560       
7561       <para>
7562         You can select an alternative port by specifying it with the server,
7563         i.e.:
7564         <literal>pop://popserver:port/</literal>.
7565       </para>
7566       
7567       <para>
7568         You can also specify different username for each folder, i.e.:
7569         <literal>pop://username@popserver[:port]/</literal>.
7570       </para>
7571       
7572       <para>
7573         Polling for new mail is more expensive over POP3 than locally. For this
7574         reason the frequency at which Madmutt will check for mail remotely can
7575         be
7576         controlled by the
7577         <madmutt-doc:varref name="pop-mail-check"/>
7578         variable, which defaults to every 60 seconds.
7579       </para>
7580       
7581       <para>
7582         If Madmutt was compiled with SSL support (by running the <emphasis>
7583           configure
7584         </emphasis>
7585         script with the <emphasis>--with-ssl</emphasis> flag), connections to
7586         POP3 servers
7587         can be encrypted. This naturally requires that the server supports
7588         SSL encrypted connections. To access a folder with POP3/SSL, you should
7589         use pops: prefix, ie:
7590         <literal>pops://[username@]popserver[:port]/</literal>.
7591       </para>
7592       
7593       <para>
7594         Another way to access your POP3 mail is the <emphasis>fetch-mail</emphasis> function
7595         (default: G).  It allows to connect to <link
7596           linkend="pop-host">pop-host</link>
7597         ,fetch all your new mail and place it in the
7598         local <madmutt-doc:varref name="spoolfile"/>.  After this
7599         point, Madmutt runs exactly as if the mail had always been local.
7600       </para>
7601       
7602       <para>
7603         <emphasis role="bold">Note:</emphasis> If you only need to fetch all
7604         messages to local mailbox
7605         you should consider using a specialized program, such as
7606         <madmutt-doc:man name="fetchmail"/>.
7607       </para>
7608       
7609       <para>
7610         
7611       </para>
7612       
7613     </sect1>
7614     
7615     <sect1 id="imap">
7616       <title>IMAP Support (OPTIONAL)</title>
7617       
7618       <para>
7619         If Madmutt was compiled with IMAP support (by running the
7620         <emphasis>configure</emphasis> script with the
7621         <emphasis>--enable-imap</emphasis> flag), it has the
7622         ability to work with folders located on a remote IMAP server.
7623       </para>
7624       
7625       <para>
7626         You can access the remote inbox by selecting the folder via its
7627         URL:
7628       </para>
7629
7630       <para>
7631         <screen>
7632 imap://imapserver/INBOX</screen>
7633       </para>
7634
7635       <para>
7636         where <literal>imapserver</literal> is the name of the IMAP
7637         server and <literal>INBOX</literal> is the special name for your
7638         spool mailbox on the IMAP server. If you want to access another
7639         mail folder at the IMAP server, you should use
7640       </para>
7641
7642       <para>
7643         <screen>
7644 imap://imapserver/path/to/folder</screen>
7645       </para>
7646         
7647       <para>
7648         where <literal>path/to/folder</literal> is the path
7649         of the folder you want to access. You can select an alternative
7650         port by specifying it with the server, i.e.:
7651       </para>
7652
7653       <para>
7654         <screen>
7655 imap://imapserver:port/INBOX</screen>
7656       </para>
7657       
7658       <para>
7659         You can also specify different username for each folder by
7660         prenpending your username and an @ symbol to the server's name.
7661       </para>
7662       
7663       <para>
7664         If Madmutt was compiled with SSL support (by running the <emphasis>
7665           configure
7666         </emphasis>
7667         script with the <emphasis>--with-ssl</emphasis> flag), connections to
7668         IMAP servers
7669         can be encrypted. This naturally requires that the server supports
7670         SSL encrypted connections. To access a folder with IMAP/SSL, you only
7671         need to substitute the initial <literal>imap://</literal> by
7672         <literal>imaps://</literal> in the above examples.
7673       </para>
7674       
7675       <para>
7676         Note that not all servers use / as the hierarchy separator.  Madmutt
7677         should
7678         correctly notice which separator is being used by the server and
7679         convertpaths accordingly.
7680       </para>
7681       
7682       <para>
7683         When browsing folders on an IMAP server, you can toggle whether to look
7684         at only the folders you are subscribed to, or all folders with the
7685         <emphasis>toggle-subscribed</emphasis> command.  See also the 
7686         <madmutt-doc:varref name="imap-list-subscribed"/>
7687         variable.
7688       </para>
7689       
7690       <para>
7691         Polling for new mail on an IMAP server can cause noticeable delays. So,
7692         you'll
7693         want to carefully tune the
7694         <madmutt-doc:varref name="imap-mail-check"/>
7695         and
7696         <madmutt-doc:varref name="timeout"/>
7697         variables.
7698       </para>
7699       
7700       <para>
7701         Note that if you are using mbox as the mail store on UW servers prior
7702         tov12.250, the server has been reported to disconnect a client if
7703         another client
7704         selects the same folder.
7705       </para>
7706       
7707       <sect2 id="imap-browser">
7708         <title>The Folder Browser</title>
7709         
7710         <para>
7711           As of version 1.2, mutt supports browsing mailboxes on an IMAP
7712           server. This is mostly the same as the local file browser, with the
7713           following differences:
7714           
7715           <itemizedlist>
7716             <listitem>
7717               
7718               <para>
7719                 Instead of file permissions, mutt displays the string "IMAP",
7720                 possibly followed by the symbol "+", indicating
7721                 that the entry contains both messages and subfolders. On
7722                 Cyrus-like servers folders will often contain both messages and
7723                 subfolders. 
7724               </para>
7725             </listitem>
7726             <listitem>
7727               
7728               <para>
7729                 For the case where an entry can contain both messages and
7730                 subfolders, the selection key (bound to <literal>enter</literal> by default)
7731                 will choose to descend into the subfolder view. If you wish to
7732                 view
7733                 the messages in that folder, you must use <literal>view-file</literal> instead
7734                 (bound to <literal>space</literal> by default).
7735               </para>
7736             </listitem>
7737             <listitem>
7738               
7739               <para>
7740                 You can create, delete and rename mailboxes with the
7741                 <literal>create-mailbox</literal>, <literal>delete-mailbox</literal>, and
7742                 <literal>rename-mailbox</literal> commands (default bindings: <literal>
7743                   C
7744                 </literal>
7745                 ,
7746                 <literal>d</literal> and <literal>r</literal>, respectively).
7747                 You may also
7748                 <literal>subscribe</literal> and <literal>unsubscribe</literal>
7749                 to mailboxes (normally
7750                 these are bound to <literal>s</literal> and <literal>u</literal>, respectively).
7751               </para>
7752             </listitem>
7753             
7754           </itemizedlist>
7755           
7756         </para>
7757         
7758       </sect2>
7759       
7760       <sect2 id="imap-auth">
7761         <title>Authentication</title>
7762         
7763         <para>
7764           Madmutt supports four authentication methods with IMAP servers: SASL,
7765           GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
7766           NTLM authentication for you poor exchange users out there, but it has
7767           yet to be integrated into the main tree). There is also support for
7768           the pseudo-protocol ANONYMOUS, which allows you to log in to a public
7769           IMAP server without having an account. To use ANONYMOUS, simply make
7770           your username blank or "anonymous".
7771         </para>
7772         
7773         <para>
7774           SASL is a special super-authenticator, which selects among several
7775           protocols
7776           (including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most
7777           secure
7778           method available on your host and the server. Using some of these
7779           methods
7780           (including DIGEST-MD5 and possibly GSSAPI), your entire session will
7781           be
7782           encrypted and invisible to those teeming network snoops. It is the
7783           best
7784           option if you have it. To use it, you must have the Cyrus SASL
7785           libraryinstalled on your system and compile mutt with the <emphasis>
7786             --with-sasl
7787           </emphasis>
7788           flag.
7789         </para>
7790         
7791         <para>
7792           Madmutt will try whichever methods are compiled in and available on
7793           the server,
7794           in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.
7795         </para>
7796         
7797         <para>
7798           There are a few variables which control authentication: 
7799           
7800           <itemizedlist>
7801             <listitem>
7802               
7803               <para>
7804                 <madmutt-doc:varref name="imap-user"/> - controls
7805                 the username under which you request authentication on the IMAP
7806                 server,
7807                 for all authenticators. This is overridden by an explicit
7808                 username in
7809                 the mailbox path (i.e. by using a mailbox name of the form
7810                 <literal>{user@host}</literal>).
7811               </para>
7812             </listitem>
7813             <listitem>
7814               
7815               <para>
7816                 <madmutt-doc:varref name="imap-pass"/> - a
7817                 password which you may preset, used by all authentication
7818                 methods where
7819                 a password is needed.
7820               </para>
7821             </listitem>
7822             <listitem>
7823               
7824               <para>
7825                 <madmutt-doc:varref name="imap-authenticators"/>
7826                 - a colon-delimited list of IMAP
7827                 authentication methods to try, in the order you wish to try
7828                 them. If
7829                 specified, this overrides mutt's default (attempt everything,
7830                 in the order
7831                 listed above).
7832               </para>
7833             </listitem>
7834             
7835           </itemizedlist>
7836           
7837         </para>
7838         
7839         <para>
7840           
7841         </para>
7842         
7843       </sect2>
7844       
7845     </sect1>
7846     
7847     <sect1 id="nntp">
7848       <title>NNTP Support (OPTIONAL)</title>
7849       
7850       <para>
7851         If compiled with ``--enable-nntp'' option, Madmutt can read news from
7852         a newsserver via NNTP.  You can open a newsgroup with the
7853         ``change-newsgroup'' function from the index/pager which is by default
7854         bound to <madmutt-doc:key>i</madmutt-doc:key>.
7855       </para>
7856       
7857       <para>
7858         The Default newsserver can be obtained from the <madmutt-doc:envvar name="NNTPSERVER"/>
7859         environment variable. Like other
7860         news readers,
7861         info about subscribed newsgroups is saved in a file as specified by the
7862         <madmutt-doc:varref name="nntp-newsrc"/> variable.
7863         Article headers are cached and can be loaded from a file when a
7864         newsgroup is entered instead loading from newsserver; currently, this
7865         caching mechanism still is different from the header caching for
7866         maildir/IMAP.
7867       </para>
7868       
7869       <sect2 id="nntp-scoring">
7870         <title>Again: Scoring</title>
7871         
7872         <para>
7873           Especially for Usenet, people often ask for advanced filtering
7874           and scoring functionality. Of course, Madmutt has scoring and
7875           allows a killfile, too. How to use a killfile has been discussed
7876           in <link linkend="command-score">Message Scoring</link>.
7877         </para>
7878         
7879         <para>
7880           What has not been discusses in detail is Madmutt's built-in
7881           realname filter. For may newsreaders including those for
7882           ``advanced users'' like <emphasis>slrn</emphasis> or <emphasis>tin</emphasis>, there are frequent
7883           request for such functionality. The solutions offered often are
7884           complicated regular expressions.
7885         </para>
7886         
7887         <para>
7888           In Madmutt this is as easy as
7889         </para>
7890         
7891         <para>
7892           
7893           <madmutt-doc:lstconf>
7894 score ~* =42</madmutt-doc:lstconf>
7895           
7896         </para>
7897         
7898         <para>
7899           This tells Madmutt to apply a score of 42 to all messages whose
7900           sender specified a valid realname and a valid email address. Using
7901         </para>
7902         
7903         <para>
7904           
7905           <madmutt-doc:lstconf>
7906 score !~* =42</madmutt-doc:lstconf>
7907           
7908         </para>
7909         
7910         <para>
7911           on the contrary applies a score of 42 to all messages <emphasis>not</emphasis>
7912           matching those criteria which are very strict:
7913         </para>
7914         
7915         <para>
7916           
7917           <itemizedlist>
7918             <listitem>
7919               
7920               <para>
7921                 Email addresses must be valid according to <madmutt-doc:rfc num="2822"/>
7922               </para>
7923             </listitem>
7924             <listitem>
7925               
7926               <para>
7927                 the name must consist of at least 2 fields whereby a field
7928                 must not end in a dot. This means that ``Joe User'' and ``Joe
7929                 A.User'' are valid while ``J. User'' and ``J. A. User'' aren't.
7930                 
7931               </para>
7932             </listitem>
7933             <listitem>
7934               
7935               <para>
7936                 it's assumed that users are interested in reading their
7937                 own mail and mail from people who they have defined an alias
7938                 forso that those 2 groups of messages are excluded from the
7939                 strict
7940                 rules.
7941                 
7942               </para>
7943             </listitem>
7944             
7945           </itemizedlist>
7946           
7947         </para>
7948         
7949         <para>
7950           
7951         </para>
7952         
7953         <para>
7954           
7955         </para>
7956         
7957       </sect2>
7958       
7959     </sect1>
7960     
7961     <sect1 id="smtp">
7962       <title>SMTP Support (OPTIONAL)</title>
7963       
7964       <para>
7965         Madmutt can be built using a library called ``libESMTP'' which
7966         provides SMTP functionality. When <literal>configure</literal> was
7967         called with
7968         <literal>--with-libesmtp</literal> or the output <literal>madmutt -v</literal> contains
7969         <literal>+USE_LIBESMTP</literal>, this will be or is the case
7970         already. The SMTP
7971         support includes support for Delivery Status Notification
7972         (see <link linkend="dsn">dsn</link> section) as well as
7973         handling the <literal>8BITMIME</literal> flag controlled via
7974         <madmutt-doc:varref name="use-8bitmime"/>.
7975       </para>
7976       
7977       <para>
7978         To enable sending mail directly via SMTP without an MTA such as
7979         Postfix or SSMTP and the like, simply set the <madmutt-doc:varref name="smtp-host"/>
7980         variable pointing to your SMTP server.
7981       </para>
7982       
7983       <para>
7984         Authentication mechanisms are available via the <madmutt-doc:varref name="smtp-user"/>
7985         and <madmutt-doc:varref name="smtp-pass"/> variables.
7986       </para>
7987       
7988       <para>
7989         Transport Encryption via the StartTLS command is also available. For
7990         this to work, first of all Madmutt must be built with SSL or GNUTLS.
7991         Secondly, the <madmutt-doc:varref name="smtp-use-tls"/> variable
7992         must be either set
7993         to ``enabled'' or ``required.'' In both cases, StartTLS will be used if
7994         the server supports it: for the second case, the connection will fail
7995         ifit doesn't while switching back to unencrypted communication for the
7996         first one.
7997       </para>
7998       
7999       <para>
8000         Some mail providers require user's to set a particular envelope
8001         sender, i.e. they allow for only one value which may not be what the
8002         user wants to send as the <literal>From:</literal> header. In this
8003         case, the variable
8004         <madmutt-doc:varref name="smtp-envelope"/> may be used
8005         to set the envelope different from the <literal>From:</literal> header.
8006       </para>
8007       
8008     </sect1>
8009     
8010     <sect1 id="account-hook">
8011       <title>Managing multiple IMAP/POP/NNTP accounts (OPTIONAL)</title>
8012       
8013       <para>
8014         If you happen to have accounts on multiple IMAP and/or POP servers,
8015         you may find managing all the authentication settings inconvenient and
8016         error-prone.  The <madmutt-doc:hook name="account"/> command may help. This hook works like
8017         <madmutt-doc:hook name="folder"/> but is invoked whenever you access a remote mailbox
8018         (including inside the folder browser), not just when you open the
8019         mailbox.
8020       </para>
8021       
8022       <para>
8023         Some examples:
8024       </para>
8025       
8026       <para>
8027         
8028         <madmutt-doc:lstconf>
8029 account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
8030 account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
8031 account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'</madmutt-doc:lstconf>
8032         
8033       </para>
8034       
8035       <para>
8036         
8037       </para>
8038       
8039     </sect1>
8040     
8041     <sect1 id="urlview">
8042       <title>Start a WWW Browser on URLs (EXTERNAL)</title>
8043       
8044       <para>
8045         If a message contains URLs (<emphasis>unified resource locator</emphasis> = address in the
8046         WWW space like <emphasis>http://www.mutt.org/</emphasis>), it is
8047         efficient to get
8048         a menu with all the URLs and start a WWW browser on one of them.  This
8049         functionality is provided by the external urlview program which can be
8050         retrieved at <madmutt-doc:web url="ftp://ftp.mutt.org/mutt/contrib/"/>
8051         and the configuration commands:
8052         
8053         <madmutt-doc:lstconf>
8054 macro index \cb |urlview\n
8055 macro pager \cb |urlview\n</madmutt-doc:lstconf>
8056         
8057       </para>
8058       
8059       <para>
8060         
8061       </para>
8062       
8063     </sect1>
8064     
8065     <sect1 id="compressed-folders">
8066       <title>Compressed folders Support (OPTIONAL)</title>
8067       
8068       <para>
8069         If Madmutt was compiled with compressed folders support (by running the
8070         <emphasis>configure</emphasis> script with the <emphasis>
8071           --enable-compressed
8072         </emphasis>
8073         flag), Mutt
8074         can open folders stored in an arbitrary format, provided that the user
8075         has a script to convert from/to this format to one of the accepted.
8076       </para>
8077       
8078       <para>
8079         The most common use is to open compressed archived folders e.g. with
8080         gzip.
8081       </para>
8082       
8083       <para>
8084         In addition, the user can provide a script that gets a folder in an
8085         accepted format and appends its context to the folder in the
8086         user-defined format, which may be faster than converting the entire
8087         folder to the accepted format, appending to it and converting back to
8088         the user-defined format.
8089       </para>
8090       
8091       <para>
8092         There are three hooks defined (<madmutt-doc:hook name="open"/>,
8093         <madmutt-doc:hook name="close"/> and <madmutt-doc:hook name="append"/>
8094         )which define commands to uncompress and compress
8095         a folder and to append messages to an existing compressed folder 
8096         respectively.
8097       </para>
8098       
8099       <para>
8100         For example:
8101       </para>
8102       
8103       <para>
8104         
8105         <madmutt-doc:lstconf>
8106 open-hook \\.gz$ "gzip -cd %f &gt; %t" 
8107 close-hook \\.gz$ "gzip -c %t &gt; %f"
8108 append-hook \\.gz$ "gzip -c %t &gt;&gt; %f" </madmutt-doc:lstconf>
8109         
8110       </para>
8111       
8112       <para>
8113         You do not have to specify all of the commands. If you omit <madmutt-doc:hook name="append"/>
8114         ,the folder will be open and
8115         closed again each time you will add to it. If you omit <madmutt-doc:hook name="close"/>
8116         (or give empty command) , the
8117         folder will be open in the  mode. If you specify <madmutt-doc:hook name="append"/>
8118         though you'll be able to append
8119         to the folder.
8120       </para>
8121       
8122       <para>
8123         Note that Madmutt will only try to use hooks if the file is not in one
8124         of
8125         the accepted formats. In particular, if the file is empty, mutt
8126         supposes it is not compressed. This is important because it allows the
8127         use of programs that do not have well defined extensions. Just use
8128         &quot;.&quot; as a regexp. But this may be surprising if your
8129         compressing script produces empty files. In this situation, unset
8130         <madmutt-doc:varref name="save-empty"/>
8131         ,so that the compressed file
8132         will be removed if you delete all of the messages.
8133       </para>
8134       
8135       <sect2 id="open-hook">
8136         <title>Open a compressed mailbox for reading</title>
8137         
8138         <para>
8139           Usage: <madmutt-doc:hook name="open"/> <emphasis>regexp</emphasis> &quot;<emphasis>command</emphasis>&quot;
8140         </para>
8141         
8142         <para>
8143           The <emphasis>command</emphasis> is the command that can be used for
8144           opening the
8145           folders whose names match <emphasis>regexp</emphasis>.
8146         </para>
8147         
8148         <para>
8149           The <emphasis>command</emphasis> string is the printf-like format
8150           string, and it
8151           should accept two parameters: %f, which is replaced with the
8152           (compressed) folder name, and %t which is replaced with the
8153           name of the temporary folder to which to write.
8154         </para>
8155         
8156         <para>
8157           %f and %t can be repeated any number of times in the
8158           command string, and all of the entries are replaced with the
8159           appropriate folder name. In addition, %% is replaced by
8160           %, as in printf, and any other %anything is left as is.
8161         </para>
8162         
8163         <para>
8164           The <emphasis>command</emphasis> should <emphasis role="bold">not</emphasis> remove the original compressed file.
8165           The <emphasis>command</emphasis> should return non-zero exit status
8166           if it fails, so
8167           mutt knows something's wrong.
8168         </para>
8169         
8170         <para>
8171           Example:
8172         </para>
8173         
8174         <para>
8175           
8176           <madmutt-doc:lstconf>
8177 open-hook \\.gz$ "gzip -cd %f &gt; %t"</madmutt-doc:lstconf>
8178           
8179         </para>
8180         
8181         <para>
8182           If the <emphasis>command</emphasis> is empty, this operation is
8183           disabled for this file
8184           type.
8185         </para>
8186         
8187       </sect2>
8188       
8189       <sect2 id="close-hook">
8190         <title>Write a compressed mailbox</title>
8191         
8192         <para>
8193           Usage: <madmutt-doc:hook name="close"/> <emphasis>regexp</emphasis>&quot;<emphasis>command</emphasis>&quot;
8194         </para>
8195         
8196         <para>
8197           This is used to close the folder that was open with the <madmutt-doc:hook name="open"/>
8198           command after some changes were made to it.
8199         </para>
8200         
8201         <para>
8202           The <emphasis>command</emphasis> string is the command that can be
8203           used for closing the
8204           folders whose names match <emphasis>regexp</emphasis>. It has the
8205           same format as in 
8206           the <madmutt-doc:hook name="open"/> command. Temporary
8207           folder
8208           in this case is the folder previously produced by the <madmutt-doc:hook name="open"/>
8209           command.
8210         </para>
8211         
8212         <para>
8213           The <emphasis>command</emphasis> should <emphasis role="bold">not</emphasis> remove the decompressed file. The
8214           <emphasis>command</emphasis> should return non-zero exit status if it
8215           fails, so mutt
8216           knows something's wrong.
8217         </para>
8218         
8219         <para>
8220           Example:
8221         </para>
8222         
8223         <para>
8224           
8225           <madmutt-doc:lstconf>
8226 close-hook \\.gz$ "gzip -c %t &gt; %f"</madmutt-doc:lstconf>
8227           
8228         </para>
8229         
8230         <para>
8231           If the <emphasis>command</emphasis> is empty, this operation is
8232           disabled for this file
8233           type, and the file can only be open in the readonly mode.
8234         </para>
8235         
8236         <para>
8237           <madmutt-doc:hook name="close"/> is not called when you
8238           exit
8239           from the folder if the folder was not changed.
8240         </para>
8241         
8242       </sect2>
8243       
8244       <sect2 id="append-hook">
8245         <title>Append a message to a compressed mailbox</title>
8246         
8247         <para>
8248           Usage: <madmutt-doc:hook name="append"/> <emphasis>regexp</emphasis>&quot;<emphasis>command</emphasis>&quot;
8249         </para>
8250         
8251         <para>
8252           This command is used for saving to an existing compressed folder.
8253           The <emphasis>command</emphasis> is the command that can be used for
8254           appending to the
8255           folders whose names match <emphasis>regexp</emphasis>. It has the
8256           same format as in 
8257           the <madmutt-doc:hook name="open"/> command.
8258           The temporary folder in this case contains the messages that are
8259           beingappended. 
8260         </para>
8261         
8262         <para>
8263           The <emphasis>command</emphasis> should <emphasis role="bold">not</emphasis> remove the decompressed file. The
8264           <emphasis>command</emphasis> should return non-zero exit status if it
8265           fails, so mutt
8266           knows something's wrong.
8267         </para>
8268         
8269         <para>
8270           Example:
8271         </para>
8272         
8273         <para>
8274           
8275           <madmutt-doc:lstconf>
8276 append-hook \\.gz$ "gzip -c %t &gt;&gt; %f" </madmutt-doc:lstconf>
8277           
8278         </para>
8279         
8280         <para>
8281           When <madmutt-doc:hook name="append"/> is used, the
8282           folder is
8283           not opened, which saves time, but this means that we can not find out
8284           what the folder type is. Thus the default (<madmutt-doc:varref name="mbox-type"/>
8285           )type is always supposed (i.e.
8286           this is the format used for the temporary folder).
8287         </para>
8288         
8289         <para>
8290           If the file does not exist when you save to it, <madmutt-doc:hook name="close"/>
8291           is called, and not <madmutt-doc:hook name="append"/>. <madmutt-doc:hook name="append"/>
8292           is only
8293           for appending to existing folders.
8294         </para>
8295         
8296         <para>
8297           If the <emphasis>command</emphasis> is empty, this operation is
8298           disabled for this file
8299           type. In this case, the folder will be open and closed again (using
8300           <madmutt-doc:hook name="open"/> and <madmutt-doc:hook name="close"/>
8301           respectively) each time you will add to it.
8302         </para>
8303         
8304       </sect2>
8305       
8306       <sect2 id="encrypted-folders">
8307         <title>Encrypted folders</title>
8308         
8309         <para>
8310           The compressed folders support can also be used to handle encrypted
8311           folders. If you want to encrypt a folder with PGP, you may want to
8312           usethe following hooks:
8313         </para>
8314         
8315         <para>
8316           
8317           <madmutt-doc:lstconf>
8318 open-hook  \\.pgp$ "pgp -f &lt; %f &gt; %t"
8319 close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId &lt; %t &gt; %f"</madmutt-doc:lstconf>
8320           
8321         </para>
8322         
8323         <para>
8324           Please note, that PGP does not support appending to an encrypted
8325           folder, so there is no <madmutt-doc:hook name="append"/> defined.
8326         </para>
8327         
8328         <para>
8329           <emphasis role="bold">Note:</emphasis> the folder is temporary stored
8330           decrypted in the /tmp
8331           directory, where it can be read by your system administrator. So
8332           thinkabout the security aspects of this.
8333         </para>
8334         
8335         <para>
8336           
8337         </para>
8338         
8339         <para>
8340           
8341         </para>
8342         
8343       </sect2>
8344       
8345     </sect1>
8346     
8347   </chapter>
8348   <!--}}}-->
8349   
8350   <chapter id="mime-support"> <!--{{{-->
8351     <title>Madmutt's MIME Support</title>
8352     
8353     <para>
8354       Quite a bit of effort has been made to make Madmutt the premier text-mode
8355       MIME MUA.  Every effort has been made to provide the functionality that
8356       the discerning MIME user requires, and the conformance to the standards
8357       wherever possible.  When configuring Madmutt for MIME, there are two
8358       extratypes of configuration files which Madmutt uses.  One is the
8359       <literal>mime.types</literal> file, which contains the mapping of file
8360       extensions to 
8361       IANA MIME types.  The other is the <literal>mailcap</literal> file, which
8362       specifies
8363       the external commands to use for handling specific MIME types.
8364     </para>
8365     
8366     <sect1 id="mime">
8367       <title>Using MIME in Mutt</title>
8368       
8369       <para>
8370         There are three areas/menus in Madmutt which deal with MIME, they are
8371         the
8372         pager (while viewing a message), the attachment menu and the compose
8373         menu.
8374       </para>
8375       
8376       <sect2 id="mime-view">
8377         <title>Viewing MIME messages in the pager</title>
8378         
8379         <para>
8380           When you select a message from the index and view it in the pager,
8381           Mutt
8382           decodes the message to a text representation.  Madmutt internally
8383           supports
8384           a number of MIME types, including <literal>text/plain, text/enriched,
8385             message/rfc822, and message/news
8386           </literal>
8387           .In addition, the export
8388           controlled version of Madmutt recognizes a variety of PGP MIME types,
8389           including PGP/MIME and application/pgp.
8390         </para>
8391         
8392         <para>
8393           Madmutt will denote attachments with a couple lines describing them.
8394           These lines are of the form:
8395           
8396           <screen>
8397 [-- Attachment #1: Description --]
8398 [-- Type: text/plain, Encoding: 7bit, Size: 10000 --]</screen>
8399           
8400           Where the <literal>Description</literal> is the description or
8401           filename given for the
8402           attachment, and the <literal>Encoding</literal> is one of
8403           <literal>7bit/8bit/quoted-printable/base64/binary</literal>.
8404         </para>
8405         
8406         <para>
8407           If Madmutt cannot deal with a MIME type, it will display a message
8408           like:
8409           
8410           <screen>
8411 [-- image/gif is unsupported (use 'v' to view this part) --]</screen>
8412           
8413         </para>
8414         
8415       </sect2>
8416       
8417       <sect2 id="attach-menu">
8418         <title>The Attachment Menu</title>
8419         
8420         <para>
8421           The default binding for <literal>view-attachments</literal> is `v',
8422           which displays the
8423           attachment menu for a message.  The attachment menu displays a list
8424           ofthe attachments in a message.  From the attachment menu, you can
8425           save,
8426           print, pipe, delete, and view attachments.  You can apply these
8427           operations to a group of attachments at once, by tagging the
8428           attachments
8429           and by using the ``tag-prefix'' operator.  You can also reply to the
8430           current message from this menu, and only the current attachment (or
8431           the
8432           attachments tagged) will be quoted in your reply.  You can view
8433           attachments as text, or view them using the mailcap viewer
8434           definition.
8435         </para>
8436         
8437         <para>
8438           Finally, you can apply the usual message-related functions (like 
8439           <madmutt-doc:funcref name="resend-message"/>, and the reply
8440           and forward functions) to attachments of type <literal>message/rfc822</literal>.
8441         </para>
8442         
8443         <para>
8444           See the help on the attachment menu for more information.
8445         </para>
8446         
8447       </sect2>
8448       
8449       <sect2 id="compose-menu">
8450         <title>The Compose Menu</title>
8451         
8452         <para>
8453           The compose menu is the menu you see before you send a message.  It
8454           allows you to edit the recipient list, the subject, and other aspects
8455           of your message.  It also contains a list of the attachments of your
8456           message, including the main body.  From this menu, you can print,
8457           copy,
8458           filter, pipe, edit, compose, review, and rename an attachment or a
8459           list of tagged attachments.  You can also modifying the attachment
8460           information, notably the type, encoding and description.
8461         </para>
8462         
8463         <para>
8464           Attachments appear as follows:
8465           
8466           <screen>
8467 1 [text/plain, 7bit, 1K]             /tmp/mutt-euler-8082-0 &lt;no description&gt;
8468 2 [applica/x-gunzip, base64, 422K]   ~/src/mutt-0.85.tar.gz &lt;no description&gt;</screen>
8469           
8470         </para>
8471         
8472         <para>
8473           The '-' denotes that Madmutt will delete the file after sending (or
8474           postponing, or canceling) the message.  It can be toggled with the
8475           <literal>toggle-unlink</literal> command (default: u).  The next
8476           field is the MIME
8477           content-type, and can be changed with the <literal>edit-type</literal> command
8478           (default: ^T).  The next field is the encoding for the
8479           attachment,
8480           which allows a binary message to be encoded for transmission on 7bit
8481           links.  It can be changed with the <literal>edit-encoding</literal>
8482           command
8483           (default: ^E).  The next field is the size of the attachment,
8484           rounded to kilobytes or megabytes.  The next field is the filename,
8485           which can be changed with the <literal>rename-file</literal> command
8486           (default: R).
8487           The final field is the description of the attachment, and can be
8488           changed with the <literal>edit-description</literal> command
8489           (default: d).
8490         </para>
8491         
8492         <para>
8493           
8494         </para>
8495         
8496       </sect2>
8497       
8498     </sect1>
8499     
8500     <sect1 id="mime-types">
8501       <title>
8502         MIME Type configuration with <literal>mime.types</literal>  
8503       </title>
8504       
8505       <para>
8506         When you add an attachment to your mail message, Madmutt searches your
8507         personal mime.types file within <madmutt-doc:envvar name="HOME"/> and then
8508         the system mime.types file at <literal>/usr/local/share/mutt/mime.types</literal> or
8509         <literal>/etc/mime.types</literal>
8510       </para>
8511       
8512       <para>
8513         The mime.types file consist of lines containing a MIME type and a space
8514         separated list of extensions.  For example:
8515         
8516         <screen>
8517 application/postscript          ps eps
8518 application/pgp                 pgp
8519 audio/x-aiff                    aif aifc aiff</screen>
8520         
8521         A sample <literal>mime.types</literal> file comes with the Madmutt
8522         distribution, and
8523         should contain most of the MIME types you are likely to use.  
8524       </para>
8525       
8526       <para>
8527         If Madmutt can not determine the mime type by the extension of the file
8528         you
8529         attach, it will look at the file.  If the file is free of binary
8530         information, Madmutt will assume that the file is plain text, and mark
8531         it
8532         as <literal>text/plain</literal>.  If the file contains binary
8533         information, then Madmutt will
8534         mark it as <literal>application/octet-stream</literal>.  You can change
8535         the MIME
8536         type that Madmutt assigns to an attachment by using the <literal>
8537           edit-type
8538         </literal>
8539         command from the compose menu (default: ^T). The MIME type is
8540         actually a
8541         major mime type followed by the sub-type, separated by a '/'. 6 major
8542         types: application, text, image, video, audio, and model have been
8543         approved
8544         after various internet discussions. Madmutt recognises all of these if
8545         the 
8546         appropriate entry is found in the mime.types file. It also recognises
8547         other
8548         major mime types, such as the chemical type that is widely used in the 
8549         molecular modelling community to pass molecular data in various forms
8550         to 
8551         various molecular viewers. Non-recognised mime types should only be
8552         used 
8553         if the recipient of the message is likely to be expecting such
8554         attachments.
8555       </para>
8556       
8557       <para>
8558         
8559       </para>
8560       
8561     </sect1>
8562     
8563     <sect1 id="mime-mailcap">
8564       <title>
8565         MIME Viewer configuration with <literal>mailcap</literal>  
8566       </title>
8567       
8568       <para>
8569         Madmutt supports <madmutt-doc:rfc num="1524"/> MIME Configuration, in particular the Unix
8570         specific format specified in Appendix A of the RfC.  This file format
8571         is commonly referred to as the mailcap format.  Many MIME compliant
8572         programs utilize the mailcap format, allowing you to specify handling
8573         for all MIME types in one place for all programs.  Programs known to
8574         use this format include Netscape, XMosaic, lynx and metamail.
8575       </para>
8576       
8577       <para>
8578         In order to handle various MIME types that Madmutt can not handle
8579         internally, Madmutt parses a series of external configuration files to
8580         find an external handler.  The default search string for these files
8581         is a colon delimited list set to
8582         
8583         <screen>
8584 ${HOME}/.mailcap:/usr/local/share/mutt/mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap</screen>
8585         
8586         where <madmutt-doc:envvar name="HOME"/> is your home directory.
8587       </para>
8588       
8589       <para>
8590         In particular, the metamail distribution will install a mailcap file,
8591         usually as <literal>/usr/local/etc/mailcap</literal>, which contains
8592         some baseline
8593         entries.
8594       </para>
8595       
8596       <sect2 id="mime-mailcap-basics">
8597         <title>The Basics of the mailcap file</title>
8598         
8599         <para>
8600           A mailcap file consists of a series of lines which are comments,
8601           blank,
8602           or definitions.
8603         </para>
8604         
8605         <para>
8606           A comment line consists of a # character followed by anything you
8607           want.
8608         </para>
8609         
8610         <para>
8611           A blank line is blank.
8612         </para>
8613         
8614         <para>
8615           A definition line consists of a content type, a view command, and any
8616           number of optional fields.  Each field of a definition line is
8617           dividedby a semicolon ';' character.
8618         </para>
8619         
8620         <para>
8621           The content type is specified in the MIME standard type/subtype
8622           method.
8623           For example,
8624           <literal>text/plain, text/html, image/gif,</literal>
8625           etc.  In addition, the mailcap format includes two formats for
8626           wildcards, one using the special '*' subtype, the other is the
8627           implicit
8628           wild, where you only include the major type.  For example, <literal>
8629             image/*
8630           </literal>
8631           ,or
8632           <literal>video,</literal> will match all image types and video types,
8633           respectively.
8634         </para>
8635         
8636         <para>
8637           The view command is a Unix command for viewing the type specified.
8638           There
8639           are two different types of commands supported. The default is to send
8640           the body of the MIME message to the command on stdin. You can change
8641           this behavior by using %s as a parameter to your view command.
8642           This will cause Madmutt to save the body of the MIME message to a
8643           temporary
8644           file, and then call the view command with the %s replaced by
8645           the name of the temporary file. In both cases, Madmutt will turn over
8646           the
8647           terminal to the view program until the program quits, at which time
8648           Mutt
8649           will remove the temporary file if it exists.
8650         </para>
8651         
8652         <para>
8653           So, in the simplest form, you can send a text/plain message to the
8654           external pager more on stdin:
8655           
8656           <screen>
8657 text/plain; more</screen>
8658           
8659           Or, you could send the message as a file:
8660           
8661           <screen>
8662 text/plain; more %s</screen>
8663           
8664           Perhaps you would like to use lynx to interactively view a text/html 
8665           message:
8666           
8667           <screen>
8668 text/html; lynx %s</screen>
8669           
8670           In this case, lynx does not support viewing a file from stdin, so you
8671           must use the %s syntax.
8672           <emphasis role="bold">Note:</emphasis> <emphasis>Some older versions
8673             of lynx contain a bug where they
8674             will check the mailcap file for a viewer for text/html.  They will
8675             find
8676             the line which calls lynx, and run it.  This causes lynx to
8677             continuously
8678             spawn itself to view the object.
8679           </emphasis>
8680         </para>
8681         
8682         <para>
8683           On the other hand, maybe you don't want to use lynx interactively,
8684           youjust want to have it convert the text/html to text/plain, then you
8685           can
8686           use:
8687           
8688           <screen>
8689 text/html; lynx -dump %s | more</screen>
8690           
8691         </para>
8692         
8693         <para>
8694           Perhaps you wish to use lynx to view text/html files, and a pager on
8695           all other text formats, then you would use the following:
8696           
8697           <screen>
8698 text/html; lynx %s
8699 text/*; more</screen>
8700           
8701           This is the simplest form of a mailcap file.
8702         </para>
8703         
8704       </sect2>
8705       
8706       <sect2 id="mime-mailcap-security">
8707         <title>Secure use of mailcap</title>
8708         
8709         <para>
8710           The interpretation of shell meta-characters embedded in MIME
8711           parameters
8712           can lead to security problems in general.  Madmutt tries to quote
8713           parameters
8714           in expansion of %s syntaxes properly, and avoids risky
8715           characters by
8716           substituting them, see the <madmutt-doc:varref name="mailcap-sanitize"/>
8717           variable.
8718         </para>
8719         
8720         <para>
8721           Although mutt's procedures to invoke programs with mailcap seem to be
8722           safe, there are other applications parsing mailcap, maybe taking less
8723           care
8724           of it.  Therefore you should pay attention to the following rules:
8725         </para>
8726         
8727         <para>
8728           <emphasis>Keep the %-expandos away from shell quoting.</emphasis>
8729           Don't quote them with single or double quotes.  Madmutt does this for
8730           you, the right way, as should any other program which interprets
8731           mailcap.  Don't put them into backtick expansions.  Be highly careful
8732           with eval statements, and avoid them if possible at all.  Trying to
8733           fix
8734           broken behaviour with quotes introduces new leaks - there is no
8735           alternative to correct quoting in the first place.
8736         </para>
8737         
8738         <para>
8739           If you have to use the %-expandos' values in context where you
8740           need
8741           quoting or backtick expansions, put that value into a shell variable
8742           and reference the shell variable where necessary, as in the following
8743           example (using <literal>$charset</literal> inside the backtick
8744           expansion is safe,
8745           since it is not itself subject to any further expansion):
8746         </para>
8747         
8748         <para>
8749           
8750           <screen>
8751 text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
8752 &#38;&#38; test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1</screen>
8753           
8754         </para>
8755         
8756       </sect2>
8757       
8758       <sect2 id="mime-mailcap-advanced">
8759         <title>Advanced mailcap Usage</title>
8760         
8761         <sect3 id="mime-mailcap-advanced-fields">
8762           <title>Optional Fields</title>
8763           
8764           <para>
8765             In addition to the required content-type and view command fields,
8766             you
8767             can add semi-colon ';' separated fields to set flags and other
8768             options.
8769             Madmutt recognizes the following optional fields:
8770             <variablelist>
8771               
8772               <varlistentry>
8773                 <term>copiousoutput</term>
8774                 <listitem>
8775                   <para>
8776                     This flag tells Madmutt that the command passes possibly
8777                     large amounts of
8778                     text on stdout.  This causes Madmutt to invoke a pager
8779                     (either the internal
8780                     pager or the external pager defined by the pager variable)
8781                     on the output
8782                     of the view command.  Without this flag, Madmutt assumes
8783                     that the command
8784                     is interactive.  One could use this to replace the pipe to <literal>
8785                       more
8786                     </literal>
8787                     in the <literal>lynx -dump</literal> example in the Basic
8788                     section:
8789                     
8790                     <screen>
8791 text/html; lynx -dump %s ; copiousoutput</screen>
8792                     
8793                     This will cause lynx to format the text/html output as
8794                     text/plain
8795                     and Madmutt will use your standard pager to display the
8796                     results.
8797                   </para>
8798                 </listitem>
8799               </varlistentry>
8800               <varlistentry>
8801                 <term>needsterminal</term>
8802                 <listitem>
8803                   <para>
8804                     Madmutt uses this flag when viewing attachments with <madmutt-doc:cmdref name="auto_view"/>,
8805                     in order to decide whether it should honor the setting
8806                     of the <madmutt-doc:varref name="wait-key"/> variable or
8807                     not.  When an attachment is viewed using an interactive
8808                     program, and the
8809                     corresponding mailcap entry has a <emphasis>needsterminal</emphasis> flag, Madmutt will use
8810                     <madmutt-doc:varref name="wait-key"/> and the exit
8811                     statusof the program to decide if it will ask you to press
8812                     a key after the
8813                     external program has exited.  In all other situations it
8814                     will not prompt
8815                     you for a key.
8816                   </para>
8817                 </listitem>
8818               </varlistentry>
8819               <varlistentry>
8820                 <term>compose=&lt;command&gt;</term>
8821                 <listitem>
8822                   <para>
8823                     This flag specifies the command to use to create a new
8824                     attachment of a
8825                     specific MIME type.  Madmutt supports this from the compose
8826                     menu.
8827                   </para>
8828                 </listitem>
8829               </varlistentry>
8830               <varlistentry>
8831                 <term>composetyped=&lt;command&gt;</term>
8832                 <listitem>
8833                   <para>
8834                     This flag specifies the command to use to create a new
8835                     attachment of a
8836                     specific MIME type.  This command differs from the compose
8837                     command in
8838                     that mutt will expect standard MIME headers on the data. 
8839                     This can be
8840                     used to specify parameters, filename, description, etc. for
8841                     a new
8842                     attachment.   Madmutt supports this from the compose menu.
8843                   </para>
8844                 </listitem>
8845               </varlistentry>
8846               <varlistentry>
8847                 <term>print=&lt;command&gt;</term>
8848                 <listitem>
8849                   <para>
8850                     This flag specifies the command to use to print a specific
8851                     MIME type.
8852                     Madmutt supports this from the attachment and compose
8853                     menus.
8854                   </para>
8855                 </listitem>
8856               </varlistentry>
8857               <varlistentry>
8858                 <term>edit=&lt;command&gt;</term>
8859                 <listitem>
8860                   <para>
8861                     This flag specifies the command to use to edit a specific
8862                     MIME type.  
8863                     Madmutt supports this from the compose menu, and also uses
8864                     it to compose
8865                     new attachments.  Madmutt will default to the defined
8866                     editor for text
8867                     attachments.
8868                   </para>
8869                 </listitem>
8870               </varlistentry>
8871               <varlistentry>
8872                 <term>nametemplate=&lt;template&gt;</term>
8873                 <listitem>
8874                   <para>
8875                     This field specifies the format for the file denoted by
8876                     %s in the
8877                     command fields.  Certain programs will require a certain
8878                     file extension,
8879                     for instance, to correctly view a file.  For instance, lynx
8880                     will only
8881                     interpret a file as <literal>text/html</literal> if the
8882                     file ends in <literal>.html</literal>.
8883                     So, you would specify lynx as a <literal>text/html</literal> viewer with a line in
8884                     the mailcap file like:
8885                     
8886                     <screen>
8887 text/html; lynx %s; nametemplate=%s.html</screen>
8888                     
8889                   </para>
8890                 </listitem>
8891               </varlistentry>
8892               <varlistentry>
8893                 <term>test=&lt;command&gt;</term>
8894                 <listitem>
8895                   <para>
8896                     This field specifies a command to run to test whether this
8897                     mailcap
8898                     entry should be used.  The command is defined with the
8899                     command expansion
8900                     rules defined in the next section.  If the command returns
8901                     0, then the
8902                     test passed, and Madmutt uses this entry.  If the command
8903                     returns non-zero,
8904                     then the test failed, and Madmutt continues searching for
8905                     the right entry.
8906                     <emphasis role="bold">Note:</emphasis> <emphasis>the
8907                       content-type must match before Madmutt performs the test.
8908                     </emphasis>
8909                     For example:
8910                     
8911                     <screen>
8912 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
8913 text/html; lynx %s</screen>
8914                     
8915                     In this example, Madmutt will run the program RunningX
8916                     which will return 0
8917                     if the X Window manager is running, and non-zero if it
8918                     isn't.  If
8919                     RunningX returns 0, then Madmutt will call netscape to
8920                     display the
8921                     text/html object.  If RunningX doesn't return 0, then
8922                     Madmutt will go on
8923                     to the next entry and use lynx to display the text/html
8924                     object.
8925                   </para>
8926                 </listitem>
8927               </varlistentry>
8928             </variablelist>
8929           </para>
8930           
8931         </sect3>
8932         
8933         <sect3 id="mime-mailcap-advanced-searchorder">
8934           <title>Search Order</title>
8935           
8936           <para>
8937             When searching for an entry in the mailcap file, Madmutt will
8938             search for
8939             the most useful entry for its purpose.  For instance, if you are
8940             attempting to print an <literal>image/gif</literal>, and you have
8941             the following
8942             entries in your mailcap file, Madmutt will search for an entry with
8943             the
8944             print command:
8945             
8946             <screen>
8947 image/*;        xv %s
8948 image/gif;      ; print= anytopnm %s | pnmtops | lpr; \
8949 nametemplate=%s.gif</screen>
8950             
8951             Madmutt will skip the <literal>image/*</literal> entry and use the <literal>
8952               image/gif
8953             </literal>
8954             entry with the print command.
8955           </para>
8956           
8957           <para>
8958             In addition, you can use this with <madmutt-doc:cmdref name="auto_view"/>
8959             to denote two commands for viewing an attachment, one to be viewed
8960             automatically, the other to be viewed interactively from the
8961             attachment
8962             menu.  In addition, you can then use the test feature to determine
8963             which
8964             viewer to use interactively depending on your environment.
8965             
8966             <screen>
8967 text/html;      netscape -remote 'openURL(%s)' ; test=RunningX
8968 text/html;      lynx %s; nametemplate=%s.html
8969 text/html;      lynx -dump %s; nametemplate=%s.html; copiousoutput</screen>
8970             
8971             For <madmutt-doc:cmdref name="auto_view"/>, Madmutt will choose
8972             the third
8973             entry because of the copiousoutput tag.  For interactive viewing,
8974             Mutt
8975             will run the program RunningX to determine if it should use the
8976             first
8977             entry.  If the program returns non-zero, Madmutt will use the
8978             second entry
8979             for interactive viewing.
8980           </para>
8981           
8982         </sect3>
8983         
8984         <sect3 id="mime-mailcap-advanced-expansion">
8985           <title>Command Expansion</title>
8986           
8987           <para>
8988             The various commands defined in the mailcap files are passed to the
8989             <literal>/bin/sh</literal> shell using the system() function. 
8990             Before the
8991             command is passed to <literal>/bin/sh -c</literal>, it is parsed to
8992             expand
8993             various special parameters with information from Madmutt.  The
8994             keywords
8995             Madmutt expands are:
8996             <variablelist>
8997               
8998               <varlistentry>
8999                 <term>%s</term>
9000                 <listitem>
9001                   <para>
9002                     As seen in the basic mailcap section, this variable is
9003                     expanded
9004                     to a filename specified by the calling program.  This file
9005                     contains
9006                     the body of the message to view/print/edit or where the
9007                     composing
9008                     program should place the results of composition.  In
9009                     addition, the
9010                     use of this keyword causes Madmutt to not pass the body of
9011                     the message
9012                     to the view/print/edit program on stdin.
9013                   </para>
9014                 </listitem>
9015               </varlistentry>
9016               <varlistentry>
9017                 <term>%t</term>
9018                 <listitem>
9019                   <para>
9020                     Madmutt will expand %t to the text representation of
9021                     the content
9022                     type of the message in the same form as the first parameter
9023                     of the
9024                     mailcap definition line, ie <literal>text/html</literal> or
9025                     <literal>image/gif</literal>.
9026                   </para>
9027                 </listitem>
9028               </varlistentry>
9029               <varlistentry>
9030                 <term>%{&lt;parameter&gt;}</term>
9031                 <listitem>
9032                   <para>
9033                     Madmutt will expand this to the value of the specified
9034                     parameter
9035                     from the Content-Type: line of the mail message.  For
9036                     instance, if
9037                     Your mail message contains:
9038                     
9039                     <madmutt-doc:lstmail>
9040 Content-Type: text/plain; charset=iso-8859-1</madmutt-doc:lstmail>
9041                     
9042                     then Madmutt will expand %{charset} to
9043                     iso-8859-1.  The default metamail
9044                     mailcap file uses this feature to test the charset to spawn
9045                     an xterm
9046                     using the right charset to view the message.
9047                   </para>
9048                 </listitem>
9049               </varlistentry>
9050               <varlistentry>
9051                 <term>\%</term>
9052                 <listitem>
9053                   <para>
9054                     This will be replaced by a %
9055                   </para>
9056                 </listitem>
9057               </varlistentry>
9058             </variablelist>
9059             Madmutt does not currently support the %F and %n
9060             keywords
9061             specified in <madmutt-doc:rfc num="1524"/>.  The main purpose of these parameters is for
9062             multipart messages, which is handled internally by Madmutt.
9063           </para>
9064           
9065         </sect3>
9066         
9067       </sect2>
9068       
9069       <sect2 id="mime-mailcap-examples">
9070         <title>Example mailcap files</title>
9071         
9072         <para>
9073           This mailcap file is fairly simple and standard:
9074           
9075           <screen>>
9076 # I'm always running X :)
9077 video/*;        xanim %s &gt; /dev/null
9078 image/*;        xv %s &gt; /dev/null
9079
9080 # I'm always running netscape (if my computer had more memory, maybe)
9081 text/html;      netscape -remote 'openURL(%s)'</screen>
9082           
9083         </para>
9084         
9085         <para>
9086           This mailcap file shows quite a number of examples:
9087         </para>
9088         
9089         <para>
9090           
9091           <screen>
9092 # Use xanim to view all videos   Xanim produces a header on startup,
9093 # send that to /dev/null so I don't see it
9094 video/*;        xanim %s &gt; /dev/null
9095
9096 # Send html to a running netscape by remote
9097 text/html;      netscape -remote 'openURL(%s)'; test=RunningNetscape
9098 # If I'm not running netscape but I am running X, start netscape on the
9099 # object
9100 text/html;      netscape %s; test=RunningX
9101
9102 # Else use lynx to view it as text
9103 text/html;      lynx %s
9104
9105 # This version would convert the text/html to text/plain
9106 text/html;      lynx -dump %s; copiousoutput
9107
9108 # I use enscript to print text in two columns to a page
9109 text/*;         more %s; print=enscript -2Gr %s
9110
9111 # Netscape adds a flag to tell itself to view jpegs internally
9112 image/jpeg;xv %s; x-mozilla-flags=internal
9113
9114 # Use xv to view images if I'm running X
9115 # In addition, this uses the \ to extend the line and set my editor
9116 # for images
9117 image/*;xv %s; test=RunningX; edit=xpaint %s
9118
9119 # Convert images to text using the netpbm tools
9120 image/*;  (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | \
9121 pgmtopbm | pbmtoascii -1x2 ) 2&gt;&#38;1 ; copiousoutput
9122
9123 # Send excel spreadsheets to my NT box
9124 application/ms-excel; open.pl %s</screen>
9125           
9126         </para>
9127         
9128         <para>
9129           
9130         </para>
9131         
9132       </sect2>
9133       
9134     </sect1>
9135     
9136     <sect1>
9137       <title>MIME Autoview</title>
9138
9139       <para>
9140         <madmutt-doc:cmddef name="auto_view">mime-type [mime-type ...]</madmutt-doc:cmddef>
9141       </para>
9142
9143       <para>
9144         <madmutt-doc:cmddef name="unauto_view">mime-type [mime-type ...]</madmutt-doc:cmddef>
9145       </para>
9146  
9147       <para>
9148         In addition to explicitly telling Madmutt to view an attachment with
9149         theMIME viewer defined in the mailcap file, Madmutt has support for
9150         automatically viewing MIME attachments while in the pager.
9151       </para>
9152       
9153       <para>
9154         To work, you must define a viewer in the mailcap file which uses the 
9155         <literal>copiousoutput</literal> option to denote that it is
9156         non-interactive.
9157         Usually, you also use the entry to convert the attachment to a text
9158         representation which you can view in the pager.
9159       </para>
9160       
9161       <para>
9162         You then use the <literal>auto_view</literal> muttrc command to
9163         list the
9164         content-types that you wish to view automatically.
9165       </para>
9166       
9167       <para>
9168         For instance, if you set auto_view to:
9169         
9170         <madmutt-doc:lstconf>
9171 auto_view text/html application/x-gunzip application/postscript
9172 image/gif application/x-tar-gz</madmutt-doc:lstconf>
9173         
9174       </para>
9175       
9176       <para>
9177         Madmutt could use the following mailcap entries to automatically view
9178         attachments of these types.
9179         
9180         <screen>
9181 text/html;      lynx -dump %s; copiousoutput; nametemplate=%s.html
9182 image/*;        anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | pgmtopbm | pbmtoascii ; copiousoutput
9183 application/x-gunzip;   gzcat; copiousoutput
9184 application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
9185 application/postscript; ps2ascii %s; copiousoutput</screen>
9186         
9187       </para>
9188       
9189       <para>
9190         ``unauto_view'' can be used to remove previous entries from the
9191         autoview list.
9192         This can be used with <madmutt-doc:hook name="message"/> to autoview messages based on size,
9193         etc.
9194         ``unauto_view *'' will remove all previous entries.
9195       </para>
9196       
9197       <para>
9198         
9199       </para>
9200       
9201     </sect1>
9202     
9203     <sect1>
9204       <title>MIME Multipart/Alternative</title>
9205
9206       <para>
9207         <madmutt-doc:cmddef name="alternative_order">mime-type [mime-type ...]</madmutt-doc:cmddef>
9208       </para>
9209       
9210       <para>
9211         <madmutt-doc:cmddef name="unalternative_order">mime-type [mime-type ...]</madmutt-doc:cmddef>
9212       </para>
9213  
9214       <para>
9215         Madmutt has some heuristics for determining which attachment of a
9216         multipart/alternative type to display.  First, mutt will check the 
9217         alternative_order list to determine if one of the available
9218         typesis preferred.  The alternative_order list consists of a
9219         number of
9220         MIME types in order, including support for implicit and explicit
9221         wildcards, for example:
9222        
9223         <madmutt-doc:lstconf>
9224 alternative_order text/enriched text/plain text
9225 application/postscript image/*</madmutt-doc:lstconf>
9226         
9227       </para>
9228       
9229       <para>
9230         Next, mutt will check if any of the types have a defined 
9231         <madmutt-doc:cmdref name="auto_view"/>, and use that.  Failing
9232         that, Madmutt will look for any text type.  As a last attempt, mutt
9233         willlook for any type it knows how to handle.
9234       </para>
9235       
9236       <para>
9237         To remove a MIME type from the <literal>alternative_order</literal> list, use the
9238         <literal>unalternative_order</literal> command.
9239       </para>
9240       
9241       <para>
9242         
9243       </para>
9244       
9245     </sect1>
9246
9247     <sect1 id="attachments">
9248       <title>Attachment Searching and Counting</title>
9249
9250       <para>
9251         If you ever lose track of attachments in your mailboxes, Mutt's
9252         attachment-counting and -searching support might be for you. You
9253         can make your message index display the number of qualifying
9254         attachments in each message, or search for messages by
9255         attachment count. You also can configure what kinds of
9256         attachments qualify for this feature with the attachments and
9257         unattachments commands.
9258       </para>
9259
9260 <para>
9261 The syntax is:
9262 </para>
9263
9264 <para>
9265   <madmutt-doc:cmddef name="attachments">
9266     ( {+|-}disposition mime-type | ? )
9267   </madmutt-doc:cmddef>
9268 </para>
9269 <para>
9270   <madmutt-doc:cmddef name="unattachments">
9271     {+|-}disposition mime-type
9272   </madmutt-doc:cmddef>
9273 </para>
9274
9275 <para>
9276 Disposition is the attachment's Content-disposition type -- either
9277 "inline" or "attachment". You can abbreviate this to I or A.
9278 </para>
9279
9280 <para>
9281 Disposition is prefixed by either a + symbolor a - symbol. If it's
9282 a +, you're saying that you want to allow this disposition and MIME
9283 type to qualify. If it's a -, you're saying that this disposition
9284 and MIME type is an exception to previous + rules. There are examples
9285 below of how this is useful.
9286 </para>
9287
9288 <para>
9289 Mime-type is, unsurprisingly, the MIME type of the attachment you want
9290 to affect. A MIME type is always of the format "major/minor", where
9291 "major" describes the broad category of document you're looking at, and
9292 "minor" describes the specific type within that category. The major
9293 part of mim-type must be literal text (or the special token "*"), but
9294 the minor part may be a regular expression. (Therefore, "*/.*" matches
9295 any MIME type.)
9296 </para>
9297
9298 <para>
9299 The MIME types you give to the attachments directive are a kind of
9300 pattern. When you use the attachments directive, the patterns you
9301 specify are added to a list. When you use unattachments, the pattern
9302 is removed from the list. The patterns are not expanded and matched
9303 to specific MIME types at this time -- they're just text in a list.
9304 They're only matched when actually evaluating a message.
9305 </para>
9306
9307 <para>
9308 Some examples might help to illustrate. The examples that are not
9309 commented out define the default configuration of the lists.
9310 </para>
9311
9312 <screen>
9313 ## Removing a pattern from a list removes that pattern literally. It
9314 ## does not remove any type matching the pattern.
9315 ##
9316 ## attachments +A */.*
9317 ## attachments +A image/jpeg
9318 ## unattachments +A */.*
9319 ##
9320 ## This leaves "attached" image/jpeg files on the allowed attachments
9321 ## list. It does not remove all items, as you might expect, because the
9322 ## second */.* is not a matching expression at this time.
9323 ##
9324 ## Remember: "unattachments" only undoes what "attachments" has done!
9325 ## It does not trigger any matching on actual messages.
9326
9327
9328 ## Qualify any MIME part with an "attachment" disposition, EXCEPT for
9329 ## text/x-vcard and application/pgp parts. (PGP parts are already known
9330 ## to mutt, and can be searched for with ~g, ~G, and ~k.)
9331 ##
9332 ## I've added x-pkcs7 to this, since it functions (for S/MIME)
9333 ## analogously to PGP signature attachments. S/MIME isn't supported
9334 ## in a stock mutt build, but we can still treat it specially here.
9335 ##
9336 attachments +A */.*
9337 attachments -A text/x-vcard application/pgp.*
9338 attachments -A application/x-pkcs7-.*
9339
9340 ## Discount all MIME parts with an "inline" disposition, unless they're
9341 ## text/plain. (Why inline a text/plain part unless it's external to the
9342 ## message flow?)
9343 ##
9344 attachments +I text/plain
9345
9346 ## These two lines make Mutt qualify MIME containers. (So, for example,
9347 ## a message/rfc822 forward will count as an attachment.) The first
9348 ## line is unnecessary if you already have "attach-allow */.*", of
9349 ## course. These are off by default! The MIME elements contained
9350 ## within a message/* or multipart/* are still examined, even if the
9351 ## containers themseves don't qualify.
9352 ##
9353 #attachments +A message/.* multipart/.*
9354 #attachments +I message/.* multipart/.*
9355
9356 ## You probably don't really care to know about deleted attachments.
9357 attachments -A message/external-body
9358 attachments -I message/external-body
9359 </screen>
9360
9361 <para>
9362 "attachments ?" will list your current settings in Muttrc format, so
9363 that it can be pasted elsewhere.
9364 </para>
9365
9366 <para>
9367   Please note that counting attachments may require lots of data be
9368   loaded. This may cause noticeable slowdowns over network links
9369   depending on the connection speed and message sizes. To fine-tune the
9370   behavior on a per-folder or other basis, the <madmutt-doc:varref
9371     name="count-attachments"/> variable may be used.
9372 </para>
9373
9374 </sect1>
9375
9376     <sect1>
9377       <title>MIME Lookup</title>
9378
9379       <para>
9380         <madmutt-doc:cmddef name="mime_lookup">mime-type [mime-type ...]</madmutt-doc:cmddef>
9381       </para>
9382
9383       <para>
9384         <madmutt-doc:cmddef name="unmime_lookup">mime-type [mime-type ...]</madmutt-doc:cmddef>
9385       </para>
9386  
9387       <para>
9388         Madmutt's mime_lookup list specifies a list of mime-types that
9389         should not
9390         be treated according to their mailcap entry.  This option is designed
9391         todeal with binary types such as application/octet-stream.  When an
9392         attachment's
9393         mime-type is listed in mime_lookup, then the extension of the
9394         filename will
9395         be compared to the list of extensions in the mime.types file.  The
9396         mime-type
9397         associated with this extension will then be used to process the
9398         attachment
9399         according to the rules in the mailcap file and according to any other
9400         configuration
9401         options (such as auto_view) specified.  Common usage would be:
9402         
9403         <madmutt-doc:lstconf>
9404 mime_lookup application/octet-stream application/X-Lotus-Manuscript</madmutt-doc:lstconf>
9405         
9406       </para>
9407       
9408       <para>
9409         In addition, the unmime_lookup command may be used to disable
9410         this feature
9411         for any particular mime-type if it had been set, for example, in a
9412         global
9413         muttrc.
9414       </para>
9415       
9416       <para>
9417         
9418       </para>
9419       
9420       <para>
9421         
9422       </para>
9423       
9424     </sect1>
9425     
9426   </chapter>
9427   <!--}}}-->
9428   
9429   <chapter id="security"> <!--{{{-->
9430     <title>Security Considerations</title>
9431     
9432     <para>
9433       First of all, Madmutt contains no security holes included by
9434       intention but may contain unknown security holes. As a consequence,
9435       please run Madmutt only with as few permissions as possible.
9436     </para>
9437     
9438     <para>
9439       Please do not run Madmutt as the super user.
9440     </para>
9441     
9442     <para>
9443       When configuring Madmutt, there're some points to note about secure
9444       setups.
9445     </para>
9446     
9447     <para>
9448       In practice, Madmutt can be easily made as vulnerable as even the
9449       most insecure mail user agents (in their default configuration) just
9450       by changing Madmutt's configuration files: it then can execute
9451       arbitrary programs and scripts attached to messages, send out private
9452       data on its own, etc. Although this is not believed to the common type
9453       of setup, please read this chapter carefully.
9454     </para>
9455     
9456     <sect1 id="security-passwords">
9457       <title>Passwords</title>
9458       
9459       <para>
9460         Although Madmutt can be told the various passwords for accounts,
9461         please never store passwords in configuration files. Besides the
9462         fact that the system's operator can always read them, you could
9463         forget to replace the actual password with asterisks when reporting
9464         a bug or asking for help via, for example, a mailing list so that
9465         your mail including your password could be archived by internet
9466         search engines, etc. Please never store passwords on disk.
9467       </para>
9468       
9469     </sect1>
9470     
9471     <sect1 id="security-tempfiles">
9472       <title>Temporary Files</title>
9473       
9474       <para>
9475         Madmutt uses many temporary files for viewing messages, verifying
9476         digital signatures, etc. The <madmutt-doc:varref name="umask"/>
9477         variable can be used to change the default permissions of these
9478         files. Please only change it if you really know what you are doing.
9479         Also, a different location for these files may be desired which can
9480         be changed via the <madmutt-doc:varref name="tmpdir"/> variable.
9481       </para>
9482       
9483     </sect1>
9484     
9485     <sect1 id="security-leaks">
9486       <title>Information Leaks</title>
9487       
9488       <sect2 id="security-leaks-mid">
9489         <title>Message-ID: headers</title>
9490         
9491         <para>
9492           In the default configuration, Madmutt will leak some information
9493           to the outside world when sending messages: the generation of
9494           <literal>Message-ID:</literal> headers includes a step counter which
9495           is increased
9496           (and rotated) with every message sent. If you'd like to hide this
9497           information probably telling others how many mail you sent in which
9498           time, you at least need to remove the <literal>%P</literal>
9499           expando from the
9500           default setting of the <madmutt-doc:varref name="msgid-format"/> variable. Please make sure that
9501           you really know how local parts of these <literal>Message-ID:</literal> headers
9502           are composed.
9503         </para>
9504         
9505       </sect2>
9506       
9507       <sect2 id="security-leaks-mailto">
9508         <title>mailto:-style links</title>
9509         
9510         <para>
9511           As Madmutt be can be set up to be the mail client to handle
9512           <literal>mailto:</literal> style links in websites, there're security
9513           considerations, too. To keep the old behavior by default, Madmutt
9514           will be strict in interpreting them which means that arbitrary
9515           header fields can be embedded in these links which could override
9516           existing header fields or attach arbitrary files. This may be
9517           problematic if the <madmutt-doc:varref name="edit-headers"/>
9518           variable is <emphasis>unset</emphasis>, i.e. the
9519           user doesn't want to see header fields while editing the message.
9520         </para>
9521         
9522         <para>
9523           For example, following a link like
9524         </para>
9525         
9526         <para>
9527           
9528           <screen>
9529 mailto:joe@host?Attach=~/.gnupg/secring.gpg</screen>
9530           
9531         </para>
9532         
9533         <para>
9534           will send out the user's private gnupg keyring to <literal>joe@host</literal> if
9535           the user doesn't follow the information on screen carefully
9536           enough.
9537         </para>
9538         
9539         <para>
9540           When <emphasis>unsetting</emphasis> the <madmutt-doc:varref name="strict-mailto"/>
9541           variable, Madmutt will
9542         </para>
9543         
9544         <para>
9545           
9546           <itemizedlist>
9547             <listitem>
9548               
9549               <para>
9550                 be less strict when interpreting these links by
9551                 prepending a <literal>X-Mailto-</literal> string to all header
9552                 fields
9553                 embedded in such a link <emphasis>and</emphasis>
9554                 
9555               </para>
9556             </listitem>
9557             <listitem>
9558               
9559               <para>
9560                 turn on the <madmutt-doc:varref name="edit-headers"/>
9561                 variable by
9562                 force to let the user see all the headers
9563                 (because they still may leak information.)
9564                 
9565               </para>
9566             </listitem>
9567             
9568           </itemizedlist>
9569           
9570         </para>
9571         
9572       </sect2>
9573       
9574     </sect1>
9575     
9576     <sect1 id="security-external">
9577       <title>External applications</title>
9578       
9579       <para>
9580         Madmutt in many places has to rely on external applications or
9581         for convenience supports mechanisms involving external
9582         applications.
9583       </para>
9584       
9585       <sect2 id="security-external-mailcap">
9586         <title>mailcap</title>
9587         
9588         <para>
9589           One of these is the <literal>mailcap</literal> mechanism as defined
9590           by <madmutt-doc:rfc num="1524"/>. Madmutt can be set up to <emphasis>automatically</emphasis>
9591           execute any
9592           given utility as listed in one of the mailcap files (see the
9593           <madmutt-doc:varref name="mailcap-path"/>
9594           variable for details.) 
9595         </para>
9596         
9597         <para>
9598           These utilities may have a variety of security vulnerabilities,
9599           including overwriting of arbitrary files, information leaks or
9600           other exploitable bugs.  These vulnerabilities may go unnoticed by
9601           the user, especially when they are called automatically (and
9602           without interactive prompting) from the mailcap file(s). When
9603           using Madmutt's autoview mechanism in combination with mailcap
9604           files, please be sure to...
9605         </para>
9606         
9607         <para>
9608           
9609           <itemizedlist>
9610             <listitem>
9611               
9612               <para>
9613                 manually select trustworth applications with a reasonable
9614                 calling sequence
9615                 
9616               </para>
9617             </listitem>
9618             <listitem>
9619               
9620               <para>
9621                 periodically check the contents of mailcap files,
9622                 especially after software installations or upgrades
9623                 
9624               </para>
9625             </listitem>
9626             <listitem>
9627               
9628               <para>
9629                 keep the software packages referenced in the mailcap file up to
9630                 date
9631                 
9632               </para>
9633             </listitem>
9634             <listitem>
9635               
9636               <para>
9637                 leave the <madmutt-doc:varref name="mailcap-sanitize"/> variable in its default
9638                 state to restrict mailcap expandos to a safe set of characters
9639                 
9640               </para>
9641             </listitem>
9642             
9643           </itemizedlist>
9644           
9645         </para>
9646         
9647       </sect2>
9648       
9649       <sect2 id="security-external-other">
9650         <title>Other</title>
9651         
9652         <para>
9653           Besides the mailcap mechanism, Madmutt uses a number of other
9654           external utilities for operation.
9655         </para>
9656         
9657         <para>
9658           The same security considerations apply for these as for tools
9659           involved via mailcap (for example, Madmutt is vulnerable to Denial
9660           of Service Attacks with compressed folders support if the
9661           uncompressed mailbox is too large for the disk it is saved to.)
9662         </para>
9663         
9664         <para>
9665           As already noted, most of these problems are not built in but
9666           caused by wrong configuration, so please check your configuration.
9667         </para>
9668         
9669       </sect2>
9670       
9671     </sect1>
9672     
9673   </chapter>
9674   <!--}}}-->
9675   
9676   <chapter id="reference"> <!--{{{-->
9677     <title>Reference</title>
9678     
9679     <sect1 id="commandline">
9680       <title>Command line options</title>
9681       
9682       <para>
9683         Running <literal>mutt</literal> with no arguments will make Madmutt
9684         attempt to read your spool
9685         mailbox.  However, it is possible to read other mailboxes and
9686         to send messages from the command line as well.
9687       </para>
9688       
9689       <para>
9690         
9691         <table frame="none" rowsep="1" texstr="l|l">
9692           <title>Reference: Command Line Options</title>
9693           <tgroup cols="2" align="left" colsep="1" rowsep="1">
9694           <thead>
9695             <row>
9696               <entry>Option</entry>
9697               <entry>Description</entry>
9698             </row>
9699           </thead>
9700           <tbody>
9701             <row>
9702               <entry><literal>-A</literal></entry>
9703               <entry>expand an alias</entry>
9704             </row>
9705             <row>
9706               <entry><literal>-a</literal></entry>
9707               <entry>attach a file to a message</entry>
9708             </row>
9709             <row>
9710               <entry><literal>-b</literal></entry>
9711               <entry>specify a blind carbon-copy (BCC) address</entry>
9712             </row>
9713             <row>
9714               <entry><literal>-c</literal></entry>
9715               <entry>specify a carbon-copy (Cc) address</entry>
9716             </row>
9717             <row>
9718               <entry><literal>-e</literal></entry>
9719               <entry>specify a config command to be run after initialization files are read</entry>
9720             </row>
9721             <row>
9722               <entry><literal>-f</literal></entry>
9723               <entry>specify a mailbox to load</entry>
9724             </row>
9725             <row>
9726               <entry><literal>-F</literal></entry>
9727               <entry>specify an alternate file to read initialization commands</entry>
9728             </row>
9729             <row>
9730               <entry><literal>-h</literal></entry>
9731               <entry>print help on command line options</entry>
9732             </row>
9733             <row>
9734               <entry><literal>-H</literal></entry>
9735               <entry>specify a draft file from which to read a header and body</entry>
9736             </row>
9737             <row>
9738               <entry><literal>-i</literal></entry>
9739               <entry>specify a file to include in a message composition</entry>
9740             </row>
9741             <row>
9742               <entry><literal>-m</literal></entry>
9743               <entry>specify a default mailbox type</entry>
9744             </row>
9745             <row>
9746               <entry><literal>-n</literal></entry>
9747               <entry>do not read the system madmuttrc</entry>
9748             </row>
9749             <row>
9750               <entry><literal>-p</literal></entry>
9751               <entry>recall a postponed message</entry>
9752             </row>
9753             <row>
9754               <entry><literal>-Q</literal></entry>
9755               <entry>query a configuration variable</entry>
9756             </row>
9757             <row>
9758               <entry><literal>-R</literal></entry>
9759               <entry>open mailbox in read-only mode</entry>
9760             </row>
9761             <row>
9762               <entry><literal>-s</literal></entry>
9763               <entry>specify a subject (enclose in quotes if it contains spaces)</entry>
9764             </row>
9765             <row>
9766               <entry><literal>-t</literal></entry>
9767               <entry>dump the value of all variables to stdout</entry>
9768             </row>
9769             <row>
9770               <entry><literal>-T</literal></entry>
9771               <entry>dump the value of all changed variables to stdout</entry>
9772             </row>
9773             <row>
9774               <entry><literal>-v</literal></entry>
9775               <entry>show version number and compile-time definitions</entry>
9776             </row>
9777             <row>
9778               <entry><literal>-x</literal></entry>
9779               <entry>simulate the mailx(1) compose mode</entry>
9780             </row>
9781             <row>
9782               <entry><literal>-y</literal></entry>
9783               <entry>show a menu containing the files specified by the mailboxes command</entry>
9784             </row>
9785             <row>
9786               <entry><literal>-z</literal></entry>
9787               <entry>exit immediately if there are no messages in the mailbox</entry>
9788             </row>
9789             <row>
9790               <entry><literal>-Z</literal></entry>
9791               <entry>open the first folder with new message,exit immediately if none</entry>
9792             </row>
9793           </tbody>
9794         </tgroup>
9795       </table>
9796
9797       </para>
9798       
9799       <para>
9800         To read messages in a mailbox
9801       </para>
9802       
9803       <para>
9804         <literal>mutt</literal> ] -nz ] ] -F <emphasis>muttrc</emphasis> ] ] -m <emphasis>
9805           type
9806         </emphasis>
9807         ] ] -f <emphasis>mailbox</emphasis> ] 
9808       </para>
9809       
9810       <para>
9811         To compose a new message
9812       </para>
9813       
9814       <para>
9815         <literal>mutt</literal> ] -n ] ] -F <emphasis>muttrc</emphasis> ] ] -a <emphasis>
9816           file
9817         </emphasis>
9818         ] ] -c <emphasis>address</emphasis> ] ] -i <emphasis>
9819           filename
9820         </emphasis>
9821         ] ] -s <emphasis>subject</emphasis> ] <emphasis>address</emphasis> ] <emphasis>
9822           address
9823         </emphasis>
9824         ... ] 
9825       </para>
9826       
9827       <para>
9828         Madmutt also supports a ``batch'' mode to send prepared messages. 
9829         Simply redirect
9830         input from the file you wish to send.  For example,
9831       </para>
9832       
9833       <para>
9834         <literal>mutt -s &quot;data set for run #2&quot;
9835           professor@bigschool.edu
9836           &lt; ~/run2.dat
9837         </literal>
9838       </para>
9839       
9840       <para>
9841         This command will send a message to ``professor@bigschool.edu'' with a
9842         subject
9843         of ``data set for run #2''.  In the body of the message will be the
9844         contents
9845         of the file ``~/run2.dat''.
9846       </para>
9847       
9848       <para>
9849         
9850       </para>
9851       
9852     </sect1>
9853     
9854     <sect1 id="patterns">
9855       <title>Patterns</title>
9856
9857       <para>
9858
9859         <table frame="none" rowsep="1" id="tab-patterns" texstr="l|l|l">
9860           <title>Reference: Patterns</title>
9861           <tgroup cols="2" align="left" colsep="1" rowsep="1">
9862           <thead>
9863             <row>
9864               <entry>Pattern Modifier</entry>
9865               <entry>Argument</entry>
9866               <entry>Description</entry>
9867             </row>
9868           </thead>
9869           <tbody>
9870             <row>
9871               <entry><madmutt-doc:pattern full="1" name="A"/></entry>
9872               <entry><literal></literal></entry>
9873               <entry>all messages</entry>
9874             </row>
9875             <row>
9876               <entry><madmutt-doc:pattern full="1" name="b"/></entry>
9877               <entry><literal>EXPR</literal></entry>
9878               <entry>messages which contain EXPR in the message body</entry>
9879             </row>
9880             <row>
9881               <entry><madmutt-doc:pattern full="1" name="B"/></entry>
9882               <entry><literal>EXPR</literal></entry>
9883               <entry>messages which contain EXPR in the whole message</entry>
9884             </row>
9885             <row>
9886               <entry><madmutt-doc:pattern full="1" name="c"/></entry>
9887               <entry><literal>EXPR</literal></entry>
9888               <entry>messages carbon-copied to EXPR</entry>
9889             </row>
9890             <row>
9891               <entry><madmutt-doc:pattern full="1" name="C"/></entry>
9892               <entry><literal>EXPR</literal></entry>
9893               <entry>message is either to: or cc: EXPR</entry>
9894             </row>
9895             <row>
9896               <entry><madmutt-doc:pattern full="1" name="D"/></entry>
9897               <entry><literal></literal></entry>
9898               <entry>deleted messages</entry>
9899             </row>
9900             <row>
9901               <entry><madmutt-doc:pattern full="1" name="d"/></entry>
9902               <entry><literal>[MIN]-[MAX]</literal></entry>
9903               <entry>messages with ``date-sent'' in a Date range</entry>
9904             </row>
9905             <row>
9906               <entry><madmutt-doc:pattern full="1" name="E"/></entry>
9907               <entry><literal></literal></entry>
9908               <entry>expired messages</entry>
9909             </row>
9910             <row>
9911               <entry><madmutt-doc:pattern full="1" name="e"/></entry>
9912               <entry><literal>EXPR</literal></entry>
9913               <entry>message which contains EXPR in the ``Sender'' field</entry>
9914             </row>
9915             <row>
9916               <entry><madmutt-doc:pattern full="1" name="F"/></entry>
9917               <entry><literal></literal></entry>
9918               <entry>flagged messages</entry>
9919             </row>
9920             <row>
9921               <entry><madmutt-doc:pattern full="1" name="f"/></entry>
9922               <entry><literal>EXPR</literal></entry>
9923               <entry>messages originating from EXPR</entry>
9924             </row>
9925             <row>
9926               <entry><madmutt-doc:pattern full="1" name="g"/></entry>
9927               <entry><literal></literal></entry>
9928               <entry>cryptographically signed messages</entry>
9929             </row>
9930             <row>
9931               <entry><madmutt-doc:pattern full="1" name="G"/></entry>
9932               <entry><literal></literal></entry>
9933               <entry>cryptographically encrypted messages</entry>
9934             </row>
9935             <row>
9936               <entry><madmutt-doc:pattern full="1" name="H"/></entry>
9937               <entry><literal>EXPR</literal></entry>
9938               <entry>messages with a spam attribute matching EXPR</entry>
9939             </row>
9940             <row>
9941               <entry><madmutt-doc:pattern full="1" name="h"/></entry>
9942               <entry><literal>EXPR</literal></entry>
9943               <entry>messages which contain EXPR in the message header</entry>
9944             </row>
9945             <row>
9946               <entry><madmutt-doc:pattern full="1" name="k"/></entry>
9947               <entry><literal></literal></entry>
9948               <entry>message contains PGP key material</entry>
9949             </row>
9950             <row>
9951               <entry><madmutt-doc:pattern full="1" name="i"/></entry>
9952               <entry><literal>EXPR</literal></entry>
9953               <entry>message which match ID in the ``Message-ID'' field</entry>
9954             </row>
9955             <row>
9956               <entry><madmutt-doc:pattern full="1" name="L"/></entry>
9957               <entry><literal>EXPR</literal></entry>
9958               <entry>message is either originated or received by EXPR</entry>
9959             </row>
9960             <row>
9961               <entry><madmutt-doc:pattern full="1" name="l"/></entry>
9962               <entry><literal></literal></entry>
9963               <entry>message is addressed to a known mailing list</entry>
9964             </row>
9965             <row>
9966               <entry><madmutt-doc:pattern full="1" name="m"/></entry>
9967               <entry><literal>[MIN]-[MAX]</literal></entry>
9968               <entry>message in the range MIN to MAX *)</entry>
9969             </row>
9970             <row>
9971               <entry><madmutt-doc:pattern full="1" name="M"/></entry>
9972               <entry><literal></literal></entry>
9973               <entry>multipart messages</entry>
9974             </row>
9975             <row>
9976               <entry><madmutt-doc:pattern full="1" name="n"/></entry>
9977               <entry><literal>[MIN]-[MAX]</literal></entry>
9978               <entry>messages with a score in the range MIN to MAX *)</entry>
9979             </row>
9980             <row>
9981               <entry><madmutt-doc:pattern full="1" name="N"/></entry>
9982               <entry><literal></literal></entry>
9983               <entry>new messages</entry>
9984             </row>
9985             <row>
9986               <entry><madmutt-doc:pattern full="1" name="O"/></entry>
9987               <entry><literal></literal></entry>
9988               <entry>old messages</entry>
9989             </row>
9990             <row>
9991               <entry><madmutt-doc:pattern full="1" name="p"/></entry>
9992               <entry><literal></literal></entry>
9993               <entry>message is addressed to you (consults alternates)</entry>
9994             </row>
9995             <row>
9996               <entry><madmutt-doc:pattern full="1" name="P"/></entry>
9997               <entry><literal></literal></entry>
9998               <entry>message is from you (consults alternates)</entry>
9999             </row>
10000             <row>
10001               <entry><madmutt-doc:pattern full="1" name="Q"/></entry>
10002               <entry><literal></literal></entry>
10003               <entry>messages which have been replied to</entry>
10004             </row>
10005             <row>
10006               <entry><madmutt-doc:pattern full="1" name="R"/></entry>
10007               <entry><literal></literal></entry>
10008               <entry>read messages</entry>
10009             </row>
10010             <row>
10011               <entry><madmutt-doc:pattern full="1" name="r"/></entry>
10012               <entry><literal>[MIN]-[MAX]</literal></entry>
10013               <entry>messages with ``date-received'' in a Date range</entry>
10014             </row>
10015             <row>
10016               <entry><madmutt-doc:pattern full="1" name="S"/></entry>
10017               <entry><literal></literal></entry>
10018               <entry>superseded messages</entry>
10019             </row>
10020             <row>
10021               <entry><madmutt-doc:pattern full="1" name="s"/></entry>
10022               <entry><literal>EXPR</literal></entry>
10023               <entry>messages having EXPR in the ``Subject'' field.</entry>
10024             </row>
10025             <row>
10026               <entry><madmutt-doc:pattern full="1" name="T"/></entry>
10027               <entry><literal></literal></entry>
10028               <entry>tagged messages</entry>
10029             </row>
10030             <row>
10031               <entry><madmutt-doc:pattern full="1" name="t"/></entry>
10032               <entry><literal>EXPR</literal></entry>
10033               <entry>messages addressed to EXPR</entry>
10034             </row>
10035             <row>
10036               <entry><madmutt-doc:pattern full="1" name="U"/></entry>
10037               <entry><literal></literal></entry>
10038               <entry>unread messages</entry>
10039             </row>
10040             <row>
10041               <entry><madmutt-doc:pattern full="1" name="u"/></entry>
10042               <entry><literal></literal></entry>
10043               <entry>message is addressed to a subscribed mailing list</entry>
10044             </row>
10045             <row>
10046               <entry><madmutt-doc:pattern full="1" name="v"/></entry>
10047               <entry><literal></literal></entry>
10048               <entry>message is part of a collapsed thread.</entry>
10049             </row>
10050             <row>
10051               <entry><madmutt-doc:pattern full="1" name="V"/></entry>
10052               <entry><literal></literal></entry>
10053               <entry>cryptographically verified messages</entry>
10054             </row>
10055             <row>
10056               <entry><madmutt-doc:pattern full="1" name="w"/></entry>
10057               <entry><literal>EXPR</literal></entry>
10058               <entry>messages which contain EXPR in the `Newsgroups' field (if compiled with NNTP support)</entry>
10059             </row>
10060             <row>
10061               <entry><madmutt-doc:pattern full="1" name="x"/></entry>
10062               <entry><literal>EXPR</literal></entry>
10063               <entry>messages which contain EXPR in the `References' field</entry>
10064             </row>
10065             <row>
10066               <entry><madmutt-doc:pattern full="1" name="X"/></entry>
10067               <entry><literal>[MIN]-[MAX]</literal></entry>
10068               <entry>messages with MIN to MAX attachments *)</entry>
10069             </row>
10070             <row>
10071               <entry><madmutt-doc:pattern full="1" name="y"/></entry>
10072               <entry><literal>EXPR</literal></entry>
10073               <entry>messages which contain EXPR in the `X-Label' field</entry>
10074             </row>
10075             <row>
10076               <entry><madmutt-doc:pattern full="1" name="z"/></entry>
10077               <entry><literal>[MIN]-[MAX]</literal></entry>
10078               <entry>messages with a size in the range MIN to MAX *)</entry>
10079             </row>
10080             <row>
10081               <entry><madmutt-doc:pattern full="1" name="="/></entry>
10082               <entry><literal></literal></entry>
10083               <entry>duplicated messages (see $duplicate_threads)</entry>
10084             </row>
10085             <row>
10086               <entry><madmutt-doc:pattern full="1" name="$"/></entry>
10087               <entry><literal></literal></entry>
10088               <entry>unreferenced messages (requires threaded view)</entry>
10089             </row>
10090             <row>
10091               <entry><madmutt-doc:pattern full="1" name="*"/></entry>
10092               <entry><literal></literal></entry>
10093               <entry>``From'' contains realname and (syntactically) valid address
10094                 (excluded are addresses matching against alternates or any alias)</entry>
10095             </row>
10096           </tbody>
10097         </tgroup>
10098       </table>
10099       </para>
10100       
10101       <para>
10102         Where EXPR are 
10103         <link linkend="advanced-regexp">regexp</link>.  Special attention has to be
10104         made when using regular expressions inside of patterns.  Specifically,
10105         Madmutt's parser for these patterns will strip one level of backslash
10106         (\),
10107         which is normally used for quoting.  If it is your intention to use a
10108         backslash in the regular expression, you will need to use two
10109         backslashes
10110         instead (\\).
10111       </para>
10112       
10113       <para>
10114         *) The forms <literal>&lt;[MAX]</literal>, <literal>&gt;[MIN]</literal>,
10115         <literal>[MIN]-</literal> and <literal>-[MAX]</literal>
10116         are allowed, too.
10117       </para>
10118       
10119     </sect1>
10120     
10121     <sect1 id="commands">
10122       <title>Configuration Commands</title>
10123       
10124       <para>
10125         The following are the commands understood by mutt.
10126       </para>
10127       
10128       <para>
10129         
10130         <itemizedlist>
10131           <listitem>
10132             
10133             <para>
10134               <literal><madmutt-doc:hook name="account"/></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
10135             </para>
10136           </listitem>
10137           <listitem>
10138             
10139             <para>
10140               <literal><madmutt-doc:cmdref name="alias"/></literal> <emphasis>key</emphasis> <emphasis>address</emphasis> [, <emphasis>address</emphasis>, ... ]
10141             </para>
10142           </listitem>
10143           <listitem>
10144             
10145             <para>
10146               <literal><madmutt-doc:cmdref name="unalias"/></literal> [ * | <emphasis>key</emphasis> ... ]
10147             </para>
10148           </listitem>
10149           <listitem>
10150             
10151             <para>
10152               <literal><madmutt-doc:cmdref name="alternates"/></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
10153             </para>
10154           </listitem>
10155           <listitem>
10156             
10157             <para>
10158               <literal><madmutt-doc:cmdref name="unalternates"/></literal> [ * | <emphasis>regexp</emphasis> ... ]
10159             </para>
10160           </listitem>
10161           <listitem>
10162             
10163             <para>
10164               <literal><madmutt-doc:cmdref name="alternative_order"/></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
10165             </para>
10166           </listitem>
10167           <listitem>
10168             
10169             <para>
10170               <literal><madmutt-doc:cmdref name="unalternative_order"/></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
10171             </para>
10172           </listitem>
10173           <listitem>
10174             
10175             <para>
10176               <literal><madmutt-doc:hook name="append"/></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
10177             </para>
10178           </listitem>
10179           <listitem>
10180             
10181             <para>
10182               <literal><madmutt-doc:cmdref name="auto_view"/></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
10183             </para>
10184           </listitem>
10185           <listitem>
10186             
10187             <para>
10188               <literal><madmutt-doc:cmdref name="unauto_view"/></literal><emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
10189             </para>
10190           </listitem>
10191           <listitem>
10192             
10193             <para>
10194               <literal><madmutt-doc:cmdref name="bind"/></literal> <emphasis>map</emphasis> <emphasis>key</emphasis> <emphasis>function</emphasis>
10195             </para>
10196           </listitem>
10197           <listitem>
10198             
10199             <para>
10200               <literal><madmutt-doc:hook name="charset"/></literal> <emphasis>alias</emphasis> <emphasis>charset</emphasis>
10201             </para>
10202           </listitem>
10203           <listitem>
10204             
10205             <para>
10206               <literal><madmutt-doc:hook name="close"/></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
10207             </para>
10208           </listitem>
10209           <listitem>
10210             
10211             <para>
10212               <literal><madmutt-doc:cmdref name="color"/></literal> <emphasis>object</emphasis> <emphasis>foreground</emphasis> <emphasis>background</emphasis> [ <emphasis>regexp</emphasis> ]
10213             </para>
10214           </listitem>
10215           <listitem>
10216             
10217             <para>
10218               <literal><madmutt-doc:cmdref name="uncolor"/></literal> <emphasis>index</emphasis> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
10219             </para>
10220           </listitem>
10221           <listitem>
10222             
10223             <para>
10224               <literal><madmutt-doc:cmdref name="exec"/></literal> <emphasis>function</emphasis> [ <emphasis>function</emphasis> ... ]
10225             </para>
10226           </listitem>
10227           <listitem>
10228             
10229             <para>
10230               <literal><madmutt-doc:hook name="fcc"/></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
10231             </para>
10232           </listitem>
10233           <listitem>
10234             
10235             <para>
10236               <literal><madmutt-doc:hook name="fcc-save"/></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
10237             </para>
10238           </listitem>
10239           <listitem>
10240             
10241             <para>
10242               <literal><madmutt-doc:hook name="folder"/></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
10243             </para>
10244           </listitem>
10245           <listitem>
10246             
10247             <para>
10248               <literal><madmutt-doc:cmdref name="hdr_order"/></literal> <emphasis>header</emphasis> [ <emphasis>header</emphasis> ... ]
10249             </para>
10250           </listitem>
10251           <listitem>
10252             
10253             <para>
10254               <literal><madmutt-doc:cmdref name="unhdr_order"/></literal> <emphasis>header</emphasis> [ <emphasis>header</emphasis> ... ]
10255             </para>
10256           </listitem>
10257           <listitem>
10258             
10259             <para>
10260               <literal><madmutt-doc:hook name="charset"/></literal> <emphasis>charset</emphasis> <emphasis>local-charset</emphasis>
10261             </para>
10262           </listitem>
10263           <listitem>
10264             
10265             <para>
10266               <literal><madmutt-doc:cmdref name="ignore"/></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
10267             </para>
10268           </listitem>
10269           <listitem>
10270             
10271             <para>
10272               <literal><madmutt-doc:cmdref name="unignore"/></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
10273             </para>
10274           </listitem>
10275           <listitem>
10276             
10277             <para>
10278               <literal><madmutt-doc:cmdref name="lists"/></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
10279             </para>
10280           </listitem>
10281           <listitem>
10282             
10283             <para>
10284               <literal><madmutt-doc:cmdref name="unlists"/></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
10285             </para>
10286           </listitem>
10287           <listitem>
10288             
10289             <para>
10290               <literal><madmutt-doc:cmdref name="macro"/></literal> <emphasis>menu</emphasis> <emphasis>key</emphasis> <emphasis>sequence</emphasis> [ <emphasis>description</emphasis> ]
10291             </para>
10292           </listitem>
10293           <listitem>
10294             
10295             <para>
10296               <literal><madmutt-doc:cmdref name="mailboxes"/></literal> <emphasis>filename</emphasis> [ <emphasis>filename</emphasis> ... ]
10297             </para>
10298           </listitem>
10299           <listitem>
10300             
10301             <para>
10302               <literal><madmutt-doc:hook name="mbox"/></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
10303             </para>
10304           </listitem>
10305           <listitem>
10306             
10307             <para>
10308               <literal><madmutt-doc:hook name="message"/></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
10309             </para>
10310           </listitem>
10311           <listitem>
10312             
10313             <para>
10314               <literal><madmutt-doc:cmdref name="mime_lookup"/></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
10315             </para>
10316           </listitem>
10317           <listitem>
10318             
10319             <para>
10320               <literal>
10321                 <madmutt-doc:cmdref name="unmime_lookup"/></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
10322             </para>
10323           </listitem>
10324           <listitem>
10325             
10326             <para>
10327               <literal><madmutt-doc:cmdref name="mono"/></literal> <emphasis>object attribute</emphasis> [ <emphasis>regexp</emphasis> ]
10328             </para>
10329           </listitem>
10330           <listitem>
10331             
10332             <para>
10333               <literal><madmutt-doc:cmdref name="unmono"/></literal> <emphasis>index</emphasis> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
10334             </para>
10335           </listitem>
10336           <listitem>
10337             
10338             <para>
10339               <literal><madmutt-doc:cmdref name="my_hdr"/></literal> <emphasis>string</emphasis>
10340             </para>
10341           </listitem>
10342           <listitem>
10343             
10344             <para>
10345               <literal><madmutt-doc:cmdref name="unmy_hdr"/></literal> <emphasis>field</emphasis> [ <emphasis>field</emphasis> ... ]
10346             </para>
10347           </listitem>
10348           <listitem>
10349             
10350             <para>
10351               <literal><madmutt-doc:hook name="open"/></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
10352             </para>
10353           </listitem>
10354           <listitem>
10355             
10356             <para>
10357               <literal><madmutt-doc:hook name="crypt"/></literal> <emphasis>pattern</emphasis> <emphasis>key-id</emphasis>
10358             </para>
10359           </listitem>
10360           <listitem>
10361             
10362             <para>
10363               <literal><madmutt-doc:cmdref name="push"/></literal> <emphasis>string</emphasis>
10364             </para>
10365           </listitem>
10366           <listitem>
10367             
10368             <para>
10369               <literal><madmutt-doc:cmdref name="reset"/> </literal><emphasis>variable</emphasis> [ <emphasis>variable</emphasis> ... ]
10370             </para>
10371           </listitem>
10372           <listitem>
10373             
10374             <para>
10375               <literal><madmutt-doc:hook name="save"/></literal> <emphasis>regexp</emphasis> <emphasis>filename</emphasis>
10376             </para>
10377           </listitem>
10378           <listitem>
10379             
10380             <para>
10381               <literal><madmutt-doc:cmdref name="score"/> </literal> <emphasis>pattern</emphasis> <emphasis>value</emphasis>
10382             </para>
10383           </listitem>
10384           <listitem>
10385             
10386             <para>
10387               <literal><madmutt-doc:cmdref name="unscore"/></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
10388             </para>
10389           </listitem>
10390           <listitem>
10391             
10392             <para>
10393               <literal><madmutt-doc:hook name="send"/></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
10394             </para>
10395           </listitem>
10396           <listitem>
10397             
10398             <para>
10399               <literal><madmutt-doc:hook name="reply"/></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
10400             </para>
10401           </listitem>
10402           <listitem>
10403             
10404             <para>
10405               <literal><madmutt-doc:cmdref name="set"/></literal> [no|inv]<emphasis>variable</emphasis>[ =<emphasis>value</emphasis> ] [ <emphasis>variable</emphasis> ... ]
10406             </para>
10407           </listitem>
10408           <listitem>
10409             
10410             <para>
10411               <literal><madmutt-doc:cmdref name="unset"/></literal> <emphasis>variable</emphasis> [ <emphasis>variable</emphasis> ... ]
10412             </para>
10413           </listitem>
10414           <listitem>
10415             
10416             <para>
10417               <literal><madmutt-doc:cmdref name="source"/></literal> <emphasis>filename</emphasis>
10418             </para>
10419           </listitem>
10420           <listitem>
10421             
10422             <para>
10423               <literal><madmutt-doc:cmdref name="spam"/></literal> <emphasis>pattern</emphasis> <emphasis>format</emphasis>
10424             </para>
10425           </listitem>
10426           <listitem>
10427             
10428             <para>
10429               <literal><madmutt-doc:cmdref name="nospam"/></literal> <emphasis>pattern</emphasis>
10430             </para>
10431           </listitem>
10432           <listitem>
10433             
10434             <para>
10435               <literal><madmutt-doc:cmdref name="subscribe"/></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ] 
10436             </para>
10437           </listitem>
10438           <listitem>
10439             
10440             <para>
10441               <literal><madmutt-doc:cmdref name="unsubscribe"/></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ] 
10442             </para>
10443           </listitem>
10444           <listitem>
10445             
10446             <para>
10447               <literal><madmutt-doc:cmdref name="toggle"/></literal> <emphasis>variable</emphasis> [ <emphasis>variable</emphasis> ... ]
10448             </para>
10449           </listitem>
10450           <listitem>
10451             
10452             <para>
10453               <literal><madmutt-doc:cmdref name="unhook"/></literal> <emphasis>hook-type</emphasis>
10454             </para>
10455           </listitem>
10456           
10457         </itemizedlist>
10458         
10459       </para>
10460       
10461     </sect1>
10462     
10463     <sect1 id="variables">
10464       <title>Configuration variables</title>
10465       
10466       <para>
10467         The following list contains all variables which, in the process of
10468         providing more consistency, have been renamed and are partially even
10469         removed already. The left column contains the old synonym variables,
10470         the right column the full/new name:
10471       </para>
10472       
10473       <para>
10474         <anchor id="sect-obsolete"/>
10475
10476         <table frame="none" rowsep="1" texstr="l|l">
10477           <title>Reference: Obsolete Variables</title>
10478           <tgroup cols="2" align="left" colsep="1" rowsep="1">
10479           <thead>
10480             <row>
10481               <entry>Old Name</entry>
10482               <entry>New Name</entry>
10483             </row>
10484           </thead>
10485           <tbody>
10486             <row>
10487               <entry><literal>edit_hdrs</literal></entry>
10488               <entry><madmutt-doc:varref name="edit-headers"/></entry>
10489             </row>
10490             <row>
10491               <entry><literal>forw_decode</literal></entry>
10492               <entry><madmutt-doc:varref name="forward-decode"/></entry>
10493               </row>
10494             <row>
10495               <entry><literal>forw_format</literal></entry>
10496               <entry><madmutt-doc:varref name="forward-format"/></entry>
10497               </row>
10498             <row>
10499               <entry><literal>forw_quote</literal></entry>
10500               <entry><madmutt-doc:varref name="forward-quote"/></entry>
10501               </row>
10502             <row>
10503               <entry><literal>hdr_format</literal></entry>
10504               <entry><madmutt-doc:varref name="index-format"/></entry>
10505               </row>
10506             <row>
10507               <entry><literal>indent_str</literal></entry>
10508               <entry><madmutt-doc:varref name="indent-string"/></entry>
10509               </row>
10510             <row>
10511               <entry><literal>mime_fwd</literal></entry>
10512               <entry><madmutt-doc:varref name="mime-forward"/></entry>
10513               </row>
10514             <row>
10515               <entry><literal>msg_format</literal></entry>
10516               <entry><madmutt-doc:varref name="message-format"/></entry>
10517               </row>
10518             <row>
10519               <entry><literal>pgp_autosign</literal></entry>
10520               <entry><madmutt-doc:varref name="crypt-autosign"/></entry>
10521               </row>
10522             <row>
10523               <entry><literal>pgp_autoencrypt</literal></entry>
10524               <entry><madmutt-doc:varref name="crypt-autoencrypt"/></entry>
10525               </row>
10526             <row>
10527               <entry><literal>pgp_replyencrypt</literal></entry>
10528               <entry><madmutt-doc:varref name="crypt-replyencrypt"/></entry>
10529               </row>
10530             <row>
10531               <entry><literal>pgp_replysign</literal></entry>
10532               <entry><madmutt-doc:varref name="crypt-replysign"/></entry>
10533               </row>
10534             <row>
10535               <entry><literal>pgp_replysignencrypted</literal></entry>
10536               <entry><madmutt-doc:varref name="crypt-replysignencrypted"/></entry>
10537               </row>
10538             <row>
10539               <entry><literal>pgp_verify_sig</literal></entry>
10540               <entry><madmutt-doc:varref name="crypt-verify-sig"/></entry>
10541               </row>
10542             <row>
10543               <entry><literal>pgp_create_traditional</literal></entry>
10544               <entry><madmutt-doc:varref name="pgp-autoinline"/></entry>
10545               </row>
10546             <row>
10547               <entry><literal>pgp_auto_traditional</literal></entry>
10548               <entry><madmutt-doc:varref name="pgp-replyinline"/></entry>
10549               </row>
10550             <row>
10551               <entry><literal>forw_decrypt</literal></entry>
10552               <entry><madmutt-doc:varref name="forward-decrypt"/></entry>
10553               </row>
10554             <row>
10555               <entry><literal>smime_sign_as</literal></entry>
10556               <entry><madmutt-doc:varref name="smime-default-key"/></entry>
10557               </row>
10558             <row>
10559               <entry><literal>post_indent_str</literal></entry>
10560               <entry><madmutt-doc:varref name="post-indent-string"/></entry>
10561               </row>
10562             <row>
10563               <entry><literal>print_cmd</literal></entry>
10564               <entry><madmutt-doc:varref name="print-command"/></entry>
10565               </row>
10566             <row>
10567               <entry><literal>shorten_hierarchy</literal></entry>
10568               <entry><madmutt-doc:varref name="sidebar-shorten-hierarchy"/></entry>
10569               </row>
10570             <row>
10571               <entry><literal>ask_followup_to</literal></entry>
10572               <entry><madmutt-doc:varref name="nntp-ask-followup-to"/></entry>
10573               </row>
10574             <row>
10575               <entry><literal>ask_x_comment_to</literal></entry>
10576               <entry><madmutt-doc:varref name="nntp-ask-x-comment-to"/></entry>
10577               </row>
10578             <row>
10579               <entry><literal>catchup_newsgroup</literal></entry>
10580               <entry><madmutt-doc:varref name="nntp-catchup"/></entry>
10581             </row>
10582             <row>
10583               <entry><literal>followup_to_poster</literal></entry>
10584               <entry><madmutt-doc:varref name="nntp-followup-to-poster"/></entry>
10585             </row>
10586             <row>
10587               <entry><literal>group_index_format</literal></entry>
10588               <entry><madmutt-doc:varref name="nntp-group-index-format"/></entry>
10589             </row>
10590             <row>
10591               <entry><literal>inews</literal></entry>
10592               <entry><madmutt-doc:varref name="nntp-inews"/></entry>
10593             </row>
10594             <row>
10595               <entry><literal>mime_subject</literal></entry>
10596               <entry><madmutt-doc:varref name="nntp-mime-subject"/></entry>
10597             </row>
10598             <row>
10599               <entry><literal>news_cache_dir</literal></entry>
10600               <entry><madmutt-doc:varref name="nntp-cache-dir"/></entry>
10601             </row>
10602             <row>
10603               <entry><literal>news_server</literal></entry>
10604               <entry><madmutt-doc:varref name="nntp-host"/></entry>
10605             </row>
10606             <row>
10607               <entry><literal>newsrc</literal></entry>
10608               <entry><madmutt-doc:varref name="nntp-newsrc"/></entry>
10609             </row>
10610             <row>
10611               <entry><literal>nntp_poll</literal></entry>
10612               <entry><madmutt-doc:varref name="nntp-mail-check"/></entry>
10613             </row>
10614             <row>
10615               <entry><literal>pop_checkinterval</literal></entry>
10616               <entry><madmutt-doc:varref name="pop-mail-check"/></entry>
10617             </row>
10618             <row>
10619               <entry><literal>post_moderated</literal></entry>
10620               <entry><madmutt-doc:varref name="nntp-post-moderated"/></entry>
10621             </row>
10622             <row>
10623               <entry><literal>save_unsubscribed</literal></entry>
10624               <entry><madmutt-doc:varref name="nntp-save-unsubscribed"/></entry>
10625             </row>
10626             <row>
10627               <entry><literal>show_new_news</literal></entry>
10628               <entry><madmutt-doc:varref name="nntp-show-new-news"/></entry>
10629             </row>
10630             <row>
10631               <entry><literal>show_only_unread</literal></entry>
10632               <entry><madmutt-doc:varref name="nntp-show-only-unread"/></entry>
10633             </row>
10634             <row>
10635               <entry><literal>x_comment_to</literal></entry>
10636               <entry><madmutt-doc:varref name="nntp-x-comment-to"/></entry>
10637             </row>
10638             <row>
10639               <entry><literal>smtp_auth_username</literal></entry>
10640               <entry><madmutt-doc:varref name="smtp-user"/></entry>
10641             </row>
10642             <row>
10643               <entry><literal>smtp_auth_password</literal></entry>
10644               <entry><madmutt-doc:varref name="smtp-pass"/></entry>
10645             </row>
10646             <row>
10647               <entry><literal>envelope_from_address</literal></entry>
10648               <entry><madmutt-doc:varref name="smtp-envelope"/></entry>
10649             </row>
10650             <row>
10651               <entry><literal>user_agent</literal></entry>
10652               <entry><madmutt-doc:varref name="agent-string"/></entry>
10653             </row>
10654           </tbody>
10655         </tgroup>
10656       </table>
10657
10658       </para>
10659       
10660       <para>
10661         The <literal>contrib</literal> subdirectory contains a script named
10662         <literal>update-config.pl</literal> which eases migration.
10663       </para>
10664       
10665       <para>
10666         A complete list of current variables follows.
10667       </para>