1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.1.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
9 <title>The Mutt Next Generation E-Mail Client</title>
11 <firstname>by Andreas Krennmair and others
12 originally based on <emphasis>mutt</emphasis> by Michael Elkins and others</firstname>
17 <ulink URL="mailto:ak@synflood.at"><ak@synflood.at>
20 <ulink URL="mailto:me@cs.hmc.edu"><me@cs.hmc.edu>
27 <pubdate>version devel-r473</pubdate>
32 Michael Elinks on mutt, circa 1995: ``All mail clients suck. This one just sucks less.'' - Sven Guckes on mutt, ca. 2003: ``But it still sucks!''
40 <title>Introduction </title>
43 <title>Overview </title>
46 <emphasis role="bold">Mutt-ng</emphasis> is a small but very powerful text-based MIME mail client. Mutt-ng is
47 highly configurable, and is well suited to the mail power user with advanced
48 features like key bindings, keyboard macros, mail threading, regular
49 expression searches and a powerful pattern matching language for selecting
54 This documentation additionally contains documentation to <emphasis role="bold">Mutt-NG</emphasis>, a
55 fork from Mutt with the goal to fix all the little annoyances of Mutt, to
56 integrate all the Mutt patches that are floating around in the web, and to
57 add other new features. Features specific to Mutt-ng will be discussed in
58 an extra section. Don't be confused when most of the documentation talk about
59 Mutt and not Mutt-ng, Mutt-ng contains all Mutt features, plus many more.
69 <title>Mutt-ng Home Page </title>
73 URL="http://www.muttng.org/"
74 >http://www.muttng.org</ulink
85 <title>Mailing Lists </title>
94 URL="https://lists.berlios.de/mailman/listinfo/mutt-ng-users"
95 >mutt-ng-users@lists.berlios.de</ulink
96 > -- This is where the mutt-ng user support happens.
103 URL="https://lists.berlios.de/mailman/listinfo/mutt-ng-devel"
104 >mutt-ng-devel@lists.berlios.de</ulink
105 > -- The development mailing list for mutt-ng
120 <title>Software Distribution Sites </title>
123 So far, there are no official releases of Mutt-ng, but you can download
124 daily snapshots from <ulink
125 URL="http://mutt-ng.berlios.de/snapshots/"
126 >http://mutt-ng.berlios.de/snapshots/</ulink
140 Visit channel <emphasis>#muttng</emphasis> on <ulink
141 URL="http://www.freenode.net/"
142 >irc.freenode.net (www.freenode.net)</ulink
143 > to chat with other people interested in Mutt-ng.
153 <title>Weblog </title>
156 If you want to read fresh news about the latest development in Mutt-ng, and get informed
157 about stuff like interesting, Mutt-ng-related articles and packages for your favorite
158 distribution, you can read and/or subscribe to our
160 URL="http://mutt-ng.supersized.org/"
161 >Mutt-ng development weblog</ulink
172 <title>Copyright </title>
175 Mutt is Copyright (C) 1996-2000 Michael R. Elkins
176 <me@cs.hmc.edu> and others
180 This program is free software; you can redistribute it and/or modify
181 it under the terms of the GNU General Public License as published by
182 the Free Software Foundation; either version 2 of the License, or
183 (at your option) any later version.
187 This program is distributed in the hope that it will be useful,
188 but WITHOUT ANY WARRANTY; without even the implied warranty of
189 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
190 GNU General Public License for more details.
194 You should have received a copy of the GNU General Public License
195 along with this program; if not, write to the Free Software
196 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111, USA.
209 </chapter> <!--}}}-->
212 <title>Getting Started </title>
215 <title>Basic Concepts </title>
218 <title>Screens and Menus </title>
221 mutt-ng offers different screens of which every has its special
231 The <emphasis>index</emphasis> displays the contents of the currently opened
239 The <emphasis>pager</emphasis> is responsible for displaying messages, that
240 is, the header, the body and all attached parts.
247 The <emphasis>file browser</emphasis> offers operations on and displays
248 information of all folders mutt-ng should watch for mail.
255 The <emphasis>sidebar</emphasis> offers a permanent view of which mailboxes
256 contain how many total, new and/or flagged mails.
263 The <emphasis>help screen</emphasis> lists for all currently available
264 commands how to invoke them as well as a short description.
271 The <emphasis>compose</emphasis> menu is a comfortable interface take last
272 actions before sending mail: change subjects, attach files, remove
280 The <emphasis>attachement</emphasis> menu gives a summary and the tree
281 structure of the attachements of the current message.
288 The <emphasis>alias</emphasis> menu lists all or a fraction of the aliases
296 The <emphasis>key</emphasis> menu used in connection with encryption lets
297 users choose the right key to encrypt with.
307 When mutt-ng is started without any further options, it'll open
308 the users default mailbox and display the index.
318 <title>Configuration </title>
321 Mutt-ng does <emphasis>not</emphasis> feature an internal configuration
322 interface or menu due to the simple fact that this would be too
323 complex to handle (currently there are several <emphasis>hundred</emphasis>
324 variables which fine-tune the behaviour.)
328 Mutt-ng is configured using configuration files which allow
329 users to add comments or manage them via version control systems
334 Also, mutt-ng comes with a shell script named <literal>grml-muttng</literal>
335 kindly contributed by users which really helps and eases the
336 creation of a user's configuration file. When downloading the
337 source code via a snapshot or via subversion, it can be found in
338 the <literal>contrib</literal> directory.
348 <title>Functions </title>
351 Mutt-ng offers great flexibility due to the use of functions:
352 internally, every action a user can make mutt-ng perform is named
353 ``function.'' Those functions are assigned to keys (or even key
354 sequences) and may be completely adjusted to user's needs. The
355 basic idea is that the impatient users get a very intuitive
356 interface to start off with and advanced users virtually get no
357 limits to adjustments.
367 <title>Interaction </title>
370 Mutt-ng has two basic concepts of user interaction:
379 There is one dedicated line on the screen used to query
380 the user for input, issue any command, query variables and
381 display error and informational messages. As for every type of
382 user input, this requires manual action leading to the need of
390 The automatized interface for interaction are the so
391 called <emphasis>hooks</emphasis>. Hooks specify actions the user wants to be
392 performed at well-defined situations: what to do when entering
393 which folder, what to do when displaying or replying to what
394 kind of message, etc. These are optional, i.e. a user doesn't
395 need to specify them but can do so.
411 <title>Modularization </title>
414 Although mutt-ng has many functionality built-in, many
415 features can be delegated to external tools to increase
416 flexibility: users can define programs to filter a message through
417 before displaying, users can use any program they want for
418 displaying a message, message types (such as PDF or PostScript)
419 for which mutt-ng doesn't have a built-in filter can be rendered
420 by arbitrary tools and so forth. Although mutt-ng has an alias
421 mechanism built-in, it features using external tools to query for
422 nearly every type of addresses from sources like LDAP, databases
423 or just the list of locally known users.
433 <title>Patterns </title>
436 Mutt-ng has a built-in pattern matching ``language'' which is
437 as widely used as possible to present a consistent interface to
438 users. The same ``pattern terms'' can be used for searching,
439 scoring, message selection and much more.
457 <title>Screens and Menus </title>
460 <title>Index </title>
463 The index is the screen that you usually see first when you
464 start mutt-ng. It gives an overview over your emails in the
465 currently opened mailbox. By default, this is your system mailbox.
466 The information you see in the index is a list of emails, each with
467 its number on the left, its flags (new email, important email,
468 email that has been forwarded or replied to, tagged email, ...),
469 the date when email was sent, its sender, the email size, and the
470 subject. Additionally, the index also shows thread hierarchies:
471 when you reply to an email, and the other person replies back, you
472 can see the other's person email in a "sub-tree" below. This is
473 especially useful for personal email between a group of people or
474 when you've subscribed to mailing lists.
484 <title>Pager </title>
487 The pager is responsible for showing the email content. On the
488 top of the pager you have an overview over the most important email
489 headers like the sender, the recipient, the subject, and much more
490 information. How much information you actually see depends on your
491 configuration, which we'll describe below.
495 Below the headers, you see the email body which usually contains
496 the message. If the email contains any attachments, you will see
497 more information about them below the email body, or, if the
498 attachments are text files, you can view them directly in the
503 To give the user a good overview, it is possible to configure
504 mutt-ng to show different things in the pager with different
505 colors. Virtually everything that can be described with a regular
506 expression can be colored, e.g. URLs, email addresses or smileys.
516 <title>File Browser </title>
519 The file browser is the interface to the local or remote
520 file system. When selecting a mailbox to open, the browser allows
521 custom sorting of items, limiting the items shown by a regular
522 expression and a freely adjustable format of what to display in
523 which way. It also allows for easy navigation through the
524 file system when selecting file(s) to attach to a message, select
525 multiple files to attach and many more.
535 <title>Sidebar </title>
538 The sidebar comes in handy to manage mails which are spread
539 over different folders. All folders users setup mutt-ng to watch
540 for new mail will be listed. The listing includes not only the
541 name but also the number of total messages, the number of new and
542 flagged messages. Items with new mail may be colored different
543 from those with flagged mail, items may be shortened or compress
544 if they're they to long to be printed in full form so that by
545 abbreviated names, user still now what the name stands for.
558 The help screen is meant to offer a quick help to the user. It
559 lists the current configuration of key bindings and their
560 associated commands including a short description, and currently
561 unbound functions that still need to be associated with a key
562 binding (or alternatively, they can be called via the mutt-ng
573 <title>Compose Menu </title>
576 The compose menu features a split screen containing the
577 information which really matter before actually sending a
578 message by mail or posting an article to a newsgroup: who gets
579 the message as what (recipient, newsgroup, who gets what kind of
580 copy). Additionally, users may set security options like
581 deciding whether to sign, encrypt or sign and encrypt a message
586 Also, it's used to attach messages, news articles or files to
587 a message, to re-edit any attachment including the message
598 <title>Alias Menu </title>
601 The alias menu is used to help users finding the recipients
602 of messages. For users who need to contact many people, there's
603 no need to remember addresses or names completely because it
604 allows for searching, too. The alias mechanism and thus the
605 alias menu also features grouping several addresses by a shorter
606 nickname, the actual alias, so that users don't have to select
607 each single recipient manually.
617 <title>Attachment Menu </title>
620 As will be later discussed in detail, mutt-ng features a good
621 and stable MIME implementation, that is, is greatly supports
622 sending and receiving messages of arbitrary type. The
623 attachment menu displays a message's structure in detail: what
624 content parts are attached to which parent part (which gives a
625 true tree structure), which type is of what type and what size.
626 Single parts may saved, deleted or modified to offer great and
627 easy access to message's internals.
637 <title>Key Menu </title>
640 <literal>FIXME</literal>
656 <title>Moving Around in Menus </title>
659 Information is presented in menus, very similar to ELM. Here is a table
660 showing the common keys used to navigate menus in Mutt-ng.
666 j or Down next-entry move to the next entry
667 k or Up previous-entry move to the previous entry
668 z or PageDn page-down go to the next page
669 Z or PageUp page-up go to the previous page
670 = or Home first-entry jump to the first entry
671 * or End last-entry jump to the last entry
672 q quit exit the current menu
673 ? help list all key bindings for the current menu
684 <sect1 id="editing"> <!--{{{-->
685 <title>Editing Input Fields </title>
688 Mutt-ng has a builtin line editor which is used as the primary way to input
689 textual data such as email addresses or filenames. The keys used to move
690 around while editing are very similar to those of Emacs.
696 ^A or <Home> bol move to the start of the line
697 ^B or <Left> backward-char move back one char
698 Esc B backward-word move back one word
699 ^D or <Delete> delete-char delete the char under the cursor
700 ^E or <End> eol move to the end of the line
701 ^F or <Right> forward-char move forward one char
702 Esc F forward-word move forward one word
703 <Tab> complete complete filename or alias
704 ^T complete-query complete address with query
705 ^K kill-eol delete to the end of the line
706 ESC d kill-eow delete to the end of the word
707 ^W kill-word kill the word in front of the cursor
708 ^U kill-line delete entire line
709 ^V quote-char quote the next typed key
710 <Up> history-up recall previous string from history
711 <Down> history-down recall next string from history
712 <BackSpace> backspace kill the char in front of the cursor
713 Esc u upcase-word convert word to upper case
714 Esc l downcase-word convert word to lower case
715 Esc c capitalize-word capitalize the word
717 <Return> n/a finish editing
723 You can remap the <emphasis>editor</emphasis> functions using the <link linkend="bind">bind</link>
724 command. For example, to make the <emphasis>Delete</emphasis> key delete the character in
725 front of the cursor rather than under, you could use
729 <literal>bind editor <delete> backspace</literal>
739 <title>Reading Mail - The Index and Pager </title> <!--{{{-->
742 Similar to many other mail clients, there are two modes in which mail is
743 read in Mutt-ng. The first is the index of messages in the mailbox, which is
744 called the ``index'' in Mutt-ng. The second mode is the display of the
745 message contents. This is called the ``pager.''
749 The next few sections describe the functions provided in each of these
754 <title>The Message Index</title> <!--{{{-->
759 c change to a different mailbox
760 ESC c change to a folder in read-only mode
761 C copy the current message to another mailbox
762 ESC C decode a message and copy it to a folder
763 ESC s decode a message and save it to a folder
764 D delete messages matching a pattern
765 d delete the current message
767 l show messages matching a pattern
768 N mark message as new
769 o change the current sort method
770 O reverse sort the mailbox
771 q save changes and exit
773 T tag messages matching a pattern
774 t toggle the tag on a message
775 ESC t toggle tag on entire message thread
776 U undelete messages matching a pattern
779 x abort changes and exit
780 <Return> display-message
781 <Tab> jump to the next new message
782 @ show the author's full e-mail address
783 $ save changes to mailbox
786 ^L clear and redraw the screen
787 ^T untag messages matching a pattern
793 <title>Status Flags</title> <!--{{{-->
796 In addition to who sent the message and the subject, a short summary of
797 the disposition of each message is printed beside the message number.
798 Zero or more of the following ``flags'' may appear, which mean:
808 message is deleted (is marked for deletion)
810 </listitem></varlistentry>
815 message have attachments marked for deletion
817 </listitem></varlistentry>
822 contains a PGP public key
824 </listitem></varlistentry>
831 </listitem></varlistentry>
838 </listitem></varlistentry>
843 message is PGP encrypted
845 </listitem></varlistentry>
850 message has been replied to
852 </listitem></varlistentry>
857 message is signed, and the signature is succesfully verified
859 </listitem></varlistentry>
866 </listitem></varlistentry>
873 </listitem></varlistentry>
880 </listitem></varlistentry>
885 Some of the status flags can be turned on or off using
891 <emphasis role="bold">set-flag</emphasis> (default: w)
897 <emphasis role="bold">clear-flag</emphasis> (default: W)
906 Furthermore, the following flags reflect who the message is addressed
907 to. They can be customized with the
908 <link linkend="to-chars">$to_chars</link> variable.
918 message is to you and you only
920 </listitem></varlistentry>
925 message is to you, but also to or cc'ed to others
927 </listitem></varlistentry>
932 message is cc'ed to you
934 </listitem></varlistentry>
941 </listitem></varlistentry>
946 message is sent to a subscribed mailing list
948 </listitem></varlistentry>
959 <title>The Pager</title> <!--{{{-->
962 By default, Mutt-ng uses its builtin pager to display the body of messages.
963 The pager is very similar to the Unix program <emphasis>less</emphasis> though not nearly as
970 <Return> go down one line
971 <Space> display the next page (or next message if at the end of a message)
972 - go back to the previous page
973 n search for next match
974 S skip beyond quoted text
975 T toggle display of quoted text
977 / search for a regular expression (pattern)
978 ESC / search backwards for a regular expression
979 \ toggle search pattern coloring
980 ^ jump to the top of the message
986 In addition, many of the functions from the <emphasis>index</emphasis> are available in
987 the pager, such as <emphasis>delete-message</emphasis> or <emphasis>copy-message</emphasis> (this is one
988 advantage over using an external pager to view messages).
992 Also, the internal pager supports a couple other advanced features. For
993 one, it will accept and translate the ``standard'' nroff sequences for
994 bold and underline. These sequences are a series of either the letter,
995 backspace (ˆH), the letter again for bold or the letter, backspace,
996 ``_'' for denoting underline. Mutt-ng will attempt to display these
997 in bold and underline respectively if your terminal supports them. If
998 not, you can use the bold and underline <link
999 linkend="color">color</link>
1000 objects to specify a color or mono attribute for them.
1004 Additionally, the internal pager supports the ANSI escape sequences for
1005 character attributes. Mutt-ng translates them into the correct color and
1006 character settings. The sequences Mutt-ng supports are:
1012 ESC [ Ps;Ps;Ps;...;Ps m
1014 0 All Attributes Off
1019 3x Foreground color is x
1020 4x Background color is x
1036 Mutt-ng uses these attributes for handling text/enriched messages, and they
1037 can also be used by an external <link
1038 linkend="auto-view">autoview</link>
1039 script for highlighting purposes. <emphasis role="bold">Note:</emphasis> If you change the colors for your
1040 display, for example by changing the color associated with color2 for
1041 your xterm, then that color will be used instead of green.
1047 <sect2 id="threads">
1048 <title>Threaded Mode</title> <!--{{{-->
1051 When the mailbox is <link linkend="sort">sorted</link> by <emphasis>threads</emphasis>, there are
1052 a few additional functions available in the <emphasis>index</emphasis> and <emphasis>pager</emphasis> modes.
1058 ^D delete-thread delete all messages in the current thread
1059 ^U undelete-thread undelete all messages in the current thread
1060 ^N next-thread jump to the start of the next thread
1061 ^P previous-thread jump to the start of the previous thread
1062 ^R read-thread mark the current thread as read
1063 ESC d delete-subthread delete all messages in the current subthread
1064 ESC u undelete-subthread undelete all messages in the current subthread
1065 ESC n next-subthread jump to the start of the next subthread
1066 ESC p previous-subthread jump to the start of the previous subthread
1067 ESC r read-subthread mark the current subthread as read
1068 ESC t tag-thread toggle the tag on the current thread
1069 ESC v collapse-thread toggle collapse for the current thread
1070 ESC V collapse-all toggle collapse for all threads
1071 P parent-message jump to parent message in thread
1077 <emphasis role="bold">Note:</emphasis> Collapsing a thread displays only the first message
1078 in the thread and hides the others. This is useful when threads
1079 contain so many messages that you can only see a handful of threads on
1080 the screen. See %M in <link
1081 linkend="index-format">index-format</link>.
1082 For example, you could use "%?M?(#%03M)&(%4l)?" in <link linkend="index-format">index-format</link> to optionally
1083 display the number of hidden messages if the thread is collapsed.
1087 See also: <link linkend="strict-threads">strict-threads</link>.
1094 <title>Miscellaneous Functions</title> <!--{{{-->
1097 <emphasis role="bold">create-alias</emphasis><anchor id="create-alias"/> (default: a)
1102 Creates a new alias based upon the current message (or prompts for a
1103 new one). Once editing is complete, an <link linkend="alias">alias</link>
1104 command is added to the file specified by the <link linkend="alias-file">alias-file</link> variable for future use. <emphasis role="bold">Note:</emphasis>
1105 Specifying an <link linkend="alias-file">alias-file</link>
1106 does not add the aliases specified there-in, you must also <link linkend="source">source</link> the file.
1110 <emphasis role="bold">check-traditional-pgp</emphasis><anchor id="check-traditional-pgp"/> (default: ESC P)
1115 This function will search the current message for content signed or
1116 encrypted with PGP the "traditional" way, that is, without proper
1117 MIME tagging. Technically, this function will temporarily change
1118 the MIME content types of the body parts containing PGP data; this
1119 is similar to the <link linkend="edit-type">edit-type</link> function's
1124 <emphasis role="bold">display-toggle-weed</emphasis><anchor id="display-toggle-weed"/> (default: h)
1129 Toggles the weeding of message header fields specified by <link linkend="ignore">ignore</link> commands.
1133 <emphasis role="bold">edit</emphasis><anchor id="edit"/> (default: e)
1138 This command (available in the ``index'' and ``pager'') allows you to
1139 edit the raw current message as it's present in the mail folder.
1140 After you have finished editing, the changed message will be
1141 appended to the current folder, and the original message will be
1142 marked for deletion.
1146 <emphasis role="bold">edit-type</emphasis><anchor id="edit-type"/>
1148 (default: ˆE on the attachment menu, and in the pager and index menus; ˆT on the
1153 This command is used to temporarily edit an attachment's content
1154 type to fix, for instance, bogus character set parameters. When
1155 invoked from the index or from the pager, you'll have the
1156 opportunity to edit the top-level attachment's content type. On the
1157 <link linkend="attach-menu">attach-menu</link>, you can change any
1158 attachment's content type. These changes are not persistent, and get
1159 lost upon changing folders.
1163 Note that this command is also available on the <link linkend="compose-menu">compose-menu</link>. There, it's used to
1164 fine-tune the properties of attachments you are going to send.
1168 <emphasis role="bold">enter-command</emphasis><anchor id="enter-command"/> (default: ``:'')
1173 This command is used to execute any command you would normally put in a
1174 configuration file. A common use is to check the settings of variables, or
1175 in conjunction with <link linkend="macro">macro</link> to change settings on the
1180 <emphasis role="bold">extract-keys</emphasis><anchor id="extract-keys"/> (default: ˆK)
1185 This command extracts PGP public keys from the current or tagged
1186 message(s) and adds them to your PGP public key ring.
1190 <emphasis role="bold">forget-passphrase</emphasis><anchor id="forget-passphrase"/> (default:
1196 This command wipes the passphrase(s) from memory. It is useful, if
1197 you misspelled the passphrase.
1201 <emphasis role="bold">list-reply</emphasis><anchor id="func-list-reply"/> (default: L)
1206 Reply to the current or tagged message(s) by extracting any addresses which
1207 match the regular expressions given by the <link linkend="lists">lists</link>
1208 commands, but also honor any <literal>Mail-Followup-To</literal> header(s) if the
1209 <link linkend="honor-followup-to">honor-followup-to</link>
1210 configuration variable is set. Using this when replying to messages posted
1211 to mailing lists helps avoid duplicate copies being sent to the author of
1212 the message you are replying to.
1216 <emphasis role="bold">pipe-message</emphasis><anchor id="pipe-message"/> (default: |)
1221 Asks for an external Unix command and pipes the current or
1222 tagged message(s) to it. The variables <link linkend="pipe-decode">pipe-decode</link>, <link linkend="pipe-split">pipe-split</link>, <link linkend="pipe-sep">pipe-sep</link> and <link linkend="wait-key">wait-key</link> control the exact behavior of this
1227 <emphasis role="bold">resend-message</emphasis><anchor id="resend-message"/> (default: ESC e)
1232 With resend-message, mutt takes the current message as a template for a
1233 new message. This function is best described as "recall from arbitrary
1234 folders". It can conveniently be used to forward MIME messages while
1235 preserving the original mail structure. Note that the amount of headers
1236 included here depends on the value of the <link linkend="weed">weed</link>
1241 This function is also available from the attachment menu. You can use this
1242 to easily resend a message which was included with a bounce message
1243 as a message/rfc822 body part.
1247 <emphasis role="bold">shell-escape</emphasis><anchor id="shell-escape"/> (default: !)
1252 Asks for an external Unix command and executes it. The <link linkend="wait-key">wait-key</link> can be used to control
1253 whether Mutt-ng will wait for a key to be pressed when the command returns
1254 (presumably to let the user read the output of the command), based on
1255 the return status of the named command.
1259 <emphasis role="bold">toggle-quoted</emphasis><anchor id="toggle-quoted"/> (default: T)
1264 The <emphasis>pager</emphasis> uses the <link linkend="quote-regexp">quote-regexp</link> variable to detect quoted text when
1265 displaying the body of the message. This function toggles the display
1266 of the quoted material in the message. It is particularly useful when
1267 are interested in just the response and there is a large amount of
1268 quoted text in the way.
1272 <emphasis role="bold">skip-quoted</emphasis><anchor id="skip-quoted"/> (default: S)
1277 This function will go to the next line of non-quoted text which come
1278 after a line of quoted text in the internal pager.
1292 <title>Sending Mail </title> <!--{{{-->
1295 The following bindings are available in the <emphasis>index</emphasis> for sending
1302 m compose compose a new message
1303 r reply reply to sender
1304 g group-reply reply to all recipients
1305 L list-reply reply to mailing list address
1306 f forward forward message
1307 b bounce bounce (remail) message
1308 ESC k mail-key mail a PGP public key to someone
1314 Bouncing a message sends the message as is to the recipient you
1315 specify. Forwarding a message allows you to add comments or
1316 modify the message you are forwarding. These items are discussed
1317 in greater detail in the next chapter <link linkend="forwarding-mail">forwarding-mail</link>.
1321 <title>Composing new messages </title> <!--{{{-->
1324 When you want to send an email using mutt-ng, simply press <literal>m</literal> on
1325 your keyboard. Then, mutt-ng asks for the recipient via a prompt in
1338 After you've finished entering the recipient(s), press return. If you
1339 want to send an email to more than one recipient, separate the email
1340 addresses using the comma "<literal>,</literal>". Mutt-ng then asks you for the email
1341 subject. Again, press return after you've entered it. After that, mutt-ng
1342 got the most important information from you, and starts up an editor
1343 where you can then enter your email.
1347 The editor that is called is selected in the following way: you
1348 can e.g. set it in the mutt-ng configuration:
1354 set editor = "vim +/^$/ -c ':set tw=72'"
1356 set editor = "emacs"
1362 If you don't set your preferred editor in your configuration, mutt-ng
1363 first looks whether the environment variable <literal>$VISUAL</literal> is set, and if
1364 so, it takes its value as editor command. Otherwise, it has a look
1365 at <literal>$EDITOR</literal> and takes its value if it is set. If no editor command
1366 can be found, mutt-ng simply assumes <literal>vi</literal> to be the default editor,
1367 since it's the most widespread editor in the Unix world and it's pretty
1368 safe to assume that it is installed and available.
1372 When you've finished entering your message, save it and quit your
1373 editor. Mutt-ng will then present you with a summary screen, the compose menu.
1374 On the top, you see a summary of the most important available key commands.
1375 Below that, you see the sender, the recipient(s), Cc and/or Bcc
1376 recipient(s), the subject, the reply-to address, and optionally
1377 information where the sent email will be stored and whether it should
1378 be digitally signed and/or encrypted.
1382 Below that, you see a list of "attachments". The mail you've just
1383 entered before is also an attachment, but due to its special type
1384 (it's plain text), it will be displayed as the normal message on
1385 the receiver's side.
1389 At this point, you can add more attachments, pressing <literal>a</literal>, you
1390 can edit the recipient addresses, pressing <literal>t</literal> for the "To:" field,
1391 <literal>c</literal> for the "Cc:" field, and <literal>b</literal> for the "Bcc: field. You can
1392 also edit the subject the subject by simply pressing <literal>s</literal> or the
1393 email message that you've entered before by pressing <literal>e</literal>. You will
1394 then again return to the editor. You can even edit the sender, by pressing
1395 <literal><esc>f</literal>, but this shall only be used with caution.
1399 Alternatively, you can configure mutt-ng in a way that most of the
1400 above settings can be edited using the editor. Therefore, you only
1401 need to add the following to your configuration:
1413 Once you have finished editing the body of your mail message, you are
1414 returned to the <emphasis>compose</emphasis> menu. The following options are available:
1420 a attach-file attach a file
1421 A attach-message attach message(s) to the message
1422 ESC k attach-key attach a PGP public key
1423 d edit-description edit description on attachment
1424 D detach-file detach a file
1425 t edit-to edit the To field
1426 ESC f edit-from edit the From field
1427 r edit-reply-to edit the Reply-To field
1428 c edit-cc edit the Cc field
1429 b edit-bcc edit the Bcc field
1430 y send-message send the message
1431 s edit-subject edit the Subject
1432 S smime-menu select S/MIME options
1433 f edit-fcc specify an ``Fcc'' mailbox
1434 p pgp-menu select PGP options
1435 P postpone-message postpone this message until later
1436 q quit quit (abort) sending the message
1437 w write-fcc write the message to a folder
1438 i ispell check spelling (if available on your system)
1439 ^F forget-passphrase wipe passphrase(s) from memory
1445 <emphasis role="bold">Note:</emphasis> The attach-message function will prompt you for a folder to
1446 attach messages from. You can now tag messages in that folder and they
1447 will be attached to the message you are sending. Note that certain
1448 operations like composing a new mail, replying, forwarding, etc. are
1449 not permitted when you are in that folder. The %r in <link linkend="status-format">status-format</link> will change to
1450 a 'A' to indicate that you are in attach-message mode.
1461 <title>Replying </title> <!--{{{-->
1464 <title>Simple Replies </title> <!--{{{-->
1467 When you want to reply to an email message, select it in the index
1468 menu and then press <literal>r</literal>. Mutt-ng's behaviour is then similar to the
1469 behaviour when you compose a message: first, you will be asked for
1470 the recipient, then for the subject, and then, mutt-ng will start
1471 the editor with the quote attribution and the quoted message. This
1472 can e.g. look like the example below.
1478 On Mon, Mar 07, 2005 at 05:02:12PM +0100, Michael Svensson wrote:
1479 > Bill, can you please send last month's progress report to Mr.
1480 > Morgan? We also urgently need the cost estimation for the new
1481 > production server that we want to set up before our customer's
1482 > project will go live.
1489 You can start editing the email message. It is strongly
1490 recommended to put your answer <emphasis>below</emphasis> the quoted text and to
1491 only quote what is really necessary and that you refer to. Putting
1492 your answer on top of the quoted message, is, although very
1493 widespread, very often not considered to be a polite way to answer
1498 The quote attribution is configurable, by default it is set to
1501 set attribution = "On %d, %n wrote:"
1508 It can also be set to something more compact, e.g.
1511 set attribution = "attribution="* %n <%a> [%(%y-%m-%d %H:%M)]:"
1518 The example above results in the following attribution:
1521 * Michael Svensson <svensson@foobar.com> [05-03-06 17:02]:
1522 > Bill, can you please send last month's progress report to Mr.
1523 > Morgan? We also urgently need the cost estimation for the new
1524 > production server that we want to set up before our customer's
1525 > project will go live.
1532 Generally, try to keep your attribution short yet
1533 information-rich. It is <emphasis>not</emphasis> the right place for witty quotes,
1534 long "attribution" novels or anything like that: the right place
1535 for such things is - if at all - the email signature at the very
1536 bottom of the message.
1540 When you're done with writing your message, save and quit the
1541 editor. As before, you will return to the compose menu, which is
1542 used in the same way as before.
1553 <title>Group Replies </title> <!--{{{-->
1556 In the situation where a group of people uses email as a
1557 discussion, most of the emails will have one or more recipients,
1558 and probably several "Cc:" recipients. The group reply functionality
1559 ensures that when you press <literal>g</literal> instead of <literal>r</literal> to do a reply,
1560 each and every recipient that is contained in the original message
1561 will receive a copy of the message, either as normal recipient or
1573 <title>List Replies </title> <!--{{{-->
1576 When you use mailing lists, it's generally better to send your
1577 reply to a message only to the list instead of the list and the
1578 original author. To make this easy to use, mutt-ng features list
1583 To do a list reply, simply press <literal>L</literal>. If the email contains
1584 a <literal>Mail-Followup-To:</literal> header, its value will be used as reply
1585 address. Otherwise, mutt-ng searches through all mail addresses in
1586 the original message and tries to match them a list of regular
1587 expressions which can be specified using the <literal>lists</literal> command.
1588 If any of the regular expression matches, a mailing
1589 list address has been found, and it will be used as reply address.
1595 lists linuxevent@luga\.at vuln-dev@ mutt-ng-users@
1602 Nowadays, most mailing list software like GNU Mailman adds a
1603 <literal>Mail-Followup-To:</literal> header to their emails anyway, so setting
1604 <literal>lists</literal> is hardly ever necessary in practice.
1622 <title>Editing the message header </title>
1625 When editing the header of your outgoing message, there are a couple of
1626 special features available.
1632 <literal>Fcc:</literal> <emphasis>filename</emphasis>
1634 Mutt-ng will pick up <emphasis>filename</emphasis>
1635 just as if you had used the <emphasis>edit-fcc</emphasis> function in the <emphasis>compose</emphasis> menu.
1639 You can also attach files to your message by specifying
1641 <literal>Attach:</literal> <emphasis>filename</emphasis> [ <emphasis>description</emphasis> ]
1643 where <emphasis>filename</emphasis> is the file to attach and <emphasis>description</emphasis> is an
1644 optional string to use as the description of the attached file.
1648 When replying to messages, if you remove the <emphasis>In-Reply-To:</emphasis> field from
1649 the header field, Mutt-ng will not generate a <emphasis>References:</emphasis> field, which
1650 allows you to create a new message thread.
1654 Also see <link linkend="edit-headers">edit-headers</link>.
1664 <title>Using Mutt-ng with PGP </title>
1667 If you want to use PGP, you can specify
1671 <literal>Pgp:</literal> [ <literal>E</literal> | <literal>S</literal> | <literal>S</literal><emphasis><id></emphasis> ]
1676 ``E'' encrypts, ``S'' signs and
1677 ``S<id>'' signs with the given key, setting <link linkend="pgp-sign-as">pgp-sign-as</link> permanently.
1681 If you have told mutt to PGP encrypt a message, it will guide you
1682 through a key selection process when you try to send the message.
1683 Mutt-ng will not ask you any questions about keys which have a
1684 certified user ID matching one of the message recipients' mail
1685 addresses. However, there may be situations in which there are
1686 several keys, weakly certified user ID fields, or where no matching
1691 In these cases, you are dropped into a menu with a list of keys from
1692 which you can select one. When you quit this menu, or mutt can't
1693 find any matching keys, you are prompted for a user ID. You can, as
1694 usually, abort this prompt using <literal>ˆG</literal>. When you do so, mutt will
1695 return to the compose screen.
1699 Once you have successfully finished the key selection, the message
1700 will be encrypted using the selected public keys, and sent out.
1704 Most fields of the entries in the key selection menu (see also <link linkend="pgp-entry-format">pgp-entry-format</link>)
1705 have obvious meanings. But some explanations on the capabilities, flags,
1706 and validity fields are in order.
1710 The flags sequence (%f) will expand to one of the following flags:
1713 R The key has been revoked and can't be used.
1714 X The key is expired and can't be used.
1715 d You have marked the key as disabled.
1716 c There are unknown critical self-signature
1723 The capabilities field (%c) expands to a two-character sequence
1724 representing a key's capabilities. The first character gives
1725 the key's encryption capabilities: A minus sign (<emphasis role="bold">-</emphasis>) means
1726 that the key cannot be used for encryption. A dot (<emphasis role="bold">.</emphasis>) means that
1727 it's marked as a signature key in one of the user IDs, but may
1728 also be used for encryption. The letter <emphasis role="bold">e</emphasis> indicates that
1729 this key can be used for encryption.
1733 The second character indicates the key's signing capabilities. Once
1734 again, a ``<emphasis role="bold">-</emphasis>'' implies ``not for signing'', ``<emphasis role="bold">.</emphasis>'' implies
1735 that the key is marked as an encryption key in one of the user-ids, and
1736 ``<emphasis role="bold">s</emphasis>'' denotes a key which can be used for signing.
1740 Finally, the validity field (%t) indicates how well-certified a user-id
1741 is. A question mark (<emphasis role="bold">?</emphasis>) indicates undefined validity, a minus
1742 character (<emphasis role="bold">-</emphasis>) marks an untrusted association, a space character
1743 means a partially trusted association, and a plus character (<emphasis role="bold">+</emphasis>)
1744 indicates complete validity.
1754 <title>Sending anonymous messages via mixmaster </title>
1757 You may also have configured mutt to co-operate with Mixmaster, an
1758 anonymous remailer. Mixmaster permits you to send your messages
1759 anonymously using a chain of remailers. Mixmaster support in mutt is for
1760 mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03.
1761 It does not support earlier versions or the later so-called version 3 betas,
1762 of which the latest appears to be called 2.9b23.
1766 To use it, you'll have to obey certain restrictions. Most
1767 important, you cannot use the <literal>Cc</literal> and <literal>Bcc</literal> headers. To tell
1768 Mutt-ng to use mixmaster, you have to select a remailer chain, using
1769 the mix function on the compose menu.
1773 The chain selection screen is divided into two parts. In the
1774 (larger) upper part, you get a list of remailers you may use. In
1775 the lower part, you see the currently selected chain of remailers.
1779 You can navigate in the chain using the <literal>chain-prev</literal> and
1780 <literal>chain-next</literal> functions, which are by default bound to the left
1781 and right arrows and to the <literal>h</literal> and <literal>l</literal> keys (think vi
1782 keyboard bindings). To insert a remailer at the current chain
1783 position, use the <literal>insert</literal> function. To append a remailer behind
1784 the current chain position, use <literal>select-entry</literal> or <literal>append</literal>.
1785 You can also delete entries from the chain, using the corresponding
1786 function. Finally, to abandon your changes, leave the menu, or
1787 <literal>accept</literal> them pressing (by default) the <literal>Return</literal> key.
1791 Note that different remailers do have different capabilities,
1792 indicated in the %c entry of the remailer menu lines (see
1793 <link linkend="mix-entry-format">mix-entry-format</link>). Most important is
1794 the ``middleman'' capability, indicated by a capital ``M'': This
1795 means that the remailer in question cannot be used as the final
1796 element of a chain, but will only forward messages to other
1797 mixmaster remailers. For details on the other capabilities, please
1798 have a look at the mixmaster documentation.
1813 <sect1 id="forwarding-mail">
1814 <title>Forwarding and Bouncing Mail </title>
1817 Often, it is necessary to forward mails to other people.
1818 Therefore, mutt-ng supports forwarding messages in two different
1823 The first one is regular forwarding, as you probably know it from
1824 other mail clients. You simply press <literal>f</literal>, enter the recipient
1825 email address, the subject of the forwarded email, and then you can
1826 edit the message to be forwarded in the editor. The forwarded
1827 message is separated from the rest of the message via the two
1834 ----- Forwarded message from Lucas User <luser@example.com> -----
1836 From: Lucas User <luser@example.com>
1837 Date: Thu, 02 Dec 2004 03:08:34 +0100
1838 To: Michael Random <mrandom@example.com>
1839 Subject: Re: blackmail
1841 Pay me EUR 50,000.- cash or your favorite stuffed animal will die
1845 ----- End forwarded message -----
1851 When you're done with editing the mail, save and quit the editor,
1852 and you will return to the compose menu, the same menu you also
1853 encounter when composing or replying to mails.
1857 The second mode of forwarding emails with mutt-ng is the
1858 so-called <emphasis>bouncing</emphasis>: when you bounce an email to another
1859 address, it will be sent in practically the same format you send it
1860 (except for headers that are created during transporting the
1861 message). To bounce a message, press <literal>b</literal> and enter the recipient
1862 email address. By default, you are then asked whether you really
1863 want to bounce the message to the specified recipient. If you answer
1864 with yes, the message will then be bounced.
1868 To the recipient, the bounced email will look as if he got it
1869 like a regular email where he was <literal>Bcc:</literal> recipient. The only
1870 possibility to find out whether it was a bounced email is to
1871 carefully study the email headers and to find out which host really
1881 <sect1 id="postponing-mail">
1882 <title>Postponing Mail </title>
1885 At times it is desirable to delay sending a message that you have
1886 already begun to compose. When the <emphasis>postpone-message</emphasis> function is
1887 used in the <emphasis>compose</emphasis> menu, the body of your message and attachments
1888 are stored in the mailbox specified by the <link linkend="postponed">postponed</link> variable. This means that you can recall the
1889 message even if you exit Mutt-ng and then restart it at a later time.
1893 Once a message is postponed, there are several ways to resume it. From the
1894 command line you can use the ``-p'' option, or if you <emphasis>compose</emphasis> a new
1895 message from the <emphasis>index</emphasis> or <emphasis>pager</emphasis> you will be prompted if postponed
1896 messages exist. If multiple messages are currently postponed, the
1897 <emphasis>postponed</emphasis> menu will pop up and you can select which message you would
1902 <emphasis role="bold">Note:</emphasis> If you postpone a reply to a message, the reply setting of
1903 the message is only updated when you actually finish the message and
1904 send it. Also, you must be in the same folder with the message you
1905 replied to for the status of the message to be updated.
1909 See also the <link linkend="postpone">postpone</link> quad-option.
1925 <title>Configuration </title>
1928 <title>Locations of Configuration Files </title>
1931 While the default configuration (or ``preferences'') make Mutt-ng usable right out
1932 of the box, it is often desirable to tailor Mutt-ng to suit your own tastes. When
1933 Mutt-ng is first invoked, it will attempt to read the ``system'' configuration
1934 file (defaults set by your local system administrator), unless the ``-n'' <link linkend="commandline">commandline</link> option is specified. This file is
1935 typically <literal>/usr/local/share/muttng/Muttngrc</literal> or <literal>/etc/Muttngrc</literal>,
1936 Mutt-ng users will find this file in <literal>/usr/local/share/muttng/Muttrc</literal> or
1937 <literal>/etc/Muttngrc</literal>. Mutt will next look for a file named <literal>.muttrc</literal>
1938 in your home directory, Mutt-ng will look for <literal>.muttngrc</literal>. If this file
1939 does not exist and your home directory has a subdirectory named <literal>.mutt</literal>,
1940 mutt try to load a file named <literal>.muttng/muttngrc</literal>.
1944 <literal>.muttrc</literal> (or <literal>.muttngrc</literal> for Mutt-ng) is the file where you will
1945 usually place your <link linkend="commands">commands</link> to configure Mutt-ng.
1954 <sect1 id="muttrc-syntax">
1955 <title>Basic Syntax of Initialization Files </title>
1958 An initialization file consists of a series of <link linkend="commands">commands</link>. Each line of the file may contain one or more commands.
1959 When multiple commands are used, they must be separated by a semicolon (;).
1962 set realname='Mutt-ng user' ; ignore x-
1965 The hash mark, or pound sign
1966 (``#''), is used as a ``comment'' character. You can use it to
1967 annotate your initialization file. All text after the comment character
1968 to the end of the line is ignored. For example,
1974 my_hdr X-Disclaimer: Why are you listening to me? # This is a comment
1980 Single quotes (') and double quotes (") can be used to quote strings
1981 which contain spaces or other special characters. The difference between
1982 the two types of quotes is similar to that of many popular shell programs,
1983 namely that a single quote is used to specify a literal string (one that is
1984 not interpreted for shell variables or quoting with a backslash [see
1985 next paragraph]), while double quotes indicate a string for which
1986 should be evaluated. For example, backtics are evaluated inside of double
1987 quotes, but <emphasis role="bold">not</emphasis> for single quotes.
1991 \ quotes the next character, just as in shells such as bash and zsh.
1992 For example, if want to put quotes ``"'' inside of a string, you can use
1993 ``\'' to force the next character to be a literal instead of interpreted
1997 set realname="Michael \"MuttDude\" Elkins"
2003 ``\\'' means to insert a literal ``\'' into the line.
2004 ``\n'' and ``\r'' have their usual C meanings of linefeed and
2005 carriage-return, respectively.
2009 A \ at the end of a line can be used to split commands over
2010 multiple lines, provided that the split points don't appear in the
2011 middle of command names.
2015 Please note that, unlike the various shells, mutt-ng interprets a ``\''
2016 at the end of a line also in comments. This allows you to disable a command
2017 split over multiple lines with only one ``#''.
2024 set realname="Michael \"MuttDude\" Elkins"
2030 When testing your config files, beware the following caveat. The backslash
2031 at the end of the commented line extends the current line with the next line
2032 - then referred to as a ``continuation line''. As the first line is
2033 commented with a hash (#) all following continuation lines are also
2034 part of a comment and therefore are ignored, too. So take care of comments
2035 when continuation lines are involved within your setup files!
2055 line1 ``continues'' until line4. however, the part after the # is a
2056 comment which includes line3 and line4. line5 is a new line of its own and
2057 thus is interpreted again.
2061 The commands understood by mutt are explained in the next paragraphs.
2062 For a complete list, see the <link linkend="commands">commands</link>.
2072 <title>Expansion within variables </title>
2075 Besides just assign static content to variables, there's plenty of
2076 ways of adding external and more or less dynamic content.
2080 <title>Commands' Output </title>
2083 It is possible to substitute the output of a Unix command in an
2084 initialization file. This is accomplished by enclosing the command
2085 in backquotes (``) as in, for example:
2091 my_hdr X-Operating-System: `uname -a`
2097 The output of the Unix command ``uname -a'' will be substituted
2098 before the line is parsed. Note that since initialization files are
2099 line oriented, only the first line of output from the Unix command
2100 will be substituted.
2106 <title>Environment Variables </title>
2109 UNIX environments can be accessed like the way it is done in
2110 shells like sh and bash: Prepend the name of the environment by a
2111 ``$'' sign. For example,
2117 set record=+sent_on_$HOSTNAME
2123 sets the <link linkend="record">record</link> variable to the
2124 string <emphasis>+sent_on_</emphasis> and appends the value of the evironment
2125 variable <literal>$HOSTNAME</literal>.
2129 <emphasis role="bold">Note:</emphasis> There will be no warning if an environment variable
2130 is not defined. The result will of the expansion will then be empty.
2136 <title>Configuration Variables </title>
2139 As for environment variables, the values of all configuration
2140 variables as string can be used in the same way, too. For example,
2146 set imap_home_namespace = $folder
2152 would set the value of <link linkend="imap-home-namespace">imap-home-namespace</link> to the value to
2153 which <link linkend="folder">folder</link> is <emphasis>currently</emphasis> set
2158 <emphasis role="bold">Note:</emphasis> There're no logical links established in such cases so
2159 that the the value for <link linkend="imap-home-namespace">imap-home-namespace</link> won't change even
2160 if <link linkend="folder">folder</link> gets changed.
2164 <emphasis role="bold">Note:</emphasis> There will be no warning if a configuration variable
2165 is not defined or is empty. The result will of the expansion will
2172 <title>Self-Defined Variables </title>
2175 Mutt-ng flexibly allows users to define their own variables. To
2176 avoid conflicts with the standard set and to prevent misleading
2177 error messages, there's a reserved namespace for them: all
2178 user-defined variables must be prefixed with <literal>user_</literal> and can be
2179 used just like any ordinary configuration or environment
2184 For example, to view the manual, users can either define two
2185 macros like the following
2191 macro generic <F1> "!less -r /path/to/manual" "Show manual"
2192 macro pager <F1> "!less -r /path/to/manual" "Show manual"
2198 for <literal>generic</literal>, <literal>pager</literal> and <literal>index</literal>. The alternative is to
2199 define a custom variable like so:
2205 set user_manualcmd = "!less -r /path/to_manual"
2206 macro generic <F1> "$user_manualcmd<enter>" "Show manual"
2207 macro pager <F1> "$user_manualcmd<enter>" "Show manual"
2208 macro index <F1> "$user_manualcmd<enter>" "Show manual"
2214 to re-use the command sequence as in:
2220 macro index <F2> "$user_manualcmd | grep '\^[ ]\\+~. '" "Show Patterns"
2226 Using this feature, arbitrary sequences can be defined once and
2227 recalled and reused where necessary. More advanced scenarios could
2228 include to save a variable's value at the beginning of macro
2229 sequence and restore it at end.
2233 When the variable is first defined, the first value it gets
2234 assigned is also the initial value to which it can be reset using
2235 the <literal>reset</literal> command.
2239 The complete removal is done via the <literal>unset</literal> keyword.
2243 After the following sequence:
2256 the variable <literal>$user_foo</literal> has a current value of 666 and an
2257 initial of 42. The query
2269 will show 666. After doing the reset via
2281 a following query will give 42 as the result. After unsetting it
2294 any query or operation (except the noted expansion within other
2295 statements) will lead to an error message.
2301 <title>Pre-Defined Variables </title>
2304 In order to allow users to share one setup over a number of
2305 different machines without having to change its contents, there's a
2306 number of pre-defined variables. These are prefixed with
2307 <literal>muttng_</literal> and are read-only, i.e. they cannot be set, unset or
2308 reset. The reference chapter lists all available variables.
2312 <emphasis> Please consult the local copy of your manual for their
2313 values as they may differ from different manual sources.</emphasis> Where
2314 the manual is installed in can be queried (already using such a
2315 variable) by running:
2321 muttng -Q muttng_docdir
2327 To extend the example for viewing the manual via self-defined
2328 variables, it can be made more readable and more portable by
2329 changing the real path in:
2335 set user_manualcmd = '!less -r /path/to_manual'
2347 set user_manualcmd = "!less -r $muttng_docdir/manual.txt"
2353 which works everywhere if a manual is installed.
2357 Please note that by the type of quoting, muttng determines when
2358 to expand these values: when it finds double quotes, the value will
2359 be expanded during reading the setup files but when it finds single
2360 quotes, it'll expand it at runtime as needed.
2364 For example, the statement
2370 folder-hook . "set user_current_folder = $muttng_folder_name"
2376 will be already be translated to the following when reading the
2383 folder-hook . "set user_current_folder = some_folder"
2389 with <literal>some_folder</literal> being the name of the first folder muttng
2390 opens. On the contrary,
2396 folder-hook . 'set user_current_folder = $muttng_folder_name'
2402 will be executed at runtime because of the single quotes so that
2403 <literal>user_current_folder</literal> will always have the value of the currently
2408 A more practical example is:
2414 folder-hook . 'source ~/.mutt/score-$muttng_folder_name'
2420 which can be used to source files containing score commands
2421 depending on the folder the user enters.
2427 <title>Type Conversions </title>
2430 A note about variable's types during conversion: internally
2431 values are stored in internal types but for any dump/query or set
2432 operation they're converted to and from string. That means that
2433 there's no need to worry about types when referencing any variable.
2434 As an example, the following can be used without harm (besides
2435 makeing muttng very likely behave strange):
2442 set folder = $read_inc
2443 set read_inc = $folder
2444 set user_magic_number = 42
2445 set folder = $user_magic_number
2455 <title>Defining/Using aliases </title>
2458 Usage: <literal>alias</literal> <emphasis>key</emphasis> <emphasis>address</emphasis> [ , <emphasis>address</emphasis>, ... ]
2462 It's usually very cumbersome to remember or type out the address of someone
2463 you are communicating with. Mutt-ng allows you to create ``aliases'' which map
2464 a short string to a full address.
2468 <emphasis role="bold">Note:</emphasis> if you want to create an alias for a group (by specifying more than
2469 one address), you <emphasis role="bold">must</emphasis> separate the addresses with a comma (``,'').
2473 To remove an alias or aliases (``*'' means all aliases):
2477 <literal>unalias</literal> [ * | <emphasis>key</emphasis> <emphasis>...</emphasis> ]
2483 alias muttdude me@cs.hmc.edu (Michael Elkins)
2484 alias theguys manny, moe, jack
2490 Unlike other mailers, Mutt-ng doesn't require aliases to be defined
2491 in a special file. The <literal>alias</literal> command can appear anywhere in
2492 a configuration file, as long as this file is <link linkend="source">source</link>. Consequently, you can have multiple alias files, or
2493 you can have all aliases defined in your muttrc.
2497 On the other hand, the <link linkend="create-alias">create-alias</link>
2498 function can use only one file, the one pointed to by the <link linkend="alias-file">alias-file</link> variable (which is
2499 <literal>˜/.muttrc</literal> by default). This file is not special either,
2500 in the sense that Mutt-ng will happily append aliases to any file, but in
2501 order for the new aliases to take effect you need to explicitly <link linkend="source">source</link> this file too.
2511 source /usr/local/share/Mutt-ng.aliases
2512 source ~/.mail_aliases
2513 set alias_file=~/.mail_aliases
2519 To use aliases, you merely use the alias at any place in mutt where mutt
2520 prompts for addresses, such as the <emphasis>To:</emphasis> or <emphasis>Cc:</emphasis> prompt. You can
2521 also enter aliases in your editor at the appropriate headers if you have the
2522 <link linkend="edit-headers">edit-headers</link> variable set.
2526 In addition, at the various address prompts, you can use the tab character
2527 to expand a partial alias to the full alias. If there are multiple matches,
2528 mutt will bring up a menu with the matching aliases. In order to be
2529 presented with the full list of aliases, you must hit tab with out a partial
2530 alias, such as at the beginning of the prompt or after a comma denoting
2535 In the alias menu, you can select as many aliases as you want with the
2536 <emphasis>select-entry</emphasis> key (default: RET), and use the <emphasis>exit</emphasis> key
2537 (default: q) to return to the address prompt.
2547 <title>Changing the default key bindings </title>
2550 Usage: <literal>bind</literal> <emphasis>map</emphasis> <emphasis>key</emphasis> <emphasis>function</emphasis>
2554 This command allows you to change the default key bindings (operation
2555 invoked when pressing a key).
2559 <emphasis>map</emphasis> specifies in which menu the binding belongs. Multiple maps may
2560 be specified by separating them with commas (no additional whitespace is
2561 allowed). The currently defined maps are:
2569 <term>generic</term>
2572 This is not a real menu, but is used as a fallback for all of the other
2573 menus except for the pager and editor modes. If a key is not defined in
2574 another menu, Mutt-ng will look for a binding to use in this menu. This allows
2575 you to bind a key to a certain function in multiple menus instead of having
2576 multiple bind statements to accomplish the same task.
2578 </listitem></varlistentry>
2583 The alias menu is the list of your personal aliases as defined in your
2584 muttrc. It is the mapping from a short alias name to the full email
2585 address(es) of the recipient(s).
2587 </listitem></varlistentry>
2592 The attachment menu is used to access the attachments on received messages.
2594 </listitem></varlistentry>
2596 <term>browser</term>
2599 The browser is used for both browsing the local directory structure, and for
2600 listing all of your incoming mailboxes.
2602 </listitem></varlistentry>
2607 The editor is the line-based editor the user enters text data.
2609 </listitem></varlistentry>
2614 The index is the list of messages contained in a mailbox.
2616 </listitem></varlistentry>
2618 <term>compose</term>
2621 The compose menu is the screen used when sending a new message.
2623 </listitem></varlistentry>
2628 The pager is the mode used to display message/attachment data, and help
2631 </listitem></varlistentry>
2636 The pgp menu is used to select the OpenPGP keys used for encrypting outgoing
2639 </listitem></varlistentry>
2641 <term>postpone</term>
2644 The postpone menu is similar to the index menu, except is used when
2645 recalling a message the user was composing, but saved until later.
2647 </listitem></varlistentry>
2652 <emphasis>key</emphasis> is the key (or key sequence) you wish to bind. To specify a
2653 control character, use the sequence <emphasis>\Cx</emphasis>, where <emphasis>x</emphasis> is the
2654 letter of the control character (for example, to specify control-A use
2655 ``\Ca''). Note that the case of <emphasis>x</emphasis> as well as <emphasis>\C</emphasis> is
2656 ignored, so that <emphasis>\CA</emphasis>, <emphasis>\Ca</emphasis>, <emphasis>\cA</emphasis> and <emphasis>\ca</emphasis> are all
2657 equivalent. An alternative form is to specify the key as a three digit
2658 octal number prefixed with a ``\'' (for example <emphasis>\177</emphasis> is
2659 equivalent to <emphasis>\c?</emphasis>).
2663 In addition, <emphasis>key</emphasis> may consist of:
2671 <backtab> backtab / shift-tab
2675 <esc> escape
2676 <up> up arrow
2677 <down> down arrow
2678 <left> left arrow
2679 <right> right arrow
2680 <pageup> Page Up
2681 <pagedown> Page Down
2682 <backspace> Backspace
2683 <delete> Delete
2684 <insert> Insert
2685 <enter> Enter
2686 <return> Return
2689 <space> Space bar
2690 <f1> function key 1
2691 <f10> function key 10
2697 <emphasis>key</emphasis> does not need to be enclosed in quotes unless it contains a
2702 <emphasis>function</emphasis> specifies which action to take when <emphasis>key</emphasis> is pressed.
2703 For a complete list of functions, see the <link linkend="functions">functions</link>. The special function <literal>noop</literal> unbinds the specified key
2713 <sect1 id="charset-hook">
2714 <title>Defining aliases for character sets </title>
2717 Usage: <literal>charset-hook</literal> <emphasis>alias</emphasis> <emphasis>charset</emphasis>
2719 Usage: <literal>iconv-hook</literal> <emphasis>charset</emphasis> <emphasis>local-charset</emphasis>
2723 The <literal>charset-hook</literal> command defines an alias for a character set.
2724 This is useful to properly display messages which are tagged with a
2725 character set name not known to mutt.
2729 The <literal>iconv-hook</literal> command defines a system-specific name for a
2730 character set. This is helpful when your systems character
2731 conversion library insists on using strange, system-specific names
2741 <sect1 id="folder-hook">
2742 <title>Setting variables based upon mailbox </title>
2745 Usage: <literal>folder-hook</literal> [!]<emphasis>regexp</emphasis> <emphasis>command</emphasis>
2749 It is often desirable to change settings based on which mailbox you are
2750 reading. The folder-hook command provides a method by which you can execute
2751 any configuration command. <emphasis>regexp</emphasis> is a regular expression specifying
2752 in which mailboxes to execute <emphasis>command</emphasis> before loading. If a mailbox
2753 matches multiple folder-hook's, they are executed in the order given in the
2758 <emphasis role="bold">Note:</emphasis> if you use the ``!'' shortcut for <link linkend="spoolfile">spoolfile</link> at the beginning of the pattern, you must place it
2759 inside of double or single quotes in order to distinguish it from the
2760 logical <emphasis>not</emphasis> operator for the expression.
2764 Note that the settings are <emphasis>not</emphasis> restored when you leave the mailbox.
2765 For example, a command action to perform is to change the sorting method
2766 based upon the mailbox being read:
2772 folder-hook mutt set sort=threads
2778 However, the sorting method is not restored to its previous value when
2779 reading a different mailbox. To specify a <emphasis>default</emphasis> command, use the
2786 folder-hook . set sort=date-sent
2798 <title>Keyboard macros </title>
2801 Usage: <literal>macro</literal> <emphasis>menu</emphasis> <emphasis>key</emphasis> <emphasis>sequence</emphasis> [ <emphasis>description</emphasis> ]
2805 Macros are useful when you would like a single key to perform a series of
2806 actions. When you press <emphasis>key</emphasis> in menu <emphasis>menu</emphasis>, Mutt-ng will behave as if
2807 you had typed <emphasis>sequence</emphasis>. So if you have a common sequence of commands
2808 you type, you can create a macro to execute those commands with a single
2813 <emphasis>menu</emphasis> is the <link linkend="maps">maps</link> which the macro will be bound.
2814 Multiple maps may be specified by separating multiple menu arguments by
2815 commas. Whitespace may not be used in between the menu arguments and the
2816 commas separating them.
2820 <emphasis>key</emphasis> and <emphasis>sequence</emphasis> are expanded by the same rules as the <link linkend="bind">bind</link>. There are some additions however. The
2821 first is that control characters in <emphasis>sequence</emphasis> can also be specified
2822 as <emphasis>ˆx</emphasis>. In order to get a caret (`ˆ'') you need to use
2823 <emphasis>ˆˆ</emphasis>. Secondly, to specify a certain key such as <emphasis>up</emphasis>
2824 or to invoke a function directly, you can use the format
2825 <emphasis><key name></emphasis> and <emphasis><function name></emphasis>. For a listing of key
2826 names see the section on <link linkend="bind">bind</link>. Functions
2827 are listed in the <link linkend="functions">functions</link>.
2831 The advantage with using function names directly is that the macros will
2832 work regardless of the current key bindings, so they are not dependent on
2833 the user having particular key definitions. This makes them more robust
2834 and portable, and also facilitates defining of macros in files used by more
2835 than one user (eg. the system Muttngrc).
2839 Optionally you can specify a descriptive text after <emphasis>sequence</emphasis>,
2840 which is shown in the help screens.
2844 <emphasis role="bold">Note:</emphasis> Macro definitions (if any) listed in the help screen(s), are
2845 silently truncated at the screen width, and are not wrapped.
2855 <title>Using color and mono video attributes </title>
2858 Usage: <literal>color</literal> <emphasis>object</emphasis> <emphasis>foreground</emphasis> <emphasis>background</emphasis> [ <emphasis>regexp</emphasis> ]
2860 Usage: <literal>color</literal> index <emphasis>foreground</emphasis> <emphasis>background</emphasis> <emphasis>pattern</emphasis>
2862 Usage: <literal>uncolor</literal> index <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
2867 If your terminal supports color, you can spice up Mutt-ng by creating your own
2868 color scheme. To define the color of an object (type of information), you
2869 must specify both a foreground color <emphasis role="bold">and</emphasis> a background color (it is not
2870 possible to only specify one or the other).
2874 <emphasis>object</emphasis> can be one of:
2889 body (match <emphasis>regexp</emphasis> in the body of messages)
2895 bold (highlighting bold patterns in the body of messages)
2901 error (error messages printed by Mutt-ng)
2907 header (match <emphasis>regexp</emphasis> in the message header)
2913 hdrdefault (default color of the message header in the pager)
2919 index (match <emphasis>pattern</emphasis> in the message index)
2925 indicator (arrow or bar used to indicate the current item in a menu)
2931 markers (the ``+'' markers at the beginning of wrapped lines in the pager)
2937 message (informational messages)
2949 quoted (text matching <link linkend="quote-regexp">quote-regexp</link> in the body of a message)
2955 quoted1, quoted2, ..., quoted<emphasis role="bold">N</emphasis> (higher levels of quoting)
2961 search (highlighting of words in the pager)
2973 status (mode lines used to display info about the mailbox or message)
2979 tilde (the ``˜'' used to pad blank lines in the pager)
2985 tree (thread tree drawn in the message index and attachment menu)
2991 underline (highlighting underlined patterns in the body of messages)
3000 <emphasis>foreground</emphasis> and <emphasis>background</emphasis> can be one of the following:
3063 color<emphasis>x</emphasis>
3072 <emphasis>foreground</emphasis> can optionally be prefixed with the keyword <literal>bright</literal> to make
3073 the foreground color boldfaced (e.g., <literal>brightred</literal>).
3077 If your terminal supports it, the special keyword <emphasis>default</emphasis> can be
3078 used as a transparent color. The value <emphasis>brightdefault</emphasis> is also valid.
3079 If Mutt-ng is linked against the <emphasis>S-Lang</emphasis> library, you also need to set
3080 the <emphasis>COLORFGBG</emphasis> environment variable to the default colors of your
3081 terminal for this to work; for example (for Bourne-like shells):
3087 set COLORFGBG="green;black"
3094 <emphasis role="bold">Note:</emphasis> The <emphasis>S-Lang</emphasis> library requires you to use the <emphasis>lightgray</emphasis>
3095 and <emphasis>brown</emphasis> keywords instead of <emphasis>white</emphasis> and <emphasis>yellow</emphasis> when
3096 setting this variable.
3100 <emphasis role="bold">Note:</emphasis> The uncolor command can be applied to the index object only. It
3101 removes entries from the list. You <emphasis role="bold">must</emphasis> specify the same pattern
3102 specified in the color command for it to be removed. The pattern ``*'' is
3103 a special token which means to clear the color index list of all entries.
3107 Mutt-ng also recognizes the keywords <emphasis>color0</emphasis>, <emphasis>color1</emphasis>, …,
3108 <emphasis>color</emphasis><emphasis role="bold">N-1</emphasis> (<emphasis role="bold">N</emphasis> being the number of colors supported
3109 by your terminal). This is useful when you remap the colors for your
3110 display (for example by changing the color associated with <emphasis>color2</emphasis>
3111 for your xterm), since color names may then lose their normal meaning.
3115 If your terminal does not support color, it is still possible change the video
3116 attributes through the use of the ``mono'' command:
3120 Usage: <literal>mono</literal> <emphasis><object> <attribute></emphasis> [ <emphasis>regexp</emphasis> ]
3122 Usage: <literal>mono</literal> index <emphasis>attribute</emphasis> <emphasis>pattern</emphasis>
3124 Usage: <literal>unmono</literal> index <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
3129 where <emphasis>attribute</emphasis> is one of the following:
3177 <title>Ignoring (weeding) unwanted message headers </title>
3180 Usage: <literal>[un]ignore</literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
3184 Messages often have many header fields added by automatic processing systems,
3185 or which may not seem useful to display on the screen. This command allows
3186 you to specify header fields which you don't normally want to see.
3190 You do not need to specify the full header field name. For example,
3191 ``ignore content-'' will ignore all header fields that begin with the pattern
3192 ``content-''. ``ignore *'' will ignore all headers.
3196 To remove a previously added token from the list, use the ``unignore'' command.
3197 The ``unignore'' command will make Mutt-ng display headers with the given pattern.
3198 For example, if you do ``ignore x-'' it is possible to ``unignore x-mailer''.
3202 ``unignore *'' will remove all tokens from the ignore list.
3209 # Sven's draconian header weeding
3211 unignore from date subject to cc
3212 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
3224 <sect1 id="alternates">
3225 <title>Alternative addresses </title>
3228 Usage: <literal>[un]alternates</literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
3233 With various functions, mutt will treat messages differently,
3234 depending on whether you sent them or whether you received them from
3235 someone else. For instance, when replying to a message that you
3236 sent to a different party, mutt will automatically suggest to send
3237 the response to the original message's recipients -- responding to
3238 yourself won't make much sense in many cases. (See <link linkend="reply-to">reply-to</link>.)
3242 Many users receive e-mail under a number of different addresses. To
3243 fully use mutt's features here, the program must be able to
3244 recognize what e-mail addresses you receive mail under. That's the
3245 purpose of the <literal>alternates</literal> command: It takes a list of regular
3246 expressions, each of which can identify an address under which you
3251 The <literal>unalternates</literal> command can be used to write exceptions to
3252 <literal>alternates</literal> patterns. If an address matches something in an
3253 <literal>alternates</literal> command, but you nonetheless do not think it is
3254 from you, you can list a more precise pattern under an <literal>unalternates</literal>
3259 To remove a regular expression from the <literal>alternates</literal> list, use the
3260 <literal>unalternates</literal> command with exactly the same <emphasis>regexp</emphasis>.
3261 Likewise, if the <emphasis>regexp</emphasis> for a <literal>alternates</literal> command matches
3262 an entry on the <literal>unalternates</literal> list, that <literal>unalternates</literal>
3263 entry will be removed. If the <emphasis>regexp</emphasis> for <literal>unalternates</literal>
3264 is ``*'', <emphasis>all entries</emphasis> on <literal>alternates</literal> will be removed.
3274 <title>Format = Flowed </title>
3277 <title>Introduction </title>
3280 Mutt-ng contains support for so-called <literal>format=flowed</literal> messages.
3281 In the beginning of email, each message had a fixed line width, and
3282 it was enough for displaying them on fixed-size terminals. But times
3283 changed, and nowadays hardly anybody still uses fixed-size terminals:
3284 more people nowaydays use graphical user interfaces, with dynamically
3285 resizable windows. This led to the demand of a new email format that
3286 makes it possible for the email client to make the email look nice
3287 in a resizable window without breaking quoting levels and creating
3288 an incompatible email format that can also be displayed nicely on
3289 old fixed-size terminals.
3293 For introductory information on <literal>format=flowed</literal> messages, see
3295 URL="http://www.joeclark.org/ffaq.html"
3296 ><http://www.joeclark.org/ffaq.html></ulink
3303 <title>Receiving: Display Setup </title>
3306 When you receive emails that are marked as <literal>format=flowed</literal>
3307 messages, and is formatted correctly, mutt-ng will try to reformat
3308 the message to optimally fit on your terminal. If you want a fixed
3309 margin on the right side of your terminal, you can set the
3323 The code above makes the line break 10 columns before the right
3324 side of the terminal.
3328 If your terminal is so wide that the lines are embarrassingly long,
3329 you can also set a maximum line length:
3335 set max_line_length = 120
3342 The example above will give you lines not longer than 120
3347 When you view at <literal>format=flowed</literal> messages, you will often see
3348 the quoting hierarchy like in the following example:
3354 >Bill, can you please send last month's progress report to Mr.
3355 >Morgan? We also urgently need the cost estimation for the new
3356 >production server that we want to set up before our customer's
3357 >project will go live.
3364 This obviously doesn't look very nice, and it makes it very
3365 hard to differentiate between text and quoting character. The
3366 solution is to configure mutt-ng to "stuff" the quoting:
3379 This will lead to a nicer result that is easier to read:
3385 > Bill, can you please send last month's progress report to Mr.
3386 > Morgan? We also urgently need the cost estimation for the new
3387 > production server that we want to set up before our customer's
3388 > project will go live.
3397 <title>Sending </title>
3400 If you want mutt-ng to send emails with <literal>format=flowed</literal> set, you
3401 need to explicitly set it:
3414 Additionally, you have to use an editor which supports writing
3415 <literal>format=flowed</literal>-conforming emails. For vim, this is done by
3416 adding <literal>w</literal> to the formatoptions (see <literal>:h formatoptions</literal> and
3417 <literal>:h fo-table</literal>) when writing emails.
3421 Also note that <emphasis>format=flowed</emphasis> knows about ``space-stuffing'',
3422 that is, when sending messages, some kinds of lines have to be
3423 indented with a single space on the sending side. On the receiving
3424 side, the first space (if any) is removed. As a consequence and in
3425 addition to the above simple setting, please keep this in mind when
3426 making manual formattings within the editor. Also note that mutt-ng
3427 currently violates the standard (RfC 3676) as it does not
3428 space-stuff lines starting with:
3437 <literal>></literal> This is <emphasis>not</emphasis> the quote character but a right
3438 angle used for other reasons
3445 <literal>From</literal> with a trailing space.
3452 just a space for formatting reasons
3462 Please make sure that you manually prepend a space to each of them.
3468 <title>Additional Notes</title>
3471 For completeness, the <link linkend="delete-space">delete-space</link> variable provides the mechanism
3472 to generate a <literal>DelSp=yes</literal> parameter on <emphasis>outgoing</emphasis> messages.
3473 According to the standard, clients receiving a <literal>format=flowed</literal>
3474 messages should delete the last space of a flowed line but still
3475 interpret the line as flowed. Because flowed lines usually contain
3476 only one space at the end, this parameter would make the receiving
3477 client concatenate the last word of the previous with the first of
3478 the current line <emphasis>without</emphasis> a space. This makes ordinary text
3479 unreadable and is intended for languages rarely using spaces. So
3480 please use this setting only if you're sure what you're doing.
3492 <title>Mailing lists </title>
3495 Usage: <literal>[un]lists</literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
3497 Usage: <literal>[un]subscribe</literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
3501 Mutt-ng has a few nice features for <link linkend="using-lists">using-lists</link>. In order to take advantage of them, you must
3502 specify which addresses belong to mailing lists, and which mailing
3503 lists you are subscribed to. Once you have done this, the <link linkend="func-list-reply">list-reply</link> function will work for all known lists.
3504 Additionally, when you send a message to a subscribed list, mutt will
3505 add a Mail-Followup-To header to tell other users' mail user agents
3506 not to send copies of replies to your personal address. Note that
3507 the Mail-Followup-To header is a non-standard extension which is not
3508 supported by all mail user agents. Adding it is not bullet-proof against
3509 receiving personal CCs of list messages. Also note that the generation
3510 of the Mail-Followup-To header is controlled by the <link linkend="followup-to">followup-to</link> configuration variable.
3514 More precisely, Mutt-ng maintains lists of patterns for the addresses
3515 of known and subscribed mailing lists. Every subscribed mailing
3516 list is known. To mark a mailing list as known, use the ``lists''
3517 command. To mark it as subscribed, use ``subscribe''.
3521 You can use regular expressions with both commands. To mark all
3522 messages sent to a specific bug report's address on mutt's bug
3523 tracking system as list mail, for instance, you could say
3524 ``subscribe [0-9]*@bugs.guug.de''. Often, it's sufficient to just
3525 give a portion of the list's e-mail address.
3529 Specify as much of the address as you need to to remove ambiguity. For
3530 example, if you've subscribed to the Mutt-ng mailing list, you will receive mail
3531 addressed to <emphasis>mutt-users@mutt.org</emphasis>. So, to tell Mutt-ng that this is a
3532 mailing list, you could add ``lists mutt-users'' to your
3533 initialization file. To tell mutt that you are subscribed to it,
3534 add ``subscribe mutt-users'' to your initialization file instead.
3535 If you also happen to get mail from someone whose address is
3536 <emphasis>mutt-users@example.com</emphasis>, you could use ``lists mutt-users@mutt\\.org''
3537 or ``subscribe mutt-users@mutt\\.org'' to
3538 match only mail from the actual list.
3542 The ``unlists'' command is used to remove a token from the list of
3543 known and subscribed mailing-lists. Use ``unlists *'' to remove all
3548 To remove a mailing list from the list of subscribed mailing lists,
3549 but keep it on the list of known mailing lists, use ``unsubscribe''.
3558 <sect1 id="mbox-hook">
3559 <title>Using Multiple spool mailboxes </title>
3562 Usage: <literal>mbox-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
3566 This command is used to move read messages from a specified mailbox to a
3567 different mailbox automatically when you quit or change folders.
3568 <emphasis>pattern</emphasis> is a regular expression specifying the mailbox to treat as a
3569 ``spool'' mailbox and <emphasis>mailbox</emphasis> specifies where mail should be saved when
3574 Unlike some of the other <emphasis>hook</emphasis> commands, only the <emphasis>first</emphasis> matching
3575 pattern is used (it is not possible to save read mail in more than a single
3585 <sect1 id="mailboxes">
3586 <title>Defining mailboxes which receive mail </title>
3589 Usage: <literal>[un]mailboxes</literal> [!]<emphasis>filename</emphasis> [ <emphasis>filename</emphasis> ... ]
3593 This command specifies folders which can receive mail and
3594 which will be checked for new messages. By default, the
3595 main menu status bar displays how many of these folders have
3600 When changing folders, pressing <emphasis>space</emphasis> will cycle
3601 through folders with new mail.
3605 Pressing TAB in the directory browser will bring up a menu showing the files
3606 specified by the <literal>mailboxes</literal> command, and indicate which contain new
3607 messages. Mutt-ng will automatically enter this mode when invoked from the
3608 command line with the <literal>-y</literal> option.
3612 The ``unmailboxes'' command is used to remove a token from the list
3613 of folders which receive mail. Use ``unmailboxes *'' to remove all
3618 <emphasis role="bold">Note:</emphasis> new mail is detected by comparing the last modification time to
3619 the last access time. Utilities like <literal>biff</literal> or <literal>frm</literal> or any other
3620 program which accesses the mailbox might cause Mutt-ng to never detect new mail
3621 for that mailbox if they do not properly reset the access time. Backup
3622 tools are another common reason for updated access times.
3626 <emphasis role="bold">Note:</emphasis> the filenames in the <literal>mailboxes</literal> command are resolved when
3627 the command is executed, so if these names contain <link linkend="shortcuts">shortcuts</link> (such as ``='' and ``!''), any variable
3628 definition that affect these characters (like <link linkend="folder">folder</link> and <link linkend="spoolfile">spoolfile</link>)
3629 should be executed before the <literal>mailboxes</literal> command.
3639 <title>User defined headers </title>
3644 <literal>my_hdr</literal> <emphasis>string</emphasis>
3646 <literal>unmy_hdr</literal> <emphasis>field</emphasis> [ <emphasis>field</emphasis> ... ]
3650 The ``my_hdr'' command allows you to create your own header
3651 fields which will be added to every message you send.
3655 For example, if you would like to add an ``Organization:'' header field to
3656 all of your outgoing messages, you can put the command
3661 my_hdr Organization: A Really Big Company, Anytown, USA
3666 in your <literal>.muttrc</literal>.
3670 <emphasis role="bold">Note:</emphasis> space characters are <emphasis>not</emphasis> allowed between the keyword and
3671 the colon (``:''). The standard for electronic mail (RFC822) says that
3672 space is illegal there, so Mutt-ng enforces the rule.
3676 If you would like to add a header field to a single message, you should
3677 either set the <link linkend="edit-headers">edit-headers</link> variable,
3678 or use the <emphasis>edit-headers</emphasis> function (default: ``E'') in the send-menu so
3679 that you can edit the header of your message along with the body.
3683 To remove user defined header fields, use the ``unmy_hdr''
3684 command. You may specify an asterisk (``*'') to remove all header
3685 fields, or the fields to remove. For example, to remove all ``To'' and
3686 ``Cc'' header fields, you could use:
3691 unmy_hdr to cc
3701 <sect1 id="hdr-order">
3702 <title>Defining the order of headers when viewing messages </title>
3705 Usage: <literal>hdr_order</literal> <emphasis>header1</emphasis> <emphasis>header2</emphasis> <emphasis>header3</emphasis>
3709 With this command, you can specify an order in which mutt will attempt
3710 to present headers to you when viewing messages.
3714 ``unhdr_order *'' will clear all previous headers from the order list,
3715 thus removing the header order effects set by the system-wide startup
3722 hdr_order From Date: From: To: Cc: Subject:
3733 <sect1 id="save-hook">
3734 <title>Specify default save filename </title>
3737 Usage: <literal>save-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>filename</emphasis>
3741 This command is used to override the default filename used when saving
3742 messages. <emphasis>filename</emphasis> will be used as the default filename if the message is
3743 <emphasis>From:</emphasis> an address matching <emphasis>regexp</emphasis> or if you are the author and the
3744 message is addressed <emphasis>to:</emphasis> something matching <emphasis>regexp</emphasis>.
3748 See <link linkend="pattern-hook">pattern-hook</link> for information on the exact format of <emphasis>pattern</emphasis>.
3758 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
3759 save-hook aol\\.com$ +spam
3765 Also see the <link linkend="fcc-save-hook">fcc-save-hook</link> command.
3774 <sect1 id="fcc-hook">
3775 <title>Specify default Fcc: mailbox when composing </title>
3778 Usage: <literal>fcc-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
3782 This command is used to save outgoing mail in a mailbox other than
3783 <link linkend="record">record</link>. Mutt-ng searches the initial list of
3784 message recipients for the first matching <emphasis>regexp</emphasis> and uses <emphasis>mailbox</emphasis>
3785 as the default Fcc: mailbox. If no match is found the message will be saved
3786 to <link linkend="record">record</link> mailbox.
3790 See <link linkend="pattern-hook">pattern-hook</link> for information on the exact format of <emphasis>pattern</emphasis>.
3794 Example: <literal>fcc-hook [@.]aol\\.com$ +spammers</literal>
3798 The above will save a copy of all messages going to the aol.com domain to
3799 the `+spammers' mailbox by default. Also see the <link linkend="fcc-save-hook">fcc-save-hook</link> command.
3808 <sect1 id="fcc-save-hook">
3809 <title>Specify default save filename and default Fcc: mailbox at once </title>
3812 Usage: <literal>fcc-save-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
3816 This command is a shortcut, equivalent to doing both a <link linkend="fcc-hook">fcc-hook</link>
3817 and a <link linkend="save-hook">save-hook</link> with its arguments.
3826 <sect1 id="send-hook">
3827 <title>Change settings based upon message recipients </title>
3830 Usage: <literal>reply-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
3832 Usage: <literal>send-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
3834 Usage: <literal>send2-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
3838 These commands can be used to execute arbitrary configuration commands based
3839 upon recipients of the message. <emphasis>pattern</emphasis> is a regular expression
3840 matching the desired address. <emphasis>command</emphasis> is executed when <emphasis>regexp</emphasis>
3841 matches recipients of the message.
3845 <literal>reply-hook</literal> is matched against the message you are <emphasis>replying</emphasis>
3846 <emphasis role="bold">to</emphasis>, instead of the message you are <emphasis>sending</emphasis>. <literal>send-hook</literal> is
3847 matched against all messages, both <emphasis>new</emphasis> and <emphasis>replies</emphasis>. <emphasis role="bold">Note:</emphasis>
3848 <literal>reply-hook</literal>s are matched <emphasis role="bold">before</emphasis> the <literal>send-hook</literal>, <emphasis role="bold">regardless</emphasis>
3849 of the order specified in the users's configuration file.
3853 <literal>send2-hook</literal> is matched every time a message is changed, either
3854 by editing it, or by using the compose menu to change its recipients
3855 or subject. <literal>send2-hook</literal> is executed after <literal>send-hook</literal>, and
3856 can, e.g., be used to set parameters such as the <link linkend="sendmail">sendmail</link> variable depending on the message's sender
3861 For each type of <literal>send-hook</literal> or <literal>reply-hook</literal>, when multiple matches
3862 occur, commands are executed in the order they are specified in the muttrc
3863 (for that type of hook).
3867 See <link linkend="pattern-hook">pattern-hook</link> for information on the exact format of <emphasis>pattern</emphasis>.
3871 Example: <literal>send-hook mutt "set mime_forward signature=''"</literal>
3875 Another typical use for this command is to change the values of the
3876 <link linkend="attribution">attribution</link>, <link linkend="signature">signature</link> and <link linkend="locale">locale</link>
3877 variables in order to change the language of the attributions and
3878 signatures based upon the recipients.
3882 <emphasis role="bold">Note:</emphasis> the send-hook's are only executed ONCE after getting the initial
3883 list of recipients. Adding a recipient after replying or editing the
3884 message will NOT cause any send-hook to be executed. Also note that
3885 my_hdr commands which modify recipient headers, or the message's
3886 subject, don't have any effect on the current message when executed
3896 <sect1 id="message-hook">
3897 <title>Change settings before formatting a message </title>
3900 Usage: <literal>message-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
3904 This command can be used to execute arbitrary configuration commands
3905 before viewing or formatting a message based upon information about the message.
3906 <emphasis>command</emphasis> is executed if the <emphasis>pattern</emphasis> matches the message to be
3907 displayed. When multiple matches occur, commands are executed in the order
3908 they are specified in the muttrc.
3912 See <link linkend="pattern-hook">pattern-hook</link> for
3913 information on the exact format of <emphasis>pattern</emphasis>.
3920 message-hook ~A 'set pager=builtin'
3921 message-hook '~f freshmeat-news' 'set pager="less \"+/^ subject: .*\""'
3932 <sect1 id="crypt-hook">
3933 <title>Choosing the cryptographic key of the recipient </title>
3936 Usage: <literal>crypt-hook</literal> <emphasis>pattern</emphasis> <emphasis>keyid</emphasis>
3940 When encrypting messages with PGP or OpenSSL, you may want to associate a certain
3941 key with a given e-mail address automatically, either because the
3942 recipient's public key can't be deduced from the destination address,
3943 or because, for some reasons, you need to override the key Mutt-ng would
3944 normally use. The crypt-hook command provides a method by which you can
3945 specify the ID of the public key to be used when encrypting messages to
3946 a certain recipient.
3950 The meaning of "key id" is to be taken broadly in this context: You
3951 can either put a numerical key ID here, an e-mail address, or even
3962 <title>Adding key sequences to the keyboard buffer </title>
3965 Usage: <literal>push</literal> <emphasis>string</emphasis>
3969 This command adds the named string to the keyboard buffer. The string may
3970 contain control characters, key names and function names like the sequence
3971 string in the <link linkend="macro">macro</link> command. You may use it to
3972 automatically run a sequence of commands at startup, or when entering
3983 <title>Executing functions </title>
3986 Usage: <literal>exec</literal> <emphasis>function</emphasis> [ <emphasis>function</emphasis> ... ]
3990 This command can be used to execute any function. Functions are
3991 listed in the <link linkend="functions">functions</link>.
3992 ``exec function'' is equivalent to ``push <function>''.
4001 <sect1 id="score-command">
4002 <title>Message Scoring </title>
4005 Usage: <literal>score</literal> <emphasis>pattern</emphasis> <emphasis>value</emphasis>
4007 Usage: <literal>unscore</literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
4011 In situations where you have to cope with a lot of emails, e.g.
4012 when you read many different mailing lists, and take part in
4013 discussions, it is always useful to have the important messages
4014 marked and the annoying messages or the ones that you aren't
4015 interested in deleted. For this purpose, mutt-ng features a
4016 mechanism called ``scoring''.
4020 When you use scoring, every message has a base score of 0. You
4021 can then use the <literal>score</literal> command to define patterns and a
4022 positive or negative value associated with it. When a pattern
4023 matches a message, the message's score will be raised or lowered by
4024 the amount of the value associated with the pattern.
4030 score "~f nion@muttng\.org" 50
4031 score "~f @sco\.com" -100
4037 If the pattern matches, it is also possible to set the score
4038 value of the current message to a certain value and then stop
4045 score "~f santaclaus@northpole\.int" =666
4051 What is important to note is that negative score values will be
4056 To make scoring actually useful, the score must be applied in
4057 some way. That's what the <emphasis>score thresholds</emphasis> are for. Currently,
4058 there are three score thresholds:
4067 flag threshold: when a message has a score value equal or higher
4068 than the flag threshold, it will be flagged.
4075 read threshold: when a message has a score value equal or lower
4076 than the read threshold, it will be marked as read.
4083 delete threshold: when a message has a score value equal or
4084 lower than the delete threshold, it will be marked as deleted.
4094 These three thresholds can be set via the variables <link linkend="score-threshold-flag">score-threshold-flag</link>, <link linkend="score-threshold-read">score-threshold-read</link>, <link linkend="score-threshold-delete">score-threshold-delete</link> and. By
4095 default, <link linkend="score-threshold-read">score-threshold-read</link> and <link linkend="score-threshold-delete">score-threshold-delete</link> are set to
4096 <literal>-1</literal>, which means that in the default threshold configuration no
4097 message will ever get marked as read or deleted.
4101 Scoring gets especially interesting when combined with the <literal>color</literal> command
4102 and the <literal>˜n</literal> pattern:
4108 color index black yellow "~n 10-"
4109 color index red yellow "~n 100-"
4115 The rules above mark all messages with a score between 10 and 99
4116 with black and yellow, and messages with a score greater or equal
4117 100 with red and yellow. This might be unusual to you if you're used
4118 to e.g. slrn's scoring mechanism, but it is more flexible, as it
4119 visually marks different scores.
4129 <title>Spam detection </title>
4132 Usage: <literal>spam</literal> <emphasis>pattern</emphasis> <emphasis>format</emphasis>
4134 Usage: <literal>nospam</literal> <emphasis>pattern</emphasis>
4138 Mutt-ng has generalized support for external spam-scoring filters.
4139 By defining your spam patterns with the <literal>spam</literal> and <literal>nospam</literal>
4140 commands, you can <emphasis>limit</emphasis>, <emphasis>search</emphasis>, and <emphasis>sort</emphasis> your
4141 mail based on its spam attributes, as determined by the external
4142 filter. You also can display the spam attributes in your index
4143 display using the <literal>%H</literal> selector in the <link linkend="index-format">index-format</link> variable. (Tip: try <literal>%?H?[%H] ?</literal>
4144 to display spam tags only when they are defined for a given message.)
4148 Your first step is to define your external filter's spam patterns using
4149 the <literal>spam</literal> command. <emphasis>pattern</emphasis> should be a regular expression
4150 that matches a header in a mail message. If any message in the mailbox
4151 matches this regular expression, it will receive a ``spam tag'' or
4152 ``spam attribute'' (unless it also matches a <literal>nospam</literal> pattern -- see
4153 below.) The appearance of this attribute is entirely up to you, and is
4154 governed by the <emphasis>format</emphasis> parameter. <emphasis>format</emphasis> can be any static
4155 text, but it also can include back-references from the <emphasis>pattern</emphasis>
4156 expression. (A regular expression ``back-reference'' refers to a
4157 sub-expression contained within parentheses.) <literal>%1</literal> is replaced with
4158 the first back-reference in the regex, <literal>%2</literal> with the second, etc.
4162 If you're using multiple spam filters, a message can have more than
4163 one spam-related header. You can define <literal>spam</literal> patterns for each
4164 filter you use. If a message matches two or more of these patterns, and
4165 the $spam_separator variable is set to a string, then the
4166 message's spam tag will consist of all the <emphasis>format</emphasis> strings joined
4167 together, with the value of $spam_separator separating
4172 For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
4173 define these spam settings:
4176 spam "X-DCC-.*-Metrics:.*(....)=many" "90+/DCC-%1"
4177 spam "X-Spam-Status: Yes" "90+/SA"
4178 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
4179 set spam_separator=", "
4185 If I then received a message that DCC registered with ``many'' hits
4186 under the ``Fuz2'' checksum, and that PureMessage registered with a
4187 97% probability of being spam, that message's spam tag would read
4188 <literal>90+/DCC-Fuz2, 97/PM</literal>. (The four characters before ``=many'' in a
4189 DCC report indicate the checksum used -- in this case, ``Fuz2''.)
4193 If the $spam_separator variable is unset, then each
4194 spam pattern match supersedes the previous one. Instead of getting
4195 joined <emphasis>format</emphasis> strings, you'll get only the last one to match.
4199 The spam tag is what will be displayed in the index when you use
4200 <literal>%H</literal> in the <literal>$index_format</literal> variable. It's also the
4201 string that the <literal>˜H</literal> pattern-matching expression matches against for
4202 <emphasis>search</emphasis> and <emphasis>limit</emphasis> functions. And it's what sorting by spam
4203 attribute will use as a sort key.
4207 That's a pretty complicated example, and most people's actual
4208 environments will have only one spam filter. The simpler your
4209 configuration, the more effective mutt can be, especially when it comes
4214 Generally, when you sort by spam tag, mutt will sort <emphasis>lexically</emphasis> --
4215 that is, by ordering strings alphnumerically. However, if a spam tag
4216 begins with a number, mutt will sort numerically first, and lexically
4217 only when two numbers are equal in value. (This is like UNIX's
4218 <literal>sort -n</literal>.) A message with no spam attributes at all -- that is, one
4219 that didn't match <emphasis>any</emphasis> of your <literal>spam</literal> patterns -- is sorted at
4220 lowest priority. Numbers are sorted next, beginning with 0 and ranging
4221 upward. Finally, non-numeric strings are sorted, with ``a'' taking lower
4222 priority than ``z''. Clearly, in general, sorting by spam tags is most
4223 effective when you can coerce your filter to give you a raw number. But
4224 in case you can't, mutt can still do something useful.
4228 The <literal>nospam</literal> command can be used to write exceptions to <literal>spam</literal>
4229 patterns. If a header pattern matches something in a <literal>spam</literal> command,
4230 but you nonetheless do not want it to receive a spam tag, you can list a
4231 more precise pattern under a <literal>nospam</literal> command.
4235 If the <emphasis>pattern</emphasis> given to <literal>nospam</literal> is exactly the same as the
4236 <emphasis>pattern</emphasis> on an existing <literal>spam</literal> list entry, the effect will be to
4237 remove the entry from the spam list, instead of adding an exception.
4238 Likewise, if the <emphasis>pattern</emphasis> for a <literal>spam</literal> command matches an entry
4239 on the <literal>nospam</literal> list, that <literal>nospam</literal> entry will be removed. If the
4240 <emphasis>pattern</emphasis> for <literal>nospam</literal> is ``*'', <emphasis>all entries on both lists</emphasis>
4241 will be removed. This might be the default action if you use <literal>spam</literal>
4242 and <literal>nospam</literal> in conjunction with a <literal>folder-hook</literal>.
4246 You can have as many <literal>spam</literal> or <literal>nospam</literal> commands as you like.
4247 You can even do your own primitive spam detection within mutt -- for
4248 example, if you consider all mail from <literal>MAILER-DAEMON</literal> to be spam,
4249 you can use a <literal>spam</literal> command like this:
4255 spam "^From: .*MAILER-DAEMON" "999"
4267 <title>Setting variables </title>
4270 Usage: <literal>set</literal> [no|inv]<emphasis>variable</emphasis>[=<emphasis>value</emphasis>] [ <emphasis>variable</emphasis> ... ]
4272 Usage: <literal>toggle</literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
4274 Usage: <literal>unset</literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
4276 Usage: <literal>reset</literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
4280 This command is used to set (and unset) <link linkend="variables">variables</link>. There are four basic types of variables:
4281 boolean, number, string and quadoption. <emphasis>boolean</emphasis> variables can be
4282 <emphasis>set</emphasis> (true) or <emphasis>unset</emphasis> (false). <emphasis>number</emphasis> variables can be
4283 assigned a positive integer value.
4287 <emphasis>string</emphasis> variables consist of any number of printable characters.
4288 <emphasis>strings</emphasis> must be enclosed in quotes if they contain spaces or tabs. You
4289 may also use the ``C'' escape sequences <emphasis role="bold">\n</emphasis> and <emphasis role="bold">\t</emphasis> for
4290 newline and tab, respectively.
4294 <emphasis>quadoption</emphasis> variables are used to control whether or not to be prompted
4295 for certain actions, or to specify a default action. A value of <emphasis>yes</emphasis>
4296 will cause the action to be carried out automatically as if you had answered
4297 yes to the question. Similarly, a value of <emphasis>no</emphasis> will cause the the
4298 action to be carried out as if you had answered ``no.'' A value of
4299 <emphasis>ask-yes</emphasis> will cause a prompt with a default answer of ``yes'' and
4300 <emphasis>ask-no</emphasis> will provide a default answer of ``no.''
4304 Prefixing a variable with ``no'' will unset it. Example: <literal>set noaskbcc</literal>.
4308 For <emphasis>boolean</emphasis> variables, you may optionally prefix the variable name with
4309 <literal>inv</literal> to toggle the value (on or off). This is useful when writing
4310 macros. Example: <literal>set invsmart_wrap</literal>.
4314 The <literal>toggle</literal> command automatically prepends the <literal>inv</literal> prefix to all
4315 specified variables.
4319 The <literal>unset</literal> command automatically prepends the <literal>no</literal> prefix to all
4320 specified variables.
4324 Using the enter-command function in the <emphasis>index</emphasis> menu, you can query the
4325 value of a variable by prefixing the name of the variable with a question
4338 The question mark is actually only required for boolean and quadoption
4343 The <literal>reset</literal> command resets all given variables to the compile time
4344 defaults (hopefully mentioned in this manual). If you use the command
4345 <literal>set</literal> and prefix the variable with ``&'' this has the same
4346 behavior as the reset command.
4350 With the <literal>reset</literal> command there exists the special variable ``all'',
4351 which allows you to reset all variables to their system defaults.
4361 <title>Reading initialization commands from another file </title>
4364 Usage: <literal>source</literal> <emphasis>filename</emphasis> [ <emphasis>filename</emphasis> ... ]
4368 This command allows the inclusion of initialization commands
4369 from other files. For example, I place all of my aliases in
4370 <literal>˜/.mail_aliases</literal> so that I can make my
4371 <literal>˜/.muttrc</literal> readable and keep my aliases private.
4375 If the filename begins with a tilde (``˜''), it will be expanded to the
4376 path of your home directory.
4380 If the filename ends with a vertical bar (|), then <emphasis>filename</emphasis> is
4381 considered to be an executable program from which to read input (eg.
4382 <literal>source ˜/bin/myscript|</literal>).
4392 <title>Removing hooks </title>
4395 Usage: <literal>unhook</literal> [ * | <emphasis>hook-type</emphasis> ]
4399 This command permits you to flush hooks you have previously defined.
4400 You can either remove all hooks by giving the ``*'' character as an
4401 argument, or you can remove all hooks of a specific type by saying
4402 something like <literal>unhook send-hook</literal>.
4411 <sect1 id="sect:sharingsetups">
4412 <title>Sharing Setups </title>
4415 <title>Character Sets </title>
4418 As users may run mutt-ng on different systems, the configuration
4419 must be maintained because it's likely that people want to use the
4420 setup everywhere they use mutt-ng. And mutt-ng tries to help where it
4425 To not produce conflicts with different character sets, mutt-ng
4426 allows users to specify in which character set their configuration
4427 files are encoded. Please note that while reading the configuration
4428 files, this is only respected after the corresponding declaration
4429 appears. It's advised to put the following at the very beginning of a
4436 set config_charset = "..."
4442 and replacing the dots with the actual character set. To avoid
4443 problems while maintaining the setup, vim user's may want to use
4444 modelines as show in:
4450 # vim:fileencoding=...:
4456 while, again, replacing the dots with the appropriate name. This
4457 tells vim as which character set to read and save the file.
4467 <title>Modularization </title>
4470 ``Modularization'' means to divide the setup into several files
4471 while sorting the options or commands by topic. Especially for
4472 longer setups (e.g. with many hooks), this helps maintaining it
4473 and solving trouble.
4477 When using separation, setups may be, as a whole or in
4478 fractions, shared over different systems.
4488 <title>Conditional parts </title>
4491 When using a configuration on different systems, the user may not
4492 always have influence on how mutt-ng is installed and which features
4497 To solve this, mutt-ng contain a feature based on the ``ifdef''
4498 patch written for mutt. Its basic syntax is:
4504 ifdef <item> <command>
4505 ifndef <item> <command>
4511 ...whereby <literal><item></literal> can be one of:
4551 All available functions, variables and menus are documented
4552 elsewhere in this manual but ``features'' is specific to these two
4553 commands. To test for one, prefix one of the following keywords with
4554 <literal>feature_</literal>:
4560 ncurses, slang, iconv, idn, dotlock, standalone, pop, nntp, imap, ssl,
4561 gnutls, sasl, sasl2, libesmtp, compressed, color, classic_pgp,
4562 classic_smime, gpgme, header_cache
4568 As an example, one can use the following in
4569 <literal>˜/.muttngrc</literal>:
4575 ifdef feature_imap 'source ~/.mutt-ng/setup-imap'
4576 ifdef feature_pop 'source ~/.mutt-ng/setup-pop'
4577 ifdef feature_nntp 'source ~/.mutt-ng/setup-nntp'
4583 ...to only source <literal>˜/.mutt-ng/setup-imap</literal> if IMAP
4584 support is built in, only source <literal>˜/.mutt-ng/setup-pop</literal>
4585 if POP support is built in and only source
4586 <literal>˜/.mutt-ng/setup-nntp</literal> if NNTP support is built in.
4590 An example for testing for variable names can be used if users
4591 use different revisions of mutt-ng whereby the older one may not
4592 have a certain variable. To test for the availability of <link linkend="imap-mail-check">imap-mail-check</link>,
4599 ifdef imap_mail_check 'set imap_mail_check = 300'
4605 Provided for completeness is the test for menu names. To set <link linkend="pager-index-lines">pager-index-lines</link> only if the pager
4606 menu is available, use:
4612 ifdef pager 'set pager_index_lines = 10'
4618 For completeness, too, the opposite of <literal>ifdef</literal> is provided:
4619 <literal>ifndef</literal> which only executes the command if the test fails. For
4620 example, the following two examples are equivalent:
4626 ifdef feature_ncurses 'source ~/.mutt-ng/setup-ncurses'
4627 ifndef feature_ncurses 'source ~/.mutt-ng/setup-slang'
4639 ifdef feature_slang 'source ~/.mutt-ng/setup-slang'
4640 ifndef feature_slang 'source ~/.mutt-ng/setup-ncurses'
4658 <title>Obsolete Variables </title>
4661 In the process of ensuring and creating more consistency, many
4662 variables have been renamed and some of the old names were already
4663 removed. Please see <link linkend="sect-obsolete">sect-obsolete</link>
4664 for a complete list.
4680 <title>Advanced Usage </title>
4683 <title>Regular Expressions </title>
4686 All string patterns in Mutt-ng including those in more complex
4687 <link linkend="patterns">patterns</link> must be specified
4688 using regular expressions (regexp) in the ``POSIX extended'' syntax (which
4689 is more or less the syntax used by egrep and GNU awk). For your
4690 convenience, we have included below a brief description of this syntax.
4694 The search is case sensitive if the pattern contains at least one upper
4695 case letter, and case insensitive otherwise. Note that ``\''
4696 must be quoted if used for a regular expression in an initialization
4697 command: ``\\''.
4701 A regular expression is a pattern that describes a set of strings.
4702 Regular expressions are constructed analogously to arithmetic
4703 expressions, by using various operators to combine smaller expressions.
4707 Note that the regular expression can be enclosed/delimited by either "
4708 or ' which is useful if the regular expression includes a white-space
4709 character. See <link linkend="muttrc-syntax">muttrc-syntax</link>
4710 for more information on " and ' delimiter processing. To match a
4711 literal " or ' you must preface it with \ (backslash).
4715 The fundamental building blocks are the regular expressions that match
4716 a single character. Most characters, including all letters and digits,
4717 are regular expressions that match themselves. Any metacharacter with
4718 special meaning may be quoted by preceding it with a backslash.
4722 The period ``.'' matches any single character. The caret ``ˆ'' and
4723 the dollar sign ``$'' are metacharacters that respectively match
4724 the empty string at the beginning and end of a line.
4728 A list of characters enclosed by ``['' and ``]'' matches any
4729 single character in that list; if the first character of the list
4730 is a caret ``ˆ'' then it matches any character <emphasis role="bold">not</emphasis> in the
4731 list. For example, the regular expression <emphasis role="bold">[0123456789]</emphasis>
4732 matches any single digit. A range of ASCII characters may be specified
4733 by giving the first and last characters, separated by a hyphen
4734 ``-''. Most metacharacters lose their special meaning inside
4735 lists. To include a literal ``]'' place it first in the list.
4736 Similarly, to include a literal ``ˆ'' place it anywhere but first.
4737 Finally, to include a literal hyphen ``-'' place it last.
4741 Certain named classes of characters are predefined. Character classes
4742 consist of ``[:'', a keyword denoting the class, and ``:]''.
4743 The following classes are defined by the POSIX standard:
4750 <term>[:alnum:]</term>
4753 Alphanumeric characters.
4755 </listitem></varlistentry>
4757 <term>[:alpha:]</term>
4760 Alphabetic characters.
4762 </listitem></varlistentry>
4764 <term>[:blank:]</term>
4767 Space or tab characters.
4769 </listitem></varlistentry>
4771 <term>[:cntrl:]</term>
4776 </listitem></varlistentry>
4778 <term>[:digit:]</term>
4783 </listitem></varlistentry>
4785 <term>[:graph:]</term>
4788 Characters that are both printable and visible. (A space is printable,
4789 but not visible, while an ``a'' is both.)
4791 </listitem></varlistentry>
4793 <term>[:lower:]</term>
4796 Lower-case alphabetic characters.
4798 </listitem></varlistentry>
4800 <term>[:print:]</term>
4803 Printable characters (characters that are not control characters.)
4805 </listitem></varlistentry>
4807 <term>[:punct:]</term>
4810 Punctuation characters (characters that are not letter, digits, control
4811 characters, or space characters).
4813 </listitem></varlistentry>
4815 <term>[:space:]</term>
4818 Space characters (such as space, tab and formfeed, to name a few).
4820 </listitem></varlistentry>
4822 <term>[:upper:]</term>
4825 Upper-case alphabetic characters.
4827 </listitem></varlistentry>
4829 <term>[:xdigit:]</term>
4832 Characters that are hexadecimal digits.
4834 </listitem></varlistentry>
4839 A character class is only valid in a regular expression inside the
4840 brackets of a character list. Note that the brackets in these
4841 class names are part of the symbolic names, and must be included
4842 in addition to the brackets delimiting the bracket list. For
4843 example, <emphasis role="bold">[[:digit:]]</emphasis> is equivalent to
4844 <emphasis role="bold">[0-9]</emphasis>.
4848 Two additional special sequences can appear in character lists. These
4849 apply to non-ASCII character sets, which can have single symbols (called
4850 collating elements) that are represented with more than one character,
4851 as well as several characters that are equivalent for collating or
4859 <term>Collating Symbols</term>
4862 A collating symbol is a multi-character collating element enclosed in
4863 ``[.'' and ``.]''. For example, if ``ch'' is a collating
4864 element, then <emphasis role="bold">[[.ch.]]</emphasis> is a regexp that matches
4865 this collating element, while <emphasis role="bold">[ch]</emphasis> is a regexp that
4866 matches either ``c'' or ``h''.
4868 </listitem></varlistentry>
4870 <term>Equivalence Classes</term>
4873 An equivalence class is a locale-specific name for a list of
4874 characters that are equivalent. The name is enclosed in ``[=''
4875 and ``=]''. For example, the name ``e'' might be used to
4876 represent all of ``è'' ``é'' and ``e''. In this case,
4877 <emphasis role="bold">[[=e=]]</emphasis> is a regexp that matches any of
4878 ``è'', ``é'' and ``e''.
4880 </listitem></varlistentry>
4885 A regular expression matching a single character may be followed by one
4886 of several repetition operators:
4896 The preceding item is optional and matched at most once.
4898 </listitem></varlistentry>
4903 The preceding item will be matched zero or more times.
4905 </listitem></varlistentry>
4910 The preceding item will be matched one or more times.
4912 </listitem></varlistentry>
4914 <term>{n}</term>
4917 The preceding item is matched exactly <emphasis>n</emphasis> times.
4919 </listitem></varlistentry>
4921 <term>{n,}</term>
4924 The preceding item is matched <emphasis>n</emphasis> or more times.
4926 </listitem></varlistentry>
4928 <term>{,m}</term>
4931 The preceding item is matched at most <emphasis>m</emphasis> times.
4933 </listitem></varlistentry>
4935 <term>{n,m}</term>
4938 The preceding item is matched at least <emphasis>n</emphasis> times, but no more than
4939 <emphasis>m</emphasis> times.
4941 </listitem></varlistentry>
4946 Two regular expressions may be concatenated; the resulting regular
4947 expression matches any string formed by concatenating two substrings
4948 that respectively match the concatenated subexpressions.
4952 Two regular expressions may be joined by the infix operator ``|'';
4953 the resulting regular expression matches any string matching either
4958 Repetition takes precedence over concatenation, which in turn takes
4959 precedence over alternation. A whole subexpression may be enclosed in
4960 parentheses to override these precedence rules.
4964 <emphasis role="bold">Note:</emphasis> If you compile Mutt-ng with the GNU <emphasis>rx</emphasis> package, the
4965 following operators may also be used in regular expressions:
4972 <term>\\y</term>
4975 Matches the empty string at either the beginning or the end of a word.
4977 </listitem></varlistentry>
4979 <term>\\B</term>
4982 Matches the empty string within a word.
4984 </listitem></varlistentry>
4986 <term>\\<</term>
4989 Matches the empty string at the beginning of a word.
4991 </listitem></varlistentry>
4993 <term>\\></term>
4996 Matches the empty string at the end of a word.
4998 </listitem></varlistentry>
5000 <term>\\w</term>
5003 Matches any word-constituent character (letter, digit, or underscore).
5005 </listitem></varlistentry>
5007 <term>\\W</term>
5010 Matches any character that is not word-constituent.
5012 </listitem></varlistentry>
5014 <term>\\`</term>
5017 Matches the empty string at the beginning of a buffer (string).
5019 </listitem></varlistentry>
5021 <term>\\'</term>
5024 Matches the empty string at the end of a buffer.
5026 </listitem></varlistentry>
5031 Please note however that these operators are not defined by POSIX, so
5032 they may or may not be available in stock libraries on various systems.
5042 <title>Patterns </title>
5045 Mutt-ng's pattern language provides a simple yet effective way to
5046 set up rules to match messages, e.g. for operations like tagging and
5047 scoring. A pattern consists of one or more sub-pattern, which can be
5048 logically grouped, ORed, and negated. For a complete listing of
5049 these patterns, please refer to table <link linkend="patterns">patterns</link> in the Reference chapter.
5053 It must be noted that in this table, <literal>EXPR</literal>, <literal>USER</literal>,
5054 <literal>ID</literal> and <literal>SUBJECT</literal> are regular expressions. For ranges, the
5055 forms <literal><[MAX]</literal>, <literal>>>[MIN]</literal>, <literal>[MIN]-</literal> and <literal>-[MAX]</literal>
5060 <title>Complex Patterns </title>
5063 It is possible to combine several sub-patterns to a more complex
5064 pattern. The most simple possibility is to logically AND several
5065 patterns by stringing them together:
5077 The pattern above matches all messages that contain ``SPAM'' in
5078 the subject and are unread.
5082 To logical OR patterns, simply use the <literal>|</literal> operator. This one
5083 especially useful when using local groups:
5089 ~f ("nion@muttng\.org"|"ak@muttng\.org"|"pdmef@muttng\.org")
5090 (~b mutt-ng|~s Mutt-ng)
5097 The first pattern matches all messages that were sent by one of
5098 the mutt-ng maintainers, while the seconds pattern matches all
5099 messages that contain ``mutt-ng'' in the message body or ``Mutt-ng''
5100 in the subject. The third pattern matches all messages that do not
5101 contain ``@synflood\.at'' in the <literal>References:</literal> header, i.e.
5102 messages that are not an (indirect) reply to one of my messages. A
5103 pattern can be logicall negated using the <literal>!</literal> operator.
5109 <title>Patterns and Dates </title>
5112 When using dates in patterns, the dates must be specified in a
5113 special format, i.e. <literal>DD/MM/YYYY</literal>. If you don't specify
5114 month or year, they default to the current month or year. When using
5115 date ranges, and you specify only the minimum or the maximum, the
5116 specified date will be excluded, e.g. <literal>01/06/2005-</literal> matches
5117 against all messages <emphasis>after</emphasis> Juni 1st, 2005.
5121 It is also possible to use so-called ``error margins'' when
5122 specifying date ranges. You simply specify a date, and then the
5123 error margin. This margin needs to contain the information whether
5124 it goes ``forth'' or ``back'' in time, by using <literal>+</literal> and <literal>-</literal>.
5125 Then follows a number and a unit, i.e. <literal>y</literal> for years, <literal>m</literal> for
5126 months, <literal>w</literal> for weeks and <literal>d</literal> for days. If you use the special
5127 <literal>*</literal> sign, it means that the error margin goes to both
5128 ``directions'' in time.
5142 The first pattern matches all dates between January 1st, 2005 and
5143 January 1st 2006. The second pattern matches all dates between
5144 October 18th, 2004 and October 4th 2004 (2 weeks before 18/10/2004),
5145 while the third pattern matches all dates 1 day around December
5146 28th, 2004 (i.e. Dec 27th, 28th and 29th).
5150 Relative dates are also very important, as they make it possible
5151 to specify date ranges between a fixed number of units and the
5152 current date. How this works can be seen in the following example:
5158 ~d >2w # messages older than two weeks
5159 ~d <3d # messages newer than 3 days
5160 ~d =1m # messages that are exactly one month old
5174 <title>Format Strings </title>
5177 <title>Introduction </title>
5180 The so called <emphasis>Format Strings</emphasis> offer great flexibility when
5181 configuring mutt-ng. In short, they describe what items to print
5182 out how in menus and status messages.
5186 Basically, they work as this: for different menus and bars,
5187 there's a variable specifying the layout. For every item
5188 available, there is a so called <emphasis>expando</emphasis>.
5192 For example, when running mutt-ng on different machines or
5193 different versions for testing purposes, it may be interesting to
5194 have the following information always printed on screen when one
5204 the current hostname
5211 the current mutt-ng version number
5221 The setting for the status bar of the index is controlled via the
5222 <link linkend="status-format">status-format</link>
5223 variable. For the hostname and version string, there's an expando
5224 for <literal>$status_format</literal>: <literal>%h</literal> expands to the
5225 hostname and <literal>%v</literal> to the version string. When just configuring:
5231 set status_format = "%v on %h: ..."
5237 mutt-ng will replace the sequence <literal>%v</literal> with the version string
5238 and <literal>%h</literal> with the host's name. When you are, for example, running
5239 mutt-ng version <literal>1.5.9i</literal> on host <literal>mailhost</literal>, you'll see the
5240 following when you're in the index:
5246 Mutt-ng 1.5.9i on mailhost: ...
5252 In the index, there're more useful information one could want to
5262 which mailbox is open
5269 how man new, flagged or postponed messages
5286 To include the mailbox' name is as easy as:
5292 set status_format = "%v on %h: %B: ...
5298 When the currently opened mailbox is <literal>Inbox</literal>, this will be expanded
5305 Mutt-ng 1.5.9i on mailhost: Inbox: ...
5311 For the number of certain types of messages, one more feature of the format
5312 strings is extremely useful. If there aren't messages of a certain type, it
5313 may not be desired to print just that there aren't any but instead only
5314 print something if there are any.
5324 <title>Conditional Expansion </title>
5327 To only print the number of messages if there are new messages in
5328 the current mailbox, further extend
5329 <literal>$status_format</literal> to:
5335 set status_format = "%v on %h: %B %?n?%n new? ...
5341 This feature is called <emphasis>nonzero-printing</emphasis> and works as this:
5342 some expandos may be optionally printed nonzero, i.e. a portion
5343 of the format string is only evaluated if the value of the expando
5344 is different from zero. The basic syntax is:
5350 %?<item>?<string if nonzero>?
5356 which tells mutt-ng to only look at <literal><string if
5357 nonzero></literal> if the value of the <literal>%<item%gt;</literal>
5358 expando is different from zero. In our example, we used <literal>n</literal> as
5359 the expando to check for and <literal>%n new</literal> as the optional nonzero
5364 But this is not all: this feature only offers one alternative:
5365 ``print something if not zero.'' Mutt-ng does, as you might guess,
5366 also provide a logically complete version: ``if zero, print
5367 something and else print something else.'' This is achieved by the
5368 following syntax for those expandos which may be printed nonzero:
5374 %?<item>?<string if nonzero>&<string if zero>?
5380 Using this we can make mutt-ng to do the following:
5389 make it print ``<emphasis>n</emphasis> new messages'' whereby <emphasis>n</emphasis> is the
5390 count but only if there new ones
5397 and make it print ``no new messages'' if there aren't any
5407 The corresponding configuration is:
5413 set status_format = "%v on %h: %B: %?n?%n new messages&no new messages? ...
5419 This doubles the use of the ``new messages'' string because it'll get
5420 always printed. Thus, it can be shortened to:
5426 set status_format = "%v on %h: %B: %?n?%n&no? new messages ...
5432 As you might see from this rather simple example, one can create
5433 very complex but fancy status messages. Please see the reference
5434 chapter for expandos and those which may be printed nonzero.
5444 <title>Modifications and Padding </title>
5447 Besides the information given so far, there're even more features of
5457 When specifying <literal>%_<item></literal> instead of
5458 just <literal>%<item></literal>, mutt-ng will convert all
5459 characters in the expansion of <literal><item></literal> to
5467 When specifying <literal>%:<item></literal> instead of just
5468 <literal>%<item></literal>, mutt-ng will convert all dots in the
5469 expansion of <literal><item></literal> to underscores
5470 (<literal>_</literal>).
5480 Also, there's a feature called <emphasis>Padding</emphasis> supplied by the
5481 following two expandos: <literal>%|X</literal> and <literal>%>X</literal>.
5488 <term><literal>%|X</literal></term>
5491 When this occurs, mutt-ng will fill the
5492 rest of the line with the character <literal>X</literal>. In our example,
5493 filling the rest of the line with dashes is done by setting:
5499 set status_format = "%v on %h: %B: %?n?%n&no? new messages %|-"
5503 </listitem></varlistentry>
5505 <term><literal>%>X</literal></term>
5508 Since the previous expando stops at
5509 the end of line, there must be a way to fill the gap between
5510 two items via the <literal>%>X</literal> expando: it puts as many
5511 characters <literal>X</literal> in between two items so that the rest of
5512 the line will be right-justified. For example, to not put the
5513 version string and hostname of our example on the left but on
5514 the right and fill the gap with spaces, one might use (note
5515 the space after <literal>%></literal>):
5521 set status_format = "%B: %?n?%n&no? new messages %> (%v on %h)"
5525 </listitem></varlistentry>
5542 <title>Using Tags </title>
5545 Sometimes it is desirable to perform an operation on a group of
5546 messages all at once rather than one at a time. An example might be
5547 to save messages to a mailing list to a separate folder, or to
5548 delete all messages with a given subject. To tag all messages
5549 matching a pattern, use the tag-pattern function, which is bound to
5550 ``shift-T'' by default. Or you can select individual messages by
5551 hand using the ``tag-message'' function, which is bound to ``t'' by
5552 default. See <link linkend="patterns">patterns</link> for Mutt-ng's pattern
5557 Once you have tagged the desired messages, you can use the
5558 ``tag-prefix'' operator, which is the ``;'' (semicolon) key by default.
5559 When the ``tag-prefix'' operator is used, the <emphasis role="bold">next</emphasis> operation will
5560 be applied to all tagged messages if that operation can be used in that
5561 manner. If the <link linkend="auto-tag">auto-tag</link>
5562 variable is set, the next operation applies to the tagged messages
5563 automatically, without requiring the ``tag-prefix''.
5567 In <link linkend="macro">macro</link> or <link linkend="push">push</link> commands,
5568 you can use the ``tag-prefix-cond'' operator. If there are no tagged
5569 messages, mutt will "eat" the rest of the macro to abort it's execution.
5570 Mutt-ng will stop "eating" the macro when it encounters the ``end-cond''
5571 operator; after this operator the rest of the macro will be executed as
5582 <title>Using Hooks </title>
5585 A <emphasis>hook</emphasis> is a concept borrowed from the EMACS editor which allows you to
5586 execute arbitrary commands before performing some operation. For example,
5587 you may wish to tailor your configuration based upon which mailbox you are
5588 reading, or to whom you are sending mail. In the Mutt-ng world, a <emphasis>hook</emphasis>
5589 consists of a <link linkend="regexp">regexp</link> or
5590 <link linkend="patterns">patterns</link> along with a
5591 configuration option/command. See
5597 <link linkend="folder-hook">folder-hook</link>
5603 <link linkend="send-hook">send-hook</link>
5609 <link linkend="message-hook">message-hook</link>
5615 <link linkend="save-hook">save-hook</link>
5621 <link linkend="mbox-hook">mbox-hook</link>
5627 <link linkend="fcc-hook">fcc-hook</link>
5633 <link linkend="fcc-save-hook">fcc-save-hook</link>
5639 for specific details on each type of <emphasis>hook</emphasis> available.
5643 <emphasis role="bold">Note:</emphasis> if a hook changes configuration settings, these changes remain
5644 effective until the end of the current mutt session. As this is generally
5645 not desired, a default hook needs to be added before all other hooks to
5646 restore configuration defaults. Here is an example with send-hook and the
5647 my_hdr directive:
5653 send-hook . 'unmy_hdr From:'
5654 send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
5659 <sect2 id="pattern-hook">
5660 <title>Message Matching in Hooks</title>
5663 Hooks that act upon messages (<literal>send-hook, save-hook, fcc-hook,
5664 message-hook</literal>) are evaluated in a slightly different manner. For the other
5665 types of hooks, a <link linkend="regexp">regexp</link> is
5666 sufficient. But in dealing with messages a finer grain of control is
5667 needed for matching since for different purposes you want to match
5672 Mutt-ng allows the use of the <link linkend="patterns">patterns</link>
5673 language for matching messages in hook commands. This works in
5674 exactly the same way as it would when <emphasis>limiting</emphasis> or
5675 <emphasis>searching</emphasis> the mailbox, except that you are restricted to those
5676 operators which match information mutt extracts from the header of
5677 the message (i.e. from, to, cc, date, subject, etc.).
5681 For example, if you wanted to set your return address based upon sending
5682 mail to a specific address, you could do something like:
5685 send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt-ng User <user@host>'
5688 which would execute the given command when sending mail to
5689 <emphasis>me@cs.hmc.edu</emphasis>.
5693 However, it is not required that you write the pattern to match using the
5694 full searching language. You can still specify a simple <emphasis>regular
5695 expression</emphasis> like the other hooks, in which case Mutt-ng will translate your
5696 pattern into the full language, using the translation specified by the
5697 <link linkend="default-hook">default-hook</link> variable. The
5698 pattern is translated at the time the hook is declared, so the value of
5699 <link linkend="default-hook">default-hook</link> that is in effect
5700 at that time will be used.
5711 <sect1 id="sidebar">
5712 <title>Using the sidebar </title>
5715 The sidebar, a feature specific to Mutt-ng, allows you to use a mailbox listing
5716 which looks very similar to the ones you probably know from GUI mail clients.
5717 The sidebar lists all specified mailboxes, shows the number in each
5718 and highlights the ones with new email
5719 Use the following configuration commands:
5722 set sidebar_visible="yes"
5723 set sidebar_width=25
5729 If you want to specify the mailboxes you can do so with:
5742 You can also specify the colors for mailboxes with new mails by using:
5745 color sidebar_new red black
5746 color sidebar white black
5752 The available functions are:
5755 sidebar-scroll-up Scrolls the mailbox list up 1 page
5756 sidebar-scroll-down Scrolls the mailbox list down 1 page
5757 sidebar-next Highlights the next mailbox
5758 sidebar-next-new Highlights the next mailbox with new mail
5759 sidebar-previous Highlights the previous mailbox
5760 sidebar-open Opens the currently highlighted mailbox
5766 Reasonable key bindings look e.g. like this:
5769 bind index \Cp sidebar-prev
5770 bind index \Cn sidebar-next
5771 bind index \Cb sidebar-open
5772 bind pager \Cp sidebar-prev
5773 bind pager \Cn sidebar-next
5774 bind pager \Cb sidebar-open
5776 macro index B ':toggle sidebar_visible^M'
5777 macro pager B ':toggle sidebar_visible^M'
5783 You can then go up and down by pressing Ctrl-P and Ctrl-N, and
5784 switch on and off the sidebar simply by pressing 'B'.
5794 <title>External Address Queries </title>
5797 Mutt-ng supports connecting to external directory databases such as LDAP,
5798 ph/qi, bbdb, or NIS through a wrapper script which connects to mutt
5799 using a simple interface. Using the <link linkend="query-command">query-command</link> variable, you specify the wrapper
5800 command to use. For example:
5806 set query_command = "mutt_ldap_query.pl '%s'"
5812 The wrapper script should accept the query on the command-line. It
5813 should return a one line message, then each matching response on a
5814 single line, each line containing a tab separated address then name then
5815 some other optional information. On error, or if there are no matching
5816 addresses, return a non-zero exit code and a one line error message.
5820 An example multiple response output:
5823 Searching database ... 20 entries ... 3 matching:
5824 me@cs.hmc.edu Michael Elkins mutt dude
5825 blong@fiction.net Brandon Long mutt and more
5826 roessler@guug.de Thomas Roessler mutt pgp
5832 There are two mechanisms for accessing the query function of mutt. One
5833 is to do a query from the index menu using the query function (default: Q).
5834 This will prompt for a query, then bring up the query menu which will
5835 list the matching responses. From the query menu, you can select
5836 addresses to create aliases, or to mail. You can tag multiple addresses
5837 to mail, start a new query, or have a new query appended to the current
5842 The other mechanism for accessing the query function is for address
5843 completion, similar to the alias completion. In any prompt for address
5844 entry, you can use the complete-query function (default: ˆT) to run a
5845 query based on the current address you have typed. Like aliases, mutt
5846 will look for what you have typed back to the last space or comma. If
5847 there is a single response for that query, mutt will expand the address
5848 in place. If there are multiple responses, mutt will activate the query
5849 menu. At the query menu, you can select one or more addresses to be
5850 added to the prompt.
5860 <title>Mailbox Formats </title>
5863 Mutt-ng supports reading and writing of four different mailbox formats:
5864 mbox, MMDF, MH and Maildir. The mailbox type is autodetected, so there
5865 is no need to use a flag for different mailbox types. When creating new
5866 mailboxes, Mutt-ng uses the default specified with the <link linkend="mbox-type">mbox-type</link> variable.
5870 <emphasis role="bold">mbox</emphasis>. This is the most widely used mailbox format for UNIX. All
5871 messages are stored in a single file. Each message has a line of the form:
5877 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
5883 to denote the start of a new message (this is often referred to as the
5884 ``From_'' line).
5888 <emphasis role="bold">MMDF</emphasis>. This is a variant of the <emphasis>mbox</emphasis> format. Each message is
5889 surrounded by lines containing ``ˆAˆAˆAˆA'' (four control-A's).
5893 <emphasis role="bold">MH</emphasis>. A radical departure from <emphasis>mbox</emphasis> and <emphasis>MMDF</emphasis>, a mailbox
5894 consists of a directory and each message is stored in a separate file.
5895 The filename indicates the message number (however, this is may not
5896 correspond to the message number Mutt-ng displays). Deleted messages are
5897 renamed with a comma (,) prepended to the filename. <emphasis role="bold">Note:</emphasis> Mutt
5898 detects this type of mailbox by looking for either <literal>.mh_sequences</literal>
5899 or <literal>.xmhcache</literal> (needed to distinguish normal directories from MH
5904 <emphasis role="bold">Maildir</emphasis>. The newest of the mailbox formats, used by the Qmail MTA (a
5905 replacement for sendmail). Similar to <emphasis>MH</emphasis>, except that it adds three
5906 subdirectories of the mailbox: <emphasis>tmp</emphasis>, <emphasis>new</emphasis> and <emphasis>cur</emphasis>. Filenames
5907 for the messages are chosen in such a way they are unique, even when two
5908 programs are writing the mailbox over NFS, which means that no file locking
5918 <sect1 id="shortcuts">
5919 <title>Mailbox Shortcuts </title>
5922 There are a number of built in shortcuts which refer to specific mailboxes.
5923 These shortcuts can be used anywhere you are prompted for a file or mailbox
5933 ! -- refers to your <link linkend="spoolfile">spoolfile</link> (incoming) mailbox
5939 > -- refers to your <link linkend="mbox">mbox</link> file
5945 < -- refers to your <link linkend="record">record</link> file
5951 ˆ -- refers to the current mailbox
5957 - or !! -- refers to the file you've last visited
5963 ˜ -- refers to your home directory
5969 = or + -- refers to your <link linkend="folder">folder</link> directory
5975 @<emphasis>alias</emphasis> -- refers to the <link linkend="save-hook">save-hook</link> as determined by the address of the alias
5989 <sect1 id="using-lists">
5990 <title>Handling Mailing Lists </title>
5993 Mutt-ng has a few configuration options that make dealing with large
5994 amounts of mail easier. The first thing you must do is to let Mutt
5995 know what addresses you consider to be mailing lists (technically
5996 this does not have to be a mailing list, but that is what it is most
5997 often used for), and what lists you are subscribed to. This is
5998 accomplished through the use of the <link linkend="lists">lists</link> commands in your muttrc.
6002 Now that Mutt-ng knows what your mailing lists are, it can do several
6003 things, the first of which is the ability to show the name of a list
6004 through which you received a message (i.e., of a subscribed list) in
6005 the <emphasis>index</emphasis> menu display. This is useful to distinguish between
6006 personal and list mail in the same mailbox. In the <link linkend="index-format">index-format</link> variable, the escape ``%L''
6007 will return the string ``To <list>'' when ``list'' appears in the
6008 ``To'' field, and ``Cc <list>'' when it appears in the ``Cc''
6009 field (otherwise it returns the name of the author).
6013 Often times the ``To'' and ``Cc'' fields in mailing list messages
6014 tend to get quite large. Most people do not bother to remove the
6015 author of the message they are reply to from the list, resulting in
6016 two or more copies being sent to that person. The ``list-reply''
6017 function, which by default is bound to ``L'' in the <emphasis>index</emphasis> menu
6018 and <emphasis>pager</emphasis>, helps reduce the clutter by only replying to the
6019 known mailing list addresses instead of all recipients (except as
6020 specified by <literal>Mail-Followup-To</literal>, see below).
6024 Mutt-ng also supports the <literal>Mail-Followup-To</literal> header. When you send
6025 a message to a list of recipients which includes one or several
6026 subscribed mailing lists, and if the <link linkend="followup-to">followup-to</link> option is set, mutt will generate
6027 a Mail-Followup-To header which contains all the recipients to whom
6028 you send this message, but not your address. This indicates that
6029 group-replies or list-replies (also known as ``followups'') to this
6030 message should only be sent to the original recipients of the
6031 message, and not separately to you - you'll receive your copy through
6032 one of the mailing lists you are subscribed to.
6036 Conversely, when group-replying or list-replying to a message which
6037 has a <literal>Mail-Followup-To</literal> header, mutt will respect this header if
6038 the <link linkend="honor-followup-to">honor-followup-to</link> configuration
6039 variable is set. Using list-reply will in this case also make sure
6040 that the reply goes to the mailing list, even if it's not specified
6041 in the list of recipients in the <literal>Mail-Followup-To</literal>.
6045 Note that, when header editing is enabled, you can create a
6046 <literal>Mail-Followup-To</literal> header manually. Mutt-ng will only auto-generate
6047 this header if it doesn't exist when you send the message.
6051 The other method some mailing list admins use is to generate a
6052 ``Reply-To'' field which points back to the mailing list address rather
6053 than the author of the message. This can create problems when trying
6054 to reply directly to the author in private, since most mail clients
6055 will automatically reply to the address given in the ``Reply-To''
6056 field. Mutt-ng uses the <link linkend="reply-to">reply-to</link>
6057 variable to help decide which address to use. If set to <emphasis>ask-yes</emphasis> or
6058 <emphasis>ask-no</emphasis>, you will be
6059 prompted as to whether or not you would like to use the address given in
6060 the ``Reply-To'' field, or reply directly to the address given in the
6061 ``From'' field. When set to <emphasis>yes</emphasis>, the ``Reply-To'' field will be used when
6066 The ``X-Label:'' header field can be used to further identify mailing
6067 lists or list subject matter (or just to annotate messages
6068 individually). The <link linkend="index-format">index-format</link> variable's ``%y'' and
6069 ``%Y'' escapes can be used to expand ``X-Label:'' fields in the
6070 index, and Mutt-ng's pattern-matcher can match regular expressions to
6071 ``X-Label:'' fields with the ``˜y'' selector. ``X-Label:'' is not a
6072 standard message header field, but it can easily be inserted by procmail
6073 and other mail filtering agents.
6077 Lastly, Mutt-ng has the ability to <link linkend="sort">sort</link> the mailbox into
6078 <link linkend="threads">threads</link>. A thread is a group of messages which all relate to the same
6079 subject. This is usually organized into a tree-like structure where a
6080 message and all of its replies are represented graphically. If you've ever
6081 used a threaded news client, this is the same concept. It makes dealing
6082 with large volume mailing lists easier because you can easily delete
6083 uninteresting threads and quickly find topics of value.
6093 <title>Editing threads </title>
6096 Mutt-ng has the ability to dynamically restructure threads that are broken
6097 either by misconfigured software or bad behavior from some
6098 correspondents. This allows to clean your mailboxes formats) from these
6099 annoyances which make it hard to follow a discussion.
6103 <title>Linking threads</title>
6106 Some mailers tend to "forget" to correctly set the "In-Reply-To:" and
6107 "References:" headers when replying to a message. This results in broken
6108 discussions because Mutt-ng has not enough information to guess the correct
6110 You can fix this by tagging the reply, then moving to the parent message
6111 and using the ``link-threads'' function (bound to & by default). The
6112 reply will then be connected to this "parent" message.
6116 You can also connect multiple children at once, tagging them and using the
6117 tag-prefix command (';') or the auto_tag option.
6123 <title>Breaking threads</title>
6126 On mailing lists, some people are in the bad habit of starting a new
6127 discussion by hitting "reply" to any message from the list and changing
6128 the subject to a totally unrelated one.
6129 You can fix such threads by using the ``break-thread'' function (bound
6130 by default to #), which will turn the subthread starting from the
6131 current message into a whole different thread.
6143 <title>Delivery Status Notification (DSN) Support </title>
6146 RFC1894 defines a set of MIME content types for relaying information
6147 about the status of electronic mail messages. These can be thought of as
6148 ``return receipts.''
6152 Users can make use of it in one of the following two ways:
6161 Berkeley sendmail 8.8.x currently has some command line options
6162 in which the mail client can make requests as to what type of status
6163 messages should be returned.
6169 The SMTP support via libESMTP supports it, too.
6178 To support this, there are two variables:
6187 <link linkend="dsn-notify">dsn-notify</link> is used
6188 to request receipts for different results (such as failed message,
6189 message delivered, etc.).
6196 <link linkend="dsn-return">dsn-return</link> requests
6197 how much of your message should be returned with the receipt
6198 (headers or full message).
6208 Please see the reference chapter for possible values.
6218 <title>POP3 Support (OPTIONAL) </title>
6221 If Mutt-ng was compiled with POP3 support (by running the <emphasis>configure</emphasis>
6222 script with the <emphasis>--enable-pop</emphasis> flag), it has the ability to work
6223 with mailboxes located on a remote POP3 server and fetch mail for local
6228 You can access the remote POP3 mailbox by selecting the folder
6229 <literal>pop://popserver/</literal>.
6233 You can select an alternative port by specifying it with the server, i.e.:
6234 <literal>pop://popserver:port/</literal>.
6238 You can also specify different username for each folder, i.e.:
6239 <literal>pop://username@popserver[:port]/</literal>.
6243 Polling for new mail is more expensive over POP3 than locally. For this
6244 reason the frequency at which Mutt-ng will check for mail remotely can be
6246 <link linkend="pop-mail-check">pop-mail-check</link>
6247 variable, which defaults to every 60 seconds.
6251 If Mutt-ng was compiled with SSL support (by running the <emphasis>configure</emphasis>
6252 script with the <emphasis>--with-ssl</emphasis> flag), connections to POP3 servers
6253 can be encrypted. This naturally requires that the server supports
6254 SSL encrypted connections. To access a folder with POP3/SSL, you should
6255 use pops: prefix, ie:
6256 <literal>pops://[username@]popserver[:port]/</literal>.
6260 Another way to access your POP3 mail is the <emphasis>fetch-mail</emphasis> function
6261 (default: G). It allows to connect to <link linkend="pop-host">pop-host</link>, fetch all your new mail and place it in the
6262 local <link linkend="spoolfile">spoolfile</link>. After this
6263 point, Mutt-ng runs exactly as if the mail had always been local.
6267 <emphasis role="bold">Note:</emphasis> If you only need to fetch all messages to local mailbox
6268 you should consider using a specialized program, such as <ulink
6269 URL="http://www.ccil.org/~esr/fetchmail"
6281 <title>IMAP Support (OPTIONAL) </title>
6284 If Mutt-ng was compiled with IMAP support (by running the <emphasis>configure</emphasis>
6285 script with the <emphasis>--enable-imap</emphasis> flag), it has the ability to work
6286 with folders located on a remote IMAP server.
6290 You can access the remote inbox by selecting the folder
6291 <literal>imap://imapserver/INBOX</literal>, where <literal>imapserver</literal> is the name of the
6292 IMAP server and <literal>INBOX</literal> is the special name for your spool mailbox on
6293 the IMAP server. If you want to access another mail folder at the IMAP
6294 server, you should use <literal>imap://imapserver/path/to/folder</literal> where
6295 <literal>path/to/folder</literal> is the path of the folder you want to access.
6299 You can select an alternative port by specifying it with the server, i.e.:
6300 <literal>imap://imapserver:port/INBOX</literal>.
6304 You can also specify different username for each folder, i.e.:
6305 <literal>imap://username@imapserver[:port]/INBOX</literal>.
6309 If Mutt-ng was compiled with SSL support (by running the <emphasis>configure</emphasis>
6310 script with the <emphasis>--with-ssl</emphasis> flag), connections to IMAP servers
6311 can be encrypted. This naturally requires that the server supports
6312 SSL encrypted connections. To access a folder with IMAP/SSL, you should
6313 use <literal>imaps://[username@]imapserver[:port]/path/to/folder</literal> as your
6318 Pine-compatible notation is also supported, i.e.
6319 <literal>{[username@]imapserver[:port][/ssl]}path/to/folder</literal>
6323 Note that not all servers use / as the hierarchy separator. Mutt-ng should
6324 correctly notice which separator is being used by the server and convert
6329 When browsing folders on an IMAP server, you can toggle whether to look
6330 at only the folders you are subscribed to, or all folders with the
6331 <emphasis>toggle-subscribed</emphasis> command. See also the
6332 <link linkend="imap-list-subscribed">imap-list-subscribed</link> variable.
6336 Polling for new mail on an IMAP server can cause noticeable delays. So, you'll
6337 want to carefully tune the
6338 <link linkend="imap-mail-check">imap-mail-check</link>
6340 <link linkend="timeout">timeout</link>
6345 Note that if you are using mbox as the mail store on UW servers prior to
6346 v12.250, the server has been reported to disconnect a client if another client
6347 selects the same folder.
6351 <title>The Folder Browser</title>
6354 As of version 1.2, mutt supports browsing mailboxes on an IMAP
6355 server. This is mostly the same as the local file browser, with the
6356 following differences:
6362 Instead of file permissions, mutt displays the string "IMAP",
6363 possibly followed by the symbol "+", indicating
6364 that the entry contains both messages and subfolders. On
6365 Cyrus-like servers folders will often contain both messages and
6372 For the case where an entry can contain both messages and
6373 subfolders, the selection key (bound to <literal>enter</literal> by default)
6374 will choose to descend into the subfolder view. If you wish to view
6375 the messages in that folder, you must use <literal>view-file</literal> instead
6376 (bound to <literal>space</literal> by default).
6382 You can create, delete and rename mailboxes with the
6383 <literal>create-mailbox</literal>, <literal>delete-mailbox</literal>, and
6384 <literal>rename-mailbox</literal> commands (default bindings: <literal>C</literal>,
6385 <literal>d</literal> and <literal>r</literal>, respectively). You may also
6386 <literal>subscribe</literal> and <literal>unsubscribe</literal> to mailboxes (normally
6387 these are bound to <literal>s</literal> and <literal>u</literal>, respectively).
6398 <title>Authentication</title>
6401 Mutt-ng supports four authentication methods with IMAP servers: SASL,
6402 GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
6403 NTLM authentication for you poor exchange users out there, but it has
6404 yet to be integrated into the main tree). There is also support for
6405 the pseudo-protocol ANONYMOUS, which allows you to log in to a public
6406 IMAP server without having an account. To use ANONYMOUS, simply make
6407 your username blank or "anonymous".
6411 SASL is a special super-authenticator, which selects among several protocols
6412 (including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most secure
6413 method available on your host and the server. Using some of these methods
6414 (including DIGEST-MD5 and possibly GSSAPI), your entire session will be
6415 encrypted and invisible to those teeming network snoops. It is the best
6416 option if you have it. To use it, you must have the Cyrus SASL library
6417 installed on your system and compile mutt with the <emphasis>--with-sasl</emphasis> flag.
6421 Mutt-ng will try whichever methods are compiled in and available on the server,
6422 in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.
6426 There are a few variables which control authentication:
6432 <link linkend="imap-user">imap-user</link> - controls
6433 the username under which you request authentication on the IMAP server,
6434 for all authenticators. This is overridden by an explicit username in
6435 the mailbox path (i.e. by using a mailbox name of the form
6436 <literal>{user@host}</literal>).
6442 <link linkend="imap-pass">imap-pass</link> - a
6443 password which you may preset, used by all authentication methods where
6444 a password is needed.
6450 <link linkend="imap-authenticators">imap-authenticators</link> - a colon-delimited list of IMAP
6451 authentication methods to try, in the order you wish to try them. If
6452 specified, this overrides mutt's default (attempt everything, in the order
6469 <sect1 id="reading-news">
6470 <title>NNTP Support (OPTIONAL) </title>
6473 If compiled with ``--enable-nntp'' option, Mutt-ng can read news from
6474 a newsserver via NNTP. You can open a newsgroup with the
6475 ``change-newsgroup'' function from the index/pager which is by default
6476 bound to <literal>i</literal>.
6480 The Default newsserver can be obtained from the
6481 <literal>$NNTPSERVER</literal> environment variable. Like other news readers,
6482 info about subscribed newsgroups is saved in a file as specified by the
6483 <link linkend="nntp-newsrc">nntp-newsrc</link> variable.
6484 Article headers are cached and can be loaded from a file when a
6485 newsgroup is entered instead loading from newsserver; currently, this
6486 caching mechanism still is different from the header caching for
6491 <title>Again: Scoring </title>
6494 Especially for Usenet, people often ask for advanced filtering
6495 and scoring functionality. Of course, mutt-ng has scoring and
6496 allows a killfile, too. How to use a killfile has been discussed
6497 in <link linkend="score-command">score-command</link>.
6501 What has not been discusses in detail is mutt-ng's built-in
6502 realname filter. For may newsreaders including those for
6503 ``advanced users'' like <emphasis>slrn</emphasis> or <emphasis>tin</emphasis>, there are frequent
6504 request for such functionality. The solutions offered often are
6505 complicated regular expressions.
6509 In mutt-ng this is as easy as
6522 This tells mutt-ng to apply a score of 42 to all messages whose
6523 sender specified a valid realname and a valid email address. Using
6536 on the contrary applies a score of 42 to all messages <emphasis>not</emphasis>
6537 matching those criteria which are very strict:
6546 Email addresses must be valid according to RFC 2822, see
6548 URL="ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt"
6549 ><ftp://ftp.rfc-editor.org/in-notes/rfc2822.txt></ulink
6557 the name must consist of at least 2 fields whereby a field
6558 must not end in a dot. This means that ``Joe User'' and ``Joe A.
6559 User'' are valid while ``J. User'' and ``J. A. User'' aren't.
6566 it's assumed that users are interested in reading their
6567 own mail and mail from people who they have defined an alias for
6568 so that those 2 groups of messages are excluded from the strict
6591 <title>SMTP Support (OPTIONAL) </title>
6594 Mutt-ng can be built using a library called ``libESMTP'' which
6595 provides SMTP functionality. When <literal>configure</literal> was called with
6596 <literal>--with-libesmtp</literal> or the output <literal>muttng -v</literal> contains
6597 <literal>+USE_LIBESMTP</literal>, this will be or is the case already. The SMTP
6598 support includes support for Delivery Status Notification (see <link linkend="dsn">dsn</link> section) as well as
6599 handling the <literal>8BITMIME</literal> flag controlled via <link linkend="use-8bitmime">use-8bitmime</link>.
6603 To enable sending mail directly via SMTP without an MTA such as
6604 Postfix or SSMTP and the like, simply set the <link linkend="smtp-host">smtp-host</link> variable pointing to your SMTP server.
6608 Authentication mechanisms are available via the <link linkend="smtp-user">smtp-user</link> and <link linkend="smtp-pass">smtp-pass</link> variables.
6612 Transport Encryption via the StartTLS command is also available. For
6613 this to work, first of all Mutt-ng must be built with SSL or GNUTLS.
6614 Secondly, the <link linkend="smtp-use-tls">smtp-use-tls</link> variable must be either set
6615 to ``enabled'' or ``required.'' In both cases, StartTLS will be used if
6616 the server supports it: for the second case, the connection will fail if
6617 it doesn't while switching back to unencrypted communication for the
6622 Some mail providers require user's to set a particular envelope
6623 sender, i.e. they allow for only one value which may not be what the
6624 user wants to send as the <literal>From:</literal> header. In this case, the variable
6625 <link linkend="smtp-envelope">smtp-envelope</link> may be used
6626 to set the envelope different from the <literal>From:</literal> header.
6631 <sect1 id="account-hook">
6632 <title>Managing multiple IMAP/POP/NNTP accounts (OPTIONAL) </title>
6635 If you happen to have accounts on multiple IMAP and/or POP servers,
6636 you may find managing all the authentication settings inconvenient and
6637 error-prone. The account-hook command may help. This hook works like
6638 folder-hook but is invoked whenever you access a remote mailbox
6639 (including inside the folder browser), not just when you open the
6650 account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
6651 account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
6652 account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'
6663 <sect1 id="urlview">
6664 <title>Start a WWW Browser on URLs (EXTERNAL) </title>
6667 If a message contains URLs (<emphasis>unified resource locator</emphasis> = address in the
6668 WWW space like <emphasis>http://www.mutt.org/</emphasis>), it is efficient to get
6669 a menu with all the URLs and start a WWW browser on one of them. This
6670 functionality is provided by the external urlview program which can be
6672 URL="ftp://ftp.mutt.org/mutt/contrib/"
6673 >ftp://ftp.mutt.org/mutt/contrib/</ulink
6674 > and the configuration commands:
6677 macro index \cb |urlview\n
6678 macro pager \cb |urlview\n
6690 <title>Compressed folders Support (OPTIONAL) </title>
6693 If Mutt-ng was compiled with compressed folders support (by running the
6694 <emphasis>configure</emphasis> script with the <emphasis>--enable-compressed</emphasis> flag), Mutt
6695 can open folders stored in an arbitrary format, provided that the user
6696 has a script to convert from/to this format to one of the accepted.
6700 The most common use is to open compressed archived folders e.g. with
6705 In addition, the user can provide a script that gets a folder in an
6706 accepted format and appends its context to the folder in the
6707 user-defined format, which may be faster than converting the entire
6708 folder to the accepted format, appending to it and converting back to
6709 the user-defined format.
6713 There are three hooks defined (<link linkend="open-hook">open-hook</link>,
6714 <link linkend="close-hook">close-hook</link> and <link linkend="append-hook">append-hook</link>) which define commands to uncompress and compress
6715 a folder and to append messages to an existing compressed folder
6726 open-hook \\.gz$ "gzip -cd %f > %t"
6727 close-hook \\.gz$ "gzip -c %t > %f"
6728 append-hook \\.gz$ "gzip -c %t >> %f"
6734 You do not have to specify all of the commands. If you omit <link linkend="append-hook">append-hook</link>, the folder will be open and
6735 closed again each time you will add to it. If you omit <link linkend="close-hook">close-hook</link> (or give empty command) , the
6736 folder will be open in the mode. If you specify <link linkend="append-hook">append-hook</link> though you'll be able to append
6741 Note that Mutt-ng will only try to use hooks if the file is not in one of
6742 the accepted formats. In particular, if the file is empty, mutt
6743 supposes it is not compressed. This is important because it allows the
6744 use of programs that do not have well defined extensions. Just use
6745 "." as a regexp. But this may be surprising if your
6746 compressing script produces empty files. In this situation, unset <link linkend="save-empty">save-empty</link>, so that the compressed file
6747 will be removed if you delete all of the messages.
6750 <sect2 id="open-hook">
6751 <title>Open a compressed mailbox for reading</title>
6754 Usage: <literal>open-hook</literal> <emphasis>regexp</emphasis> "<emphasis>command</emphasis>"
6758 The <emphasis>command</emphasis> is the command that can be used for opening the
6759 folders whose names match <emphasis>regexp</emphasis>.
6763 The <emphasis>command</emphasis> string is the printf-like format string, and it
6764 should accept two parameters: %f, which is replaced with the
6765 (compressed) folder name, and %t which is replaced with the
6766 name of the temporary folder to which to write.
6770 %f and %t can be repeated any number of times in the
6771 command string, and all of the entries are replaced with the
6772 appropriate folder name. In addition, %% is replaced by
6773 %, as in printf, and any other %anything is left as is.
6777 The <emphasis>command</emphasis> should <emphasis role="bold">not</emphasis> remove the original compressed file.
6778 The <emphasis>command</emphasis> should return non-zero exit status if it fails, so
6779 mutt knows something's wrong.
6789 open-hook \\.gz$ "gzip -cd %f > %t"
6795 If the <emphasis>command</emphasis> is empty, this operation is disabled for this file
6801 <sect2 id="close-hook">
6802 <title>Write a compressed mailbox</title>
6805 Usage: <literal>close-hook</literal> <emphasis>regexp</emphasis> "<emphasis>command</emphasis>"
6809 This is used to close the folder that was open with the <link linkend="open-hook">open-hook</link> command after some changes were made to it.
6813 The <emphasis>command</emphasis> string is the command that can be used for closing the
6814 folders whose names match <emphasis>regexp</emphasis>. It has the same format as in
6815 the <link linkend="open-hook">open-hook</link> command. Temporary folder
6816 in this case is the folder previously produced by the <<link linkend="open-hook">open-hook</link> command.
6820 The <emphasis>command</emphasis> should <emphasis role="bold">not</emphasis> remove the decompressed file. The
6821 <emphasis>command</emphasis> should return non-zero exit status if it fails, so mutt
6822 knows something's wrong.
6832 close-hook \\.gz$ "gzip -c %t > %f"
6838 If the <emphasis>command</emphasis> is empty, this operation is disabled for this file
6839 type, and the file can only be open in the readonly mode.
6843 <link linkend="close-hook">close-hook</link> is not called when you exit
6844 from the folder if the folder was not changed.
6849 <sect2 id="append-hook">
6850 <title>Append a message to a compressed mailbox</title>
6853 Usage: <literal>append-hook</literal> <emphasis>regexp</emphasis> "<emphasis>command</emphasis>"
6857 This command is used for saving to an existing compressed folder.
6858 The <emphasis>command</emphasis> is the command that can be used for appending to the
6859 folders whose names match <emphasis>regexp</emphasis>. It has the same format as in
6860 the <link linkend="open-hook">open-hook</link> command.
6861 The temporary folder in this case contains the messages that are being
6866 The <emphasis>command</emphasis> should <emphasis role="bold">not</emphasis> remove the decompressed file. The
6867 <emphasis>command</emphasis> should return non-zero exit status if it fails, so mutt
6868 knows something's wrong.
6878 append-hook \\.gz$ "gzip -c %t >> %f"
6884 When <link linkend="append-hook">append-hook</link> is used, the folder is
6885 not opened, which saves time, but this means that we can not find out
6886 what the folder type is. Thus the default (<link linkend="mbox-type">mbox-type</link>) type is always supposed (i.e.
6887 this is the format used for the temporary folder).
6891 If the file does not exist when you save to it, <link linkend="close-hook">close-hook</link> is called, and not <link linkend="append-hook">append-hook</link>. <link linkend="append-hook">append-hook</link> is only
6892 for appending to existing folders.
6896 If the <emphasis>command</emphasis> is empty, this operation is disabled for this file
6897 type. In this case, the folder will be open and closed again (using
6898 <link linkend="open-hook">open-hook</link> and <link linkend="close-hook">close-hook</link>respectively) each time you will add to it.
6904 <title>Encrypted folders</title>
6907 The compressed folders support can also be used to handle encrypted
6908 folders. If you want to encrypt a folder with PGP, you may want to use
6909 the following hooks:
6915 open-hook \\.pgp$ "pgp -f < %f > %t"
6916 close-hook \\.pgp$ "pgp -fe YourPgpUserIdOrKeyId < %t > %f"
6922 Please note, that PGP does not support appending to an encrypted
6923 folder, so there is no append-hook defined.
6927 <emphasis role="bold">Note:</emphasis> the folder is temporary stored decrypted in the /tmp
6928 directory, where it can be read by your system administrator. So think
6929 about the security aspects of this.
6947 <title>Mutt-ng's MIME Support </title>
6950 Quite a bit of effort has been made to make Mutt-ng the premier text-mode
6951 MIME MUA. Every effort has been made to provide the functionality that
6952 the discerning MIME user requires, and the conformance to the standards
6953 wherever possible. When configuring Mutt-ng for MIME, there are two extra
6954 types of configuration files which Mutt-ng uses. One is the
6955 <literal>mime.types</literal> file, which contains the mapping of file extensions to
6956 IANA MIME types. The other is the <literal>mailcap</literal> file, which specifies
6957 the external commands to use for handling specific MIME types.
6961 <title>Using MIME in Mutt </title>
6964 There are three areas/menus in Mutt-ng which deal with MIME, they are the
6965 pager (while viewing a message), the attachment menu and the compose
6970 <title>Viewing MIME messages in the pager</title>
6973 When you select a message from the index and view it in the pager, Mutt
6974 decodes the message to a text representation. Mutt-ng internally supports
6975 a number of MIME types, including <literal>text/plain, text/enriched,
6976 message/rfc822, and message/news</literal>. In addition, the export
6977 controlled version of Mutt-ng recognizes a variety of PGP MIME types,
6978 including PGP/MIME and application/pgp.
6982 Mutt-ng will denote attachments with a couple lines describing them.
6983 These lines are of the form:
6986 [-- Attachment #1: Description --]
6987 [-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
6990 Where the <literal>Description</literal> is the description or filename given for the
6991 attachment, and the <literal>Encoding</literal> is one of
6992 <literal>7bit/8bit/quoted-printable/base64/binary</literal>.
6996 If Mutt-ng cannot deal with a MIME type, it will display a message like:
6999 [-- image/gif is unsupported (use 'v' to view this part) --]
7006 <sect2 id="attach-menu">
7007 <title>The Attachment Menu</title>
7010 The default binding for <literal>view-attachments</literal> is `v', which displays the
7011 attachment menu for a message. The attachment menu displays a list of
7012 the attachments in a message. From the attachment menu, you can save,
7013 print, pipe, delete, and view attachments. You can apply these
7014 operations to a group of attachments at once, by tagging the attachments
7015 and by using the ``tag-prefix'' operator. You can also reply to the
7016 current message from this menu, and only the current attachment (or the
7017 attachments tagged) will be quoted in your reply. You can view
7018 attachments as text, or view them using the mailcap viewer definition.
7022 Finally, you can apply the usual message-related functions (like
7023 <link linkend="resend-message">resend-message</link>, and the reply
7024 and forward functions) to attachments of type <literal>message/rfc822</literal>.
7028 See the help on the attachment menu for more information.
7033 <sect2 id="compose-menu">
7034 <title>The Compose Menu</title>
7037 The compose menu is the menu you see before you send a message. It
7038 allows you to edit the recipient list, the subject, and other aspects
7039 of your message. It also contains a list of the attachments of your
7040 message, including the main body. From this menu, you can print, copy,
7041 filter, pipe, edit, compose, review, and rename an attachment or a
7042 list of tagged attachments. You can also modifying the attachment
7043 information, notably the type, encoding and description.
7047 Attachments appear as follows:
7050 - 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0 <no description>
7051 2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz <no description>
7057 The '-' denotes that Mutt-ng will delete the file after sending (or
7058 postponing, or canceling) the message. It can be toggled with the
7059 <literal>toggle-unlink</literal> command (default: u). The next field is the MIME
7060 content-type, and can be changed with the <literal>edit-type</literal> command
7061 (default: ˆT). The next field is the encoding for the attachment,
7062 which allows a binary message to be encoded for transmission on 7bit
7063 links. It can be changed with the <literal>edit-encoding</literal> command
7064 (default: ˆE). The next field is the size of the attachment,
7065 rounded to kilobytes or megabytes. The next field is the filename,
7066 which can be changed with the <literal>rename-file</literal> command (default: R).
7067 The final field is the description of the attachment, and can be
7068 changed with the <literal>edit-description</literal> command (default: d).
7080 <title>MIME Type configuration with <literal>mime.types</literal> </title>
7083 When you add an attachment to your mail message, Mutt-ng searches your
7084 personal mime.types file at <literal>${HOME}/.mime.types</literal>, and then
7085 the system mime.types file at <literal>/usr/local/share/mutt/mime.types</literal> or
7086 <literal>/etc/mime.types</literal>
7090 The mime.types file consist of lines containing a MIME type and a space
7091 separated list of extensions. For example:
7094 application/postscript ps eps
7096 audio/x-aiff aif aifc aiff
7099 A sample <literal>mime.types</literal> file comes with the Mutt-ng distribution, and
7100 should contain most of the MIME types you are likely to use.
7104 If Mutt-ng can not determine the mime type by the extension of the file you
7105 attach, it will look at the file. If the file is free of binary
7106 information, Mutt-ng will assume that the file is plain text, and mark it
7107 as <literal>text/plain</literal>. If the file contains binary information, then Mutt-ng will
7108 mark it as <literal>application/octet-stream</literal>. You can change the MIME
7109 type that Mutt-ng assigns to an attachment by using the <literal>edit-type</literal>
7110 command from the compose menu (default: ˆT). The MIME type is actually a
7111 major mime type followed by the sub-type, separated by a '/'. 6 major
7112 types: application, text, image, video, audio, and model have been approved
7113 after various internet discussions. Mutt-ng recognises all of these if the
7114 appropriate entry is found in the mime.types file. It also recognises other
7115 major mime types, such as the chemical type that is widely used in the
7116 molecular modelling community to pass molecular data in various forms to
7117 various molecular viewers. Non-recognised mime types should only be used
7118 if the recipient of the message is likely to be expecting such attachments.
7128 <title>MIME Viewer configuration with <literal>mailcap</literal> </title>
7131 Mutt-ng supports RFC 1524 MIME Configuration, in particular the Unix
7132 specific format specified in Appendix A of RFC 1524. This file format
7133 is commonly referred to as the mailcap format. Many MIME compliant
7134 programs utilize the mailcap format, allowing you to specify handling
7135 for all MIME types in one place for all programs. Programs known to
7136 use this format include Netscape, XMosaic, lynx and metamail.
7140 In order to handle various MIME types that Mutt-ng can not handle
7141 internally, Mutt-ng parses a series of external configuration files to
7142 find an external handler. The default search string for these files
7143 is a colon delimited list set to
7146 ${HOME}/.mailcap:/usr/local/share/mutt/mailcap:/etc/mailcap:/etc/mailcap:/usr/etc/mailcap:/usr/local/etc/mailcap
7149 where <literal>$HOME</literal> is your home directory.
7153 In particular, the metamail distribution will install a mailcap file,
7154 usually as <literal>/usr/local/etc/mailcap</literal>, which contains some baseline
7159 <title>The Basics of the mailcap file</title>
7162 A mailcap file consists of a series of lines which are comments, blank,
7167 A comment line consists of a # character followed by anything you want.
7171 A blank line is blank.
7175 A definition line consists of a content type, a view command, and any
7176 number of optional fields. Each field of a definition line is divided
7177 by a semicolon ';' character.
7181 The content type is specified in the MIME standard type/subtype method.
7183 <literal>text/plain, text/html, image/gif, </literal>
7184 etc. In addition, the mailcap format includes two formats for
7185 wildcards, one using the special '*' subtype, the other is the implicit
7186 wild, where you only include the major type. For example, <literal>image/*</literal>, or
7187 <literal>video,</literal> will match all image types and video types,
7192 The view command is a Unix command for viewing the type specified. There
7193 are two different types of commands supported. The default is to send
7194 the body of the MIME message to the command on stdin. You can change
7195 this behavior by using %s as a parameter to your view command.
7196 This will cause Mutt-ng to save the body of the MIME message to a temporary
7197 file, and then call the view command with the %s replaced by
7198 the name of the temporary file. In both cases, Mutt-ng will turn over the
7199 terminal to the view program until the program quits, at which time Mutt
7200 will remove the temporary file if it exists.
7204 So, in the simplest form, you can send a text/plain message to the
7205 external pager more on stdin:
7211 Or, you could send the message as a file:
7217 Perhaps you would like to use lynx to interactively view a text/html
7224 In this case, lynx does not support viewing a file from stdin, so you
7225 must use the %s syntax.
7226 <emphasis role="bold">Note:</emphasis> <emphasis>Some older versions of lynx contain a bug where they
7227 will check the mailcap file for a viewer for text/html. They will find
7228 the line which calls lynx, and run it. This causes lynx to continuously
7229 spawn itself to view the object.</emphasis>
7233 On the other hand, maybe you don't want to use lynx interactively, you
7234 just want to have it convert the text/html to text/plain, then you can
7238 text/html; lynx -dump %s | more
7244 Perhaps you wish to use lynx to view text/html files, and a pager on
7245 all other text formats, then you would use the following:
7252 This is the simplest form of a mailcap file.
7258 <title>Secure use of mailcap</title>
7261 The interpretation of shell meta-characters embedded in MIME parameters
7262 can lead to security problems in general. Mutt-ng tries to quote parameters
7263 in expansion of %s syntaxes properly, and avoids risky characters by
7264 substituting them, see the <link linkend="mailcap-sanitize">mailcap-sanitize</link> variable.
7268 Although mutt's procedures to invoke programs with mailcap seem to be
7269 safe, there are other applications parsing mailcap, maybe taking less care
7270 of it. Therefore you should pay attention to the following rules:
7274 <emphasis>Keep the %-expandos away from shell quoting.</emphasis>
7275 Don't quote them with single or double quotes. Mutt-ng does this for
7276 you, the right way, as should any other program which interprets
7277 mailcap. Don't put them into backtick expansions. Be highly careful
7278 with eval statements, and avoid them if possible at all. Trying to fix
7279 broken behaviour with quotes introduces new leaks - there is no
7280 alternative to correct quoting in the first place.
7284 If you have to use the %-expandos' values in context where you need
7285 quoting or backtick expansions, put that value into a shell variable
7286 and reference the shell variable where necessary, as in the following
7287 example (using <literal>$charset</literal> inside the backtick expansion is safe,
7288 since it is not itself subject to any further expansion):
7294 text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
7295 && test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
7303 <title>Advanced mailcap Usage</title>
7306 <title>Optional Fields</title>
7309 In addition to the required content-type and view command fields, you
7310 can add semi-colon ';' separated fields to set flags and other options.
7311 Mutt-ng recognizes the following optional fields:
7315 <term>copiousoutput</term>
7318 This flag tells Mutt-ng that the command passes possibly large amounts of
7319 text on stdout. This causes Mutt-ng to invoke a pager (either the internal
7320 pager or the external pager defined by the pager variable) on the output
7321 of the view command. Without this flag, Mutt-ng assumes that the command
7322 is interactive. One could use this to replace the pipe to <literal>more</literal>
7323 in the <literal>lynx -dump</literal> example in the Basic section:
7326 text/html; lynx -dump %s ; copiousoutput
7329 This will cause lynx to format the text/html output as text/plain
7330 and Mutt-ng will use your standard pager to display the results.
7332 </listitem></varlistentry>
7334 <term>needsterminal</term>
7337 Mutt-ng uses this flag when viewing attachments with <link linkend="auto-view">auto-view</link>, in order to decide whether it should honor the setting
7338 of the <link linkend="wait-key">wait-key</link> variable or
7339 not. When an attachment is viewed using an interactive program, and the
7340 corresponding mailcap entry has a <emphasis>needsterminal</emphasis> flag, Mutt-ng will use
7341 <link linkend="wait-key">wait-key</link> and the exit status
7342 of the program to decide if it will ask you to press a key after the
7343 external program has exited. In all other situations it will not prompt
7346 </listitem></varlistentry>
7348 <term>compose=<command></term>
7351 This flag specifies the command to use to create a new attachment of a
7352 specific MIME type. Mutt-ng supports this from the compose menu.
7354 </listitem></varlistentry>
7356 <term>composetyped=<command></term>
7359 This flag specifies the command to use to create a new attachment of a
7360 specific MIME type. This command differs from the compose command in
7361 that mutt will expect standard MIME headers on the data. This can be
7362 used to specify parameters, filename, description, etc. for a new
7363 attachment. Mutt-ng supports this from the compose menu.
7365 </listitem></varlistentry>
7367 <term>print=<command></term>
7370 This flag specifies the command to use to print a specific MIME type.
7371 Mutt-ng supports this from the attachment and compose menus.
7373 </listitem></varlistentry>
7375 <term>edit=<command></term>
7378 This flag specifies the command to use to edit a specific MIME type.
7379 Mutt-ng supports this from the compose menu, and also uses it to compose
7380 new attachments. Mutt-ng will default to the defined editor for text
7383 </listitem></varlistentry>
7385 <term>nametemplate=<template></term>
7388 This field specifies the format for the file denoted by %s in the
7389 command fields. Certain programs will require a certain file extension,
7390 for instance, to correctly view a file. For instance, lynx will only
7391 interpret a file as <literal>text/html</literal> if the file ends in <literal>.html</literal>.
7392 So, you would specify lynx as a <literal>text/html</literal> viewer with a line in
7393 the mailcap file like:
7396 text/html; lynx %s; nametemplate=%s.html
7400 </listitem></varlistentry>
7402 <term>test=<command></term>
7405 This field specifies a command to run to test whether this mailcap
7406 entry should be used. The command is defined with the command expansion
7407 rules defined in the next section. If the command returns 0, then the
7408 test passed, and Mutt-ng uses this entry. If the command returns non-zero,
7409 then the test failed, and Mutt-ng continues searching for the right entry.
7410 <emphasis role="bold">Note:</emphasis> <emphasis>the content-type must match before Mutt-ng performs the test.</emphasis>
7414 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
7418 In this example, Mutt-ng will run the program RunningX which will return 0
7419 if the X Window manager is running, and non-zero if it isn't. If
7420 RunningX returns 0, then Mutt-ng will call netscape to display the
7421 text/html object. If RunningX doesn't return 0, then Mutt-ng will go on
7422 to the next entry and use lynx to display the text/html object.
7424 </listitem></varlistentry>
7431 <title>Search Order</title>
7434 When searching for an entry in the mailcap file, Mutt-ng will search for
7435 the most useful entry for its purpose. For instance, if you are
7436 attempting to print an <literal>image/gif</literal>, and you have the following
7437 entries in your mailcap file, Mutt-ng will search for an entry with the
7442 image/gif; ; print= anytopnm %s | pnmtops | lpr; \
7446 Mutt-ng will skip the <literal>image/*</literal> entry and use the <literal>image/gif</literal>
7447 entry with the print command.
7451 In addition, you can use this with <link linkend="auto-view">auto-view</link>
7452 to denote two commands for viewing an attachment, one to be viewed
7453 automatically, the other to be viewed interactively from the attachment
7454 menu. In addition, you can then use the test feature to determine which
7455 viewer to use interactively depending on your environment.
7458 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
7459 text/html; lynx %s; nametemplate=%s.html
7460 text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput
7463 For <link linkend="auto-view">auto-view</link>, Mutt-ng will choose the third
7464 entry because of the copiousoutput tag. For interactive viewing, Mutt
7465 will run the program RunningX to determine if it should use the first
7466 entry. If the program returns non-zero, Mutt-ng will use the second entry
7467 for interactive viewing.
7473 <title>Command Expansion</title>
7476 The various commands defined in the mailcap files are passed to the
7477 <literal>/bin/sh</literal> shell using the system() function. Before the
7478 command is passed to <literal>/bin/sh -c</literal>, it is parsed to expand
7479 various special parameters with information from Mutt-ng. The keywords
7480 Mutt-ng expands are:
7484 <term>%s</term>
7487 As seen in the basic mailcap section, this variable is expanded
7488 to a filename specified by the calling program. This file contains
7489 the body of the message to view/print/edit or where the composing
7490 program should place the results of composition. In addition, the
7491 use of this keyword causes Mutt-ng to not pass the body of the message
7492 to the view/print/edit program on stdin.
7494 </listitem></varlistentry>
7496 <term>%t</term>
7499 Mutt-ng will expand %t to the text representation of the content
7500 type of the message in the same form as the first parameter of the
7501 mailcap definition line, ie <literal>text/html</literal> or
7502 <literal>image/gif</literal>.
7504 </listitem></varlistentry>
7506 <term>%{<parameter>}</term>
7509 Mutt-ng will expand this to the value of the specified parameter
7510 from the Content-Type: line of the mail message. For instance, if
7511 Your mail message contains:
7514 Content-Type: text/plain; charset=iso-8859-1
7517 then Mutt-ng will expand %{charset} to iso-8859-1. The default metamail
7518 mailcap file uses this feature to test the charset to spawn an xterm
7519 using the right charset to view the message.
7521 </listitem></varlistentry>
7523 <term>\%</term>
7526 This will be replaced by a %
7528 </listitem></varlistentry>
7530 Mutt-ng does not currently support the %F and %n keywords
7531 specified in RFC 1524. The main purpose of these parameters is for
7532 multipart messages, which is handled internally by Mutt-ng.
7540 <title>Example mailcap files</title>
7543 This mailcap file is fairly simple and standard:
7546 # I'm always running X :)
7547 video/*; xanim %s > /dev/null
7548 image/*; xv %s > /dev/null
7550 # I'm always running netscape (if my computer had more memory, maybe)
7551 text/html; netscape -remote 'openURL(%s)'
7557 This mailcap file shows quite a number of examples:
7563 # Use xanim to view all videos Xanim produces a header on startup,
7564 # send that to /dev/null so I don't see it
7565 video/*; xanim %s > /dev/null
7567 # Send html to a running netscape by remote
7568 text/html; netscape -remote 'openURL(%s)'; test=RunningNetscape
7570 # If I'm not running netscape but I am running X, start netscape on the
7572 text/html; netscape %s; test=RunningX
7574 # Else use lynx to view it as text
7577 # This version would convert the text/html to text/plain
7578 text/html; lynx -dump %s; copiousoutput
7580 # I use enscript to print text in two columns to a page
7581 text/*; more %s; print=enscript -2Gr %s
7583 # Netscape adds a flag to tell itself to view jpegs internally
7584 image/jpeg;xv %s; x-mozilla-flags=internal
7586 # Use xv to view images if I'm running X
7587 # In addition, this uses the \ to extend the line and set my editor
7589 image/*;xv %s; test=RunningX; \
7592 # Convert images to text using the netpbm tools
7593 image/*; (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
7594 pbmtoascii -1x2 ) 2>&1 ; copiousoutput
7596 # Send excel spreadsheets to my NT box
7597 application/ms-excel; open.pl %s
7610 <sect1 id="auto-view">
7611 <title>MIME Autoview </title>
7614 In addition to explicitly telling Mutt-ng to view an attachment with the
7615 MIME viewer defined in the mailcap file, Mutt-ng has support for
7616 automatically viewing MIME attachments while in the pager.
7620 To work, you must define a viewer in the mailcap file which uses the
7621 <literal>copiousoutput</literal> option to denote that it is non-interactive.
7622 Usually, you also use the entry to convert the attachment to a text
7623 representation which you can view in the pager.
7627 You then use the <literal>auto_view</literal> muttrc command to list the
7628 content-types that you wish to view automatically.
7632 For instance, if you set auto_view to:
7635 auto_view text/html application/x-gunzip application/postscript image/gif application/x-tar-gz
7641 Mutt-ng could use the following mailcap entries to automatically view
7642 attachments of these types.
7645 text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
7646 image/*; anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | pgmtopbm | pbmtoascii ; copiousoutput
7647 application/x-gunzip; gzcat; copiousoutput
7648 application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
7649 application/postscript; ps2ascii %s; copiousoutput
7655 ``unauto_view'' can be used to remove previous entries from the autoview list.
7656 This can be used with message-hook to autoview messages based on size, etc.
7657 ``unauto_view *'' will remove all previous entries.
7666 <sect1 id="alternative-order">
7667 <title>MIME Multipart/Alternative </title>
7670 Mutt-ng has some heuristics for determining which attachment of a
7671 multipart/alternative type to display. First, mutt will check the
7672 alternative_order list to determine if one of the available types
7673 is preferred. The alternative_order list consists of a number of
7674 MIME types in order, including support for implicit and explicit
7675 wildcards, for example:
7678 alternative_order text/enriched text/plain text application/postscript image/*
7684 Next, mutt will check if any of the types have a defined
7685 <link linkend="auto-view">auto-view</link>, and use that. Failing
7686 that, Mutt-ng will look for any text type. As a last attempt, mutt will
7687 look for any type it knows how to handle.
7691 To remove a MIME type from the <literal>alternative_order</literal> list, use the
7692 <literal>unalternative_order</literal> command.
7701 <sect1 id="mime-lookup">
7702 <title>MIME Lookup </title>
7705 Mutt-ng's mime_lookup list specifies a list of mime-types that should not
7706 be treated according to their mailcap entry. This option is designed to
7707 deal with binary types such as application/octet-stream. When an attachment's
7708 mime-type is listed in mime_lookup, then the extension of the filename will
7709 be compared to the list of extensions in the mime.types file. The mime-type
7710 associated with this extension will then be used to process the attachment
7711 according to the rules in the mailcap file and according to any other configuration
7712 options (such as auto_view) specified. Common usage would be:
7715 mime_lookup application/octet-stream application/X-Lotus-Manuscript
7721 In addition, the unmime_lookup command may be used to disable this feature
7722 for any particular mime-type if it had been set, for example, in a global
7739 <title>Security Considerations </title>
7742 First of all, mutt-ng contains no security holes included by
7743 intention but may contain unknown security holes. As a consequence,
7744 please run mutt-ng only with as few permissions as possible.
7748 Please do not run mutt-ng as the super user.
7752 When configuring mutt-ng, there're some points to note about secure
7757 In practice, mutt-ng can be easily made as vulnerable as even the
7758 most insecure mail user agents (in their default configuration) just
7759 by changing mutt-ng's configuration files: it then can execute
7760 arbitrary programs and scripts attached to messages, send out private
7761 data on its own, etc. Although this is not believed to the common type
7762 of setup, please read this chapter carefully.
7766 <title>Passwords </title>
7769 Although mutt-ng can be told the various passwords for accounts,
7770 please never store passwords in configuration files. Besides the
7771 fact that the system's operator can always read them, you could
7772 forget to replace the actual password with asterisks when reporting
7773 a bug or asking for help via, for example, a mailing list so that
7774 your mail including your password could be archived by internet
7775 search engines, etc. Please never store passwords on disk.
7781 <title>Temporary Files </title>
7784 Mutt-ng uses many temporary files for viewing messages, verifying
7785 digital signatures, etc. The <link linkend="umask">umask</link>
7786 variable can be used to change the default permissions of these
7787 files. Please only change it if you really know what you are doing.
7788 Also, a different location for these files may be desired which can
7789 be changed via the <link linkend="tmpdir">tmpdir</link> variable.
7795 <title>Information Leaks </title>
7798 <title>Message-ID: headers </title>
7801 In the default configuration, mutt-ng will leak some information
7802 to the outside world when sending messages: the generation of
7803 <literal>Message-ID:</literal> headers includes a step counter which is increased
7804 (and rotated) with every message sent. If you'd like to hide this
7805 information probably telling others how many mail you sent in which
7806 time, you at least need to remove the <literal>%P</literal> expando from the
7807 default setting of the <link linkend="msgid-format">msgid-format</link> variable. Please make sure that
7808 you really know how local parts of these <literal>Message-ID:</literal> headers
7815 <title>mailto:-style links </title>
7818 As mutt-ng be can be set up to be the mail client to handle
7819 <literal>mailto:</literal> style links in websites, there're security
7820 considerations, too. To keep the old behavior by default, mutt-ng
7821 will be strict in interpreting them which means that arbitrary
7822 header fields can be embedded in these links which could override
7823 existing header fields or attach arbitrary files. This may be
7824 problematic if the <link linkend="edit-headers">edit-headers</link> variable is <emphasis>unset</emphasis>, i.e. the
7825 user doesn't want to see header fields while editing the message.
7829 For example, following a link like
7835 mailto:joe@host?Attach=~/.gnupg/secring.gpg
7841 will send out the user's private gnupg keyring to <literal>joe@host</literal> if
7842 the user doesn't follow the information on screen carefully
7847 When <emphasis>unsetting</emphasis> the <link linkend="strict-mailto">strict-mailto</link> variable, mutt-ng will
7856 be less strict when interpreting these links by
7857 prepending a <literal>X-Mailto-</literal> string to all header fields
7858 embedded in such a link <emphasis>and</emphasis>
7865 turn on the <link linkend="edit-headers">edit-headers</link> variable by
7866 force to let the user see all the headers
7867 (because they still may leak information.)
7881 <title>External applications </title>
7884 Mutt-ng in many places has to rely on external applications or
7885 for convenience supports mechanisms involving external
7890 <title>mailcap </title>
7893 One of these is the <literal>mailcap</literal> mechanism as defined by RfC
7894 1524. Mutt-ng can be set up to <emphasis>automatically</emphasis> execute any
7895 given utility as listed in one of the mailcap files (see the
7896 <link linkend="mailcap-path">mailcap-path</link>
7897 variable for details.)
7901 These utilities may have a variety of security vulnerabilities,
7902 including overwriting of arbitrary files, information leaks or
7903 other exploitable bugs. These vulnerabilities may go unnoticed by
7904 the user, especially when they are called automatically (and
7905 without interactive prompting) from the mailcap file(s). When
7906 using mutt-ng's autoview mechanism in combination with mailcap
7907 files, please be sure to...
7916 manually select trustworth applications with a reasonable
7924 periodically check the contents of mailcap files,
7925 especially after software installations or upgrades
7932 keep the software packages referenced in the mailcap file up to date
7939 leave the <link linkend="mailcap-sanitize">mailcap-sanitize</link> variable in its default
7940 state to restrict mailcap expandos to a safe set of characters
7952 <title>Other </title>
7955 Besides the mailcap mechanism, mutt-ng uses a number of other
7956 external utilities for operation.
7960 The same security considerations apply for these as for tools
7961 involved via mailcap (for example, mutt-ng is vulnerable to Denial
7962 of Service Attacks with compressed folders support if the
7963 uncompressed mailbox is too large for the disk it is saved to.)
7967 As already noted, most of these problems are not built in but
7968 caused by wrong configuration, so please check your configuration.
7978 <title>Reference </title>
7980 <sect1 id="commandline">
7981 <title>Command line options </title>
7984 Running <literal>mutt</literal> with no arguments will make Mutt-ng attempt to read your spool
7985 mailbox. However, it is possible to read other mailboxes and
7986 to send messages from the command line as well.
7993 -a attach a file to a message
7994 -b specify a blind carbon-copy (BCC) address
7995 -c specify a carbon-copy (Cc) address
7996 -e specify a config command to be run after initialization files are read
7997 -f specify a mailbox to load
7998 -F specify an alternate file to read initialization commands
7999 -h print help on command line options
8000 -H specify a draft file from which to read a header and body
8001 -i specify a file to include in a message composition
8002 -m specify a default mailbox type
8003 -n do not read the system Muttngrc
8004 -p recall a postponed message
8005 -Q query a configuration variable
8006 -R open mailbox in read-only mode
8007 -s specify a subject (enclose in quotes if it contains spaces)
8008 -t dump the value of all variables to stdout
8009 -T dump the value of all changed variables to stdout
8010 -v show version number and compile-time definitions
8011 -x simulate the mailx(1) compose mode
8012 -y show a menu containing the files specified by the mailboxes command
8013 -z exit immediately if there are no messages in the mailbox
8014 -Z open the first folder with new message,exit immediately if none
8020 To read messages in a mailbox
8024 <literal>mutt</literal> [ -nz ] [ -F <emphasis>muttrc</emphasis> ] [ -m <emphasis>type</emphasis> ] [ -f <emphasis>mailbox</emphasis> ]
8028 To compose a new message
8032 <literal>mutt</literal> [ -n ] [ -F <emphasis>muttrc</emphasis> ] [ -a <emphasis>file</emphasis> ] [ -c <emphasis>address</emphasis> ] [ -i <emphasis>filename</emphasis> ] [ -s <emphasis>subject</emphasis> ] <emphasis>address</emphasis> [ <emphasis>address</emphasis> ... ]
8036 Mutt-ng also supports a ``batch'' mode to send prepared messages. Simply redirect
8037 input from the file you wish to send. For example,
8041 <literal>mutt -s "data set for run #2" professor@bigschool.edu
8042 < ˜/run2.dat</literal>
8046 This command will send a message to ``professor@bigschool.edu'' with a subject
8047 of ``data set for run #2''. In the body of the message will be the contents
8048 of the file ``˜/run2.dat''.
8057 <sect1 id="patterns">
8058 <title>Patterns </title>
8064 ~b EXPR messages which contain EXPR in the message body
8065 ~B EXPR messages which contain EXPR in the whole message
8066 ~c USER messages carbon-copied to USER
8067 ~C EXPR message is either to: or cc: EXPR
8069 ~d [MIN]-[MAX] messages with ``date-sent'' in a Date range
8071 ~e EXPR message which contains EXPR in the ``Sender'' field
8073 ~f USER messages originating from USER
8074 ~g cryptographically signed messages
8075 ~G cryptographically encrypted messages
8076 ~H EXPR messages with a spam attribute matching EXPR
8077 ~h EXPR messages which contain EXPR in the message header
8078 ~k message contains PGP key material
8079 ~i ID message which match ID in the ``Message-ID'' field
8080 ~L EXPR message is either originated or received by EXPR
8081 ~l message is addressed to a known mailing list
8082 ~m [MIN]-[MAX] message in the range MIN to MAX *)
8083 ~M multipart messages
8084 ~n [MIN]-[MAX] messages with a score in the range MIN to MAX *)
8087 ~p message is addressed to you (consults alternates)
8088 ~P message is from you (consults alternates)
8089 ~Q messages which have been replied to
8091 ~r [MIN]-[MAX] messages with ``date-received'' in a Date range
8092 ~S superseded messages
8093 ~s SUBJECT messages having SUBJECT in the ``Subject'' field.
8095 ~t USER messages addressed to USER
8097 ~v message is part of a collapsed thread.
8098 ~V cryptographically verified messages
8099 ~w EXPR messages which contain EXPR in the `Newsgroups' field
8100 (if compiled with NNTP support)
8101 ~x EXPR messages which contain EXPR in the `References' field
8102 ~y EXPR messages which contain EXPR in the `X-Label' field
8103 ~z [MIN]-[MAX] messages with a size in the range MIN to MAX *)
8104 ~= duplicated messages (see $duplicate_threads)
8105 ~$ unreferenced messages (requires threaded view)
8106 ~* ``From'' contains realname and (syntactically) valid
8107 address (excluded are addresses matching against
8108 alternates or any alias)
8114 Where EXPR, USER, ID, and SUBJECT are
8115 <link linkend="regexp">regexp</link>. Special attention has to be
8116 made when using regular expressions inside of patterns. Specifically,
8117 Mutt-ng's parser for these patterns will strip one level of backslash (\),
8118 which is normally used for quoting. If it is your intention to use a
8119 backslash in the regular expression, you will need to use two backslashes
8124 *) The forms <literal><[MAX]</literal>, <literal>>[MIN]</literal>,
8125 <literal>[MIN]-</literal> and <literal>-[MAX]</literal>
8135 <sect1 id="commands">
8136 <title>Configuration Commands </title>
8139 The following are the commands understood by mutt.
8148 <literal><link linkend="account-hook">account-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
8154 <literal><link linkend="alias">alias</link></literal> <emphasis>key</emphasis> <emphasis>address</emphasis> [ , <emphasis>address</emphasis>, ... ]
8160 <literal><link linkend="alias">alias</link></literal> [ * | <emphasis>key</emphasis> ... ]
8166 <literal><link linkend="alternates">alternates</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
8172 <literal><link linkend="alternates">alternates</link></literal> [ * | <emphasis>regexp</emphasis> ... ]
8178 <literal><link linkend="alternative-order">alternative-order</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
8184 <literal><link linkend="alternative-order">alternative-order</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
8190 <literal><link linkend="append-hook">append-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
8196 <literal><link linkend="auto-view">auto-view</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
8202 <literal><link linkend="auto-view">auto-view</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
8208 <literal><link linkend="bind">bind</link></literal> <emphasis>map</emphasis> <emphasis>key</emphasis> <emphasis>function</emphasis>
8214 <literal><link linkend="charset-hook">charset-hook</link></literal> <emphasis>alias</emphasis> <emphasis>charset</emphasis>
8220 <literal><link linkend="close-hook">close-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
8226 <literal><link linkend="color">color</link></literal> <emphasis>object</emphasis> <emphasis>foreground</emphasis> <emphasis>background</emphasis> [ <emphasis>regexp</emphasis> ]
8232 <literal><link linkend="color">color</link></literal> <emphasis>index</emphasis> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
8238 <literal><link linkend="exec">exec</link></literal> <emphasis>function</emphasis> [ <emphasis>function</emphasis> ... ]
8244 <literal><link linkend="fcc-hook">fcc-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
8250 <literal><link linkend="fcc-save-hook">fcc-save-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
8256 <literal><link linkend="folder-hook">folder-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
8262 <literal><link linkend="hdr-order">hdr-order</link></literal> <emphasis>header</emphasis> [ <emphasis>header</emphasis> ... ]
8268 <literal><link linkend="hdr-order">hdr-order</link></literal> <emphasis>header</emphasis> [ <emphasis>header</emphasis> ... ]
8274 <literal><link linkend="charset-hook">charset-hook</link></literal> <emphasis>charset</emphasis> <emphasis>local-charset</emphasis>
8280 <literal><link linkend="ignore">ignore</link></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
8286 <literal><link linkend="ignore">ignore</link></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
8292 <literal><link linkend="lists">lists</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
8298 <literal><link linkend="lists">lists</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
8304 <literal><link linkend="macro">macro</link></literal> <emphasis>menu</emphasis> <emphasis>key</emphasis> <emphasis>sequence</emphasis> [ <emphasis>description</emphasis> ]
8310 <literal><link linkend="mailboxes">mailboxes</link></literal> <emphasis>filename</emphasis> [ <emphasis>filename</emphasis> ... ]
8316 <literal><link linkend="mbox-hook">mbox-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
8322 <literal><link linkend="message-hook">message-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
8328 <literal><link linkend="mime-lookup">mime-lookup</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
8334 <literal><link linkend="mime-lookup">mime-lookup</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
8340 <literal><link linkend="color">color</link></literal> <emphasis>object attribute</emphasis> [ <emphasis>regexp</emphasis> ]
8346 <literal><link linkend="color">color</link></literal> <emphasis>index</emphasis> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
8352 <literal><link linkend="my-hdr">my-hdr</link></literal> <emphasis>string</emphasis>
8358 <literal><link linkend="my-hdr">my-hdr</link></literal> <emphasis>field</emphasis> [ <emphasis>field</emphasis> ... ]
8364 <literal><link linkend="open-hook">open-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
8370 <literal><link linkend="crypt-hook">crypt-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>key-id</emphasis>
8376 <literal><link linkend="push">push</link></literal> <emphasis>string</emphasis>
8382 <literal><link linkend="set">set</link></literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
8388 <literal><link linkend="save-hook">save-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>filename</emphasis>
8394 <literal><link linkend="score-command">score-command</link></literal> <emphasis>pattern</emphasis> <emphasis>value</emphasis>
8400 <literal><link linkend="score-command">score-command</link></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
8406 <literal><link linkend="send-hook">send-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
8412 <literal><link linkend="reply-hook">reply-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>command</emphasis>
8418 <literal><link linkend="set">set</link></literal> [no|inv]<emphasis>variable</emphasis>[=<emphasis>value</emphasis>] [ <emphasis>variable</emphasis> ... ]
8424 <literal><link linkend="set">set</link></literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
8430 <literal><link linkend="source">source</link></literal> <emphasis>filename</emphasis>
8436 <literal><link linkend="spam">spam</link></literal> <emphasis>pattern</emphasis> <emphasis>format</emphasis>
8442 <literal><link linkend="spam">spam</link></literal> <emphasis>pattern</emphasis>
8448 <literal><link linkend="lists">lists</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
8454 <literal><link linkend="lists">lists</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
8460 <literal><link linkend="set">set</link></literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
8466 <literal><link linkend="unhook">unhook</link></literal> <emphasis>hook-type</emphasis>
8476 <sect1 id="variables">
8477 <title>Configuration variables</title>
8480 The following list contains all variables which, in the process of
8481 providing more consistency, have been renamed and are partially even
8482 removed already. The left column contains the old synonym variables,
8483 the right column the full/new name:
8487 <anchor id="sect-obsolete"/>
8490 edit_hdrs edit_headers
8491 forw_decode forward_decode
8492 forw_format forward_format
8493 forw_quote forward_quote
8494 hdr_format index_format
8495 indent_str indent_string
8496 mime_fwd mime_forward
8497 msg_format message_format
8498 pgp_autosign crypt_autosign
8499 pgp_autoencrypt crypt_autoencrypt
8500 pgp_replyencrypt crypt_replyencrypt
8501 pgp_replysign crypt_replysign
8502 pgp_replysignencrypted crypt_replysignencrypted
8503 pgp_verify_sig crypt_verify_sig
8504 pgp_create_traditional pgp_autoinline
8505 pgp_auto_traditional pgp_replyinline
8506 forw_decrypt forward_decrypt
8507 smime_sign_as smime_default_key
8508 post_indent_str post_indent_string
8509 print_cmd print_command
8510 shorten_hierarchy sidebar_shorten_hierarchy
8511 ask_followup_to nntp_ask_followup_to
8512 ask_x_comment_to nntp_ask_x_comment_to
8513 catchup_newsgroup nntp_catchup
8514 followup_to_poster nntp_followup_to_poster
8515 group_index_format nntp_group_index_format
8517 mime_subject nntp_mime_subject
8518 news_cache_dir nntp_cache_dir
8519 news_server nntp_host
8521 nntp_poll nntp_mail_check
8522 pop_checkinterval pop_mail_check
8523 post_moderated nntp_post_moderated
8524 save_unsubscribed nntp_save_unsubscribed
8525 show_new_news nntp_show_new_news
8526 show_only_unread nntp_show_only_unread
8527 x_comment_to nntp_x_comment_to
8528 smtp_auth_username smtp_user
8529 smtp_auth_password smtp_pass
8535 The <literal>contrib</literal> subdirectory contains a script named
8536 <literal>update-config.pl</literal> which eases migration.
8540 A complete list of current variables follows.