1 <?xml version="1.0" standalone="no"?>
2 <!DOCTYPE book PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
3 "http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd">
7 <title>The Mutt E-Mail Client</title>
9 <firstname>Michael</firstname><surname>Elkins</surname>
10 <email>me@cs.hmc.edu</email>
12 <releaseinfo>version @VERSION@</releaseinfo>
16 ``All mail clients suck. This one just sucks less.'' -me, circa 1995
22 <title>Introduction</title>
25 <emphasis role="bold">Mutt</emphasis> is a small but very powerful text-based MIME mail client. Mutt is
26 highly configurable, and is well suited to the mail power user with advanced
27 features like key bindings, keyboard macros, mail threading, regular
28 expression searches and a powerful pattern matching language for selecting
33 <title>Mutt Home Page</title>
37 url="http://www.mutt.org/"
38 >http://www.mutt.org/</ulink
44 <sect1 id="muttlists">
45 <title>Mailing Lists</title>
48 To subscribe to one of the following mailing lists, send a message with the
49 word <emphasis>subscribe</emphasis> in the body to
50 <literal>list-name</literal><emphasis>-request</emphasis><literal>@mutt.org</literal>.
59 <email>mutt-announce-request@mutt.org</email> -- low traffic list for announcements
65 <email>mutt-users-request@mutt.org</email> -- help, bug reports and feature requests
71 <email>mutt-dev-request@mutt.org</email> -- development mailing list
80 <emphasis role="bold">Note:</emphasis> all messages posted to <emphasis>mutt-announce</emphasis> are automatically
81 forwarded to <emphasis>mutt-users</emphasis>, so you do not need to be subscribed to both
87 <sect1 id="distribution">
88 <title>Software Distribution Sites</title>
97 url="ftp://ftp.mutt.org/mutt/"
98 >ftp://ftp.mutt.org/mutt/</ulink
108 For a list of mirror sites, please refer to <ulink
109 url="http://www.mutt.org/download.html"
110 >http://www.mutt.org/download.html</ulink
120 Visit channel <emphasis>#mutt</emphasis> on
121 <ulink url="http://www.freenode.net/">irc.freenode.net</ulink> to chat with
122 other people interested in Mutt.
128 <title>USENET</title>
131 See the newsgroup <ulink
132 url="news:comp.mail.mutt"
133 >comp.mail.mutt</ulink
139 <sect1 id="copyright">
140 <title>Copyright</title>
143 Mutt is Copyright (C) 1996-2005 Michael R. Elkins
144 <email>me@cs.hmc.edu</email> and others
148 This program is free software; you can redistribute it and/or modify
149 it under the terms of the GNU General Public License as published by
150 the Free Software Foundation; either version 2 of the License, or
151 (at your option) any later version.
155 This program is distributed in the hope that it will be useful,
156 but WITHOUT ANY WARRANTY; without even the implied warranty of
157 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
158 GNU General Public License for more details.
162 You should have received a copy of the GNU General Public License
163 along with this program; if not, write to the Free Software
164 Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
171 <chapter id="gettingstarted">
172 <title>Getting Started</title>
175 This section is intended as a brief overview of how to use Mutt. There are
176 many other features which are described elsewhere in the manual. There
177 is even more information available in the Mutt FAQ and various web
178 pages. See the <ulink
179 url="http://www.mutt.org/mutt/"
185 The keybindings described in this section are the defaults as distributed.
186 Your local system administrator may have altered the defaults for your site.
187 You can always type ``?'' in any menu to display the current bindings.
191 The first thing you need to do is invoke mutt, simply by typing mutt
192 at the command line. There are various command-line options, see
193 either the mutt man page or the <link linkend="commandline">reference</link>.
197 <title>Moving Around in Menus</title>
200 Information is presented in menus, very similar to ELM, see <xref linkend="tab-keys-nav"/>
201 for common keys used to navigate menus in Mutt.
206 <table id="tab-keys-nav">
207 <title>Most common navigation keys</title>
210 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
213 <row><entry>j or Down</entry><entry>next-entry</entry><entry>move to the next entry</entry></row>
214 <row><entry>k or Up</entry><entry>previous-entry</entry><entry>move to the previous entry</entry></row>
215 <row><entry>z or PageDn</entry><entry>page-down</entry><entry>go to the next page</entry></row>
216 <row><entry>Z or PageUp</entry><entry>page-up</entry><entry>go to the previous page</entry></row>
217 <row><entry>= or Home</entry><entry>first-entry</entry><entry>jump to the first entry</entry></row>
218 <row><entry>* or End</entry><entry>last-entry</entry><entry>jump to the last entry</entry></row>
219 <row><entry>q</entry><entry>quit</entry><entry>exit the current menu</entry></row>
220 <row><entry>?</entry><entry>help</entry><entry>list all keybindings for the current menu</entry></row>
230 <title>Editing Input Fields</title>
232 <sect2 id="editing-intro">
233 <title>Introduction</title>
236 Mutt has a built-in line editor for inputting text, e.g. email
237 addresses or filenames. The keys used to manipulate text input are
238 very similar to those of Emacs. See <xref linkend="tab-keys-editor"/> for a full
239 reference of available functions, their default key bindings, and
245 <table id="tab-keys-editor">
246 <title>Most common line editor keys</title>
249 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
252 <row><entry>ˆA or <Home></entry><entry>bol</entry><entry>move to the start of the line</entry></row>
253 <row><entry>ˆB or <Left></entry><entry>backward-char</entry><entry>move back one char</entry></row>
254 <row><entry>Esc B</entry><entry>backward-word</entry><entry>move back one word</entry></row>
255 <row><entry>ˆD or <Delete></entry><entry>delete-char</entry><entry>delete the char under the cursor</entry></row>
256 <row><entry>ˆE or <End></entry><entry>eol</entry><entry>move to the end of the line</entry></row>
257 <row><entry>ˆF or <Right></entry><entry>forward-char</entry><entry>move forward one char</entry></row>
258 <row><entry>Esc F</entry><entry>forward-word</entry><entry>move forward one word</entry></row>
259 <row><entry><Tab></entry><entry>complete</entry><entry>complete filename or alias</entry></row>
260 <row><entry>ˆT</entry><entry>complete-query</entry><entry>complete address with query</entry></row>
261 <row><entry>ˆK</entry><entry>kill-eol</entry><entry>delete to the end of the line</entry></row>
262 <row><entry>ESC d</entry><entry>kill-eow</entry><entry>delete to the end ot the word</entry></row>
263 <row><entry>ˆW</entry><entry>kill-word</entry><entry>kill the word in front of the cursor</entry></row>
264 <row><entry>ˆU</entry><entry>kill-line</entry><entry>delete entire line</entry></row>
265 <row><entry>ˆV</entry><entry>quote-char</entry><entry>quote the next typed key</entry></row>
266 <row><entry><Up></entry><entry>history-up</entry><entry>recall previous string from history</entry></row>
267 <row><entry><Down></entry><entry>history-down</entry><entry>recall next string from history</entry></row>
268 <row><entry><BackSpace></entry><entry>backspace</entry><entry>kill the char in front of the cursor</entry></row>
269 <row><entry>Esc u</entry><entry>upcase-word</entry><entry>convert word to upper case</entry></row>
270 <row><entry>Esc l</entry><entry>downcase-word</entry><entry>convert word to lower case</entry></row>
271 <row><entry>Esc c</entry><entry>capitalize-word</entry><entry>capitalize the word</entry></row>
272 <row><entry>ˆG</entry><entry>n/a</entry><entry>abort</entry></row>
273 <row><entry><Return></entry><entry>n/a</entry><entry>finish editing</entry></row>
281 You can remap the <emphasis>editor</emphasis> functions using the
282 <link linkend="bind">bind</link> command. For example, to make
283 the <emphasis>Delete</emphasis> key delete the character in front of
284 the cursor rather than under, you could use
288 bind editor <delete> backspace
293 <sect2 id="editing-history">
294 <title>History</title>
297 The number of items in the built-in editor's history is controlled by
298 the <link linkend="history">$history</link> variable. You may
299 cycle through them at an editor prompt by using the
300 <literal>history-up</literal> and/or <literal>history-down</literal>
305 Mutt maintains several distinct history lists, one for each of the
306 following categories:
311 <listitem><para>muttrc commands</para></listitem>
312 <listitem><para>addresses and aliases</para></listitem>
313 <listitem><para>shell commands</para></listitem>
314 <listitem><para>filenames</para></listitem>
315 <listitem><para>patterns</para></listitem>
316 <listitem><para>everything else</para></listitem>
321 Mutt automatically filters out repeated items from the history. It
322 also mimics the behavior of some shells by ignoring items starting
327 The latter feature can be useful in macros to not clobber the history's
328 valuable entries with unwanted entries.
336 <title>Reading Mail - The Index and Pager</title>
339 Similar to many other mail clients, there are two modes in which mail is
340 read in Mutt. The first is the index of messages in the mailbox, which is
341 called the ``index'' in Mutt. The second mode is the display of the
342 message contents. This is called the ``pager.''
346 The next few sections describe the functions provided in each of these
351 <title>The Message Index</title>
354 Common keys used to navigate through and manage messages in the index
355 are shown in <xref linkend="tab-key-index"/>.
360 <table id="tab-key-index">
361 <title>Most common message index keys</title>
364 <row><entry>Key</entry><entry>Description</entry></row>
367 <row><entry>c</entry><entry>change to a different mailbox</entry></row>
368 <row><entry>ESC c</entry><entry>change to a folder in read-only mode</entry></row>
369 <row><entry>C</entry><entry>copy the current message to another mailbox</entry></row>
370 <row><entry>ESC C</entry><entry>decode a message and copy it to a folder</entry></row>
371 <row><entry>ESC s</entry><entry>decode a message and save it to a folder</entry></row>
372 <row><entry>D</entry><entry>delete messages matching a pattern</entry></row>
373 <row><entry>d</entry><entry>delete the current message</entry></row>
374 <row><entry>F</entry><entry>mark as important</entry></row>
375 <row><entry>l</entry><entry>show messages matching a pattern</entry></row>
376 <row><entry>N</entry><entry>mark message as new</entry></row>
377 <row><entry>o</entry><entry>change the current sort method</entry></row>
378 <row><entry>O</entry><entry>reverse sort the mailbox</entry></row>
379 <row><entry>q</entry><entry>save changes and exit</entry></row>
380 <row><entry>s</entry><entry>save-message</entry></row>
381 <row><entry>T</entry><entry>tag messages matching a pattern</entry></row>
382 <row><entry>t</entry><entry>toggle the tag on a message</entry></row>
383 <row><entry>ESC t</entry><entry>toggle tag on entire message thread</entry></row>
384 <row><entry>U</entry><entry>undelete messages matching a pattern</entry></row>
385 <row><entry>u</entry><entry>undelete-message</entry></row>
386 <row><entry>v</entry><entry>view-attachments</entry></row>
387 <row><entry>x</entry><entry>abort changes and exit</entry></row>
388 <row><entry><Return></entry><entry>display-message</entry></row>
389 <row><entry><Tab></entry><entry>jump to the next new or unread message</entry></row>
390 <row><entry>@</entry><entry>show the author's full e-mail address</entry></row>
391 <row><entry>$</entry><entry>save changes to mailbox</entry></row>
392 <row><entry>/</entry><entry>search</entry></row>
393 <row><entry>ESC /</entry><entry>search-reverse</entry></row>
394 <row><entry>ˆL</entry><entry>clear and redraw the screen</entry></row>
395 <row><entry>ˆT</entry><entry>untag messages matching a pattern</entry></row>
403 <title>Status Flags</title>
406 In addition to who sent the message and the subject, a short summary of
407 the disposition of each message is printed beside the message number.
408 Zero or more of the following ``flags'' may appear, which mean:
418 message is deleted (is marked for deletion)
426 message have attachments marked for deletion
434 contains a PGP public key
458 message is PGP encrypted
466 message has been replied to
474 message is signed, and the signature is successfully verified
506 Some of the status flags can be turned on or off using
512 <emphasis role="bold">set-flag</emphasis> (default: w)
518 <emphasis role="bold">clear-flag</emphasis> (default: W)
527 Furthermore, the following flags reflect who the message is addressed
528 to. They can be customized with the
529 <link linkend="to-chars">$to_chars</link> variable.
539 message is to you and you only
547 message is to you, but also to or cc'ed to others
555 message is cc'ed to you
571 message is sent to a subscribed mailing list
583 <title>The Pager</title>
586 By default, Mutt uses its builtin pager to display the body of messages.
587 The pager is very similar to the Unix program <emphasis>less</emphasis> though not nearly as
593 <table id="tab-key-pager">
594 <title>Most common pager keys</title>
597 <row><entry>Key</entry><entry>Description</entry></row>
600 <row><entry><Return></entry><entry>go down one line</entry></row>
601 <row><entry><Space></entry><entry>display the next page (or next message if at the end of a message)</entry></row>
602 <row><entry>-</entry><entry>go back to the previous page</entry></row>
603 <row><entry>n</entry><entry>search for next match</entry></row>
604 <row><entry>S</entry><entry>skip beyond quoted text</entry></row>
605 <row><entry>T</entry><entry>toggle display of quoted text</entry></row>
606 <row><entry>?</entry><entry>show keybindings</entry></row>
607 <row><entry>/</entry><entry>search for a regular expression (pattern)</entry></row>
608 <row><entry>ESC /</entry><entry>search backwards for a regular expression</entry></row>
609 <row><entry>\</entry><entry>toggle search pattern coloring</entry></row>
610 <row><entry>ˆ</entry><entry>jump to the top of the message</entry></row>
618 In addition to key bindings in <xref linkend="tab-key-pager"/>,
619 many of the functions from the <emphasis>index</emphasis> are available in
620 the pager, such as <emphasis>delete-message</emphasis> or <emphasis>copy-message</emphasis> (this is one
621 advantage over using an external pager to view messages).
625 Also, the internal pager supports a couple other advanced features. For
626 one, it will accept and translate the ``standard'' nroff sequences for
627 bold and underline. These sequences are a series of either the letter,
628 backspace (ˆH), the letter again for bold or the letter, backspace,
629 ``_'' for denoting underline. Mutt will attempt to display these
630 in bold and underline respectively if your terminal supports them. If
631 not, you can use the bold and underline <link linkend="color">color</link>
632 objects to specify a color or mono attribute for them.
636 Additionally, the internal pager supports the ANSI escape sequences for
637 character attributes. Mutt translates them into the correct color and
638 character settings. The sequences Mutt supports are
639 '\e[<emphasis>Ps</emphasis>;<emphasis>Ps</emphasis>;..<emphasis>Ps</emphasis>;m'
640 where <emphasis>Ps</emphasis> can be one of the codes shown in
641 <xref linkend="tab-ansi-esc"/>.
644 <table id="tab-ansi-esc">
645 <title>ANSI escape sequences</title>
648 <row><entry>Escape code</entry><entry>Description</entry></row>
651 <row><entry>0</entry><entry>All Attributes Off</entry></row>
652 <row><entry>1</entry><entry>Bold on</entry></row>
653 <row><entry>4</entry><entry>Underline on</entry></row>
654 <row><entry>5</entry><entry>Blink on</entry></row>
655 <row><entry>7</entry><entry>Reverse video on</entry></row>
656 <row><entry>3<emphasis><color></emphasis></entry><entry>Foreground color is <emphasis><color></emphasis> (see <xref linkend="tab-color"/>)</entry></row>
657 <row><entry>4<emphasis><color></emphasis></entry><entry>Background color is <emphasis><color></emphasis> (see <xref linkend="tab-color"/>)</entry></row>
662 <table id="tab-color">
663 <title>Color sequences</title>
666 <row><entry>Color code</entry><entry>Color</entry></row>
669 <row><entry>0</entry><entry>Black</entry></row>
670 <row><entry>1</entry><entry>Red</entry></row>
671 <row><entry>2</entry><entry>Green</entry></row>
672 <row><entry>3</entry><entry>Yellow</entry></row>
673 <row><entry>4</entry><entry>Blue</entry></row>
674 <row><entry>5</entry><entry>Magenta</entry></row>
675 <row><entry>6</entry><entry>Cyan</entry></row>
676 <row><entry>7</entry><entry>White</entry></row>
682 Mutt uses these attributes for handling text/enriched messages, and they
683 can also be used by an external <link linkend="auto-view">autoview</link>
684 script for highlighting purposes. <emphasis role="bold">Note:</emphasis> If you change the colors for your
685 display, for example by changing the color associated with color2 for
686 your xterm, then that color will be used instead of green.
692 <title>Threaded Mode</title>
695 When the mailbox is <link linkend="sort">sorted</link> by <emphasis>threads</emphasis>, there are
696 a few additional functions available in the <emphasis>index</emphasis> and <emphasis>pager</emphasis> modes
697 as shown in <xref linkend="tab-key-threads"/>.
702 <table id="tab-key-threads">
703 <title>Most common thread mode keys</title>
706 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
709 <row><entry>ˆD</entry><entry>delete-thread</entry><entry>delete all messages in the current thread</entry></row>
710 <row><entry>ˆU</entry><entry>undelete-thread</entry><entry>undelete all messages in the current thread</entry></row>
711 <row><entry>ˆN</entry><entry>next-thread</entry><entry>jump to the start of the next thread</entry></row>
712 <row><entry>ˆP</entry><entry>previous-thread</entry><entry>jump to the start of the previous thread</entry></row>
713 <row><entry>ˆR</entry><entry>read-thread</entry><entry>mark the current thread as read</entry></row>
714 <row><entry>ESC d</entry><entry>delete-subthread</entry><entry>delete all messages in the current subthread</entry></row>
715 <row><entry>ESC u</entry><entry>undelete-subthread</entry><entry>undelete all messages in the current subthread</entry></row>
716 <row><entry>ESC n</entry><entry>next-subthread</entry><entry>jump to the start of the next subthread</entry></row>
717 <row><entry>ESC p</entry><entry>previous-subthread</entry><entry>jump to the start of the previous subthread</entry></row>
718 <row><entry>ESC r</entry><entry>read-subthread</entry><entry>mark the current subthread as read</entry></row>
719 <row><entry>ESC t</entry><entry>tag-thread</entry><entry>toggle the tag on the current thread</entry></row>
720 <row><entry>ESC v</entry><entry>collapse-thread</entry><entry>toggle collapse for the current thread</entry></row>
721 <row><entry>ESC V</entry><entry>collapse-all</entry><entry>toggle collapse for all threads</entry></row>
722 <row><entry>P</entry><entry>parent-message</entry><entry>jump to parent message in thread</entry></row>
730 <emphasis role="bold">Note:</emphasis> Collapsing a thread displays only the first message
731 in the thread and hides the others. This is useful when threads
732 contain so many messages that you can only see a handful of threads on
733 the screen. See %M in <link linkend="index-format">$index_format</link>.
734 For example, you could use "%?M?(#%03M)&(%4l)?" in <link linkend="index-format">$index_format</link> to optionally
735 display the number of hidden messages if the thread is collapsed.
739 See also: <link linkend="strict-threads">$strict_threads</link>.
745 <title>Miscellaneous Functions</title>
748 <emphasis role="bold">create-alias</emphasis><anchor id="create-alias"/> (default: a)
753 Creates a new alias based upon the current message (or prompts for a
754 new one). Once editing is complete, an <link linkend="alias">alias</link>
755 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>
756 Specifying an <link linkend="alias-file">$alias_file</link>
757 does not add the aliases specified there-in, you must also <link linkend="source">source</link> the file.
761 <emphasis role="bold">check-traditional-pgp</emphasis><anchor id="check-traditional-pgp"/> (default: ESC P)
766 This function will search the current message for content signed or
767 encrypted with PGP the "traditional" way, that is, without proper
768 MIME tagging. Technically, this function will temporarily change
769 the MIME content types of the body parts containing PGP data; this
770 is similar to the <link linkend="edit-type">edit-type</link> function's
775 <emphasis role="bold">display-toggle-weed</emphasis><anchor id="display-toggle-weed"/> (default: h)
780 Toggles the weeding of message header fields specified by <link linkend="ignore">ignore</link> commands.
784 <emphasis role="bold">edit</emphasis><anchor id="edit"/> (default: e)
789 This command (available in the ``index'' and ``pager'') allows you to
790 edit the raw current message as it's present in the mail folder.
791 After you have finished editing, the changed message will be
792 appended to the current folder, and the original message will be
797 <emphasis role="bold">edit-type</emphasis><anchor id="edit-type"/>
799 (default: ˆE on the attachment menu, and in the pager and index menus; ˆT on the
804 This command is used to temporarily edit an attachment's content
805 type to fix, for instance, bogus character set parameters. When
806 invoked from the index or from the pager, you'll have the
807 opportunity to edit the top-level attachment's content type. On the
808 <link linkend="attach-menu">attachment menu</link>, you can change any
809 attachment's content type. These changes are not persistent, and get
810 lost upon changing folders.
814 Note that this command is also available on the <link linkend="compose-menu">compose
815 menu</link>. There, it's used to fine-tune the properties of attachments you are going
820 <emphasis role="bold">enter-command</emphasis><anchor id="enter-command"/> (default: ``:'')
825 This command is used to execute any command you would normally put in a
826 configuration file. A common use is to check the settings of variables, or
827 in conjunction with <link linkend="macro">macros</link> to change settings on the
832 <emphasis role="bold">extract-keys</emphasis><anchor id="extract-keys"/> (default: ˆK)
837 This command extracts PGP public keys from the current or tagged
838 message(s) and adds them to your PGP public key ring.
842 <emphasis role="bold">forget-passphrase</emphasis><anchor id="forget-passphrase"/> (default:
848 This command wipes the passphrase(s) from memory. It is useful, if
849 you misspelled the passphrase.
853 <emphasis role="bold">list-reply</emphasis><anchor id="list-reply"/> (default: L)
858 Reply to the current or tagged message(s) by extracting any addresses which
859 match the regular expressions given by the <link linkend="lists">lists or subscribe</link>
860 commands, but also honor any <literal>Mail-Followup-To</literal> header(s) if the
861 <link linkend="honor-followup-to">$honor_followup_to</link>
862 configuration variable is set. Using this when replying to messages posted
863 to mailing lists helps avoid duplicate copies being sent to the author of
864 the message you are replying to.
868 <emphasis role="bold">pipe-message</emphasis><anchor id="pipe-message"/> (default: |)
873 Asks for an external Unix command and pipes the current or
874 tagged message(s) to it. The variables <link linkend="pipe-decode">$pipe_decode</link>, <link linkend="pipe-split">$pipe_split</link>,
875 <link linkend="pipe-sep">$pipe_sep</link> and <link linkend="wait-key">$wait_key</link> control the exact behavior of this function.
879 <emphasis role="bold">resend-message</emphasis><anchor id="resend-message"/> (default: ESC e)
884 With resend-message, mutt takes the current message as a template for a
885 new message. This function is best described as "recall from arbitrary
886 folders". It can conveniently be used to forward MIME messages while
887 preserving the original mail structure. Note that the amount of headers
888 included here depends on the value of the <link linkend="weed">$weed</link>
893 This function is also available from the attachment menu. You can use this
894 to easily resend a message which was included with a bounce message
895 as a message/rfc822 body part.
899 <emphasis role="bold">shell-escape</emphasis><anchor id="shell-escape"/> (default: !)
904 Asks for an external Unix command and executes it. The <link linkend="wait-key">$wait_key</link> can be used to control
905 whether Mutt will wait for a key to be pressed when the command returns
906 (presumably to let the user read the output of the command), based on
907 the return status of the named command.
911 <emphasis role="bold">toggle-quoted</emphasis><anchor id="toggle-quoted"/> (default: T)
916 The <emphasis>pager</emphasis> uses the <link linkend="quote-regexp">$quote_regexp</link> variable to detect quoted text when
917 displaying the body of the message. This function toggles the display
918 of the quoted material in the message. It is particularly useful when
919 are interested in just the response and there is a large amount of
920 quoted text in the way.
924 <emphasis role="bold">skip-quoted</emphasis><anchor id="skip-quoted"/> (default: S)
929 This function will go to the next line of non-quoted text which come
930 after a line of quoted text in the internal pager.
938 <title>Sending Mail</title>
941 The bindings shown in <xref linkend="tab-key-send"/> are available in the
942 <emphasis>index</emphasis> for sending messages.
947 <table id="tab-key-send">
948 <title>Most common mail sending keys</title>
951 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
954 <row><entry>m</entry><entry>compose</entry><entry>compose a new message</entry></row>
955 <row><entry>r</entry><entry>reply</entry><entry>reply to sender</entry></row>
956 <row><entry>g</entry><entry>group-reply</entry><entry>reply to all recipients</entry></row>
957 <row><entry>L</entry><entry>list-reply</entry><entry>reply to mailing list address</entry></row>
958 <row><entry>f</entry><entry>forward</entry><entry>forward message</entry></row>
959 <row><entry>b</entry><entry>bounce</entry><entry>bounce (remail) message</entry></row>
960 <row><entry>ESC k</entry><entry>mail-key</entry><entry>mail a PGP public key to someone</entry></row>
968 Bouncing a message sends the message as is to the recipient you
969 specify. Forwarding a message allows you to add comments or
970 modify the message you are forwarding. These items are discussed
971 in greater detail in the next chapter ``<link linkend="forwarding-mail">Forwarding
972 and Bouncing Mail</link>.''
976 Mutt will then enter the <emphasis>compose</emphasis> menu and prompt you for the
977 recipients to place on the ``To:'' header field. Next, it will ask
978 you for the ``Subject:'' field for the message, providing a default if
979 you are replying to or forwarding a message. See also
980 <link linkend="askcc">$askcc</link>,
981 <link linkend="askbcc">$askbcc</link>,
982 <link linkend="autoedit">$autoedit</link>,
983 <link linkend="bounce">$bounce</link>,
984 <link linkend="fast-reply">$fast_reply</link>,
985 and <link linkend="include">$include</link>
986 for changing how Mutt asks these questions.
990 Mutt will then automatically start your <link linkend="editor">$editor</link> on the message body. If the <link linkend="edit-headers">$edit_headers</link> variable is set, the headers will be at
991 the top of the message in your editor. Any messages you are replying
992 to will be added in sort order to the message, with appropriate <link linkend="attribution">$attribution</link>, <link linkend="indent-string">$indent_string</link> and <link linkend="post-indent-string">$post_indent_string</link>. When forwarding a
993 message, if the <link linkend="mime-forward">$mime_forward</link>
994 variable is unset, a copy of the forwarded message will be included. If
995 you have specified a <link linkend="signature">$signature</link>, it
996 will be appended to the message.
1000 Once you have finished editing the body of your mail message, you are
1001 returned to the <emphasis>compose</emphasis> menu providing the functions
1002 show in <xref linkend="tab-func-compose"/>.
1007 <table id="tab-func-compose">
1008 <title>Most common compose menu keys</title>
1011 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
1014 <row><entry>a</entry><entry>attach-file</entry><entry>attach a file</entry></row>
1015 <row><entry>A</entry><entry>attach-message</entry><entry>attach message(s) to the message</entry></row>
1016 <row><entry>ESC k</entry><entry>attach-key</entry><entry>attach a PGP public key</entry></row>
1017 <row><entry>d</entry><entry>edit-description</entry><entry>edit description on attachment</entry></row>
1018 <row><entry>D</entry><entry>detach-file</entry><entry>detach a file</entry></row>
1019 <row><entry>t</entry><entry>edit-to</entry><entry>edit the To field</entry></row>
1020 <row><entry>ESC f</entry><entry>edit-from</entry><entry>edit the From field</entry></row>
1021 <row><entry>r</entry><entry>edit-reply-to</entry><entry>edit the Reply-To field</entry></row>
1022 <row><entry>c</entry><entry>edit-cc</entry><entry>edit the Cc field</entry></row>
1023 <row><entry>b</entry><entry>edit-bcc</entry><entry>edit the Bcc field</entry></row>
1024 <row><entry>y</entry><entry>send-message</entry><entry>send the message</entry></row>
1025 <row><entry>s</entry><entry>edit-subject</entry><entry>edit the Subject</entry></row>
1026 <row><entry>S</entry><entry>smime-menu</entry><entry>select S/MIME options</entry></row>
1027 <row><entry>f</entry><entry>edit-fcc</entry><entry>specify an ``Fcc'' mailbox</entry></row>
1028 <row><entry>p</entry><entry>pgp-menu</entry><entry>select PGP options</entry></row>
1029 <row><entry>P</entry><entry>postpone-message</entry><entry>postpone this message until later</entry></row>
1030 <row><entry>q</entry><entry>quit</entry><entry>quit (abort) sending the message</entry></row>
1031 <row><entry>w</entry><entry>write-fcc</entry><entry>write the message to a folder</entry></row>
1032 <row><entry>i</entry><entry>ispell</entry><entry>check spelling (if available on your system)</entry></row>
1033 <row><entry>ˆF</entry><entry>forget-passphrase</entry><entry>wipe passphrase(s) from memory</entry></row>
1041 <emphasis role="bold">Note:</emphasis> The attach-message function will prompt you for a folder to
1042 attach messages from. You can now tag messages in that folder and they
1043 will be attached to the message you are sending. Note that certain
1044 operations like composing a new mail, replying, forwarding, etc. are
1045 not permitted when you are in that folder. The %r in <link linkend="status-format">$status_format</link> will change to
1046 a 'A' to indicate that you are in attach-message mode.
1050 <title>Editing the message header</title>
1053 When editing the header of your outgoing message, there are a couple of
1054 special features available.
1060 <literal>Fcc:</literal> <emphasis>filename</emphasis>
1062 Mutt will pick up <emphasis>filename</emphasis>
1063 just as if you had used the <emphasis>edit-fcc</emphasis> function in the <emphasis>compose</emphasis> menu.
1067 You can also attach files to your message by specifying
1069 <literal>Attach:</literal> <emphasis>filename</emphasis> [ <emphasis>description</emphasis> ]
1071 where <emphasis>filename</emphasis> is the file to attach and <emphasis>description</emphasis> is an
1072 optional string to use as the description of the attached file.
1076 When replying to messages, if you remove the <emphasis>In-Reply-To:</emphasis> field from
1077 the header field, Mutt will not generate a <emphasis>References:</emphasis> field, which
1078 allows you to create a new message thread.
1082 Also see <link linkend="edit-headers">$edit_headers</link>.
1088 <title>Using Mutt with PGP</title>
1091 If you want to use PGP, you can specify
1095 <literal>Pgp:</literal> [ <literal>E</literal> | <literal>S</literal> | <literal>S</literal><emphasis><id></emphasis> ]
1100 ``E'' encrypts, ``S'' signs and
1101 ``S<id>'' signs with the given key, setting <link linkend="pgp-sign-as">$pgp_sign_as</link> permanently.
1105 If you have told mutt to PGP encrypt a message, it will guide you
1106 through a key selection process when you try to send the message.
1107 Mutt will not ask you any questions about keys which have a
1108 certified user ID matching one of the message recipients' mail
1109 addresses. However, there may be situations in which there are
1110 several keys, weakly certified user ID fields, or where no matching
1115 In these cases, you are dropped into a menu with a list of keys from
1116 which you can select one. When you quit this menu, or mutt can't
1117 find any matching keys, you are prompted for a user ID. You can, as
1118 usually, abort this prompt using <literal>ˆG</literal>. When you do so, mutt will
1119 return to the compose screen.
1123 Once you have successfully finished the key selection, the message
1124 will be encrypted using the selected public keys, and sent out.
1128 Most fields of the entries in the key selection menu (see also <link linkend="pgp-entry-format">$pgp_entry_format</link>)
1129 have obvious meanings. But some explanations on the capabilities, flags,
1130 and validity fields are in order.
1134 The flags sequence (%f) will expand to one of the flags in
1135 <xref linkend="tab-pgp-menuflags"/>.
1137 <table id="tab-pgp-menuflags">
1138 <title>PGP key menu flags</title>
1141 <row><entry>Flag</entry><entry>Description</entry></row>
1144 <row><entry>R</entry><entry>The key has been revoked and can't be used.</entry></row>
1145 <row><entry>X</entry><entry>The key is expired and can't be used.</entry></row>
1146 <row><entry>d</entry><entry>You have marked the key as disabled.</entry></row>
1147 <row><entry>c</entry><entry>There are unknown critical self-signature packets.</entry></row>
1155 The capabilities field (%c) expands to a two-character sequence
1156 representing a key's capabilities. The first character gives
1157 the key's encryption capabilities: A minus sign (<emphasis role="bold">-</emphasis>) means
1158 that the key cannot be used for encryption. A dot (<emphasis role="bold">.</emphasis>) means that
1159 it's marked as a signature key in one of the user IDs, but may
1160 also be used for encryption. The letter <emphasis role="bold">e</emphasis> indicates that
1161 this key can be used for encryption.
1165 The second character indicates the key's signing capabilities. Once
1166 again, a ``<emphasis role="bold">-</emphasis>'' implies ``not for signing'', ``<emphasis role="bold">.</emphasis>'' implies
1167 that the key is marked as an encryption key in one of the user-ids, and
1168 ``<emphasis role="bold">s</emphasis>'' denotes a key which can be used for signing.
1172 Finally, the validity field (%t) indicates how well-certified a user-id
1173 is. A question mark (<emphasis role="bold">?</emphasis>) indicates undefined validity, a minus
1174 character (<emphasis role="bold">-</emphasis>) marks an untrusted association, a space character
1175 means a partially trusted association, and a plus character (<emphasis role="bold">+</emphasis>)
1176 indicates complete validity.
1182 <title>Sending anonymous messages via mixmaster.</title>
1185 You may also have configured mutt to co-operate with Mixmaster, an
1186 anonymous remailer. Mixmaster permits you to send your messages
1187 anonymously using a chain of remailers. Mixmaster support in mutt is for
1188 mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03.
1189 It does not support earlier versions or the later so-called version 3 betas,
1190 of which the latest appears to be called 2.9b23.
1194 To use it, you'll have to obey certain restrictions. Most
1195 important, you cannot use the <literal>Cc</literal> and <literal>Bcc</literal> headers. To tell
1196 Mutt to use mixmaster, you have to select a remailer chain, using
1197 the mix function on the compose menu.
1201 The chain selection screen is divided into two parts. In the
1202 (larger) upper part, you get a list of remailers you may use. In
1203 the lower part, you see the currently selected chain of remailers.
1207 You can navigate in the chain using the <literal>chain-prev</literal> and
1208 <literal>chain-next</literal> functions, which are by default bound to the left
1209 and right arrows and to the <literal>h</literal> and <literal>l</literal> keys (think vi
1210 keyboard bindings). To insert a remailer at the current chain
1211 position, use the <literal>insert</literal> function. To append a remailer behind
1212 the current chain position, use <literal>select-entry</literal> or <literal>append</literal>.
1213 You can also delete entries from the chain, using the corresponding
1214 function. Finally, to abandon your changes, leave the menu, or
1215 <literal>accept</literal> them pressing (by default) the <literal>Return</literal> key.
1219 Note that different remailers do have different capabilities,
1220 indicated in the %c entry of the remailer menu lines (see
1221 <link linkend="mix-entry-format">$mix_entry_format</link>). Most important is
1222 the ``middleman'' capability, indicated by a capital ``M'': This
1223 means that the remailer in question cannot be used as the final
1224 element of a chain, but will only forward messages to other
1225 mixmaster remailers. For details on the other capabilities, please
1226 have a look at the mixmaster documentation.
1232 <title>Sending format=flowed messages</title>
1235 <title>Concept</title>
1238 <literal>format=flowed</literal>-style messages (or <literal>f=f</literal>
1239 for short) are <literal>text/plain</literal> messages that consist of paragraphs which a receiver's
1240 mail client may reformat to its own needs which mostly means to
1241 customize line lengths regardless of what the sender sent. Technically this is
1242 achieved by letting lines of a ``flowable'' paragraph end in spaces.
1246 While for text-mode clients like mutt it's the best way to assume only a
1247 standard 80x25 character cell terminal, it may be desired to let the
1248 receiver decide completely how to view a message.
1254 <title>Mutt support</title>
1257 Mutt only supports setting the required <literal>format=flowed</literal>
1258 MIME parameter on outgoing messages if the <link linkend="text-flowed"
1259 >$text_flowed</link> variable is set. It does not add the
1260 trailing spaces nor does it provide any other feature related to
1261 composing <literal>f=f</literal> messages (like reformatting
1262 non-<literal>f=f</literal> parts of a reply to <literal>f=f</literal>
1263 before calling the editor).
1267 After editing the initial message text and before entering
1268 the compose menu, mutt properly space-stuffes the message.
1269 <emphasis>Space-stuffing</emphasis> is required by RfC3676 defining
1270 <literal>format=flowed</literal> and means to prepend a space to:
1274 <listitem><para>all lines starting with a space</para></listitem>
1275 <listitem><para>lines starting with the word ``<literal>From</literal>''
1276 followed by space</para></listitem>
1277 <listitem><para>all lines starting with ``<literal>></literal>'' which
1278 is not intended to be a quote character</para></listitem>
1282 All leading spaces are to be removed by receiving clients to restore
1283 the original message.
1287 <emphasis role="bold">Note</emphasis> that mutt only support space-stuffing
1288 for the first two types of lines but not for the third: It is impossible to
1289 safely detect whether a leading <literal>></literal> character starts a
1296 <title>Editor considerations</title>
1299 As mutt provides no additional features to compose <literal>f=f</literal>
1300 messages, it's completely up to the user and his editor to produce
1301 proper messages. Please consider your editor's documentation if you
1302 intend to send <literal>f=f</literal> messages.
1306 Please note that when editing messages from the compose menu several
1307 times before really sending a mail, it's up to the user to ensure that
1308 the message is properly space-stuffed.
1312 For example, <emphasis>vim</emphasis> provides the <literal>w</literal>
1313 flag for its <literal>formatoptions</literal> setting to assist in
1314 creating <literal>f=f</literal> messages, see <literal>:help
1315 fo-table</literal> for details.
1324 <sect1 id="forwarding-mail">
1325 <title>Forwarding and Bouncing Mail</title>
1328 Bouncing and forwarding let you send an existing message to recipients
1329 that you specify. Bouncing a message uses the <link linkend="sendmail">$sendmail</link> command to send a copy to alternative addresses as if
1330 they were the message's original recipients. Forwarding a message, on
1331 the other hand, allows you to modify the message before it is resent
1332 (for example, by adding your own comments). The default key bindings
1333 are shown in <xref linkend="tab-key-fwd"/>.
1338 <table id="tab-key-fwd">
1339 <title>Message forwarding/bouncing keys</title>
1342 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
1345 <row><entry>f</entry><entry>forward</entry><entry>forward message</entry></row>
1346 <row><entry>b</entry><entry>bounce</entry><entry>bounce (remail) message</entry></row>
1354 Forwarding can be done by including the original message in the new
1355 message's body (surrounded by indicating lines) or including it as a MIME
1356 attachment, depending on the value of the <link linkend="mime-forward">$mime_forward</link> variable. Decoding of attachments,
1357 like in the pager, can be controlled by the <link linkend="forward-decode">$forward_decode</link> and <link linkend="mime-forward-decode">$mime_forward_decode</link> variables,
1358 respectively. The desired forwarding format may depend on the content,
1359 therefore <emphasis>$mime_forward</emphasis> is a quadoption which, for
1360 example, can be set to ``ask-no''.
1364 The inclusion of headers is controlled by the current setting of the
1365 <link linkend="weed">$weed</link> variable, unless <link linkend="mime-forward">$mime_forward</link> is set.
1369 Editing the message to forward follows the same procedure as sending or
1370 replying to a message does.
1375 <sect1 id="postponing-mail">
1376 <title>Postponing Mail</title>
1379 At times it is desirable to delay sending a message that you have
1380 already begun to compose. When the <emphasis>postpone-message</emphasis> function is
1381 used in the <emphasis>compose</emphasis> menu, the body of your message and attachments
1382 are stored in the mailbox specified by the <link linkend="postponed">$postponed</link> variable. This means that you can recall the
1383 message even if you exit Mutt and then restart it at a later time.
1387 Once a message is postponed, there are several ways to resume it. From the
1388 command line you can use the ``-p'' option, or if you <emphasis>compose</emphasis> a new
1389 message from the <emphasis>index</emphasis> or <emphasis>pager</emphasis> you will be prompted if postponed
1390 messages exist. If multiple messages are currently postponed, the
1391 <emphasis>postponed</emphasis> menu will pop up and you can select which message you would
1396 <emphasis role="bold">Note:</emphasis> If you postpone a reply to a message, the reply setting of
1397 the message is only updated when you actually finish the message and
1398 send it. Also, you must be in the same folder with the message you
1399 replied to for the status of the message to be updated.
1403 See also the <link linkend="postpone">$postpone</link> quad-option.
1410 <chapter id="configuration">
1411 <title>Configuration</title>
1414 While the default configuration (or ``preferences'') make Mutt
1415 usable right out of the box, it is often desirable to tailor Mutt to
1416 suit your own tastes. When Mutt is first invoked, it will attempt to
1417 read the ``system'' configuration file (defaults set by your local
1418 system administrator), unless the ``-n'' <link linkend="commandline">command line</link> option is specified. This file is typically
1419 <literal>/usr/local/share/mutt/Muttrc</literal> or <literal>/etc/Muttrc</literal>. Mutt
1420 will next look for a file named <literal>.muttrc</literal> in your home
1421 directory. If this file does not exist and your home directory has
1422 a subdirectory named <literal>.mutt</literal>, mutt try to load a file named
1423 <literal>.mutt/muttrc</literal>.
1427 <literal>.muttrc</literal> is the file where you will usually place your <link linkend="commands">commands</link> to configure Mutt.
1431 In addition, mutt supports version specific configuration files that are
1432 parsed instead of the default files as explained above. For instance, if
1433 your system has a <literal>Muttrc-0.88</literal> file in the system configuration
1434 directory, and you are running version 0.88 of mutt, this file will be
1435 sourced instead of the <literal>Muttrc</literal> file. The same is true of the user
1436 configuration file, if you have a file <literal>.muttrc-0.88.6</literal> in your home
1437 directory, when you run mutt version 0.88.6, it will source this file
1438 instead of the default <literal>.muttrc</literal> file. The version number is the
1439 same which is visible using the ``-v'' <link linkend="commandline">command line</link> switch or using the <literal>show-version</literal> key (default:
1440 V) from the index menu.
1443 <sect1 id="muttrc-syntax" xreflabel="Syntax of Initialization Files">
1444 <title>Syntax of Initialization Files</title>
1447 An initialization file consists of a series of <link linkend="commands">commands</link>. Each line of the file may contain one or more commands.
1448 When multiple commands are used, they must be separated by a semicolon (;).
1451 set realname='Mutt user' ; ignore x-
1454 The hash mark, or pound sign
1455 (``#''), is used as a ``comment'' character. You can use it to
1456 annotate your initialization file. All text after the comment character
1457 to the end of the line is ignored. For example,
1463 my_hdr X-Disclaimer: Why are you listening to me? # This is a comment
1469 Single quotes (') and double quotes (") can be used to quote strings
1470 which contain spaces or other special characters. The difference between
1471 the two types of quotes is similar to that of many popular shell programs,
1472 namely that a single quote is used to specify a literal string (one that is
1473 not interpreted for shell variables or quoting with a backslash [see
1474 next paragraph]), while double quotes indicate a string for which
1475 should be evaluated. For example, backtics are evaluated inside of double
1476 quotes, but <emphasis role="bold">not</emphasis> for single quotes.
1480 \ quotes the next character, just as in shells such as bash and zsh.
1481 For example, if want to put quotes ``"'' inside of a string, you can use
1482 ``\'' to force the next character to be a literal instead of interpreted
1486 set realname="Michael \"MuttDude\" Elkins"
1492 ``\\'' means to insert a literal ``\'' into the line.
1493 ``\n'' and ``\r'' have their usual C meanings of linefeed and
1494 carriage-return, respectively.
1498 A \ at the end of a line can be used to split commands over
1499 multiple lines, provided that the split points don't appear in the
1500 middle of command names.
1504 It is also possible to substitute the output of a Unix command in an
1505 initialization file. This is accomplished by enclosing the command in
1506 backquotes (``). For example,
1509 my_hdr X-Operating-System: `uname -a`
1512 The output of the Unix command ``uname -a'' will be substituted before the
1513 line is parsed. Note that since initialization files are line oriented, only
1514 the first line of output from the Unix command will be substituted.
1518 Both environment variables and mutt variables can be accessed by
1519 prepending ``$'' to the name of the variable. For example,
1523 set record=+sent_on_$HOSTNAME
1527 will cause mutt to save outgoing messages to a folder named
1528 ``sent_on_kremvax'' if the environment variable HOSTNAME is set to
1529 ``kremvax.'' (See <link linkend="record">$record</link> for
1534 Mutt expands the variable when it is assigned, not when it is used. If
1535 the value of a variable on the right-hand side of an assignment
1536 changes after the assignment, the variable on the left-hand side will
1541 The commands understood by mutt are explained in the next paragraphs.
1542 For a complete list, see the <link linkend="commands">command reference</link>.
1547 <sect1 id="addrgroup">
1548 <title>Address groups</title>
1551 Usage: <literal>group</literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] [ <literal>-rx</literal> <emphasis>EXPR</emphasis> [ ... ] ] [ <literal>-addr</literal> <emphasis>EXPR</emphasis> [ ... ] ]
1555 <literal>group</literal> is used to directly add either addresses or
1556 regular expressions to the specified group or groups. The different
1557 categories of arguments to the <literal>group</literal> command can be
1558 in any order. The flags <literal>-rx</literal> and
1559 <literal>-addr</literal> specify what the following strings (that cannot
1560 begin with a hyphen) should be interpreted as: either a regular
1561 expression or an email address, respectively.
1565 These address groups can also be created implicitely by the
1566 <link linkend="alias">alias</link>, <link linkend="lists">lists</link>,
1567 <link linkend="lists">subscribe</link> and
1568 <link linkend="alternates">alternates</link> commands by specifying the
1569 optional <literal>-group</literal> option.
1573 Once defined, these address groups can be used in
1574 <link linkend="patterns">patterns</link> to search for and limit the
1575 display to messages matching a group.
1579 Usage: <literal>ungroup</literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] [ * | [ [ <literal>-rx</literal> <emphasis>EXPR</emphasis> [ ... ] ] [ <literal>-addr</literal> <emphasis>EXPR</emphasis> [ ... ] ] ]
1583 <literal>ungroup</literal> is used to remove addresses or regular
1584 expressions from the specified group or groups. The syntax is similar to
1585 the <literal>group</literal> command, however the special character
1586 <literal>*</literal> can be used to empty a group of all of its
1593 <title>Defining/Using aliases</title>
1596 Usage: <literal>alias</literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>key</emphasis> <emphasis>address</emphasis> [ , <emphasis>address</emphasis>, ... ]
1600 It's usually very cumbersome to remember or type out the address of someone
1601 you are communicating with. Mutt allows you to create ``aliases'' which map
1602 a short string to a full address.
1606 <emphasis role="bold">Note:</emphasis> if you want to create an alias for more than
1607 one address, you <emphasis role="bold">must</emphasis> separate the addresses with a comma (``,'').
1611 The optional <literal>-group</literal> argument to
1612 <literal>alias</literal> causes the aliased address(es) to be added to
1613 the named <emphasis>group</emphasis>.
1617 To remove an alias or aliases (``*'' means all aliases):
1621 <literal>unalias</literal> [ * | <emphasis>key</emphasis> <emphasis>...</emphasis> ]
1627 alias muttdude me@cs.hmc.edu (Michael Elkins)
1628 alias theguys manny, moe, jack
1634 Unlike other mailers, Mutt doesn't require aliases to be defined
1635 in a special file. The <literal>alias</literal> command can appear anywhere in
1636 a configuration file, as long as this file is <link linkend="source">sourced</link>. Consequently, you can have multiple alias files, or
1637 you can have all aliases defined in your muttrc.
1641 On the other hand, the <link linkend="create-alias">create-alias</link>
1642 function can use only one file, the one pointed to by the <link linkend="alias-file">$alias_file</link> variable (which is
1643 <literal>˜/.muttrc</literal> by default). This file is not special either,
1644 in the sense that Mutt will happily append aliases to any file, but in
1645 order for the new aliases to take effect you need to explicitly <link linkend="source">source</link> this file too.
1655 source /usr/local/share/Mutt.aliases
1656 source ~/.mail_aliases
1657 set alias_file=~/.mail_aliases
1663 To use aliases, you merely use the alias at any place in mutt where mutt
1664 prompts for addresses, such as the <emphasis>To:</emphasis> or <emphasis>Cc:</emphasis> prompt. You can
1665 also enter aliases in your editor at the appropriate headers if you have the
1666 <link linkend="edit-headers">$edit_headers</link> variable set.
1670 In addition, at the various address prompts, you can use the tab character
1671 to expand a partial alias to the full alias. If there are multiple matches,
1672 mutt will bring up a menu with the matching aliases. In order to be
1673 presented with the full list of aliases, you must hit tab with out a partial
1674 alias, such as at the beginning of the prompt or after a comma denoting
1679 In the alias menu, you can select as many aliases as you want with the
1680 <emphasis>select-entry</emphasis> key (default: RET), and use the <emphasis>exit</emphasis> key
1681 (default: q) to return to the address prompt.
1687 <title>Changing the default key bindings</title>
1690 Usage: <literal>bind</literal> <emphasis>map</emphasis> <emphasis>key</emphasis> <emphasis>function</emphasis>
1694 This command allows you to change the default key bindings (operation
1695 invoked when pressing a key).
1699 <emphasis>map</emphasis> specifies in which menu the binding belongs. Multiple maps may
1700 be specified by separating them with commas (no additional whitespace is
1701 allowed). The currently defined maps are:
1709 <term>generic</term>
1712 This is not a real menu, but is used as a fallback for all of the other
1713 menus except for the pager and editor modes. If a key is not defined in
1714 another menu, Mutt will look for a binding to use in this menu. This allows
1715 you to bind a key to a certain function in multiple menus instead of having
1716 multiple bind statements to accomplish the same task.
1724 The alias menu is the list of your personal aliases as defined in your
1725 muttrc. It is the mapping from a short alias name to the full email
1726 address(es) of the recipient(s).
1734 The attachment menu is used to access the attachments on received messages.
1739 <term>browser</term>
1742 The browser is used for both browsing the local directory structure, and for
1743 listing all of your incoming mailboxes.
1751 The editor is the line-based editor the user enters text data.
1759 The index is the list of messages contained in a mailbox.
1764 <term>compose</term>
1767 The compose menu is the screen used when sending a new message.
1775 The pager is the mode used to display message/attachment data, and help
1784 The pgp menu is used to select the OpenPGP keys used for encrypting outgoing
1790 <term>postpone</term>
1793 The postpone menu is similar to the index menu, except is used when
1794 recalling a message the user was composing, but saved until later.
1802 <emphasis>key</emphasis> is the key (or key sequence) you wish to bind. To specify a
1803 control character, use the sequence <emphasis>\Cx</emphasis>, where <emphasis>x</emphasis> is the
1804 letter of the control character (for example, to specify control-A use
1805 ``\Ca''). Note that the case of <emphasis>x</emphasis> as well as <emphasis>\C</emphasis> is
1806 ignored, so that <emphasis>\CA</emphasis>, <emphasis>\Ca</emphasis>, <emphasis>\cA</emphasis> and <emphasis>\ca</emphasis> are all
1807 equivalent. An alternative form is to specify the key as a three digit
1808 octal number prefixed with a ``\'' (for example <emphasis>\177</emphasis> is
1809 equivalent to <emphasis>\c?</emphasis>). In addition, <emphasis>key</emphasis> may
1810 be a symbolic name as shown in <xref linkend="tab-key-names"/>.
1815 <table id="tab-key-names">
1816 <title>Symbolic key names</title>
1819 <row><entry>Symbolic name</entry><entry>Meaning</entry></row>
1822 <row><entry>\t</entry><entry>tab</entry></row>
1823 <row><entry><tab></entry><entry>tab</entry></row>
1824 <row><entry><backtab></entry><entry>backtab / shift-tab</entry></row>
1825 <row><entry>\r</entry><entry>carriage return</entry></row>
1826 <row><entry>\n</entry><entry>newline</entry></row>
1827 <row><entry>\e</entry><entry>escape</entry></row>
1828 <row><entry><esc></entry><entry>escape</entry></row>
1829 <row><entry><up></entry><entry>up arrow</entry></row>
1830 <row><entry><down></entry><entry>down arrow</entry></row>
1831 <row><entry><left></entry><entry>left arrow</entry></row>
1832 <row><entry><right></entry><entry>right arrow</entry></row>
1833 <row><entry><pageup></entry><entry>Page Up</entry></row>
1834 <row><entry><pagedown></entry><entry>Page Down</entry></row>
1835 <row><entry><backspace></entry><entry>Backspace</entry></row>
1836 <row><entry><delete></entry><entry>Delete</entry></row>
1837 <row><entry><insert></entry><entry>Insert</entry></row>
1838 <row><entry><enter></entry><entry>Enter</entry></row>
1839 <row><entry><return></entry><entry>Return</entry></row>
1840 <row><entry><home></entry><entry>Home</entry></row>
1841 <row><entry><end></entry><entry>End</entry></row>
1842 <row><entry><space></entry><entry>Space bar</entry></row>
1843 <row><entry><f1></entry><entry>function key 1</entry></row>
1844 <row><entry><f10></entry><entry>function key 10</entry></row>
1852 <emphasis>key</emphasis> does not need to be enclosed in quotes unless it contains a
1857 <emphasis>function</emphasis> specifies which action to take when <emphasis>key</emphasis> is pressed.
1858 For a complete list of functions, see the <link linkend="functions">reference</link>. The special function <literal>noop</literal> unbinds the specified key
1864 <sect1 id="charset-hook">
1865 <title>Defining aliases for character sets </title>
1869 Usage: <literal>charset-hook</literal> <emphasis>alias</emphasis> <emphasis>charset</emphasis>
1870 Usage: <literal>iconv-hook</literal> <emphasis>charset</emphasis> <emphasis>local-charset</emphasis>
1875 The <literal>charset-hook</literal> command defines an alias for a character set.
1876 This is useful to properly display messages which are tagged with a
1877 character set name not known to mutt.
1881 The <literal>iconv-hook</literal> command defines a system-specific name for a
1882 character set. This is helpful when your systems character
1883 conversion library insists on using strange, system-specific names
1889 <sect1 id="folder-hook">
1890 <title>Setting variables based upon mailbox</title>
1893 Usage: <literal>folder-hook</literal> [!]<emphasis>regexp</emphasis> <emphasis>command</emphasis>
1897 It is often desirable to change settings based on which mailbox you are
1898 reading. The folder-hook command provides a method by which you can execute
1899 any configuration command. <emphasis>regexp</emphasis> is a regular expression specifying
1900 in which mailboxes to execute <emphasis>command</emphasis> before loading. If a mailbox
1901 matches multiple folder-hook's, they are executed in the order given in the
1906 <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
1907 inside of double or single quotes in order to distinguish it from the
1908 logical <emphasis>not</emphasis> operator for the expression.
1912 Note that the settings are <emphasis>not</emphasis> restored when you leave the mailbox.
1913 For example, a command action to perform is to change the sorting method
1914 based upon the mailbox being read:
1920 folder-hook mutt set sort=threads
1926 However, the sorting method is not restored to its previous value when
1927 reading a different mailbox. To specify a <emphasis>default</emphasis> command, use the
1934 folder-hook . set sort=date-sent
1942 <title>Keyboard macros</title>
1945 Usage: <literal>macro</literal> <emphasis>menu</emphasis> <emphasis>key</emphasis> <emphasis>sequence</emphasis> [ <emphasis>description</emphasis> ]
1949 Macros are useful when you would like a single key to perform a series of
1950 actions. When you press <emphasis>key</emphasis> in menu <emphasis>menu</emphasis>, Mutt will behave as if
1951 you had typed <emphasis>sequence</emphasis>. So if you have a common sequence of commands
1952 you type, you can create a macro to execute those commands with a single
1957 <emphasis>menu</emphasis> is the <link linkend="maps">map</link> which the macro will be bound.
1958 Multiple maps may be specified by separating multiple menu arguments by
1959 commas. Whitespace may not be used in between the menu arguments and the
1960 commas separating them.
1964 <emphasis>key</emphasis> and <emphasis>sequence</emphasis> are expanded by the same rules as the <link linkend="bind">key bindings</link>. There are some additions however. The
1965 first is that control characters in <emphasis>sequence</emphasis> can also be specified
1966 as <emphasis>ˆx</emphasis>. In order to get a caret (`ˆ'') you need to use
1967 <emphasis>ˆˆ</emphasis>. Secondly, to specify a certain key such as <emphasis>up</emphasis>
1968 or to invoke a function directly, you can use the format
1969 <emphasis><key name></emphasis> and <emphasis><function name></emphasis>. For a listing of key
1970 names see the section on <link linkend="bind">key bindings</link>. Functions
1971 are listed in the <link linkend="functions">reference</link>.
1975 The advantage with using function names directly is that the macros will
1976 work regardless of the current key bindings, so they are not dependent on
1977 the user having particular key definitions. This makes them more robust
1978 and portable, and also facilitates defining of macros in files used by more
1979 than one user (e.g., the system Muttrc).
1983 Optionally you can specify a descriptive text after <emphasis>sequence</emphasis>,
1984 which is shown in the help screens.
1988 <emphasis role="bold">Note:</emphasis> Macro definitions (if any) listed in the help screen(s), are
1989 silently truncated at the screen width, and are not wrapped.
1995 <title>Using color and mono video attributes</title>
1999 Usage: <literal>color</literal> <emphasis>object</emphasis> <emphasis>foreground</emphasis> <emphasis>background</emphasis> [ <emphasis>regexp</emphasis> ]
2000 Usage: <literal>color</literal> index <emphasis>foreground</emphasis> <emphasis>background</emphasis> <emphasis>pattern</emphasis>
2001 Usage: <literal>uncolor</literal> index <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
2006 If your terminal supports color, you can spice up Mutt by creating your own
2007 color scheme. To define the color of an object (type of information), you
2008 must specify both a foreground color <emphasis role="bold">and</emphasis> a background color (it is not
2009 possible to only specify one or the other).
2013 <emphasis>object</emphasis> can be one of:
2028 body (match <emphasis>regexp</emphasis> in the body of messages)
2034 bold (hiliting bold patterns in the body of messages)
2040 error (error messages printed by Mutt)
2046 header (match <emphasis>regexp</emphasis> in the message header)
2052 hdrdefault (default color of the message header in the pager)
2058 index (match <emphasis>pattern</emphasis> in the message index)
2064 indicator (arrow or bar used to indicate the current item in a menu)
2070 markers (the ``+'' markers at the beginning of wrapped lines in the pager)
2076 message (informational messages)
2088 quoted (text matching <link linkend="quote-regexp">$quote_regexp</link> in the body of a message)
2094 quoted1, quoted2, ..., quoted<emphasis role="bold">N</emphasis> (higher levels of quoting)
2100 search (hiliting of words in the pager)
2112 status (mode lines used to display info about the mailbox or message)
2118 tilde (the ``˜'' used to pad blank lines in the pager)
2124 tree (thread tree drawn in the message index and attachment menu)
2130 underline (hiliting underlined patterns in the body of messages)
2139 <emphasis>foreground</emphasis> and <emphasis>background</emphasis> can be one of the following:
2202 color<emphasis>x</emphasis>
2211 <emphasis>foreground</emphasis> can optionally be prefixed with the keyword <literal>bright</literal> to make
2212 the foreground color boldfaced (e.g., <literal>brightred</literal>).
2216 If your terminal supports it, the special keyword <emphasis>default</emphasis> can be
2217 used as a transparent color. The value <emphasis>brightdefault</emphasis> is also valid.
2218 If Mutt is linked against the <emphasis>S-Lang</emphasis> library, you also need to set
2219 the <emphasis>COLORFGBG</emphasis> environment variable to the default colors of your
2220 terminal for this to work; for example (for Bourne-like shells):
2226 set COLORFGBG="green;black"
2233 <emphasis role="bold">Note:</emphasis> The <emphasis>S-Lang</emphasis> library requires you to use the <emphasis>lightgray</emphasis>
2234 and <emphasis>brown</emphasis> keywords instead of <emphasis>white</emphasis> and <emphasis>yellow</emphasis> when
2235 setting this variable.
2239 <emphasis role="bold">Note:</emphasis> The uncolor command can be applied to the index object only. It
2240 removes entries from the list. You <emphasis role="bold">must</emphasis> specify the same pattern
2241 specified in the color command for it to be removed. The pattern ``*'' is
2242 a special token which means to clear the color index list of all entries.
2246 Mutt also recognizes the keywords <emphasis>color0</emphasis>, <emphasis>color1</emphasis>, …,
2247 <emphasis>color</emphasis><emphasis role="bold">N-1</emphasis> (<emphasis role="bold">N</emphasis> being the number of colors supported
2248 by your terminal). This is useful when you remap the colors for your
2249 display (for example by changing the color associated with <emphasis>color2</emphasis>
2250 for your xterm), since color names may then lose their normal meaning.
2254 If your terminal does not support color, it is still possible change the video
2255 attributes through the use of the ``mono'' command:
2260 Usage: <literal>mono</literal> <emphasis><object> <attribute></emphasis> [ <emphasis>regexp</emphasis> ]
2261 Usage: <literal>mono</literal> index <emphasis>attribute</emphasis> <emphasis>pattern</emphasis>
2262 Usage: <literal>unmono</literal> index <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
2267 where <emphasis>attribute</emphasis> is one of the following:
2311 <title>Ignoring (weeding) unwanted message headers</title>
2314 Usage: <literal>[un]ignore</literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
2318 Messages often have many header fields added by automatic processing systems,
2319 or which may not seem useful to display on the screen. This command allows
2320 you to specify header fields which you don't normally want to see.
2324 You do not need to specify the full header field name. For example,
2325 ``ignore content-'' will ignore all header fields that begin with the pattern
2326 ``content-''. ``ignore *'' will ignore all headers.
2330 To remove a previously added token from the list, use the ``unignore'' command.
2331 The ``unignore'' command will make Mutt display headers with the given pattern.
2332 For example, if you do ``ignore x-'' it is possible to ``unignore x-mailer''.
2336 ``unignore *'' will remove all tokens from the ignore list.
2343 # Sven's draconian header weeding
2345 unignore from date subject to cc
2346 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
2354 <sect1 id="alternates">
2355 <title>Alternative addresses</title>
2358 Usage: <literal>[un]alternates</literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
2363 With various functions, mutt will treat messages differently,
2364 depending on whether you sent them or whether you received them from
2365 someone else. For instance, when replying to a message that you
2366 sent to a different party, mutt will automatically suggest to send
2367 the response to the original message's recipients -- responding to
2368 yourself won't make much sense in many cases. (See <link linkend="reply-to">$reply_to</link>.)
2372 Many users receive e-mail under a number of different addresses. To
2373 fully use mutt's features here, the program must be able to
2374 recognize what e-mail addresses you receive mail under. That's the
2375 purpose of the <literal>alternates</literal> command: It takes a list of regular
2376 expressions, each of which can identify an address under which you
2381 As addresses are matched using regular expressions and not exact strict
2382 comparisons, you should make sure you specify your addresses as precise
2383 as possible to avoid mismatches. For example, if you specify:
2387 alternates user@example
2391 mutt will consider ``<literal>some-user@example</literal>'' as
2392 being your address, too which may not be desired. As a solution, in such
2393 cases addresses should be specified as:
2397 alternates '^user@example$'
2401 The <literal>-group</literal> flag causes all of the subsequent regular expressions
2402 to be added to the named group.
2406 The <literal>unalternates</literal> command can be used to write exceptions to
2407 <literal>alternates</literal> patterns. If an address matches something in an
2408 <literal>alternates</literal> command, but you nonetheless do not think it is
2409 from you, you can list a more precise pattern under an <literal>unalternates</literal>
2414 To remove a regular expression from the <literal>alternates</literal> list, use the
2415 <literal>unalternates</literal> command with exactly the same <emphasis>regexp</emphasis>.
2416 Likewise, if the <emphasis>regexp</emphasis> for an <literal>alternates</literal> command matches
2417 an entry on the <literal>unalternates</literal> list, that <literal>unalternates</literal>
2418 entry will be removed. If the <emphasis>regexp</emphasis> for <literal>unalternates</literal>
2419 is ``*'', <emphasis>all entries</emphasis> on <literal>alternates</literal> will be removed.
2425 <title>Mailing lists</title>
2429 Usage: <literal>[un]lists</literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
2430 Usage: <literal>[un]subscribe</literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
2435 Mutt has a few nice features for <link linkend="using-lists">handling mailing lists</link>. In order to take advantage of them, you must
2436 specify which addresses belong to mailing lists, and which mailing
2437 lists you are subscribed to. Once you have done this, the <link linkend="list-reply">list-reply</link> function will work for all known lists.
2438 Additionally, when you send a message to a subscribed list, mutt will
2439 add a Mail-Followup-To header to tell other users' mail user agents
2440 not to send copies of replies to your personal address. Note that
2441 the Mail-Followup-To header is a non-standard extension which is not
2442 supported by all mail user agents. Adding it is not bullet-proof against
2443 receiving personal CCs of list messages. Also note that the generation
2444 of the Mail-Followup-To header is controlled by the <link linkend="followup-to">$followup_to</link> configuration variable.
2448 More precisely, Mutt maintains lists of patterns for the addresses
2449 of known and subscribed mailing lists. Every subscribed mailing
2450 list is known. To mark a mailing list as known, use the ``lists''
2451 command. To mark it as subscribed, use ``subscribe''.
2455 You can use regular expressions with both commands. To mark all
2456 messages sent to a specific bug report's address on mutt's bug
2457 tracking system as list mail, for instance, you could say
2458 ``subscribe [0-9]*@bugs.guug.de''. Often, it's sufficient to just
2459 give a portion of the list's e-mail address.
2463 Specify as much of the address as you need to to remove ambiguity. For
2464 example, if you've subscribed to the Mutt mailing list, you will receive mail
2465 addressed to <emphasis>mutt-users@mutt.org</emphasis>. So, to tell Mutt
2466 that this is a mailing list, you could add ``lists mutt-users@'' to your
2467 initialization file. To tell mutt that you are subscribed to it,
2468 add ``subscribe mutt-users'' to your initialization file instead.
2469 If you also happen to get mail from someone whose address is
2470 <emphasis>mutt-users@example.com</emphasis>, you could use
2471 ``lists ^mutt-users@mutt\\.org$''
2472 or ``subscribe ^mutt-users@mutt\\.org$'' to
2473 match only mail from the actual list.
2477 The <literal>-group</literal> flag adds all of the subsequent regular expressions
2482 The ``unlists'' command is used to remove a token from the list of
2483 known and subscribed mailing-lists. Use ``unlists *'' to remove all
2488 To remove a mailing list from the list of subscribed mailing lists,
2489 but keep it on the list of known mailing lists, use ``unsubscribe''.
2494 <sect1 id="mbox-hook">
2495 <title>Using Multiple spool mailboxes</title>
2498 Usage: <literal>mbox-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
2502 This command is used to move read messages from a specified mailbox to a
2503 different mailbox automatically when you quit or change folders.
2504 <emphasis>pattern</emphasis> is a regular expression specifying the mailbox to treat as a
2505 ``spool'' mailbox and <emphasis>mailbox</emphasis> specifies where mail should be saved when
2510 Unlike some of the other <emphasis>hook</emphasis> commands, only the <emphasis>first</emphasis> matching
2511 pattern is used (it is not possible to save read mail in more than a single
2517 <sect1 id="mailboxes">
2518 <title>Monitoring incoming mail</title>
2521 Usage: <literal>[un]mailboxes</literal> <emphasis>folder</emphasis> [ <emphasis>folder</emphasis> ... ]
2525 This command specifies folders which can receive mail and
2526 which will be checked for new messages. By default, the
2527 main menu status bar displays how many of these folders have
2532 <literal>folder</literal> can either be a local file or directory
2533 (Mbox/Mmdf or Maildir/Mh). If Mutt was built with POP and/or IMAP
2534 support, <literal>folder</literal> can also be a POP/IMAP folder
2535 URL. The URL syntax is described in <xref linkend="url-syntax"/>,
2536 POP and IMAP are described in <xref linkend="pop"/> and <xref linkend="imap"/>
2541 When changing folders, pressing <emphasis>space</emphasis> will cycle
2542 through folders with new mail.
2546 Pressing TAB in the directory browser will bring up a menu showing the files
2547 specified by the <literal>mailboxes</literal> command, and indicate which contain new
2548 messages. Mutt will automatically enter this mode when invoked from the
2549 command line with the <literal>-y</literal> option.
2553 The ``unmailboxes'' command is used to remove a token from the list
2554 of folders which receive mail. Use ``unmailboxes *'' to remove all
2559 <emphasis role="bold">Note:</emphasis> the folders in the <literal>mailboxes</literal> command are resolved when
2560 the command is executed, so if these names contain <link linkend="shortcuts">shortcut characters</link> (such as ``='' and ``!''), any variable
2561 definition that affect these characters (like <link linkend="folder">$folder</link> and <link linkend="spoolfile">$spoolfile</link>)
2562 should be executed before the <literal>mailboxes</literal> command. If
2563 none of these shorcuts are used, a local path should be absolute as
2564 otherwise mutt tries to find it within the current working directory
2565 from where mutt was started which may not always be desired.
2569 For local folders, new mail is detected by comparing access and/or
2570 modification times of files and folders. The interval in which Mutt
2571 checks for new mail is defined by
2572 <link linkend="mail-check">$mail_check</link>.
2576 Special care is required with Mbox and Mmdf
2577 folders as Mutt assumes such a folder has new mail if it wasn't
2578 accessed after it was last modified. Utilities like <literal>biff</literal> or
2579 <literal>frm</literal> or any other program which accesses the mailbox might cause
2580 Mutt to never detect new mail for that mailbox if they do not properly reset the
2581 access time. Backup tools are another common reason for updated access times.
2587 <title>User defined headers</title>
2592 <literal>my_hdr</literal> <emphasis>string</emphasis>
2594 <literal>unmy_hdr</literal> <emphasis>field</emphasis> [ <emphasis>field</emphasis> ... ]
2598 The ``my_hdr'' command allows you to create your own header
2599 fields which will be added to every message you send.
2603 For example, if you would like to add an ``Organization:'' header field to
2604 all of your outgoing messages, you can put the command
2609 >my_hdr Organization: A Really Big Company, Anytown, USA</quote
2614 in your <literal>.muttrc</literal>.
2618 <emphasis role="bold">Note:</emphasis> space characters are <emphasis>not</emphasis> allowed between the keyword and
2619 the colon (``:''). The standard for electronic mail (RFC822) says that
2620 space is illegal there, so Mutt enforces the rule.
2624 If you would like to add a header field to a single message, you should
2625 either set the <link linkend="edit-headers">$edit_headers</link> variable,
2626 or use the <emphasis>edit-headers</emphasis> function (default: ``E'') in the send-menu so
2627 that you can edit the header of your message along with the body.
2631 To remove user defined header fields, use the ``unmy_hdr''
2632 command. You may specify an asterisk (``*'') to remove all header
2633 fields, or the fields to remove. For example, to remove all ``To'' and
2634 ``Cc'' header fields, you could use:
2639 >unmy_hdr to cc</quote
2645 <sect1 id="hdr-order">
2646 <title>Defining the order of headers when viewing messages</title>
2649 Usage: <literal>hdr_order</literal> <emphasis>header1</emphasis> <emphasis>header2</emphasis> <emphasis>header3</emphasis>
2653 With this command, you can specify an order in which mutt will attempt
2654 to present headers to you when viewing messages.
2658 ``unhdr_order *'' will clear all previous headers from the order list,
2659 thus removing the header order effects set by the system-wide startup
2666 hdr_order From Date: From: To: Cc: Subject:
2673 <sect1 id="save-hook">
2674 <title>Specify default save mailbox</title>
2677 Usage: <literal>save-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
2681 This command is used to override the default mailbox used when saving
2682 messages. <emphasis>mailbox</emphasis> will be used as the default if the message
2683 matches <emphasis>pattern</emphasis>, see <xref linkend="pattern-hook"/> for information
2684 on the exact format.
2688 To provide more flexibility and good defaults, Mutt applies the
2689 expandos of <link linkend="index-format">$index_format</link> to
2690 <emphasis>mailbox</emphasis> after it was expanded.
2700 # default: save all to ~/Mail/<author name>
2701 save-hook . ~/Mail/%F
2702 # save from me@turing.cs.hmc.edu/me@cs.hmc.edu to $folder/elinks
2703 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
2704 # save from aol.com to $folder/spam
2705 save-hook aol\\.com$ +spam
2711 Also see the <link linkend="fcc-save-hook">fcc-save-hook</link> command.
2716 <sect1 id="fcc-hook">
2717 <title>Specify default Fcc: mailbox when composing</title>
2720 Usage: <literal>fcc-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
2724 This command is used to save outgoing mail in a mailbox other than
2725 <link linkend="record">$record</link>. Mutt searches the initial list of
2726 message recipients for the first matching <emphasis>regexp</emphasis> and uses <emphasis>mailbox</emphasis>
2727 as the default Fcc: mailbox. If no match is found the message will be saved
2728 to <link linkend="record">$record</link> mailbox.
2732 To provide more flexibility and good defaults, Mutt applies the
2733 expandos of <link linkend="index-format">$index_format</link> to
2734 <emphasis>mailbox</emphasis> after it was expanded.
2738 See <xref linkend="pattern-hook"/> for information on the exact format of <emphasis>pattern</emphasis>.
2742 Example: <literal>fcc-hook [@.]aol\\.com$ +spammers</literal>
2746 The above will save a copy of all messages going to the aol.com domain to
2747 the `+spammers' mailbox by default. Also see the <link linkend="fcc-save-hook">fcc-save-hook</link> command.
2752 <sect1 id="fcc-save-hook">
2753 <title>Specify default save filename and default Fcc: mailbox at once</title>
2756 Usage: <literal>fcc-save-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
2760 This command is a shortcut, equivalent to doing both a <link linkend="fcc-hook">fcc-hook</link>
2761 and a <link linkend="save-hook">save-hook</link> with its arguments,
2762 including %-expansion on <emphasis>mailbox</emphasis> according
2763 to <link linkend="index-format">$index_format</link>.
2768 <sect1 id="send-hook">
2769 <title>Change settings based upon message recipients</title>
2773 Usage: <literal>reply-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
2774 Usage: <literal>send-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
2775 Usage: <literal>send2-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
2780 These commands can be used to execute arbitrary configuration commands based
2781 upon recipients of the message. <emphasis>pattern</emphasis> is a regular expression
2782 matching the desired address. <emphasis>command</emphasis> is executed when <emphasis>regexp</emphasis>
2783 matches recipients of the message.
2787 <literal>reply-hook</literal> is matched against the message you are <emphasis>replying</emphasis>
2788 <emphasis role="bold">to</emphasis>, instead of the message you are <emphasis>sending</emphasis>. <literal>send-hook</literal> is
2789 matched against all messages, both <emphasis>new</emphasis> and <emphasis>replies</emphasis>. <emphasis role="bold">Note:</emphasis>
2790 <literal>reply-hook</literal>s are matched <emphasis role="bold">before</emphasis> the <literal>send-hook</literal>, <emphasis role="bold">regardless</emphasis>
2791 of the order specified in the user's configuration file.
2795 <literal>send2-hook</literal> is matched every time a message is changed, either
2796 by editing it, or by using the compose menu to change its recipients
2797 or subject. <literal>send2-hook</literal> is executed after <literal>send-hook</literal>, and
2798 can, e.g., be used to set parameters such as the <link linkend="sendmail">$sendmail</link> variable depending on the message's sender
2803 For each type of <literal>send-hook</literal> or <literal>reply-hook</literal>, when multiple matches
2804 occur, commands are executed in the order they are specified in the muttrc
2805 (for that type of hook).
2809 See <xref linkend="pattern-hook"/> for information on the exact format of <emphasis>pattern</emphasis>.
2813 Example: <literal>send-hook mutt "set mime_forward signature=''"</literal>
2817 Another typical use for this command is to change the values of the
2818 <link linkend="attribution">$attribution</link>, <link linkend="signature">$signature</link> and <link linkend="locale">$locale</link>
2819 variables in order to change the language of the attributions and
2820 signatures based upon the recipients.
2824 <emphasis role="bold">Note:</emphasis> the send-hook's are only executed ONCE after getting the initial
2825 list of recipients. Adding a recipient after replying or editing the
2826 message will NOT cause any send-hook to be executed. Also note that
2827 my_hdr commands which modify recipient headers, or the message's
2828 subject, don't have any effect on the current message when executed
2834 <sect1 id="message-hook">
2835 <title>Change settings before formatting a message</title>
2838 Usage: <literal>message-hook</literal> [!]<emphasis>pattern</emphasis> <emphasis>command</emphasis>
2842 This command can be used to execute arbitrary configuration commands
2843 before viewing or formatting a message based upon information about the message.
2844 <emphasis>command</emphasis> is executed if the <emphasis>pattern</emphasis> matches the message to be
2845 displayed. When multiple matches occur, commands are executed in the order
2846 they are specified in the muttrc.
2850 See <xref linkend="pattern-hook"/> for
2851 information on the exact format of <emphasis>pattern</emphasis>.
2858 message-hook ~A 'set pager=builtin'
2859 message-hook '~f freshmeat-news' 'set pager="less \"+/^ subject: .*\""'
2866 <sect1 id="crypt-hook">
2867 <title>Choosing the cryptographic key of the recipient</title>
2870 Usage: <literal>crypt-hook</literal> <emphasis>pattern</emphasis> <emphasis>keyid</emphasis>
2874 When encrypting messages with PGP or OpenSSL, you may want to associate a certain
2875 key with a given e-mail address automatically, either because the
2876 recipient's public key can't be deduced from the destination address,
2877 or because, for some reasons, you need to override the key Mutt would
2878 normally use. The crypt-hook command provides a method by which you can
2879 specify the ID of the public key to be used when encrypting messages to
2880 a certain recipient.
2884 The meaning of "key id" is to be taken broadly in this context: You
2885 can either put a numerical key ID here, an e-mail address, or even
2892 <title>Adding key sequences to the keyboard buffer</title>
2895 Usage: <literal>push</literal> <emphasis>string</emphasis>
2899 This command adds the named string to the keyboard buffer. The string may
2900 contain control characters, key names and function names like the sequence
2901 string in the <link linkend="macro">macro</link> command. You may use it to
2902 automatically run a sequence of commands at startup, or when entering
2903 certain folders. For example, the following command will automatically
2904 collapse all threads when entering a folder:
2907 folder-hook . 'push <collapse-all>'
2914 <title>Executing functions</title>
2917 Usage: <literal>exec</literal> <emphasis>function</emphasis> [ <emphasis>function</emphasis> ... ]
2921 This command can be used to execute any function. Functions are
2922 listed in the <link linkend="functions">function reference</link>.
2923 ``exec function'' is equivalent to ``push <function>''.
2928 <sect1 id="score-command">
2929 <title>Message Scoring</title>
2933 Usage: <literal>score</literal> <emphasis>pattern</emphasis> <emphasis>value</emphasis>
2934 Usage: <literal>unscore</literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
2939 The <literal>score</literal> commands adds <emphasis>value</emphasis> to a message's score if <emphasis>pattern</emphasis>
2940 matches it. <emphasis>pattern</emphasis> is a string in the format described in the <link linkend="patterns">patterns</link> section (note: For efficiency reasons, patterns
2941 which scan information not available in the index, such as <literal>˜b</literal>,
2942 <literal>˜B</literal> or <literal>˜h</literal>, may not be used). <emphasis>value</emphasis> is a
2943 positive or negative integer. A message's final score is the sum total of all
2944 matching <literal>score</literal> entries. However, you may optionally prefix <emphasis>value</emphasis> with
2945 an equal sign (=) to cause evaluation to stop at a particular entry if there is
2946 a match. Negative final scores are rounded up to 0.
2950 The <literal>unscore</literal> command removes score entries from the list. You <emphasis role="bold">must</emphasis>
2951 specify the same pattern specified in the <literal>score</literal> command for it to be
2952 removed. The pattern ``*'' is a special token which means to clear the list
2953 of all score entries.
2959 <title>Spam detection</title>
2963 Usage: <literal>spam</literal> <emphasis>pattern</emphasis> <emphasis>format</emphasis>
2964 Usage: <literal>nospam</literal> <emphasis>pattern</emphasis>
2969 Mutt has generalized support for external spam-scoring filters.
2970 By defining your spam patterns with the <literal>spam</literal> and <literal>nospam</literal>
2971 commands, you can <emphasis>limit</emphasis>, <emphasis>search</emphasis>, and <emphasis>sort</emphasis> your
2972 mail based on its spam attributes, as determined by the external
2973 filter. You also can display the spam attributes in your index
2974 display using the <literal>%H</literal> selector in the <link linkend="index-format">$index_format</link> variable. (Tip: try <literal>%?H?[%H] ?</literal>
2975 to display spam tags only when they are defined for a given message.)
2979 Your first step is to define your external filter's spam patterns using
2980 the <literal>spam</literal> command. <emphasis>pattern</emphasis> should be a regular expression
2981 that matches a header in a mail message. If any message in the mailbox
2982 matches this regular expression, it will receive a ``spam tag'' or
2983 ``spam attribute'' (unless it also matches a <literal>nospam</literal> pattern -- see
2984 below.) The appearance of this attribute is entirely up to you, and is
2985 governed by the <emphasis>format</emphasis> parameter. <emphasis>format</emphasis> can be any static
2986 text, but it also can include back-references from the <emphasis>pattern</emphasis>
2987 expression. (A regular expression ``back-reference'' refers to a
2988 sub-expression contained within parentheses.) <literal>%1</literal> is replaced with
2989 the first back-reference in the regex, <literal>%2</literal> with the second, etc.
2993 If you're using multiple spam filters, a message can have more than
2994 one spam-related header. You can define <literal>spam</literal> patterns for each
2995 filter you use. If a message matches two or more of these patterns, and
2996 the $spam_separator variable is set to a string, then the
2997 message's spam tag will consist of all the <emphasis>format</emphasis> strings joined
2998 together, with the value of $spam_separator separating
3003 For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
3004 define these spam settings:
3007 spam "X-DCC-.*-Metrics:.*(....)=many" "90+/DCC-%1"
3008 spam "X-Spam-Status: Yes" "90+/SA"
3009 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
3010 set spam_separator=", "
3016 If I then received a message that DCC registered with ``many'' hits
3017 under the ``Fuz2'' checksum, and that PureMessage registered with a
3018 97% probability of being spam, that message's spam tag would read
3019 <literal>90+/DCC-Fuz2, 97/PM</literal>. (The four characters before ``=many'' in a
3020 DCC report indicate the checksum used -- in this case, ``Fuz2''.)
3024 If the $spam_separator variable is unset, then each
3025 spam pattern match supersedes the previous one. Instead of getting
3026 joined <emphasis>format</emphasis> strings, you'll get only the last one to match.
3030 The spam tag is what will be displayed in the index when you use
3031 <literal>%H</literal> in the <literal>$index_format</literal> variable. It's also the
3032 string that the <literal>˜H</literal> pattern-matching expression matches against for
3033 <emphasis>search</emphasis> and <emphasis>limit</emphasis> functions. And it's what sorting by spam
3034 attribute will use as a sort key.
3038 That's a pretty complicated example, and most people's actual
3039 environments will have only one spam filter. The simpler your
3040 configuration, the more effective mutt can be, especially when it comes
3045 Generally, when you sort by spam tag, mutt will sort <emphasis>lexically</emphasis> --
3046 that is, by ordering strings alphanumerically. However, if a spam tag
3047 begins with a number, mutt will sort numerically first, and lexically
3048 only when two numbers are equal in value. (This is like UNIX's
3049 <literal>sort -n</literal>.) A message with no spam attributes at all -- that is, one
3050 that didn't match <emphasis>any</emphasis> of your <literal>spam</literal> patterns -- is sorted at
3051 lowest priority. Numbers are sorted next, beginning with 0 and ranging
3052 upward. Finally, non-numeric strings are sorted, with ``a'' taking lower
3053 priority than ``z''. Clearly, in general, sorting by spam tags is most
3054 effective when you can coerce your filter to give you a raw number. But
3055 in case you can't, mutt can still do something useful.
3059 The <literal>nospam</literal> command can be used to write exceptions to <literal>spam</literal>
3060 patterns. If a header pattern matches something in a <literal>spam</literal> command,
3061 but you nonetheless do not want it to receive a spam tag, you can list a
3062 more precise pattern under a <literal>nospam</literal> command.
3066 If the <emphasis>pattern</emphasis> given to <literal>nospam</literal> is exactly the same as the
3067 <emphasis>pattern</emphasis> on an existing <literal>spam</literal> list entry, the effect will be to
3068 remove the entry from the spam list, instead of adding an exception.
3069 Likewise, if the <emphasis>pattern</emphasis> for a <literal>spam</literal> command matches an entry
3070 on the <literal>nospam</literal> list, that <literal>nospam</literal> entry will be removed. If the
3071 <emphasis>pattern</emphasis> for <literal>nospam</literal> is ``*'', <emphasis>all entries on both lists</emphasis>
3072 will be removed. This might be the default action if you use <literal>spam</literal>
3073 and <literal>nospam</literal> in conjunction with a <literal>folder-hook</literal>.
3077 You can have as many <literal>spam</literal> or <literal>nospam</literal> commands as you like.
3078 You can even do your own primitive spam detection within mutt -- for
3079 example, if you consider all mail from <literal>MAILER-DAEMON</literal> to be spam,
3080 you can use a <literal>spam</literal> command like this:
3086 spam "^From: .*MAILER-DAEMON" "999"
3094 <title>Setting and Querying Variables</title>
3096 <sect2 id="set-commands">
3097 <title>Commands</title>
3100 The following commands are available to manipulate and query variables:
3105 Usage: <literal>set</literal> [no|inv]<emphasis>variable</emphasis>[=<emphasis>value</emphasis>] [ <emphasis>variable</emphasis> ... ]
3106 Usage: <literal>toggle</literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
3107 Usage: <literal>unset</literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
3108 Usage: <literal>reset</literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
3113 This command is used to set (and unset) <link linkend="variables">configuration variables</link>. There are four basic types of variables:
3114 boolean, number, string and quadoption. <emphasis>boolean</emphasis> variables can be
3115 <emphasis>set</emphasis> (true) or <emphasis>unset</emphasis> (false). <emphasis>number</emphasis> variables can be
3116 assigned a positive integer value.
3120 <emphasis>string</emphasis> variables consist of any number of printable characters.
3121 <emphasis>strings</emphasis> must be enclosed in quotes if they contain spaces or tabs. You
3122 may also use the ``C'' escape sequences <emphasis role="bold">\n</emphasis> and <emphasis role="bold">\t</emphasis> for
3123 newline and tab, respectively.
3127 <emphasis>quadoption</emphasis> variables are used to control whether or not to be prompted
3128 for certain actions, or to specify a default action. A value of <emphasis>yes</emphasis>
3129 will cause the action to be carried out automatically as if you had answered
3130 yes to the question. Similarly, a value of <emphasis>no</emphasis> will cause the
3131 action to be carried out as if you had answered ``no.'' A value of
3132 <emphasis>ask-yes</emphasis> will cause a prompt with a default answer of ``yes'' and
3133 <emphasis>ask-no</emphasis> will provide a default answer of ``no.''
3137 Prefixing a variable with ``no'' will unset it. Example: <literal>set noaskbcc</literal>.
3141 For <emphasis>boolean</emphasis> variables, you may optionally prefix the variable name with
3142 <literal>inv</literal> to toggle the value (on or off). This is useful when writing
3143 macros. Example: <literal>set invsmart_wrap</literal>.
3147 The <literal>toggle</literal> command automatically prepends the <literal>inv</literal> prefix to all
3148 specified variables.
3152 The <literal>unset</literal> command automatically prepends the <literal>no</literal> prefix to all
3153 specified variables.
3157 Using the enter-command function in the <emphasis>index</emphasis> menu, you can query the
3158 value of a variable by prefixing the name of the variable with a question
3171 The question mark is actually only required for boolean and quadoption
3176 The <literal>reset</literal> command resets all given variables to the compile time
3177 defaults (hopefully mentioned in this manual). If you use the command
3178 <literal>set</literal> and prefix the variable with ``&'' this has the same
3179 behavior as the reset command.
3183 With the <literal>reset</literal> command there exists the special variable ``all'',
3184 which allows you to reset all variables to their system defaults.
3189 <sect2 id="set-myvar">
3190 <title>User-defined variables</title>
3192 <sect3 id="set-myvar-intro">
3193 <title>Introduction</title>
3196 Along with the variables listed in the
3197 <link linkend="variables">Configuration variables</link> section, mutt
3198 supports user-defined variables with names starting
3199 with <literal>my_</literal> as in, for
3200 example, <literal>my_cfgdir</literal>.
3204 The <literal>set</literal> command creates a
3205 custom <literal>$my_</literal> variable and changes its
3206 value. The <literal>unset</literal> and <literal>reset</literal>
3207 commands remove the variable entirely.
3211 Since user-defined variables are expanded in the same way that
3212 environment variables are (except for
3213 the <link linkend="shell-escape">shell-escape</link> command), this
3214 feature can be used to make configuration files more readable.
3219 <sect3 id="set-myvar-examples">
3220 <title>Examples</title>
3223 The following example defines and uses the variable <literal>my_cfgdir</literal>
3224 to abbreviate the calls of the <link linkend="source">source</link> command:
3229 set my_cfgdir = $HOME/mutt/config
3231 source $my_cfgdir/hooks
3232 source $my_cfgdir/macros
3233 # more source commands...
3238 A custom variable can also be used in macros to backup the current value
3239 of another variable. In the following example, the value of the
3240 <link linkend="delete">$delete</link> is changed temporarily
3241 while its original value is saved as <literal>my_delete</literal>.
3242 After the macro has executed all commands, the original value of <link
3243 linkend="delete">$delete</link> is restored.
3248 macro pager ,x '\
3249 <enter-command>set my_delete=$delete<enter>\
3250 <enter-command>set delete=yes<enter>\
3252 <enter-command>set delete=$my_delete<enter>'
3257 Since mutt expands such values already when parsing the configuration
3258 file(s), the value of <literal>$my_delete</literal> in the
3259 last example would be the value of <literal>$delete</literal> exactly
3260 as it was at that point during parsing the configuration file. If
3261 another statement would change the value for <literal>$delete</literal>
3262 later in the same or another file, it would have no effect on
3263 <literal>$my_delete</literal>. However, the expansion can
3264 be deferred to runtime, as shown in the next example, when escaping the
3270 macro pager <PageDown> "\
3271 <enter-command> set my_old_pager_stop=\$pager_stop pager_stop<Enter>\
3272 <next-page>\
3273 <enter-command> set pager_stop=\$my_old_pager_stop<Enter>\
3274 <enter-command> unset my_old_pager_stop<Enter>"
3279 Note that there is a space
3280 between <literal><enter-command></literal> and
3281 the <literal>set</literal> configuration command, preventing mutt from
3282 recording the macro's commands into its history.
3292 <title>Reading initialization commands from another file</title>
3295 Usage: <literal>source</literal> <emphasis>filename</emphasis>
3299 This command allows the inclusion of initialization commands
3300 from other files. For example, I place all of my aliases in
3301 <literal>˜/.mail_aliases</literal> so that I can make my
3302 <literal>˜/.muttrc</literal> readable and keep my aliases private.
3306 If the filename begins with a tilde (``˜''), it will be expanded to the
3307 path of your home directory.
3311 If the filename ends with a vertical bar (|), then <emphasis>filename</emphasis> is
3312 considered to be an executable program from which to read input (eg.
3313 <literal>source ˜/bin/myscript|</literal>).
3319 <title>Removing hooks</title>
3322 Usage: <literal>unhook</literal> [ * | <emphasis>hook-type</emphasis> ]
3326 This command permits you to flush hooks you have previously defined.
3327 You can either remove all hooks by giving the ``*'' character as an
3328 argument, or you can remove all hooks of a specific type by saying
3329 something like <literal>unhook send-hook</literal>.
3334 <sect1 id="formatstrings">
3335 <title>Format Strings</title>
3338 <title>Basic usage</title>
3341 Format strings are a general concept you'll find in several locations
3342 through the mutt configuration, especially in the
3343 <link linkend="index-format">$index_format"</link>,
3344 <link linkend="pager-format">$pager_format"</link>,
3345 <link linkend="status-format">$status_format"</link>,
3346 and other ``*_format'' variables. These can be very straightforward,
3347 and it's quite possible you already know how to use them.
3351 The most basic format string element is a percent symbol followed
3352 by another character. For example, <literal>%s</literal>
3353 represents a message's Subject: header in the <link
3354 linkend="index-format">$index_format"</link> variable. The
3355 ``expandos'' available are documented with each format variable, but
3356 there are general modifiers available with all formatting expandos,
3357 too. Those are our concern here.
3361 Some of the modifers are borrowed right out of C (though you might
3362 know them from Perl, Python, shell, or another langugage). These are
3363 the [-]m.n modifiers, as in <literal>%-12.12s</literal>. As with
3364 such programming languages, these modifiers allow you to specify the
3365 minumum and maximum size of the resulting string, as well as its
3366 justification. If the ``-'' sign follows the percent, the string will
3367 be left-justified instead of right-justified. If there's a number
3368 immediately following that, it's the minimum amount of space the
3369 formatted string will occupy -- if it's naturally smaller than that, it
3370 will be padded out with spaces. If a decimal point and another number
3371 follow, that's the maximum space allowable -- the string will not be
3372 permitted to exceed that width, no matter its natural size. Each of
3373 these three elements is optional, so that all these are legal format
3375 <literal>%-12s</literal>
3376 <literal>%4c</literal>
3377 <literal>%.15F</literal>
3378 <literal>%-12.15L</literal>
3382 Mutt adds some other modifiers to format strings. If you use an equals
3383 symbol (<literal>=</literal>) as a numeric prefix (like the minus
3384 above), it will force the string to be centered within its minimum
3385 space range. For example, <literal>%=14y</literal> will reserve 14
3386 characters for the %y expansion -- that's the X-Label: header, in
3387 <literal>$index_format</literal>. If the expansion
3388 results in a string less than 14 characters, it will be centered in a
3389 14-character space. If the X-Label for a message were "test", that
3390 expansion would look like `` test ''.
3394 There are two very little-known modifiers that affect the way that an
3395 expando is replaced. If there is an underline (``_'') character
3396 between any format modifiers (as above) and the expando letter, it will
3397 expands in all lower case. And if you use a colon (``:''), it will
3398 replace all decimal points with underlines.
3404 <title>Filters</title>
3407 Any format string ending in a vertical bar (``|'') will be
3408 expanded and piped through the first word in the string, using spaces
3409 as separator. The string returned will be used for display.
3410 If the returned string ends in %, it will be passed through
3411 the formatter a second time. This allows the filter to generate a
3412 replacement format string including % expandos.
3416 All % expandos in a format string are expanded before the script
3421 set status_format="script.sh '%r %f (%L)'|"
3425 will make mutt expand <literal>%r</literal>,
3426 <literal>%f</literal> and <literal>%L</literal>
3427 before calling the script. The example also shows that arguments can be
3428 quoted: the script will receive the expanded string between the single quotes
3429 as the only argument.
3433 A practical example is the <literal>mutt_xtitle</literal>
3434 script installed in the <literal>samples</literal>
3435 subdirectory of the mutt documentation: it can be used as filter for
3436 <literal>$status_format</literal> to set the current
3437 terminal's title, if supported.
3446 <chapter id="advancedusage">
3447 <title>Advanced Usage</title>
3450 <title>Regular Expressions</title>
3453 All string patterns in Mutt including those in more complex
3454 <link linkend="patterns">patterns</link> must be specified
3455 using regular expressions (regexp) in the ``POSIX extended'' syntax (which
3456 is more or less the syntax used by egrep and GNU awk). For your
3457 convenience, we have included below a brief description of this syntax.
3461 The search is case sensitive if the pattern contains at least one upper
3462 case letter, and case insensitive otherwise. Note that ``\''
3463 must be quoted if used for a regular expression in an initialization
3464 command: ``\\''.
3468 A regular expression is a pattern that describes a set of strings.
3469 Regular expressions are constructed analogously to arithmetic
3470 expressions, by using various operators to combine smaller expressions.
3474 Note that the regular expression can be enclosed/delimited by either "
3475 or ' which is useful if the regular expression includes a white-space
3476 character. See <xref linkend="muttrc-syntax"/>
3477 for more information on " and ' delimiter processing. To match a
3478 literal " or ' you must preface it with \ (backslash).
3482 The fundamental building blocks are the regular expressions that match
3483 a single character. Most characters, including all letters and digits,
3484 are regular expressions that match themselves. Any metacharacter with
3485 special meaning may be quoted by preceding it with a backslash.
3489 The period ``.'' matches any single character. The caret ``ˆ'' and
3490 the dollar sign ``$'' are metacharacters that respectively match
3491 the empty string at the beginning and end of a line.
3495 A list of characters enclosed by ``['' and ``]'' matches any
3496 single character in that list; if the first character of the list
3497 is a caret ``ˆ'' then it matches any character <emphasis role="bold">not</emphasis> in the
3498 list. For example, the regular expression <emphasis role="bold">[0123456789]</emphasis>
3499 matches any single digit. A range of ASCII characters may be specified
3500 by giving the first and last characters, separated by a hyphen
3501 ``-''. Most metacharacters lose their special meaning inside
3502 lists. To include a literal ``]'' place it first in the list.
3503 Similarly, to include a literal ``ˆ'' place it anywhere but first.
3504 Finally, to include a literal hyphen ``-'' place it last.
3508 Certain named classes of characters are predefined. Character classes
3509 consist of ``[:'', a keyword denoting the class, and ``:]''.
3510 The following classes are defined by the POSIX standard:
3517 <term>[:alnum:]</term>
3520 Alphanumeric characters.
3525 <term>[:alpha:]</term>
3528 Alphabetic characters.
3533 <term>[:blank:]</term>
3536 Space or tab characters.
3541 <term>[:cntrl:]</term>
3549 <term>[:digit:]</term>
3557 <term>[:graph:]</term>
3560 Characters that are both printable and visible. (A space is printable,
3561 but not visible, while an ``a'' is both.)
3566 <term>[:lower:]</term>
3569 Lower-case alphabetic characters.
3574 <term>[:print:]</term>
3577 Printable characters (characters that are not control characters.)
3582 <term>[:punct:]</term>
3585 Punctuation characters (characters that are not letter, digits, control
3586 characters, or space characters).
3591 <term>[:space:]</term>
3594 Space characters (such as space, tab and formfeed, to name a few).
3599 <term>[:upper:]</term>
3602 Upper-case alphabetic characters.
3607 <term>[:xdigit:]</term>
3610 Characters that are hexadecimal digits.
3618 A character class is only valid in a regular expression inside the
3619 brackets of a character list. Note that the brackets in these
3620 class names are part of the symbolic names, and must be included
3621 in addition to the brackets delimiting the bracket list. For
3622 example, <emphasis role="bold">[[:digit:]]</emphasis> is equivalent to
3623 <emphasis role="bold">[0-9]</emphasis>.
3627 Two additional special sequences can appear in character lists. These
3628 apply to non-ASCII character sets, which can have single symbols (called
3629 collating elements) that are represented with more than one character,
3630 as well as several characters that are equivalent for collating or
3638 <term>Collating Symbols</term>
3641 A collating symbol is a multi-character collating element enclosed in
3642 ``[.'' and ``.]''. For example, if ``ch'' is a collating
3643 element, then <emphasis role="bold">[[.ch.]]</emphasis> is a regexp that matches
3644 this collating element, while <emphasis role="bold">[ch]</emphasis> is a regexp that
3645 matches either ``c'' or ``h''.
3650 <term>Equivalence Classes</term>
3653 An equivalence class is a locale-specific name for a list of
3654 characters that are equivalent. The name is enclosed in ``[=''
3655 and ``=]''. For example, the name ``e'' might be used to
3656 represent all of ``è'' ``é'' and ``e''. In this case,
3657 <emphasis role="bold">[[=e=]]</emphasis> is a regexp that matches any of
3658 ``è'', ``é'' and ``e''.
3666 A regular expression matching a single character may be followed by one
3667 of several repetition operators:
3677 The preceding item is optional and matched at most once.
3685 The preceding item will be matched zero or more times.
3693 The preceding item will be matched one or more times.
3698 <term>{n}</term>
3701 The preceding item is matched exactly <emphasis>n</emphasis> times.
3706 <term>{n,}</term>
3709 The preceding item is matched <emphasis>n</emphasis> or more times.
3714 <term>{,m}</term>
3717 The preceding item is matched at most <emphasis>m</emphasis> times.
3722 <term>{n,m}</term>
3725 The preceding item is matched at least <emphasis>n</emphasis> times, but no more than
3726 <emphasis>m</emphasis> times.
3734 Two regular expressions may be concatenated; the resulting regular
3735 expression matches any string formed by concatenating two substrings
3736 that respectively match the concatenated subexpressions.
3740 Two regular expressions may be joined by the infix operator ``|'';
3741 the resulting regular expression matches any string matching either
3746 Repetition takes precedence over concatenation, which in turn takes
3747 precedence over alternation. A whole subexpression may be enclosed in
3748 parentheses to override these precedence rules.
3752 <emphasis role="bold">Note:</emphasis> If you compile Mutt with the GNU <emphasis>rx</emphasis> package, the
3753 following operators may also be used in regular expressions:
3760 <term>\\y</term>
3763 Matches the empty string at either the beginning or the end of a word.
3768 <term>\\B</term>
3771 Matches the empty string within a word.
3776 <term>\\<</term>
3779 Matches the empty string at the beginning of a word.
3784 <term>\\></term>
3787 Matches the empty string at the end of a word.
3792 <term>\\w</term>
3795 Matches any word-constituent character (letter, digit, or underscore).
3800 <term>\\W</term>
3803 Matches any character that is not word-constituent.
3808 <term>\\`</term>
3811 Matches the empty string at the beginning of a buffer (string).
3816 <term>\\'</term>
3819 Matches the empty string at the end of a buffer.
3827 Please note however that these operators are not defined by POSIX, so
3828 they may or may not be available in stock libraries on various systems.
3833 <sect1 id="patterns">
3834 <title>Patterns: Searching, Limiting and Tagging</title>
3837 Many of Mutt's commands allow you to specify a pattern to match
3838 (limit, tag-pattern, delete-pattern, etc.). <xref linkend="tab-patterns"/>
3839 shows several ways to select messages.
3844 <table id="tab-patterns">
3845 <title>Pattern modifiers</title>
3848 <row><entry>Pattern modifier</entry><entry>Description</entry></row>
3851 <row><entry>~A</entry><entry>all messages</entry></row>
3852 <row><entry>~b EXPR</entry><entry>messages which contain EXPR in the message body</entry></row>
3853 <row><entry>=b STRING</entry><entry>messages which contain STRING in the message body. If IMAP is enabled, searches for STRING on the server, rather than downloading each message and searching it locally.</entry></row>
3854 <row><entry>~B EXPR</entry><entry>messages which contain EXPR in the whole message</entry></row>
3855 <row><entry>~c EXPR</entry><entry>messages carbon-copied to EXPR</entry></row>
3856 <row><entry>%c GROUP</entry><entry>messages carbon-copied to any member of GROUP</entry></row>
3857 <row><entry>~C EXPR</entry><entry>message is either to: or cc: EXPR</entry></row>
3858 <row><entry>%C GROUP</entry><entry>message is either to: or cc: to any member of GROUP</entry></row>
3859 <row><entry>~d [MIN]-[MAX]</entry><entry>messages with ``date-sent'' in a Date range</entry></row>
3860 <row><entry>~D</entry><entry>deleted messages</entry></row>
3861 <row><entry>~e EXPR</entry><entry>message which contains EXPR in the ``Sender'' field</entry></row>
3862 <row><entry>%e GROUP</entry><entry>message which contain a member of GROUP in the ``Sender'' field</entry></row>
3863 <row><entry>~E</entry><entry>expired messages</entry></row>
3864 <row><entry>~F</entry><entry>flagged messages</entry></row>
3865 <row><entry>~f EXPR</entry><entry>messages originating from EXPR</entry></row>
3866 <row><entry>%f GROUP</entry><entry>messages originating from any member of GROUP</entry></row>
3867 <row><entry>~g</entry><entry>cryptographically signed messages</entry></row>
3868 <row><entry>~G</entry><entry>cryptographically encrypted messages</entry></row>
3869 <row><entry>~h EXPR</entry><entry>messages which contain EXPR in the message header</entry></row>
3870 <row><entry>~H EXPR</entry><entry>messages with a spam attribute matching EXPR</entry></row>
3871 <row><entry>~i EXPR</entry><entry>message which match EXPR in the ``Message-ID'' field</entry></row>
3872 <row><entry>~k</entry><entry>message contains PGP key material</entry></row>
3873 <row><entry>~L EXPR</entry><entry>message is either originated or received by EXPR</entry></row>
3874 <row><entry>%L GROUP</entry><entry>message is either originated or received by any member of GROUP</entry></row>
3875 <row><entry>~l</entry><entry>message is addressed to a known mailing list</entry></row>
3876 <row><entry>~m [MIN]-[MAX]</entry><entry>message in the range MIN to MAX *)</entry></row>
3877 <row><entry>~n [MIN]-[MAX]</entry><entry>messages with a score in the range MIN to MAX *)</entry></row>
3878 <row><entry>~N</entry><entry>new messages</entry></row>
3879 <row><entry>~O</entry><entry>old messages</entry></row>
3880 <row><entry>~p</entry><entry>message is addressed to you (consults alternates)</entry></row>
3881 <row><entry>~P</entry><entry>message is from you (consults alternates)</entry></row>
3882 <row><entry>~Q</entry><entry>messages which have been replied to</entry></row>
3883 <row><entry>~r [MIN]-[MAX]</entry><entry>messages with ``date-received'' in a Date range</entry></row>
3884 <row><entry>~R</entry><entry>read messages</entry></row>
3885 <row><entry>~s EXPR</entry><entry>messages having EXPR in the ``Subject'' field.</entry></row>
3886 <row><entry>~S</entry><entry>superseded messages</entry></row>
3887 <row><entry>~t EXPR</entry><entry>messages addressed to EXPR</entry></row>
3888 <row><entry>~T</entry><entry>tagged messages</entry></row>
3889 <row><entry>~u</entry><entry>message is addressed to a subscribed mailing list</entry></row>
3890 <row><entry>~U</entry><entry>unread messages</entry></row>
3891 <row><entry>~v</entry><entry>message is part of a collapsed thread.</entry></row>
3892 <row><entry>~V</entry><entry>cryptographically verified messages</entry></row>
3893 <row><entry>~x EXPR</entry><entry>messages which contain EXPR in the `References' field</entry></row>
3894 <row><entry>~X [MIN]-[MAX]</entry><entry>messages with MIN to MAX attachments *)</entry></row>
3895 <row><entry>~y EXPR</entry><entry>messages which contain EXPR in the `X-Label' field</entry></row>
3896 <row><entry>~z [MIN]-[MAX]</entry><entry>messages with a size in the range MIN to MAX *)</entry></row>
3897 <row><entry>~=</entry><entry>duplicated messages (see $duplicate_threads)</entry></row>
3898 <row><entry>~$</entry><entry>unreferenced messages (requires threaded view)</entry></row>
3899 <row><entry>~(PATTERN)</entry><entry>messages in threads
3900 containing messages matching a certain pattern, e.g. all
3901 threads containing messages from you: ~(~P)</entry></row>
3910 <link linkend="regexp">regular expression</link>. Special attention has to be
3911 made when using regular expressions inside of patterns. Specifically,
3912 Mutt's parser for these patterns will strip one level of backslash (\),
3913 which is normally used for quoting. If it is your intention to use a
3914 backslash in the regular expression, you will need to use two backslashes
3915 instead (\\). You can force mutt to treat EXPR as a simple string
3916 instead of a regular expression by using = instead of ˜ in the
3917 pattern name. For example, =b *.* will find all messages that contain
3918 the literal string '*.*'. Simple string matches are less powerful than
3919 regular expressions but can be considerably faster. This is especially
3920 true for IMAP folders, because string matches can be performed on the
3921 server instead of by fetching every message. IMAP treats =h specially:
3922 it must be of the form "header: substring" and will not partially
3923 match header names. The substring part may be omitted if you simply
3924 wish to find messages containing a particular header without regard to
3929 *) The forms <literal><[MAX]</literal>, <literal>>[MIN]</literal>,
3930 <literal>[MIN]-</literal> and <literal>-[MAX]</literal>
3935 <title>Pattern Modifier</title>
3938 Note that patterns matching 'lists' of addresses (notably c,C,p,P and t)
3939 match if there is at least one match in the whole list. If you want to
3940 make sure that all elements of that list match, you need to prefix your
3941 pattern with ˆ.
3942 This example matches all mails which only has recipients from Germany.
3956 <title>Simple Patterns</title>
3959 Mutt supports two versions of so called ``simple searches'' which are
3960 issued if the query entered for searching, limiting and similar
3961 operations does not seem to be a valid pattern (i.e. it does not contain
3962 one of these characters: ``~'', ``='' or ``%''). If the query is
3963 supposed to contain one of these special characters, they must be escaped
3964 by prepending a backslash (``\'').
3968 The first type is by checking whether the query string equals
3969 a keyword case-insensitively from <xref linkend="tab-simplesearch-keywords"/>:
3970 If that is the case, Mutt will use the shown pattern modifier instead.
3971 If a keyword would conflict with your search keyword, you need to turn
3972 it into a regular expression to avoid matching the keyword table. For
3973 example, if you want to find all messages matching ``<literal>flag</literal>''
3974 (using <link linkend="simple-search">$simple_search</link>,
3975 see below but not meaning flagged messages) simply search for
3976 ``<literal>[f]lag</literal>''.
3979 <table id="tab-simplesearch-keywords">
3980 <title>Simple search keywords</title>
3983 <row><entry>Keyword</entry><entry>Pattern modifier</entry></row>
3986 <row><entry>all</entry><entry>~A</entry></row>
3987 <row><entry>.</entry><entry>~A</entry></row>
3988 <row><entry>ˆ</entry><entry>~A</entry></row>
3989 <row><entry>del</entry><entry>~D</entry></row>
3990 <row><entry>flag</entry><entry>~F</entry></row>
3991 <row><entry>new</entry><entry>~N</entry></row>
3992 <row><entry>old</entry><entry>~O</entry></row>
3993 <row><entry>repl</entry><entry>~Q</entry></row>
3994 <row><entry>read</entry><entry>~R</entry></row>
3995 <row><entry>tag</entry><entry>~T</entry></row>
3996 <row><entry>unread</entry><entry>~U</entry></row>
4002 The second type of simple search is to build a complex search
4003 pattern using <link linkend="simple-search">$simple_search</link>
4004 as a template. Mutt will insert your query properly quoted and search
4005 for the composed complex query.
4011 <title>Complex Patterns</title>
4014 Logical AND is performed by specifying more than one criterion. For
4027 would select messages which contain the word ``mutt'' in the list of
4028 recipients <emphasis role="bold">and</emphasis> that have the word ``elkins'' in the ``From'' header
4033 Mutt also recognizes the following operators to create more complex search
4043 ! -- logical NOT operator
4049 | -- logical OR operator
4055 () -- logical grouping operator
4064 Here is an example illustrating a complex search pattern. This pattern will
4065 select all messages which do not contain ``mutt'' in the ``To'' or ``Cc''
4066 field and which are from ``elkins''.
4072 !(~t mutt|~c mutt) ~f elkins
4078 Here is an example using white space in the regular expression (note
4079 the ' and " delimiters). For this to match, the mail's subject must
4080 match the ``ˆJunk +From +Me$'' and it must be from either ``Jim +Somebody''
4081 or ``Ed +SomeoneElse'':
4087 '~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")'
4093 Note that if a regular expression contains parenthesis, or a vertical bar
4094 ("|"), you <emphasis role="bold">must</emphasis> enclose the expression in double or single quotes since
4095 those characters are also used to separate different parts of Mutt's
4096 pattern language. For example,
4102 ~f "me@(mutt\.org|cs\.hmc\.edu)"
4108 Without the quotes, the parenthesis wouldn't end.
4109 This would be seperated to two OR'd patterns: <emphasis>˜f me@(mutt\.org</emphasis>
4110 and <emphasis>cs\.hmc\.edu)</emphasis>. They are never what you want.
4116 <title>Searching by Date</title>
4119 Mutt supports two types of dates, <emphasis>absolute</emphasis> and <emphasis>relative</emphasis>.
4123 <emphasis role="bold">Absolute</emphasis>. Dates <emphasis role="bold">must</emphasis> be in DD/MM/YY format (month and year are
4124 optional, defaulting to the current month and year). An example of a valid
4131 Limit to messages matching: ~d 20/1/95-31/10
4137 If you omit the minimum (first) date, and just specify ``-DD/MM/YY'', all
4138 messages <emphasis>before</emphasis> the given date will be selected. If you omit the maximum
4139 (second) date, and specify ``DD/MM/YY-'', all messages <emphasis>after</emphasis> the given
4140 date will be selected. If you specify a single date with no dash (``-''),
4141 only messages sent on the given date will be selected.
4145 <emphasis role="bold">Error Margins</emphasis>. You can add error margins to absolute dates.
4146 An error margin is a sign (+ or -), followed by a digit, followed by
4147 one of the units in <xref linkend="tab-date-units"/>. As a special case, you can replace the
4148 sign by a ``*'' character, which is equivalent to giving identical plus and minus error margins.
4151 <table id="tab-date-units">
4152 <title>Date units</title>
4155 <row><entry>Unit</entry><entry>Description</entry></row>
4158 <row><entry>y</entry><entry>Years</entry></row>
4159 <row><entry>m</entry><entry>Months</entry></row>
4160 <row><entry>w</entry><entry>Weeks</entry></row>
4161 <row><entry>d</entry><entry>Days</entry></row>
4167 Example: To select any messages two weeks around January 15, 2001,
4168 you'd use the following pattern:
4172 Limit to messages matching: ~d 15/1/2001*2w
4178 <emphasis role="bold">Relative</emphasis>. This type of date is relative to the current date, and may
4185 ><emphasis>offset</emphasis> (messages older than <emphasis>offset</emphasis> units)
4191 <<emphasis>offset</emphasis> (messages newer than <emphasis>offset</emphasis> units)
4197 =<emphasis>offset</emphasis> (messages exactly <emphasis>offset</emphasis> units old)
4206 <emphasis>offset</emphasis> is specified as a positive number with one of the units from <xref linkend="tab-date-units"/>.
4210 Example: to select messages less than 1 month old, you would use
4213 Limit to messages matching: ~d <1m
4219 <emphasis role="bold">Note:</emphasis> all dates used when searching are relative to the
4220 <emphasis role="bold">local</emphasis> time zone, so unless you change the setting of your <link linkend="index-format">$index_format</link> to include a
4221 <literal>%[...]</literal> format, these are <emphasis role="bold">not</emphasis> the dates shown
4230 <title>Using Tags</title>
4233 Sometimes it is desirable to perform an operation on a group of
4234 messages all at once rather than one at a time. An example might be
4235 to save messages to a mailing list to a separate folder, or to
4236 delete all messages with a given subject. To tag all messages
4237 matching a pattern, use the tag-pattern function, which is bound to
4238 ``shift-T'' by default. Or you can select individual messages by
4239 hand using the ``tag-message'' function, which is bound to ``t'' by
4240 default. See <link linkend="patterns">patterns</link> for Mutt's pattern
4245 Once you have tagged the desired messages, you can use the
4246 ``tag-prefix'' operator, which is the ``;'' (semicolon) key by default.
4247 When the ``tag-prefix'' operator is used, the <emphasis role="bold">next</emphasis> operation will
4248 be applied to all tagged messages if that operation can be used in that
4249 manner. If the <link linkend="auto-tag">$auto_tag</link>
4250 variable is set, the next operation applies to the tagged messages
4251 automatically, without requiring the ``tag-prefix''.
4255 In <link linkend="macro">macros</link> or <link linkend="push">push</link> commands,
4256 you can use the ``tag-prefix-cond'' operator. If there are no tagged
4257 messages, mutt will "eat" the rest of the macro to abort it's execution.
4258 Mutt will stop "eating" the macro when it encounters the ``end-cond''
4259 operator; after this operator the rest of the macro will be executed as
4266 <title>Using Hooks</title>
4269 A <emphasis>hook</emphasis> is a concept borrowed from the EMACS editor which allows you to
4270 execute arbitrary commands before performing some operation. For example,
4271 you may wish to tailor your configuration based upon which mailbox you are
4272 reading, or to whom you are sending mail. In the Mutt world, a <emphasis>hook</emphasis>
4273 consists of a <link linkend="regexp">regular expression</link> or
4274 <link linkend="patterns">pattern</link> along with a
4275 configuration option/command. See
4281 <link linkend="folder-hook">folder-hook</link>
4287 <link linkend="send-hook">send-hook</link>
4293 <link linkend="message-hook">message-hook</link>
4299 <link linkend="save-hook">save-hook</link>
4305 <link linkend="mbox-hook">mbox-hook</link>
4311 <link linkend="fcc-hook">fcc-hook</link>
4317 <link linkend="fcc-save-hook">fcc-save-hook</link>
4323 for specific details on each type of <emphasis>hook</emphasis> available.
4327 <emphasis role="bold">Note:</emphasis> if a hook changes configuration settings, these changes remain
4328 effective until the end of the current mutt session. As this is generally
4329 not desired, a default hook needs to be added before all other hooks to
4330 restore configuration defaults. Here is an example with send-hook and the
4331 my_hdr directive:
4337 send-hook . 'unmy_hdr From:'
4338 send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
4343 <sect2 id="pattern-hook" xreflabel="Message Matching in Hooks">
4344 <title>Message Matching in Hooks</title>
4347 Hooks that act upon messages (<literal>message-hook, reply-hook,
4348 send-hook, send2-hook, save-hook, fcc-hook</literal>) are evaluated in a
4349 slightly different manner. For the other
4350 types of hooks, a <link linkend="regexp">regular expression</link> is
4351 sufficient. But in dealing with messages a finer grain of control is
4352 needed for matching since for different purposes you want to match
4357 Mutt allows the use of the <link linkend="patterns">search pattern</link>
4358 language for matching messages in hook commands. This works in
4359 exactly the same way as it would when <emphasis>limiting</emphasis> or
4360 <emphasis>searching</emphasis> the mailbox, except that you are restricted to those
4361 operators which match information mutt extracts from the header of
4362 the message (i.e., from, to, cc, date, subject, etc.).
4366 For example, if you wanted to set your return address based upon sending
4367 mail to a specific address, you could do something like:
4370 send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt User <user@host>'
4373 which would execute the given command when sending mail to
4374 <emphasis>me@cs.hmc.edu</emphasis>.
4378 However, it is not required that you write the pattern to match using the
4379 full searching language. You can still specify a simple <emphasis>regular
4380 expression</emphasis> like the other hooks, in which case Mutt will translate your
4381 pattern into the full language, using the translation specified by the
4382 <link linkend="default-hook">$default_hook</link> variable. The
4383 pattern is translated at the time the hook is declared, so the value of
4384 <link linkend="default-hook">$default_hook</link> that is in effect
4385 at that time will be used.
4393 <title>External Address Queries</title>
4396 Mutt supports connecting to external directory databases such as LDAP,
4397 ph/qi, bbdb, or NIS through a wrapper script which connects to mutt
4398 using a simple interface. Using the <link linkend="query-command">$query_command</link> variable, you specify the wrapper
4399 command to use. For example:
4405 set query_command = "mutt_ldap_query.pl '%s'"
4411 The wrapper script should accept the query on the command-line. It
4412 should return a one line message, then each matching response on a
4413 single line, each line containing a tab separated address then name then
4414 some other optional information. On error, or if there are no matching
4415 addresses, return a non-zero exit code and a one line error message.
4419 An example multiple response output:
4422 Searching database ... 20 entries ... 3 matching:
4423 me@cs.hmc.edu Michael Elkins mutt dude
4424 blong@fiction.net Brandon Long mutt and more
4425 roessler@does-not-exist.org Thomas Roessler mutt pgp
4431 There are two mechanisms for accessing the query function of mutt. One
4432 is to do a query from the index menu using the query function (default: Q).
4433 This will prompt for a query, then bring up the query menu which will
4434 list the matching responses. From the query menu, you can select
4435 addresses to create aliases, or to mail. You can tag multiple addresses
4436 to mail, start a new query, or have a new query appended to the current
4441 The other mechanism for accessing the query function is for address
4442 completion, similar to the alias completion. In any prompt for address
4443 entry, you can use the complete-query function (default: ˆT) to run a
4444 query based on the current address you have typed. Like aliases, mutt
4445 will look for what you have typed back to the last space or comma. If
4446 there is a single response for that query, mutt will expand the address
4447 in place. If there are multiple responses, mutt will activate the query
4448 menu. At the query menu, you can select one or more addresses to be
4449 added to the prompt.
4454 <sect1 id="mailbox-formats">
4455 <title>Mailbox Formats</title>
4458 Mutt supports reading and writing of four different mailbox formats:
4459 mbox, MMDF, MH and Maildir. The mailbox type is autodetected, so there
4460 is no need to use a flag for different mailbox types. When creating new
4461 mailboxes, Mutt uses the default specified with the <link linkend="mbox-type">$mbox_type</link> variable.
4465 <emphasis role="bold">mbox</emphasis>. This is the most widely used mailbox format for UNIX. All
4466 messages are stored in a single file. Each message has a line of the form:
4472 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
4478 to denote the start of a new message (this is often referred to as the
4479 ``From_'' line).
4483 <emphasis role="bold">MMDF</emphasis>. This is a variant of the <emphasis>mbox</emphasis> format. Each message is
4484 surrounded by lines containing ``ˆAˆAˆAˆA'' (four control-A's).
4488 <emphasis role="bold">MH</emphasis>. A radical departure from <emphasis>mbox</emphasis> and <emphasis>MMDF</emphasis>, a mailbox
4489 consists of a directory and each message is stored in a separate file.
4490 The filename indicates the message number (however, this is may not
4491 correspond to the message number Mutt displays). Deleted messages are
4492 renamed with a comma (,) prepended to the filename. <emphasis role="bold">Note:</emphasis> Mutt
4493 detects this type of mailbox by looking for either <literal>.mh_sequences</literal>
4494 or <literal>.xmhcache</literal> (needed to distinguish normal directories from MH
4499 <emphasis role="bold">Maildir</emphasis>. The newest of the mailbox formats, used by the Qmail MTA (a
4500 replacement for sendmail). Similar to <emphasis>MH</emphasis>, except that it adds three
4501 subdirectories of the mailbox: <emphasis>tmp</emphasis>, <emphasis>new</emphasis> and <emphasis>cur</emphasis>. Filenames
4502 for the messages are chosen in such a way they are unique, even when two
4503 programs are writing the mailbox over NFS, which means that no file locking
4509 <sect1 id="shortcuts">
4510 <title>Mailbox Shortcuts</title>
4513 There are a number of built in shortcuts which refer to specific mailboxes.
4514 These shortcuts can be used anywhere you are prompted for a file or mailbox
4524 ! -- refers to your <link linkend="spoolfile">$spoolfile</link> (incoming) mailbox
4530 > -- refers to your <link linkend="mbox">$mbox</link> file
4536 < -- refers to your <link linkend="record">$record</link> file
4542 ˆ -- refers to the current mailbox
4548 - or !! -- refers to the file you've last visited
4554 ˜ -- refers to your home directory
4560 = or + -- refers to your <link linkend="folder">$folder</link> directory
4566 @<emphasis>alias</emphasis> -- refers to the <link linkend="save-hook">default save folder</link> as determined by the address of the alias
4576 <sect1 id="using-lists">
4577 <title>Handling Mailing Lists</title>
4580 Mutt has a few configuration options that make dealing with large
4581 amounts of mail easier. The first thing you must do is to let Mutt
4582 know what addresses you consider to be mailing lists (technically
4583 this does not have to be a mailing list, but that is what it is most
4584 often used for), and what lists you are subscribed to. This is
4585 accomplished through the use of the <link linkend="lists">lists and subscribe</link> commands in your muttrc.
4589 Now that Mutt knows what your mailing lists are, it can do several
4590 things, the first of which is the ability to show the name of a list
4591 through which you received a message (i.e., of a subscribed list) in
4592 the <emphasis>index</emphasis> menu display. This is useful to distinguish between
4593 personal and list mail in the same mailbox. In the <link linkend="index-format">$index_format</link> variable, the escape ``%L''
4594 will return the string ``To <list>'' when ``list'' appears in the
4595 ``To'' field, and ``Cc <list>'' when it appears in the ``Cc''
4596 field (otherwise it returns the name of the author).
4600 Often times the ``To'' and ``Cc'' fields in mailing list messages
4601 tend to get quite large. Most people do not bother to remove the
4602 author of the message they are reply to from the list, resulting in
4603 two or more copies being sent to that person. The ``list-reply''
4604 function, which by default is bound to ``L'' in the <emphasis>index</emphasis> menu
4605 and <emphasis>pager</emphasis>, helps reduce the clutter by only replying to the
4606 known mailing list addresses instead of all recipients (except as
4607 specified by <literal>Mail-Followup-To</literal>, see below).
4611 Mutt also supports the <literal>Mail-Followup-To</literal> header. When you send
4612 a message to a list of recipients which includes one or several
4613 subscribed mailing lists, and if the <link linkend="followup-to">$followup_to</link> option is set, mutt will generate
4614 a Mail-Followup-To header which contains all the recipients to whom
4615 you send this message, but not your address. This indicates that
4616 group-replies or list-replies (also known as ``followups'') to this
4617 message should only be sent to the original recipients of the
4618 message, and not separately to you - you'll receive your copy through
4619 one of the mailing lists you are subscribed to.
4623 Conversely, when group-replying or list-replying to a message which
4624 has a <literal>Mail-Followup-To</literal> header, mutt will respect this header if
4625 the <link linkend="honor-followup-to">$honor_followup_to</link> configuration
4626 variable is set. Using list-reply will in this case also make sure
4627 that the reply goes to the mailing list, even if it's not specified
4628 in the list of recipients in the <literal>Mail-Followup-To</literal>.
4632 Note that, when header editing is enabled, you can create a
4633 <literal>Mail-Followup-To</literal> header manually. Mutt will only auto-generate
4634 this header if it doesn't exist when you send the message.
4638 The other method some mailing list admins use is to generate a
4639 ``Reply-To'' field which points back to the mailing list address rather
4640 than the author of the message. This can create problems when trying
4641 to reply directly to the author in private, since most mail clients
4642 will automatically reply to the address given in the ``Reply-To''
4643 field. Mutt uses the <link linkend="reply-to">$reply_to</link>
4644 variable to help decide which address to use. If set to <emphasis>ask-yes</emphasis> or
4645 <emphasis>ask-no</emphasis>, you will be
4646 prompted as to whether or not you would like to use the address given in
4647 the ``Reply-To'' field, or reply directly to the address given in the
4648 ``From'' field. When set to <emphasis>yes</emphasis>, the ``Reply-To'' field will be used when
4653 The ``X-Label:'' header field can be used to further identify mailing
4654 lists or list subject matter (or just to annotate messages
4655 individually). The <link linkend="index-format">$index_format</link> variable's ``%y'' and
4656 ``%Y'' escapes can be used to expand ``X-Label:'' fields in the
4657 index, and Mutt's pattern-matcher can match regular expressions to
4658 ``X-Label:'' fields with the ``˜y'' selector. ``X-Label:'' is not a
4659 standard message header field, but it can easily be inserted by procmail
4660 and other mail filtering agents.
4664 Lastly, Mutt has the ability to <link linkend="sort">sort</link> the mailbox into
4665 <link linkend="threads">threads</link>. A thread is a group of messages which all relate to the same
4666 subject. This is usually organized into a tree-like structure where a
4667 message and all of its replies are represented graphically. If you've ever
4668 used a threaded news client, this is the same concept. It makes dealing
4669 with large volume mailing lists easier because you can easily delete
4670 uninteresting threads and quickly find topics of value.
4675 <sect1 id="editing-threads">
4676 <title>Editing threads</title>
4679 Mutt has the ability to dynamically restructure threads that are broken
4680 either by misconfigured software or bad behavior from some
4681 correspondents. This allows to clean your mailboxes formats) from these
4682 annoyances which make it hard to follow a discussion.
4686 <title>Linking threads</title>
4689 Some mailers tend to "forget" to correctly set the "In-Reply-To:" and
4690 "References:" headers when replying to a message. This results in broken
4691 discussions because Mutt has not enough information to guess the correct
4693 You can fix this by tagging the reply, then moving to the parent message
4694 and using the ``link-threads'' function (bound to & by default). The
4695 reply will then be connected to this "parent" message.
4699 You can also connect multiple children at once, tagging them and using the
4700 tag-prefix command (';') or the auto_tag option.
4706 <title>Breaking threads</title>
4709 On mailing lists, some people are in the bad habit of starting a new
4710 discussion by hitting "reply" to any message from the list and changing
4711 the subject to a totally unrelated one.
4712 You can fix such threads by using the ``break-thread'' function (bound
4713 by default to #), which will turn the subthread starting from the
4714 current message into a whole different thread.
4722 <title>Delivery Status Notification (DSN) Support</title>
4725 RFC1894 defines a set of MIME content types for relaying information
4726 about the status of electronic mail messages. These can be thought of as
4727 ``return receipts.''
4731 To support DSN, there are two variables. <link linkend="dsn-notify">$dsn_notify</link> is used to request receipts for
4732 different results (such as failed message, message delivered, etc.).
4733 <link linkend="dsn-return">$dsn_return</link> requests how much
4734 of your message should be returned with the receipt (headers or full
4739 When using <link linkend="sendmail">$sendmail</link> for mail
4740 delivery, you need to use either Berkeley sendmail 8.8.x (or greater) a MTA
4741 supporting DSN command line options compatible to Sendmail: The -N and -R
4742 options can be used by the mail client to make requests as to what type of
4743 status messages should be returned. Please consider your MTA documentation
4744 whether DSN is supported.
4748 For SMTP delivery using <link
4749 linkend="smtp-url">$smtp_url</link>, it depends on the
4750 capabilities announced by the server whether mutt will attempt to
4756 <sect1 id="urlview">
4757 <title>Start a WWW Browser on URLs (EXTERNAL)</title>
4760 If a message contains URLs (<emphasis>unified resource locator</emphasis> = address in the
4761 WWW space like <emphasis>http://www.mutt.org/</emphasis>), it is efficient to get
4762 a menu with all the URLs and start a WWW browser on one of them. This
4763 functionality is provided by the external urlview program which can be
4765 url="ftp://ftp.mutt.org/mutt/contrib/"
4766 >ftp://ftp.mutt.org/mutt/contrib/</ulink
4767 > and the configuration commands:
4770 macro index \cb |urlview\n
4771 macro pager \cb |urlview\n
4780 <chapter id="mimesupport">
4781 <title>Mutt's MIME Support</title>
4784 Quite a bit of effort has been made to make Mutt the premier text-mode
4785 MIME MUA. Every effort has been made to provide the functionality that
4786 the discerning MIME user requires, and the conformance to the standards
4787 wherever possible. When configuring Mutt for MIME, there are two extra
4788 types of configuration files which Mutt uses. One is the
4789 <literal>mime.types</literal> file, which contains the mapping of file extensions to
4790 IANA MIME types. The other is the <literal>mailcap</literal> file, which specifies
4791 the external commands to use for handling specific MIME types.
4794 <sect1 id="using-mime">
4795 <title>Using MIME in Mutt</title>
4798 There are three areas/menus in Mutt which deal with MIME, they are the
4799 pager (while viewing a message), the attachment menu and the compose
4804 <title>Viewing MIME messages in the pager</title>
4807 When you select a message from the index and view it in the pager, Mutt
4808 decodes the message to a text representation. Mutt internally supports
4809 a number of MIME types, including <literal>text/plain, text/enriched,
4810 message/rfc822, and message/news</literal>. In addition, the export
4811 controlled version of Mutt recognizes a variety of PGP MIME types,
4812 including PGP/MIME and application/pgp.
4816 Mutt will denote attachments with a couple lines describing them.
4817 These lines are of the form:
4820 [-- Attachment #1: Description --]
4821 [-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
4824 Where the <literal>Description</literal> is the description or filename given for the
4825 attachment, and the <literal>Encoding</literal> is one of
4826 <literal>7bit/8bit/quoted-printable/base64/binary</literal>.
4830 If Mutt cannot deal with a MIME type, it will display a message like:
4833 [-- image/gif is unsupported (use 'v' to view this part) --]
4840 <sect2 id="attach-menu">
4841 <title>The Attachment Menu</title>
4844 The default binding for <literal>view-attachments</literal> is `v', which displays the
4845 attachment menu for a message. The attachment menu displays a list of
4846 the attachments in a message. From the attachment menu, you can save,
4847 print, pipe, delete, and view attachments. You can apply these
4848 operations to a group of attachments at once, by tagging the attachments
4849 and by using the ``tag-prefix'' operator. You can also reply to the
4850 current message from this menu, and only the current attachment (or the
4851 attachments tagged) will be quoted in your reply. You can view
4852 attachments as text, or view them using the mailcap viewer definition.
4856 Finally, you can apply the usual message-related functions (like
4857 <link linkend="resend-message">resend-message</link>, and the reply
4858 and forward functions) to attachments of type <literal>message/rfc822</literal>.
4862 See the help on the attachment menu for more information.
4867 <sect2 id="compose-menu">
4868 <title>The Compose Menu</title>
4871 The compose menu is the menu you see before you send a message. It
4872 allows you to edit the recipient list, the subject, and other aspects
4873 of your message. It also contains a list of the attachments of your
4874 message, including the main body. From this menu, you can print, copy,
4875 filter, pipe, edit, compose, review, and rename an attachment or a
4876 list of tagged attachments. You can also modifying the attachment
4877 information, notably the type, encoding and description.
4881 Attachments appear as follows:
4884 - 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0 <no description>
4885 2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz <no description>
4891 The '-' denotes that Mutt will delete the file after sending (or
4892 postponing, or canceling) the message. It can be toggled with the
4893 <literal>toggle-unlink</literal> command (default: u). The next field is the MIME
4894 content-type, and can be changed with the <literal>edit-type</literal> command
4895 (default: ˆT). The next field is the encoding for the attachment,
4896 which allows a binary message to be encoded for transmission on 7bit
4897 links. It can be changed with the <literal>edit-encoding</literal> command
4898 (default: ˆE). The next field is the size of the attachment,
4899 rounded to kilobytes or megabytes. The next field is the filename,
4900 which can be changed with the <literal>rename-file</literal> command (default: R).
4901 The final field is the description of the attachment, and can be
4902 changed with the <literal>edit-description</literal> command (default: d).
4909 <sect1 id="mime-types">
4910 <title>MIME Type configuration with <literal>mime.types</literal></title>
4913 When you add an attachment to your mail message, Mutt searches your
4914 personal mime.types file at <literal>${HOME}/.mime.types</literal>, and then
4915 the system mime.types file at <literal>/usr/local/share/mutt/mime.types</literal> or
4916 <literal>/etc/mime.types</literal>
4920 The mime.types file consist of lines containing a MIME type and a space
4921 separated list of extensions. For example:
4924 application/postscript ps eps
4926 audio/x-aiff aif aifc aiff
4929 A sample <literal>mime.types</literal> file comes with the Mutt distribution, and
4930 should contain most of the MIME types you are likely to use.
4934 If Mutt can not determine the mime type by the extension of the file you
4935 attach, it will look at the file. If the file is free of binary
4936 information, Mutt will assume that the file is plain text, and mark it
4937 as <literal>text/plain</literal>. If the file contains binary information, then Mutt will
4938 mark it as <literal>application/octet-stream</literal>. You can change the MIME
4939 type that Mutt assigns to an attachment by using the <literal>edit-type</literal>
4940 command from the compose menu (default: ˆT). The MIME type is actually a
4941 major mime type followed by the sub-type, separated by a '/'. 6 major
4942 types: application, text, image, video, audio, and model have been approved
4943 after various internet discussions. Mutt recognizes all of these if the
4944 appropriate entry is found in the mime.types file. It also recognizes other
4945 major mime types, such as the chemical type that is widely used in the
4946 molecular modeling community to pass molecular data in various forms to
4947 various molecular viewers. Non-recognized mime types should only be used
4948 if the recipient of the message is likely to be expecting such attachments.
4953 <sect1 id="mime-viewers">
4954 <title>MIME Viewer configuration with <literal>mailcap</literal></title>
4957 Mutt supports RFC 1524 MIME Configuration, in particular the Unix
4958 specific format specified in Appendix A of RFC 1524. This file format
4959 is commonly referred to as the mailcap format. Many MIME compliant
4960 programs utilize the mailcap format, allowing you to specify handling
4961 for all MIME types in one place for all programs. Programs known to
4962 use this format include Netscape, XMosaic, lynx and metamail.
4966 In order to handle various MIME types that Mutt can not handle
4967 internally, Mutt parses a series of external configuration files to
4968 find an external handler. The default search string for these files
4969 is a colon delimited list containing the following files:
4972 <listitem><para><literal>$HOME/.mailcap</literal></para></listitem>
4973 <listitem><para><literal>$PKGDATADIR/mailcap</literal></para></listitem>
4974 <listitem><para><literal>$SYSCONFDIR/mailcap</literal></para></listitem>
4975 <listitem><para><literal>/etc/mailcap</literal></para></listitem>
4976 <listitem><para><literal>/usr/etc/mailcap</literal></para></listitem>
4977 <listitem><para><literal>/usr/local/etc/mailcap</literal></para></listitem>
4980 where <literal>$HOME</literal> is your home directory. The
4981 <literal>$PKGDATADIR</literal> and the
4982 <literal>$SYSCONFDIR</literal> directories depend on where mutt
4983 is installed: the former is the default for shared data, the
4984 latter for system configuration files.
4988 The default search path can be obtained by running the following
4993 mutt -nF /dev/null -Q mailcap_path
4997 In particular, the metamail distribution will install a mailcap file,
4998 usually as <literal>/usr/local/etc/mailcap</literal>, which contains some baseline
5003 <title>The Basics of the mailcap file</title>
5006 A mailcap file consists of a series of lines which are comments, blank,
5011 A comment line consists of a # character followed by anything you want.
5015 A blank line is blank.
5019 A definition line consists of a content type, a view command, and any
5020 number of optional fields. Each field of a definition line is divided
5021 by a semicolon ';' character.
5025 The content type is specified in the MIME standard type/subtype method.
5027 <literal>text/plain, text/html, image/gif, </literal>
5028 etc. In addition, the mailcap format includes two formats for
5029 wildcards, one using the special '*' subtype, the other is the implicit
5030 wild, where you only include the major type. For example, <literal>image/*</literal>, or
5031 <literal>video,</literal> will match all image types and video types,
5036 The view command is a Unix command for viewing the type specified. There
5037 are two different types of commands supported. The default is to send
5038 the body of the MIME message to the command on stdin. You can change
5039 this behavior by using %s as a parameter to your view command.
5040 This will cause Mutt to save the body of the MIME message to a temporary
5041 file, and then call the view command with the %s replaced by
5042 the name of the temporary file. In both cases, Mutt will turn over the
5043 terminal to the view program until the program quits, at which time Mutt
5044 will remove the temporary file if it exists.
5048 So, in the simplest form, you can send a text/plain message to the
5049 external pager more on stdin:
5055 Or, you could send the message as a file:
5061 Perhaps you would like to use lynx to interactively view a text/html
5068 In this case, lynx does not support viewing a file from stdin, so you
5069 must use the %s syntax.
5070 <emphasis role="bold">Note:</emphasis> <emphasis>Some older versions of lynx contain a bug where they
5071 will check the mailcap file for a viewer for text/html. They will find
5072 the line which calls lynx, and run it. This causes lynx to continuously
5073 spawn itself to view the object.</emphasis>
5077 On the other hand, maybe you don't want to use lynx interactively, you
5078 just want to have it convert the text/html to text/plain, then you can
5082 text/html; lynx -dump %s | more
5088 Perhaps you wish to use lynx to view text/html files, and a pager on
5089 all other text formats, then you would use the following:
5096 This is the simplest form of a mailcap file.
5102 <title>Secure use of mailcap</title>
5105 The interpretation of shell meta-characters embedded in MIME parameters
5106 can lead to security problems in general. Mutt tries to quote parameters
5107 in expansion of %s syntaxes properly, and avoids risky characters by
5108 substituting them, see the <link linkend="mailcap-sanitize">$mailcap_sanitize</link> variable.
5112 Although mutt's procedures to invoke programs with mailcap seem to be
5113 safe, there are other applications parsing mailcap, maybe taking less care
5114 of it. Therefore you should pay attention to the following rules:
5118 <emphasis>Keep the %-expandos away from shell quoting.</emphasis>
5119 Don't quote them with single or double quotes. Mutt does this for
5120 you, the right way, as should any other program which interprets
5121 mailcap. Don't put them into backtick expansions. Be highly careful
5122 with eval statements, and avoid them if possible at all. Trying to fix
5123 broken behavior with quotes introduces new leaks - there is no
5124 alternative to correct quoting in the first place.
5128 If you have to use the %-expandos' values in context where you need
5129 quoting or backtick expansions, put that value into a shell variable
5130 and reference the shell variable where necessary, as in the following
5131 example (using <literal>$charset</literal> inside the backtick expansion is safe,
5132 since it is not itself subject to any further expansion):
5138 text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
5139 && test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
5147 <title>Advanced mailcap Usage</title>
5150 <title>Optional Fields</title>
5153 In addition to the required content-type and view command fields, you
5154 can add semi-colon ';' separated fields to set flags and other options.
5155 Mutt recognizes the following optional fields:
5159 <term>copiousoutput</term>
5162 This flag tells Mutt that the command passes possibly large amounts of
5163 text on stdout. This causes Mutt to invoke a pager (either the internal
5164 pager or the external pager defined by the pager variable) on the output
5165 of the view command. Without this flag, Mutt assumes that the command
5166 is interactive. One could use this to replace the pipe to <literal>more</literal>
5167 in the <literal>lynx -dump</literal> example in the Basic section:
5170 text/html; lynx -dump %s ; copiousoutput
5173 This will cause lynx to format the text/html output as text/plain
5174 and Mutt will use your standard pager to display the results.
5179 <term>needsterminal</term>
5182 Mutt uses this flag when viewing attachments with <link linkend="auto-view">auto_view</link>, in order to decide whether it should honor the setting
5183 of the <link linkend="wait-key">$wait_key</link> variable or
5184 not. When an attachment is viewed using an interactive program, and the
5185 corresponding mailcap entry has a <emphasis>needsterminal</emphasis> flag, Mutt will use
5186 <link linkend="wait-key">$wait_key</link> and the exit status
5187 of the program to decide if it will ask you to press a key after the
5188 external program has exited. In all other situations it will not prompt
5194 <term>compose=<command></term>
5197 This flag specifies the command to use to create a new attachment of a
5198 specific MIME type. Mutt supports this from the compose menu.
5203 <term>composetyped=<command></term>
5206 This flag specifies the command to use to create a new attachment of a
5207 specific MIME type. This command differs from the compose command in
5208 that mutt will expect standard MIME headers on the data. This can be
5209 used to specify parameters, filename, description, etc. for a new
5210 attachment. Mutt supports this from the compose menu.
5215 <term>print=<command></term>
5218 This flag specifies the command to use to print a specific MIME type.
5219 Mutt supports this from the attachment and compose menus.
5224 <term>edit=<command></term>
5227 This flag specifies the command to use to edit a specific MIME type.
5228 Mutt supports this from the compose menu, and also uses it to compose
5229 new attachments. Mutt will default to the defined editor for text
5235 <term>nametemplate=<template></term>
5238 This field specifies the format for the file denoted by %s in the
5239 command fields. Certain programs will require a certain file extension,
5240 for instance, to correctly view a file. For instance, lynx will only
5241 interpret a file as <literal>text/html</literal> if the file ends in <literal>.html</literal>.
5242 So, you would specify lynx as a <literal>text/html</literal> viewer with a line in
5243 the mailcap file like:
5246 text/html; lynx %s; nametemplate=%s.html
5253 <term>test=<command></term>
5256 This field specifies a command to run to test whether this mailcap
5257 entry should be used. The command is defined with the command expansion
5258 rules defined in the next section. If the command returns 0, then the
5259 test passed, and Mutt uses this entry. If the command returns non-zero,
5260 then the test failed, and Mutt continues searching for the right entry.
5261 <emphasis role="bold">Note:</emphasis> <emphasis>the content-type must match before Mutt performs the test.</emphasis>
5265 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
5269 In this example, Mutt will run the program RunningX which will return 0
5270 if the X Window manager is running, and non-zero if it isn't. If
5271 RunningX returns 0, then Mutt will call netscape to display the
5272 text/html object. If RunningX doesn't return 0, then Mutt will go on
5273 to the next entry and use lynx to display the text/html object.
5283 <title>Search Order</title>
5286 When searching for an entry in the mailcap file, Mutt will search for
5287 the most useful entry for its purpose. For instance, if you are
5288 attempting to print an <literal>image/gif</literal>, and you have the following
5289 entries in your mailcap file, Mutt will search for an entry with the
5294 image/gif; ; print= anytopnm %s | pnmtops | lpr; \
5298 Mutt will skip the <literal>image/*</literal> entry and use the <literal>image/gif</literal>
5299 entry with the print command.
5303 In addition, you can use this with <link linkend="auto-view">auto_view</link>
5304 to denote two commands for viewing an attachment, one to be viewed
5305 automatically, the other to be viewed interactively from the attachment
5306 menu. In addition, you can then use the test feature to determine which
5307 viewer to use interactively depending on your environment.
5310 text/html; netscape -remote 'openURL(%s)' ; test=RunningX
5311 text/html; lynx %s; nametemplate=%s.html
5312 text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput
5315 For <link linkend="auto-view">auto_view</link>, Mutt will choose the third
5316 entry because of the copiousoutput tag. For interactive viewing, Mutt
5317 will run the program RunningX to determine if it should use the first
5318 entry. If the program returns non-zero, Mutt will use the second entry
5319 for interactive viewing.
5325 <title>Command Expansion</title>
5328 The various commands defined in the mailcap files are passed to the
5329 <literal>/bin/sh</literal> shell using the system() function. Before the
5330 command is passed to <literal>/bin/sh -c</literal>, it is parsed to expand
5331 various special parameters with information from Mutt. The keywords
5336 <term>%s</term>
5339 As seen in the basic mailcap section, this variable is expanded
5340 to a filename specified by the calling program. This file contains
5341 the body of the message to view/print/edit or where the composing
5342 program should place the results of composition. In addition, the
5343 use of this keyword causes Mutt to not pass the body of the message
5344 to the view/print/edit program on stdin.
5349 <term>%t</term>
5352 Mutt will expand %t to the text representation of the content
5353 type of the message in the same form as the first parameter of the
5354 mailcap definition line, ie <literal>text/html</literal> or
5355 <literal>image/gif</literal>.
5360 <term>%{<parameter>}</term>
5363 Mutt will expand this to the value of the specified parameter
5364 from the Content-Type: line of the mail message. For instance, if
5365 Your mail message contains:
5368 Content-Type: text/plain; charset=iso-8859-1
5371 then Mutt will expand %{charset} to iso-8859-1. The default metamail
5372 mailcap file uses this feature to test the charset to spawn an xterm
5373 using the right charset to view the message.
5378 <term>\%</term>
5381 This will be replaced by a %
5386 Mutt does not currently support the %F and %n keywords
5387 specified in RFC 1524. The main purpose of these parameters is for
5388 multipart messages, which is handled internally by Mutt.
5396 <title>Example mailcap files</title>
5399 This mailcap file is fairly simple and standard:
5402 # I'm always running X :)
5403 video/*; xanim %s > /dev/null
5404 image/*; xv %s > /dev/null
5406 # I'm always running netscape (if my computer had more memory, maybe)
5407 text/html; netscape -remote 'openURL(%s)'
5413 This mailcap file shows quite a number of examples:
5419 # Use xanim to view all videos Xanim produces a header on startup,
5420 # send that to /dev/null so I don't see it
5421 video/*; xanim %s > /dev/null
5423 # Send html to a running netscape by remote
5424 text/html; netscape -remote 'openURL(%s)'; test=RunningNetscape
5426 # If I'm not running netscape but I am running X, start netscape on the
5428 text/html; netscape %s; test=RunningX
5430 # Else use lynx to view it as text
5433 # This version would convert the text/html to text/plain
5434 text/html; lynx -dump %s; copiousoutput
5436 # I use enscript to print text in two columns to a page
5437 text/*; more %s; print=enscript -2Gr %s
5439 # Netscape adds a flag to tell itself to view jpegs internally
5440 image/jpeg;xv %s; x-mozilla-flags=internal
5442 # Use xv to view images if I'm running X
5443 # In addition, this uses the \ to extend the line and set my editor
5445 image/*;xv %s; test=RunningX; \
5448 # Convert images to text using the netpbm tools
5449 image/*; (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
5450 pbmtoascii -1x2 ) 2>&1 ; copiousoutput
5452 # Send excel spreadsheets to my NT box
5453 application/ms-excel; open.pl %s
5462 <sect1 id="auto-view">
5463 <title>MIME Autoview</title>
5466 In addition to explicitly telling Mutt to view an attachment with the
5467 MIME viewer defined in the mailcap file, Mutt has support for
5468 automatically viewing MIME attachments while in the pager.
5472 To work, you must define a viewer in the mailcap file which uses the
5473 <literal>copiousoutput</literal> option to denote that it is non-interactive.
5474 Usually, you also use the entry to convert the attachment to a text
5475 representation which you can view in the pager.
5479 You then use the <literal>auto_view</literal> muttrc command to list the
5480 content-types that you wish to view automatically.
5484 For instance, if you set auto_view to:
5487 auto_view text/html application/x-gunzip \
5488 application/postscript image/gif application/x-tar-gz
5494 Mutt could use the following mailcap entries to automatically view
5495 attachments of these types.
5498 text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
5499 image/*; anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | \
5500 pgmtopbm | pbmtoascii ; copiousoutput
5501 application/x-gunzip; gzcat; copiousoutput
5502 application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
5503 application/postscript; ps2ascii %s; copiousoutput
5509 ``unauto_view'' can be used to remove previous entries from the autoview list.
5510 This can be used with message-hook to autoview messages based on size, etc.
5511 ``unauto_view *'' will remove all previous entries.
5516 <sect1 id="alternative-order">
5517 <title>MIME Multipart/Alternative</title>
5520 Mutt has some heuristics for determining which attachment of a
5521 multipart/alternative type to display. First, mutt will check the
5522 alternative_order list to determine if one of the available types
5523 is preferred. The alternative_order list consists of a number of
5524 mimetypes in order, including support for implicit and explicit
5525 wildcards, for example:
5528 alternative_order text/enriched text/plain text application/postscript image/*
5534 Next, mutt will check if any of the types have a defined
5535 <link linkend="auto-view">auto_view</link>, and use that. Failing
5536 that, Mutt will look for any text type. As a last attempt, mutt will
5537 look for any type it knows how to handle.
5541 To remove a MIME type from the <literal>alternative_order</literal> list, use the
5542 <literal>unalternative_order</literal> command.
5547 <sect1 id="attachments">
5548 <title>Attachment Searching and Counting</title>
5551 If you ever lose track of attachments in your mailboxes, Mutt's
5552 attachment-counting and -searching support might be for you. You can
5553 make your message index display the number of qualifying attachments in
5554 each message, or search for messages by attachment count. You also can
5555 configure what kinds of attachments qualify for this feature with the
5556 attachments and unattachments commands.
5560 In order to provide this information, mutt needs to fully MIME-parse
5561 all messages affected first. This can slow down operation especially for
5562 remote mail folders such as IMAP because all messages have to be
5563 downloaded first regardless whether the user really wants to view them
5571 attachments {+|-}disposition mime-type
5572 unattachments {+|-}disposition mime-type
5577 Disposition is the attachment's Content-disposition type -- either
5578 "inline" or "attachment". You can abbreviate this to I or A.
5582 Disposition is prefixed by either a + symbolor a - symbol. If it's
5583 a +, you're saying that you want to allow this disposition and MIME
5584 type to qualify. If it's a -, you're saying that this disposition
5585 and MIME type is an exception to previous + rules. There are examples
5586 below of how this is useful.
5590 Mime-type is, unsurprisingly, the MIME type of the attachment you want
5591 to affect. A MIME type is always of the format "major/minor", where
5592 "major" describes the broad category of document you're looking at, and
5593 "minor" describes the specific type within that category. The major
5594 part of mim-type must be literal text (or the special token "*"), but
5595 the minor part may be a regular expression. (Therefore, "*/.*" matches
5600 The MIME types you give to the attachments directive are a kind of
5601 pattern. When you use the attachments directive, the patterns you
5602 specify are added to a list. When you use unattachments, the pattern
5603 is removed from the list. The patterns are not expanded and matched
5604 to specific MIME types at this time -- they're just text in a list.
5605 They're only matched when actually evaluating a message.
5609 Some examples might help to illustrate. The examples that are not
5610 commented out define the default configuration of the lists.
5614 ## Removing a pattern from a list removes that pattern literally. It
5615 ## does not remove any type matching the pattern.
5617 ## attachments +A */.*
5618 ## attachments +A image/jpeg
5619 ## unattachments +A */.*
5621 ## This leaves "attached" image/jpeg files on the allowed attachments
5622 ## list. It does not remove all items, as you might expect, because the
5623 ## second */.* is not a matching expression at this time.
5625 ## Remember: "unattachments" only undoes what "attachments" has done!
5626 ## It does not trigger any matching on actual messages.
5629 ## Qualify any MIME part with an "attachment" disposition, EXCEPT for
5630 ## text/x-vcard and application/pgp parts. (PGP parts are already known
5631 ## to mutt, and can be searched for with ~g, ~G, and ~k.)
5633 ## I've added x-pkcs7 to this, since it functions (for S/MIME)
5634 ## analogously to PGP signature attachments. S/MIME isn't supported
5635 ## in a stock mutt build, but we can still treat it specially here.
5638 attachments -A text/x-vcard application/pgp.*
5639 attachments -A application/x-pkcs7-.*
5641 ## Discount all MIME parts with an "inline" disposition, unless they're
5642 ## text/plain. (Why inline a text/plain part unless it's external to the
5645 attachments +I text/plain
5647 ## These two lines make Mutt qualify MIME containers. (So, for example,
5648 ## a message/rfc822 forward will count as an attachment.) The first
5649 ## line is unnecessary if you already have "attach-allow */.*", of
5650 ## course. These are off by default! The MIME elements contained
5651 ## within a message/* or multipart/* are still examined, even if the
5652 ## containers themseves don't qualify.
5654 #attachments +A message/.* multipart/.*
5655 #attachments +I message/.* multipart/.*
5657 ## You probably don't really care to know about deleted attachments.
5658 attachments -A message/external-body
5659 attachments -I message/external-body
5663 "attachments ?" will list your current settings in Muttrc format, so
5664 that it can be pasted elsewhere.
5669 <sect1 id="mime-lookup">
5670 <title>MIME Lookup</title>
5673 Mutt's mime_lookup list specifies a list of mime-types that should not
5674 be treated according to their mailcap entry. This option is designed to
5675 deal with binary types such as application/octet-stream. When an attachment's
5676 mime-type is listed in mime_lookup, then the extension of the filename will
5677 be compared to the list of extensions in the mime.types file. The mime-type
5678 associated with this extension will then be used to process the attachment
5679 according to the rules in the mailcap file and according to any other configuration
5680 options (such as auto_view) specified. Common usage would be:
5683 mime_lookup application/octet-stream application/X-Lotus-Manuscript
5689 In addition, the unmime_lookup command may be used to disable this feature
5690 for any particular mime-type if it had been set, for example, in a global
5698 <chapter id="optionalfeatures">
5699 <title>Optional features</title>
5702 <title>General notes</title>
5705 <title>Enabling/disabling features</title>
5708 Mutt supports several of optional features which can be enabled or
5709 disabled at compile-time by giving the <emphasis>configure</emphasis> script
5710 certain arguments. These are listed in the ``Optional features'' section of
5711 the <emphasis>configure --help</emphasis> output.
5715 Which features are enabled or disabled can later be determined from the
5716 output of <literal>mutt -v</literal>. If a compile option starts with
5717 ``+'' it is enabled and disabled if prefixed with ``-''. For example, if
5718 mutt was compiled using GnuTLS for encrypted communication instead of
5719 OpenSSL, <literal>mutt -v</literal> would contain:
5723 -USE_SSL_OPENSSL +USE_SSL_GNUTLS</screen>
5727 <sect2 id="url-syntax">
5728 <title>URL syntax</title>
5731 Mutt optionally supports the IMAP, POP3 and SMTP protocols which require
5732 to access servers using URLs. The canonical syntax for specifying URLs
5733 in mutt is (an item enclosed in <literal>[]</literal> means it is optional and
5738 proto[s]://[username[:password]@]server[:port]/[path]
5742 <literal>proto</literal> is the communication protocol:
5743 <literal>imap</literal> for IMAP, <literal>pop</literal> for POP3 and
5744 <literal>smtp</literal> for SMTP. If ``s'' for ``secure communication''
5745 is appended, mutt will attempt to establish an encrypted communication
5746 using SSL or TLS. If no explicit port is given, mutt will use the
5747 system's default for the given protocol.
5751 Since all protocols by mutt support authentication, the username may be
5752 given directly in the URL instead of using the <literal>pop_user</literal> or
5753 <literal>imap_user</literal> variables. A password can be given, too but
5754 is not recommended if the URL is specified in a configuration file on
5759 The optional path is only relevant for IMAP.
5763 For IMAP for example, you can select an alternative port by specifying it with the
5764 server: <literal>imap://imapserver:port/INBOX</literal>. You can also specify different
5765 username for each folder: <literal>imap://username@imapserver[:port]/INBOX</literal>
5766 or <literal>imap://username2@imapserver[:port]/path/to/folder</literal>.
5767 Replacing <literal>imap://</literal> by <literal>imaps://</literal>
5768 would make mutt attempt to conect using SSL or TLS on a different port
5769 to encrypt the communication.
5777 <title>SSL/TLS Support</title>
5780 If mutt is compiled with IMAP, POP3 and/or SMTP support, it can also be
5781 compiled with support for SSL or TLS using either OpenSSL or GnuTLS (
5782 by running the <emphasis>configure</emphasis> script with the
5783 <emphasis>--enable-ssl=...</emphasis> option for OpenSSL or
5784 <emphasis>--enable-gnutls=...</emphasis> for GnuTLS). Mutt can then
5785 attempt to encrypt communication with remote servers if these protocols
5786 are suffixed with ``s'' for ``secure communication''.
5792 <title>POP3 Support</title>
5795 If Mutt was compiled with POP3 support (by running the <emphasis>configure</emphasis>
5796 script with the <emphasis>--enable-pop</emphasis> flag), it has the ability to work
5797 with mailboxes located on a remote POP3 server and fetch mail for local
5802 Remote POP3 servers can be accessed using URLs with the <literal>pop</literal> protocol
5803 for unencrypted and <literal>pops</literal> for encrypted
5804 communication, see <xref linkend="url-syntax"/> for details.
5808 Polling for new mail is more expensive over POP3 than locally. For this
5809 reason the frequency at which Mutt will check for mail remotely can be
5811 <link linkend="pop-checkinterval">$pop_checkinterval</link>
5812 variable, which defaults to every 60 seconds.
5816 Another way to access your POP3 mail is the <emphasis>fetch-mail</emphasis> function
5817 (default: G). It allows to connect to <link linkend="pop-host">$pop_host</link>, fetch all your new mail and place it in the
5818 local <link linkend="spoolfile">$spoolfile</link>. After this
5819 point, Mutt runs exactly as if the mail had always been local.
5823 <emphasis role="bold">Note:</emphasis> If you only need to fetch all messages to a
5824 local mailbox you should consider using a specialized program, such as
5825 <literal>fetchmail</literal>, <literal>getmail</literal> or similar.
5831 <title>IMAP Support</title>
5834 If Mutt was compiled with IMAP support (by running the <emphasis>configure</emphasis>
5835 script with the <emphasis>--enable-imap</emphasis> flag), it has the ability to work
5836 with folders located on a remote IMAP server.
5840 You can access the remote inbox by selecting the folder by its URL
5841 (see <xref linkend="url-syntax"/> for details) using the
5842 <literal>imap</literal> or <literal>imaps</literal> protocol.
5843 Alternatively, a pine-compatible notation is also supported, ie
5844 <literal>{[username@]imapserver[:port][/ssl]}path/to/folder</literal>
5848 Note that not all servers use ``/'' as the hierarchy separator. Mutt should
5849 correctly notice which separator is being used by the server and convert
5854 When browsing folders on an IMAP server, you can toggle whether to look
5855 at only the folders you are subscribed to, or all folders with the
5856 <emphasis>toggle-subscribed</emphasis> command. See also the
5857 <link linkend="imap-list-subscribed">$imap_list_subscribed</link> variable.
5861 Polling for new mail on an IMAP server can cause noticeable delays. So, you'll
5862 want to carefully tune the
5863 <link linkend="mail-check">$mail_check</link>
5865 <link linkend="timeout">$timeout</link>
5866 variables. Personally I use
5873 with relatively good results over my slow modem line.
5877 Note that if you are using mbox as the mail store on UW servers prior to
5878 v12.250, the server has been reported to disconnect a client if another client
5879 selects the same folder.
5883 <title>The Folder Browser</title>
5886 As of version 1.2, mutt supports browsing mailboxes on an IMAP
5887 server. This is mostly the same as the local file browser, with the
5888 following differences:
5894 In lieu of file permissions, mutt displays the string "IMAP",
5895 possibly followed by the symbol "+", indicating
5896 that the entry contains both messages and subfolders. On
5897 Cyrus-like servers folders will often contain both messages and
5904 For the case where an entry can contain both messages and
5905 subfolders, the selection key (bound to <literal>enter</literal> by default)
5906 will choose to descend into the subfolder view. If you wish to view
5907 the messages in that folder, you must use <literal>view-file</literal> instead
5908 (bound to <literal>space</literal> by default).
5914 You can create, delete and rename mailboxes with the
5915 <literal>create-mailbox</literal>, <literal>delete-mailbox</literal>, and
5916 <literal>rename-mailbox</literal> commands (default bindings: <literal>C</literal>,
5917 <literal>d</literal> and <literal>r</literal>, respectively). You may also
5918 <literal>subscribe</literal> and <literal>unsubscribe</literal> to mailboxes (normally
5919 these are bound to <literal>s</literal> and <literal>u</literal>, respectively).
5930 <title>Authentication</title>
5933 Mutt supports four authentication methods with IMAP servers: SASL,
5934 GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
5935 NTLM authentication for you poor exchange users out there, but it has
5936 yet to be integrated into the main tree). There is also support for
5937 the pseudo-protocol ANONYMOUS, which allows you to log in to a public
5938 IMAP server without having an account. To use ANONYMOUS, simply make
5939 your username blank or "anonymous".
5943 SASL is a special super-authenticator, which selects among several protocols
5944 (including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the most secure
5945 method available on your host and the server. Using some of these methods
5946 (including DIGEST-MD5 and possibly GSSAPI), your entire session will be
5947 encrypted and invisible to those teeming network snoops. It is the best
5948 option if you have it. To use it, you must have the Cyrus SASL library
5949 installed on your system and compile mutt with the <emphasis>--with-sasl</emphasis> flag.
5953 Mutt will try whichever methods are compiled in and available on the server,
5954 in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5, LOGIN.
5958 There are a few variables which control authentication:
5964 <link linkend="imap-user">$imap_user</link> - controls
5965 the username under which you request authentication on the IMAP server,
5966 for all authenticators. This is overridden by an explicit username in
5967 the mailbox path (ie by using a mailbox name of the form
5968 <literal>{user@host}</literal>).
5974 <link linkend="imap-pass">$imap_pass</link> - a
5975 password which you may preset, used by all authentication methods where
5976 a password is needed.
5982 <link linkend="imap-authenticators">$imap_authenticators</link> - a colon-delimited list of IMAP
5983 authentication methods to try, in the order you wish to try them. If
5984 specified, this overrides mutt's default (attempt everything, in the order
5998 <title>SMTP Support</title>
6001 Besides supporting traditional mail delivery through a
6002 sendmail-compatible program, mutt supports delivery through SMTP if it
6003 was configured and built with <literal>--enable-smtp</literal>.
6007 If the configuration variable
6008 <link linkend="smtp-url">$smtp_url</link> is set, mutt
6009 will contact the given SMTP server to deliver messages; if it is unset,
6010 mutt will use the program specified by <link linkend="sendmail">$sendmail</link>.
6014 For details on the URL syntax, please see <xref linkend="url-syntax"/>.
6018 The built-in SMTP support supports encryption (the <literal>smtps</literal> protocol
6019 using SSL or TLS) as well as SMTP authentication using SASL. The authentication mechanisms
6020 for SASL are specified in <link linkend="smtp-authenticators">$smtp_authenticators</link>
6021 defaulting to an empty list which makes mutt try all available methods
6022 from most-secure to least-secure.
6027 <sect1 id="account-hook">
6028 <title>Managing multiple accounts</title>
6031 If you happen to have accounts on multiple IMAP, POP and/or SMTP servers,
6032 you may find managing all the authentication settings inconvenient and
6033 error-prone. The account-hook command may help. This hook works like
6034 folder-hook but is invoked whenever you access a remote mailbox
6035 (including inside the folder browser), not just when you open the
6046 account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
6047 account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
6048 account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'
6049 account-hook smtp://user@host3/ 'set tunnel="ssh host3 /usr/libexec/smtpd"'
6056 <sect1 id="caching">
6057 <title>Local caching</title>
6060 Mutt contains two types of local caching: <emphasis>(1)</emphasis>
6061 the so-called ``header caching'' and <emphasis>(2)</emphasis> the
6062 so-called ``body caching'' which are both described in this section.
6066 Header caching is optional as it depends on external libraries, body
6067 caching is always enabled if mutt is compiled with POP and/or IMAP
6068 support as these use it (body caching requires no external library).
6071 <sect2 id="header-caching">
6072 <title>Header caching</title>
6075 Mutt provides optional support for caching message headers for the
6076 following types of folders: IMAP, POP, Maildir and MH. Header caching
6077 greatly improves speed because for remote folders, headers
6078 usually only need to be downloaded once. For Maildir and MH, reading the
6079 headers from a single file is much faster than looking at possibly
6080 thousands of single files (since Maildir and MH use one file per message.)
6084 Header caching can be enabled via the configure script and the
6085 <emphasis>--enable-hcache</emphasis> option. It's not turned on
6086 by default because external database libraries are required: one
6087 of qdbm, gdbm or bdb must be present.
6092 linkend="header-cache">$header_cache</link> can be
6093 used to either point to a file or a directory. If set to point to
6094 a file, one database file for all folders will be used (which may
6095 result in lower performance), but one file per folder if it points
6100 For the one-file-per-folder case, database files for remote folders
6101 will be named according to their URL while database files for local
6102 folders will be named by the MD5 checksums of their path. These database
6103 files may be safely removed if a system is short on space. You
6104 can compute the name of the header cache file for a particular local folder
6105 through a command like the following:
6110 $ printf '%s' '/path/to/folder' | md5sum
6115 The <literal>md5sum</literal> command may also be
6116 named <literal>md5</literal>, depending on your operating system.
6121 <sect2 id="body-caching">
6122 <title>Body caching</title>
6125 Both cache methods can be combined using the same directory for storage
6126 (and for IMAP/POP even provide meaningful file names) which simplifies
6127 manual maintenance tasks.
6132 In addition to caching message headers only, mutt can also cache
6133 whole message bodies. This results in faster display of messages
6134 for POP and IMAP folders because messages usually have to be
6135 downloaded only once.
6139 For configuration, the variable <link linkend="message-cachedir"
6140 >$message_cachedir</link> must point to a
6141 directory. There, mutt will create a hierarchy of subdirectories
6142 named like: <literal>proto:user@hostname</literal> where
6143 <literal>proto</literal> is either ``pop'' or ``imap.'' Within
6144 there for each folder, mutt stores messages in single files (just
6145 like Maildir) so that with manual symlink creation these cache
6146 directories can be examined with mutt as read-only Maildir folders.
6150 All files can be removed as needed if the consumed disk space
6151 becomes an issue as mutt will silently fetch missing items again.
6156 <sect2 id="maint-cache">
6157 <title>Maintenance</title>
6160 Mutt does not (yet) support maintenance features for header cache
6161 database files so that files have to be removed in case they grow too
6162 big. It depends on the database library used for header caching whether
6163 disk space freed by removing messages is re-used.
6167 For body caches, mutt can keep the local cache in sync with the
6168 remote mailbox if the
6169 <link linkend="message-cache-clean">$message_cache_clean</link>
6170 variable is set. Cleaning means to remove messages from the cache which
6171 are no longer present in the mailbox which only happens when other mail
6172 clients or instances of mutt using a different body cache location
6173 delete messages (Mutt itself removes deleted messages from the cache
6174 when syncing a mailbox). As cleaning can take a noticeable amount of time,
6175 it should not be set in general but only occasionally.
6182 <sect1 id="exact-address">
6183 <title>Exact address generation</title>
6186 Mutt supports the ``Name <user@host>'' address syntax for reading and
6187 writing messages, the older ``user@host (Name)'' syntax is only supported when
6188 reading messages. The <emphasis>--enable-exact-address</emphasis>
6189 switch can be given to configure to build it with write-support
6190 for the latter syntax. <literal>EXACT_ADDRESS</literal> in the output of
6191 <literal>mutt -v</literal> indicates whether it's supported.
6198 <chapter id="tuning">
6199 <title>Performance tuning</title>
6201 <sect1 id="tuning-mailboxes">
6202 <title>Reading and writing mailboxes</title>
6205 Mutt's performance when reading mailboxes can be improved in two ways:
6211 For remote folders (IMAP and POP) as well as folders using
6212 one-file-per message storage (Maildir and MH), mutt's
6213 performance can be greatly improved using
6214 <link linkend="header-caching">header caching</link>.
6215 Using a single database per folder may further increase
6219 Mutt provides the <link linkend="read-inc">$read_inc</link>
6220 and <link linkend="write-inc">$write_inc</link>
6221 variables to specify at which rate to update progress
6222 counters. If these values are too low, mutt may spend more
6223 time on updating the progress counter than it spends on
6224 actually reading/writing folders.
6227 For example, when opening a maildir folder with a few
6228 thousand messages, the default value for
6229 <link linkend="read-inc">$read_inc</link>
6230 may be too low. It can be tuned on on a folder-basis using
6231 <link linkend="folder-hook">folder-hooks</link>:
6234 # use very high $read_inc to speed up reading hcache'd maildirs
6235 folder-hook . 'set read_inc=1000'
6236 # use lower value for reading slower remote IMAP folders
6237 folder-hook ^imap 'set read_inc=100'
6238 # use even lower value for reading even slower remote POP folders
6239 folder-hook ^pop 'set read_inc=1'</screen>
6245 <para>These settings work on a per-message basis. However, as messages may
6246 greatly differ in size and certain operations are much faster than others,
6247 even per-folder settings of the increment variables may not be
6248 desirable as they produce either too few or too much progress updates.
6249 Thus, Mutt allows to limit the number of progress updates per second it'll
6250 actually send to the terminal using the
6251 <link linkend="time-inc">$time_inc</link> variable.</para>
6255 <sect1 id="tuning-messages">
6256 <title>Reading messages from remote folders</title>
6259 Reading messages from remote folders such as IMAP an POP can be
6260 slow especially for large mailboxes since mutt only caches a very
6261 limited number of recently viewed messages (usually 10) per
6262 session (so that it will be gone for the next session.)
6266 To improve performance and permanently cache whole messages,
6267 please refer to mutt's so-called
6268 <link linkend="body-caching">body caching</link> for details.
6273 <sect1 id="tuning-search">
6274 <title>Searching and limiting</title>
6277 When searching mailboxes either via a search or a limit action, for
6278 some patterns mutt distinguishes between regular expression and string
6279 searches. For regular expressions, patterns are prefixed with
6280 ``˜'' and with ``='' for string searches.
6284 Even though a regular expression search is fast, it's several times
6285 slower than a pure string search which is noticable especially on large
6286 folders. As a consequence, a string search should be used instead of a
6287 regular expression search if the user already knows enough about the
6292 For example, when limiting a large folder to all messages sent to or by
6293 an author, it's much faster to search for the initial part of an e-mail
6294 address via <literal>=Luser@</literal> instead of
6295 <literal>˜Luser@</literal>. This is especially true for searching
6296 message bodies since a larger amount of input has to be searched.
6300 Please note that string search is an exact case-sensitive search
6301 while a regular expression search with only lower-case letters performs
6302 a case-insensitive search.
6309 <chapter id="reference">
6310 <title>Reference</title>
6312 <sect1 id="commandline">
6313 <title>Command line options</title>
6316 Running <literal>mutt</literal> with no arguments will make Mutt attempt to read your spool
6317 mailbox. However, it is possible to read other mailboxes and
6318 to send messages from the command line as well.
6324 <title>Command line options</title>
6327 <row><entry>Option</entry><entry>Description</entry></row>
6330 <row><entry>-A</entry><entry>expand an alias</entry></row>
6331 <row><entry>-a</entry><entry>attach a file to a message</entry></row>
6332 <row><entry>-b</entry><entry>specify a blind carbon-copy (BCC) address</entry></row>
6333 <row><entry>-c</entry><entry>specify a carbon-copy (Cc) address</entry></row>
6334 <row><entry>-D</entry><entry>print the value of all mutt variables to stdout</entry></row>
6335 <row><entry>-e</entry><entry>specify a config command to be run after initialization files are read</entry></row>
6336 <row><entry>-f</entry><entry>specify a mailbox to load</entry></row>
6337 <row><entry>-F</entry><entry>specify an alternate file to read initialization commands</entry></row>
6338 <row><entry>-h</entry><entry>print help on command line options</entry></row>
6339 <row><entry>-H</entry><entry>specify a draft file from which to read a header and body</entry></row>
6340 <row><entry>-i</entry><entry>specify a file to include in a message composition</entry></row>
6341 <row><entry>-m</entry><entry>specify a default mailbox type</entry></row>
6342 <row><entry>-n</entry><entry>do not read the system Muttrc</entry></row>
6343 <row><entry>-p</entry><entry>recall a postponed message</entry></row>
6344 <row><entry>-Q</entry><entry>query a configuration variable</entry></row>
6345 <row><entry>-R</entry><entry>open mailbox in read-only mode</entry></row>
6346 <row><entry>-s</entry><entry>specify a subject (enclose in quotes if it contains spaces)</entry></row>
6347 <row><entry>-v</entry><entry>show version number and compile-time definitions</entry></row>
6348 <row><entry>-x</entry><entry>simulate the mailx(1) compose mode</entry></row>
6349 <row><entry>-y</entry><entry>show a menu containing the files specified by the mailboxes command</entry></row>
6350 <row><entry>-z</entry><entry>exit immediately if there are no messages in the mailbox</entry></row>
6351 <row><entry>-Z</entry><entry>open the first folder with new message,exit immediately if none</entry></row>
6359 To read messages in a mailbox
6363 <literal>mutt</literal> [ -nz ] [ -F <emphasis>muttrc</emphasis> ] [ -m <emphasis>type</emphasis> ] [ -f <emphasis>mailbox</emphasis> ]
6367 To compose a new message
6371 <literal>mutt</literal> [ -n ] [ -F <emphasis>muttrc</emphasis> ] [ -a <emphasis>file</emphasis> ] [ -c <emphasis>address</emphasis> ] [ -i <emphasis>filename</emphasis> ] [ -s <emphasis>subject</emphasis> ]
6372 [ [ <emphasis>file</emphasis> ... ] -- ] <emphasis>address</emphasis> [ <emphasis>address</emphasis> ... ]
6376 Mutt also supports a ``batch'' mode to send prepared messages. Simply redirect
6377 input from the file you wish to send. For example,
6381 <literal>mutt -s "data set for run #2" professor@bigschool.edu
6382 < ˜/run2.dat</literal>
6386 This command will send a message to ``professor@bigschool.edu'' with a subject
6387 of ``data set for run #2''. In the body of the message will be the contents
6388 of the file ``˜/run2.dat''.
6392 All files passed with -a <emphasis>file</emphasis> will be attached as a MIME
6393 part to the message. To attach several files, use ``--'' to separate files and
6394 recipient addresses: <literal>mutt -a *.png -- some@one.org</literal>
6399 <sect1 id="commands">
6400 <title>Configuration Commands</title>
6403 The following are the commands understood by mutt.
6412 <literal><link linkend="account-hook">account-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
6418 <literal><link linkend="alias">alias</link></literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>key</emphasis> <emphasis>address</emphasis> [ , <emphasis>address</emphasis>, ... ]
6424 <literal><link linkend="alias">unalias</link></literal> [ * | <emphasis>key</emphasis> ... ]
6430 <literal><link linkend="alternates">alternates</link></literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
6436 <literal><link linkend="alternates">unalternates</link></literal> [ * | <emphasis>regexp</emphasis> ... ]
6442 <literal><link linkend="alternative-order">alternative-order</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
6448 <literal><link linkend="alternative-order">unalternative-order</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
6454 <literal><link linkend="auto-view">auto_view</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
6460 <literal><link linkend="auto-view">unauto_view</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
6466 <literal><link linkend="bind">bind</link></literal> <emphasis>map</emphasis> <emphasis>key</emphasis> <emphasis>function</emphasis>
6472 <literal><link linkend="charset-hook">charset-hook</link></literal> <emphasis>alias</emphasis> <emphasis>charset</emphasis>
6478 <literal><link linkend="charset-hook">iconv-hook</link></literal> <emphasis>charset</emphasis> <emphasis>local-charset</emphasis>
6484 <literal><link linkend="color">color</link></literal> <emphasis>object</emphasis> <emphasis>foreground</emphasis> <emphasis>background</emphasis> [ <emphasis>regexp</emphasis> ]
6490 <literal><link linkend="color">uncolor</link></literal> <emphasis>index</emphasis> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
6496 <literal><link linkend="exec">exec</link></literal> <emphasis>function</emphasis> [ <emphasis>function</emphasis> ... ]
6502 <literal><link linkend="fcc-hook">fcc-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
6508 <literal><link linkend="fcc-save-hook">fcc-save-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
6514 <literal><link linkend="folder-hook">folder-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
6520 <literal><link linkend="hdr-order">hdr_order</link></literal> <emphasis>header</emphasis> [ <emphasis>header</emphasis> ... ]
6526 <literal><link linkend="hdr-order">unhdr_order</link></literal> <emphasis>header</emphasis> [ <emphasis>header</emphasis> ... ]
6532 <literal><link linkend="ignore">ignore</link></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
6538 <literal><link linkend="ignore">unignore</link></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
6544 <literal><link linkend="lists">lists</link></literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
6550 <literal><link linkend="lists">unlists</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
6556 <literal><link linkend="macro">macro</link></literal> <emphasis>menu</emphasis> <emphasis>key</emphasis> <emphasis>sequence</emphasis> [ <emphasis>description</emphasis> ]
6562 <literal><link linkend="mailboxes">mailboxes</link></literal> <emphasis>filename</emphasis> [ <emphasis>filename</emphasis> ... ]
6568 <literal><link linkend="mbox-hook">mbox-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>mailbox</emphasis>
6574 <literal><link linkend="message-hook">message-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
6580 <literal><link linkend="mime-lookup">mime_lookup</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
6586 <literal><link linkend="mime-lookup">unmime_lookup</link></literal> <emphasis>mimetype</emphasis> [ <emphasis>mimetype</emphasis> ... ]
6592 <literal><link linkend="color">mono</link></literal> <emphasis>object attribute</emphasis> [ <emphasis>regexp</emphasis> ]
6598 <literal><link linkend="color">unmono</link></literal> <emphasis>index</emphasis> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
6604 <literal><link linkend="my-hdr">my_hdr</link></literal> <emphasis>string</emphasis>
6610 <literal><link linkend="my-hdr">unmy_hdr</link></literal> <emphasis>field</emphasis> [ <emphasis>field</emphasis> ... ]
6616 <literal><link linkend="crypt-hook">crypt-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>key-id</emphasis>
6622 <literal><link linkend="push">push</link></literal> <emphasis>string</emphasis>
6628 <literal><link linkend="set">reset</link></literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
6634 <literal><link linkend="save-hook">save-hook</link></literal> <emphasis>regexp</emphasis> <emphasis>filename</emphasis>
6640 <literal><link linkend="score-command">score</link></literal> <emphasis>pattern</emphasis> <emphasis>value</emphasis>
6646 <literal><link linkend="score-command">unscore</link></literal> <emphasis>pattern</emphasis> [ <emphasis>pattern</emphasis> ... ]
6652 <literal><link linkend="send-hook">reply-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
6658 <literal><link linkend="send-hook">send-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
6664 <literal><link linkend="send-hook">send2-hook</link></literal> <emphasis>pattern</emphasis> <emphasis>command</emphasis>
6670 <literal><link linkend="set">set</link></literal> [no|inv]<emphasis>variable</emphasis>[=<emphasis>value</emphasis>] [ <emphasis>variable</emphasis> ... ]
6676 <literal><link linkend="set">unset</link></literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
6682 <literal><link linkend="source">source</link></literal> <emphasis>filename</emphasis>
6688 <literal><link linkend="spam">spam</link></literal> <emphasis>pattern</emphasis> <emphasis>format</emphasis>
6694 <literal><link linkend="spam">nospam</link></literal> <emphasis>pattern</emphasis>
6700 <literal><link linkend="lists">subscribe</link></literal> [ <literal>-group</literal> <emphasis>name</emphasis> [ ... ] ] <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
6706 <literal><link linkend="lists">unsubscribe</link></literal> <emphasis>regexp</emphasis> [ <emphasis>regexp</emphasis> ... ]
6712 <literal><link linkend="set">toggle</link></literal> <emphasis>variable</emphasis> [<emphasis>variable</emphasis> ... ]
6718 <literal><link linkend="unhook">unhook</link></literal> <emphasis>hook-type</emphasis>
6728 <sect1 id="variables">
6729 <title>Configuration variables</title>