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 <quote>All mail clients suck. This one just sucks less.</quote> —
23 <title>Introduction</title>
26 <emphasis role="bold">Mutt</emphasis> is a small but very powerful
27 text-based MIME mail client. Mutt is highly configurable, and is well
28 suited to the mail power user with advanced features like key bindings,
29 keyboard macros, mail threading, regular expression searches and a
30 powerful pattern matching language for selecting groups of messages.
34 <title>Mutt Home Page</title>
37 The official homepage can be found at
38 <ulink url="http://www.mutt.org/">http://www.mutt.org/</ulink>.
43 <sect1 id="muttlists">
44 <title>Mailing Lists</title>
47 To subscribe to one of the following mailing lists, send a message with
48 the word <emphasis>subscribe</emphasis> in the body to
49 <emphasis>list-name</emphasis><literal>-request@mutt.org</literal>.
56 <email>mutt-announce-request@mutt.org</email> — low traffic list for
63 <email>mutt-users-request@mutt.org</email> — help, bug reports and
70 <email>mutt-dev-request@mutt.org</email> — development mailing list
77 All messages posted to <emphasis>mutt-announce</emphasis> are
78 automatically forwarded to <emphasis>mutt-users</emphasis>, so you do
79 not need to be subscribed to both lists.
84 <sect1 id="distribution">
85 <title>Getting Mutt</title>
88 Mutt releases can be downloaded from <ulink
89 url="ftp://ftp.mutt.org/mutt/">ftp://ftp.mutt.org/mutt/</ulink>. For a
90 list of mirror sites, please refer to <ulink
91 url="http://www.mutt.org/download.html">http://www.mutt.org/download.html</ulink>.
95 For nightly tarballs and version control access, please refer to the
96 <ulink url="http://dev.mutt.org/">Mutt development site</ulink>.
102 <title>Mutt Online Resources</title>
107 <term>Bug Tracking System</term>
110 The official Mutt bug tracking system can be found at
111 <ulink url="http://bugs.mutt.org/">http://bugs.mutt.org/</ulink>
120 An (unofficial) wiki can be found
121 at <ulink url="http://wiki.mutt.org/">http://wiki.mutt.org/</ulink>.
130 For the IRC user community, visit channel <emphasis>#mutt</emphasis> on
131 <ulink url="http://www.freenode.net/">irc.freenode.net</ulink>.
140 For USENET, see the newsgroup <ulink url="news:comp.mail.mutt">comp.mail.mutt</ulink>.
150 <title>Contributing to Mutt</title>
153 There are various ways to contribute to the Mutt project.
157 Especially for new users it may be helpful to meet other new and
158 experienced users to chat about Mutt, talk about problems and share
163 Since translations of Mutt into other languages are highly appreciated,
164 the Mutt developers always look for skilled translators that help
165 improve and continue to maintain stale translations.
169 For contributing code patches for new features and bug fixes, please
170 refer to the developer pages at
171 <ulink url="http://dev.mutt.org/">http://dev.mutt.org/</ulink> for more details.
177 <title>Typographical Conventions</title>
180 This section lists typographical conventions followed throughout this
181 manual. See table <xref linkend="tab-typo"/> for typographical
182 conventions for special terms.
185 <table id="tab-typo">
186 <title>Typographical conventions for special terms</title>
189 <row><entry>Item</entry><entry>Refers to...</entry></row>
192 <row><entry><literal>printf(3)</literal></entry><entry>UNIX manual pages, execute <literal>man 3 printf</literal></entry></row>
193 <row><entry><literal><PageUp></literal></entry><entry>named keys</entry></row>
194 <row><entry><literal><create-alias></literal></entry><entry>named Mutt function</entry></row>
195 <row><entry><literal>^G</literal></entry><entry>Control+G key combination</entry></row>
196 <row><entry>$mail_check</entry><entry>Mutt configuration option</entry></row>
197 <row><entry><literal>$HOME</literal></entry><entry>environment variable</entry></row>
203 Examples are presented as:
211 Within command synopsis, curly brackets (<quote>{}</quote>) denote a set
212 of options of which one is mandatory, square brackets
213 (<quote>[]</quote>) denote optional arguments, three dots
214 denote that the argument may be repeated arbitrary times.
219 <sect1 id="copyright">
220 <title>Copyright</title>
223 Mutt is Copyright © 1996-2009 Michael R. Elkins
224 <email>me@mutt.org</email> and others.
228 This program is free software; you can redistribute it and/or modify it
229 under the terms of the GNU General Public License as published by the
230 Free Software Foundation; either version 2 of the License, or (at your
231 option) any later version.
235 This program is distributed in the hope that it will be useful, but
236 WITHOUT ANY WARRANTY; without even the implied warranty of
237 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
238 General Public License for more details.
242 You should have received a copy of the GNU General Public License along
243 with this program; if not, write to the Free Software Foundation, Inc.,
244 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
251 <chapter id="gettingstarted">
252 <title>Getting Started</title>
255 This section is intended as a brief overview of how to use Mutt. There
256 are many other features which are described elsewhere in the manual.
257 There is even more information available in the Mutt FAQ and various web
258 pages. See the <ulink url="http://www.mutt.org/">Mutt homepage</ulink>
263 The keybindings described in this section are the defaults as
264 distributed. Your local system administrator may have altered the
265 defaults for your site. You can always type <quote>?</quote> in any
266 menu to display the current bindings.
270 The first thing you need to do is invoke Mutt, simply by typing
271 <literal>mutt</literal> at the command line. There are various
272 command-line options, see either the Mutt man page or the <link
273 linkend="commandline">reference</link>.
276 <sect1 id="core-concepts">
277 <title>Core Concepts</title>
280 Mutt is a text-based application which interacts with users through
281 different menus which are mostly line-/entry-based or page-based. A
282 line-based menu is the so-called <quote>index</quote> menu (listing all
283 messages of the currently opened folder) or the <quote>alias</quote>
284 menu (allowing you to select recipients from a list). Examples for
285 page-based menus are the <quote>pager</quote> (showing one message at a
286 time) or the <quote>help</quote> menu listing all available key
291 The user interface consists of a context sensitive help line at the top,
292 the menu's contents followed by a context sensitive status line and
293 finally the command line. The command line is used to display
294 informational and error messages as well as for prompts and for entering
295 interactive commands.
299 Mutt is configured through variables which, if the user wants to
300 permanently use a non-default value, are written to configuration
301 files. Mutt supports a rich config file syntax to make even complex
302 configuration files readable and commentable.
306 Because Mutt allows for customizing almost all key bindings, there are
307 so-called <quote>functions</quote> which can be executed manually (using
308 the command line) or in macros. Macros allow the user to bind a sequence
309 of commands to a single key or a short key sequence instead of repeating
310 a sequence of actions over and over.
314 Many commands (such as saving or copying a message to another folder)
315 can be applied to a single message or a set of messages (so-called
316 <quote>tagged</quote> messages). To help selecting messages, Mutt
317 provides a rich set of message patterns (such as recipients, sender,
318 body contents, date sent/received, etc.) which can be combined into
319 complex expressions using the boolean <emphasis>and</emphasis> and
320 <emphasis>or</emphasis> operations as well as negating. These patterns
321 can also be used to (for example) search for messages or to limit the
322 index to show only matching messages.
326 Mutt supports a <quote>hook</quote> concept which allows the user to
327 execute arbitrary configuration commands and functions in certain
328 situations such as entering a folder, starting a new message or replying
329 to an existing one. These hooks can be used to highly customize Mutt's
330 behavior including managing multiple identities, customizing the
331 display for a folder or even implementing auto-archiving based on a
332 per-folder basis and much more.
336 Besides an interactive mode, Mutt can also be used as a command-line
337 tool only send messages. It also supports a
338 <literal>mailx(1)</literal>-compatible interface, see <xref
339 linkend="tab-commandline-options"/> for a complete list of command-line
345 <sect1 id="concept-screens-and-menus">
346 <title>Screens and Menus</title>
348 <sect2 id="intro-index">
352 The index is the screen that you usually see first when you start
353 Mutt. It gives an overview over your emails in the currently opened
354 mailbox. By default, this is your system mailbox. The information you
355 see in the index is a list of emails, each with its number on the left,
356 its flags (new email, important email, email that has been forwarded or
357 replied to, tagged email, ...), the date when email was sent, its
358 sender, the email size, and the subject. Additionally, the index also
359 shows thread hierarchies: when you reply to an email, and the other
360 person replies back, you can see the other person's email in a
361 "sub-tree" below. This is especially useful for personal email between
362 a group of people or when you've subscribed to mailing lists.
367 <sect2 id="intro-pager">
371 The pager is responsible for showing the email content. On the top of
372 the pager you have an overview over the most important email headers
373 like the sender, the recipient, the subject, and much more
374 information. How much information you actually see depends on your
375 configuration, which we'll describe below.
379 Below the headers, you see the email body which usually contains the
380 message. If the email contains any attachments, you will see more
381 information about them below the email body, or, if the attachments are
382 text files, you can view them directly in the pager.
386 To give the user a good overview, it is possible to configure Mutt to
387 show different things in the pager with different colors. Virtually
388 everything that can be described with a regular expression can be
389 colored, e.g. URLs, email addresses or smileys.
394 <sect2 id="intro-browser">
395 <title>File Browser</title>
398 The file browser is the interface to the local or remote file
399 system. When selecting a mailbox to open, the browser allows custom
400 sorting of items, limiting the items shown by a regular expression and a
401 freely adjustable format of what to display in which way. It also allows
402 for easy navigation through the file system when selecting file(s) to
403 attach to a message, select multiple files to attach and many more.
408 <sect2 id="intro-help">
412 The help screen is meant to offer a quick help to the user. It lists the
413 current configuration of key bindings and their associated commands
414 including a short description, and currently unbound functions that
415 still need to be associated with a key binding (or alternatively, they
416 can be called via the Mutt command prompt).
421 <sect2 id="intro-compose">
422 <title>Compose Menu</title>
425 The compose menu features a split screen containing the information
426 which really matter before actually sending a message by mail: who gets
427 the message as what (recipients and who gets what kind of
428 copy). Additionally, users may set security options like deciding
429 whether to sign, encrypt or sign and encrypt a message with/for what
430 keys. Also, it's used to attach messages, to re-edit any attachment
431 including the message itself.
436 <sect2 id="intro-alias">
437 <title>Alias Menu</title>
440 The alias menu is used to help users finding the recipients of
441 messages. For users who need to contact many people, there's no need to
442 remember addresses or names completely because it allows for searching,
443 too. The alias mechanism and thus the alias menu also features grouping
444 several addresses by a shorter nickname, the actual alias, so that users
445 don't have to select each single recipient manually.
450 <sect2 id="intro-attach">
451 <title>Attachment Menu</title>
454 As will be later discussed in detail, Mutt features a good and stable
455 MIME implementation, that is, it supports sending and receiving messages
456 of arbitrary MIME types. The attachment menu displays a message's
457 structure in detail: what content parts are attached to which parent
458 part (which gives a true tree structure), which type is of what type and
459 what size. Single parts may saved, deleted or modified to offer great
460 and easy access to message's internals.
468 <title>Moving Around in Menus</title>
471 The most important navigation keys common to line- or entry-based menus
472 are shown in <xref linkend="tab-keys-nav-line"/> and in <xref
473 linkend="tab-keys-nav-page"/> for page-based menus.
476 <table id="tab-keys-nav-line">
477 <title>Most common navigation keys in entry-based menus</title>
480 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
483 <row><entry>j or <Down></entry><entry><literal><next-entry></literal></entry><entry>move to the next entry</entry></row>
484 <row><entry>k or <Up></entry><entry><literal><previous-entry></literal></entry><entry>move to the previous entry</entry></row>
485 <row><entry>z or <PageDn></entry><entry><literal><page-down></literal></entry><entry>go to the next page</entry></row>
486 <row><entry>Z or <PageUp></entry><entry><literal><page-up></literal></entry><entry>go to the previous page</entry></row>
487 <row><entry>= or <Home></entry><entry><literal><first-entry></literal></entry><entry>jump to the first entry</entry></row>
488 <row><entry>* or <End></entry><entry><literal><last-entry></literal></entry><entry>jump to the last entry</entry></row>
489 <row><entry>q</entry><entry><literal><quit></literal></entry><entry>exit the current menu</entry></row>
490 <row><entry>?</entry><entry><literal><help></literal></entry><entry>list all keybindings for the current menu</entry></row>
495 <table id="tab-keys-nav-page">
496 <title>Most common navigation keys in page-based menus</title>
499 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
502 <row><entry>J or <Return></entry><entry><literal><next-line></literal></entry><entry>scroll down one line</entry></row>
503 <row><entry><Backspace></entry><entry><literal><previous-line></literal></entry><entry>scroll up one line</entry></row>
504 <row><entry>K, <Space> or <PageDn></entry><entry><literal><next-page></literal></entry><entry>move to the next page</entry></row>
505 <row><entry>- or <PageUp></entry><entry><literal><previous-page></literal></entry><entry>move the previous page</entry></row>
506 <row><entry><Home></entry><entry><literal><top></literal></entry><entry>move to the top</entry></row>
507 <row><entry><End></entry><entry><literal><bottom></literal></entry><entry>move to the bottom</entry></row>
515 <title>Editing Input Fields</title>
517 <sect2 id="editing-intro">
518 <title>Introduction</title>
521 Mutt has a built-in line editor for inputting text, e.g. email addresses
522 or filenames. The keys used to manipulate text input are very similar to
523 those of Emacs. See <xref linkend="tab-keys-editor"/> for a full
524 reference of available functions, their default key bindings, and short
528 <table id="tab-keys-editor">
529 <title>Most common line editor keys</title>
532 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
535 <row><entry>^A or <Home></entry><entry><literal><bol></literal></entry><entry>move to the start of the line</entry></row>
536 <row><entry>^B or <Left></entry><entry><literal><backward-char></literal></entry><entry>move back one char</entry></row>
537 <row><entry>Esc B</entry><entry><literal><backward-word></literal></entry><entry>move back one word</entry></row>
538 <row><entry>^D or <Delete></entry><entry><literal><delete-char></literal></entry><entry>delete the char under the cursor</entry></row>
539 <row><entry>^E or <End></entry><entry><literal><eol></literal></entry><entry>move to the end of the line</entry></row>
540 <row><entry>^F or <Right></entry><entry><literal><forward-char></literal></entry><entry>move forward one char</entry></row>
541 <row><entry>Esc F</entry><entry><literal><forward-word></literal></entry><entry>move forward one word</entry></row>
542 <row><entry><Tab></entry><entry><literal><complete></literal></entry><entry>complete filename or alias</entry></row>
543 <row><entry>^T</entry><entry><literal><complete-query></literal></entry><entry>complete address with query</entry></row>
544 <row><entry>^K</entry><entry><literal><kill-eol></literal></entry><entry>delete to the end of the line</entry></row>
545 <row><entry>Esc d</entry><entry><literal><kill-eow></literal></entry><entry>delete to the end of the word</entry></row>
546 <row><entry>^W</entry><entry><literal><kill-word></literal></entry><entry>kill the word in front of the cursor</entry></row>
547 <row><entry>^U</entry><entry><literal><kill-line></literal></entry><entry>delete entire line</entry></row>
548 <row><entry>^V</entry><entry><literal><quote-char></literal></entry><entry>quote the next typed key</entry></row>
549 <row><entry><Up></entry><entry><literal><history-up></literal></entry><entry>recall previous string from history</entry></row>
550 <row><entry><Down></entry><entry><literal><history-down></literal></entry><entry>recall next string from history</entry></row>
551 <row><entry><BackSpace></entry><entry><literal><backspace></literal></entry><entry>kill the char in front of the cursor</entry></row>
552 <row><entry>Esc u</entry><entry><literal><upcase-word></literal></entry><entry>convert word to upper case</entry></row>
553 <row><entry>Esc l</entry><entry><literal><downcase-word></literal></entry><entry>convert word to lower case</entry></row>
554 <row><entry>Esc c</entry><entry><literal><capitalize-word></literal></entry><entry>capitalize the word</entry></row>
555 <row><entry>^G</entry><entry>n/a</entry><entry>abort</entry></row>
556 <row><entry><Return></entry><entry>n/a</entry><entry>finish editing</entry></row>
562 You can remap the <emphasis>editor</emphasis> functions using the <link
563 linkend="bind"><command>bind</command></link> command. For example, to
564 make the <Delete> key delete the character in front of the cursor
565 rather than under, you could use:
569 bind editor <delete> backspace
574 <sect2 id="editing-history">
575 <title>History</title>
578 Mutt maintains a history for the built-in editor. The number of items
579 is controlled by the <link linkend="history">$history</link> variable
580 and can be made persistent using an external file specified using <link
581 linkend="history-file">$history_file</link>. You may cycle through them
582 at an editor prompt by using the <literal><history-up></literal>
583 and/or <literal><history-down></literal> commands. But notice that
584 Mutt does not remember the currently entered text, it only cycles
585 through history and wraps around at the end or beginning.
589 Mutt maintains several distinct history lists, one for each of the
590 following categories:
594 <listitem><para><literal>.muttrc</literal> commands</para></listitem>
595 <listitem><para>addresses and aliases</para></listitem>
596 <listitem><para>shell commands</para></listitem>
597 <listitem><para>filenames</para></listitem>
598 <listitem><para>patterns</para></listitem>
599 <listitem><para>everything else</para></listitem>
603 Mutt automatically filters out consecutively repeated items from the
604 history. It also mimics the behavior of some shells by ignoring items
605 starting with a space. The latter feature can be useful in macros to not
606 clobber the history's valuable entries with unwanted entries.
614 <title>Reading Mail</title>
617 Similar to many other mail clients, there are two modes in which mail is
618 read in Mutt. The first is a list of messages in the mailbox, which is
619 called the <quote>index</quote> menu in Mutt. The second mode is the
620 display of the message contents. This is called the
621 <quote>pager.</quote>
625 The next few sections describe the functions provided in each of these
629 <sect2 id="index-menu">
630 <title>The Message Index</title>
633 Common keys used to navigate through and manage messages in the index
634 are shown in <xref linkend="tab-key-index"/>. How messages are presented
635 in the index menu can be customized using the <link
636 linkend="index-format">$index_format</link> variable.
639 <table id="tab-key-index">
640 <title>Most common message index keys</title>
643 <row><entry>Key</entry><entry>Description</entry></row>
646 <row><entry>c</entry><entry>change to a different mailbox</entry></row>
647 <row><entry>Esc c</entry><entry>change to a folder in read-only mode</entry></row>
648 <row><entry>C</entry><entry>copy the current message to another mailbox</entry></row>
649 <row><entry>Esc C</entry><entry>decode a message and copy it to a folder</entry></row>
650 <row><entry>Esc s</entry><entry>decode a message and save it to a folder</entry></row>
651 <row><entry>D</entry><entry>delete messages matching a pattern</entry></row>
652 <row><entry>d</entry><entry>delete the current message</entry></row>
653 <row><entry>F</entry><entry>mark as important</entry></row>
654 <row><entry>l</entry><entry>show messages matching a pattern</entry></row>
655 <row><entry>N</entry><entry>mark message as new</entry></row>
656 <row><entry>o</entry><entry>change the current sort method</entry></row>
657 <row><entry>O</entry><entry>reverse sort the mailbox</entry></row>
658 <row><entry>q</entry><entry>save changes and exit</entry></row>
659 <row><entry>s</entry><entry>save-message</entry></row>
660 <row><entry>T</entry><entry>tag messages matching a pattern</entry></row>
661 <row><entry>t</entry><entry>toggle the tag on a message</entry></row>
662 <row><entry>Esc t</entry><entry>toggle tag on entire message thread</entry></row>
663 <row><entry>U</entry><entry>undelete messages matching a pattern</entry></row>
664 <row><entry>u</entry><entry>undelete-message</entry></row>
665 <row><entry>v</entry><entry>view-attachments</entry></row>
666 <row><entry>x</entry><entry>abort changes and exit</entry></row>
667 <row><entry><Return></entry><entry>display-message</entry></row>
668 <row><entry><Tab></entry><entry>jump to the next new or unread message</entry></row>
669 <row><entry>@</entry><entry>show the author's full e-mail address</entry></row>
670 <row><entry>$</entry><entry>save changes to mailbox</entry></row>
671 <row><entry>/</entry><entry>search</entry></row>
672 <row><entry>Esc /</entry><entry>search-reverse</entry></row>
673 <row><entry>^L</entry><entry>clear and redraw the screen</entry></row>
674 <row><entry>^T</entry><entry>untag messages matching a pattern</entry></row>
680 In addition to who sent the message and the subject, a short summary of
681 the disposition of each message is printed beside the message number.
682 Zero or more of the <quote>flags</quote> in <xref
683 linkend="tab-msg-status-flags"/> may appear, some of which can be turned
684 on or off using these functions: <literal><set-flag></literal> and
685 <literal><clear-flag></literal> bound by default to
686 <quote>w</quote> and <quote>W</quote> respectively.
690 Furthermore, the flags in <xref linkend="tab-msg-recip-flags"/> reflect
691 who the message is addressed to. They can be customized with the <link
692 linkend="to-chars">$to_chars</link> variable.
695 <table id="tab-msg-status-flags">
696 <title>Message status flags</title>
699 <row><entry>Flag</entry><entry>Description</entry></row>
702 <row><entry>D</entry><entry>message is deleted (is marked for deletion)</entry></row>
703 <row><entry>d</entry><entry>message has attachments marked for deletion</entry></row>
704 <row><entry>K</entry><entry>contains a PGP public key</entry></row>
705 <row><entry>N</entry><entry>message is new</entry></row>
706 <row><entry>O</entry><entry>message is old</entry></row>
707 <row><entry>P</entry><entry>message is PGP encrypted</entry></row>
708 <row><entry>r</entry><entry>message has been replied to</entry></row>
709 <row><entry>S</entry><entry>message is signed, and the signature is successfully verified</entry></row>
710 <row><entry>s</entry><entry>message is signed</entry></row>
711 <row><entry>!</entry><entry>message is flagged</entry></row>
712 <row><entry>*</entry><entry>message is tagged</entry></row>
713 <row><entry>n</entry><entry>thread contains new messages (only if collapsed)</entry></row>
714 <row><entry>o</entry><entry>thread contains old messages (only if collapsed)</entry></row>
719 <table id="tab-msg-recip-flags">
720 <title>Message recipient flags</title>
723 <row><entry>Flag</entry><entry>Description</entry></row>
726 <row><entry>+</entry><entry>message is to you and you only</entry></row>
727 <row><entry>T</entry><entry>message is to you, but also to or CC'ed to others</entry></row>
728 <row><entry>C</entry><entry>message is CC'ed to you</entry></row>
729 <row><entry>F</entry><entry>message is from you</entry></row>
730 <row><entry>L</entry><entry>message is sent to a subscribed mailing list</entry></row>
737 <sect2 id="pager-menu">
738 <title>The Pager</title>
741 By default, Mutt uses its built-in pager to display the contents of
742 messages (an external pager such as <literal>less(1)</literal> can be
743 configured, see <link linkend="pager">$pager</link> variable). The
744 pager is very similar to the Unix program <literal>less(1)</literal>
745 though not nearly as featureful.
748 <table id="tab-key-pager">
749 <title>Most common pager keys</title>
752 <row><entry>Key</entry><entry>Description</entry></row>
755 <row><entry><Return></entry><entry>go down one line</entry></row>
756 <row><entry><Space></entry><entry>display the next page (or next message if at the end of a message)</entry></row>
757 <row><entry>-</entry><entry>go back to the previous page</entry></row>
758 <row><entry>n</entry><entry>search for next match</entry></row>
759 <row><entry>S</entry><entry>skip beyond quoted text</entry></row>
760 <row><entry>T</entry><entry>toggle display of quoted text</entry></row>
761 <row><entry>?</entry><entry>show keybindings</entry></row>
762 <row><entry>/</entry><entry>regular expression search</entry></row>
763 <row><entry>Esc /</entry><entry>backward regular expression search</entry></row>
764 <row><entry>\</entry><entry>toggle highlighting of search matches</entry></row>
765 <row><entry>^</entry><entry>jump to the top of the message</entry></row>
771 In addition to key bindings in <xref linkend="tab-key-pager"/>, many of
772 the functions from the index menu are also available in the pager, such
773 as <literal><delete-message></literal> or
774 <literal><copy-message></literal> (this is one advantage over
775 using an external pager to view messages).
779 Also, the internal pager supports a couple other advanced features. For
780 one, it will accept and translate the <quote>standard</quote> nroff
781 sequences for bold and underline. These sequences are a series of either
782 the letter, backspace (<quote>^H</quote>), the letter again for bold or
783 the letter, backspace, <quote>_</quote> for denoting underline. Mutt
784 will attempt to display these in bold and underline respectively if your
785 terminal supports them. If not, you can use the bold and underline <link
786 linkend="color">color</link> objects to specify a
787 <command>color</command> or mono attribute for them.
791 Additionally, the internal pager supports the ANSI escape sequences for
792 character attributes. Mutt translates them into the correct color and
793 character settings. The sequences Mutt supports are:
797 \e[<emphasis>Ps</emphasis>;<emphasis>Ps</emphasis>;..<emphasis>Ps</emphasis>;m
801 where <emphasis>Ps</emphasis> can be one of the codes shown in <xref
802 linkend="tab-ansi-esc"/>.
805 <table id="tab-ansi-esc">
806 <title>ANSI escape sequences</title>
809 <row><entry>Escape code</entry><entry>Description</entry></row>
812 <row><entry>0</entry><entry>All attributes off</entry></row>
813 <row><entry>1</entry><entry>Bold on</entry></row>
814 <row><entry>4</entry><entry>Underline on</entry></row>
815 <row><entry>5</entry><entry>Blink on</entry></row>
816 <row><entry>7</entry><entry>Reverse video on</entry></row>
817 <row><entry>3<emphasis><color></emphasis></entry><entry>Foreground color is <emphasis><color></emphasis> (see <xref linkend="tab-color"/>)</entry></row>
818 <row><entry>4<emphasis><color></emphasis></entry><entry>Background color is <emphasis><color></emphasis> (see <xref linkend="tab-color"/>)</entry></row>
823 <table id="tab-color">
824 <title>Color sequences</title>
827 <row><entry>Color code</entry><entry>Color</entry></row>
830 <row><entry>0</entry><entry>Black</entry></row>
831 <row><entry>1</entry><entry>Red</entry></row>
832 <row><entry>2</entry><entry>Green</entry></row>
833 <row><entry>3</entry><entry>Yellow</entry></row>
834 <row><entry>4</entry><entry>Blue</entry></row>
835 <row><entry>5</entry><entry>Magenta</entry></row>
836 <row><entry>6</entry><entry>Cyan</entry></row>
837 <row><entry>7</entry><entry>White</entry></row>
843 Mutt uses these attributes for handling <literal>text/enriched</literal>
844 messages, and they can also be used by an external <link
845 linkend="auto-view">autoview</link> script for highlighting purposes.
850 If you change the colors for your display, for example by changing the
851 color associated with color2 for your xterm, then that color will be
852 used instead of green.
858 Note that the search commands in the pager take regular expressions,
859 which are not quite the same as the more complex <link
860 linkend="patterns">patterns</link> used by the search command in the
861 index. This is because patterns are used to select messages by criteria
862 whereas the pager already displays a selected message.
869 <title>Threaded Mode</title>
872 So-called <quote>threads</quote> provide a hierarchy of messages where
873 replies are linked to their parent message(s). This organizational form
874 is extremely useful in mailing lists where different parts of the
875 discussion diverge. Mutt displays threads as a tree structure.
879 In Mutt, when a mailbox is <link linkend="sort">sorted</link>
880 by <emphasis>threads</emphasis>, there are a few additional functions
881 available in the <emphasis>index</emphasis>
882 and <emphasis>pager</emphasis> modes as shown in
883 <xref linkend="tab-key-threads"/>.
886 <table id="tab-key-threads">
887 <title>Most common thread mode keys</title>
890 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
893 <row><entry>^D</entry><entry><literal><delete-thread></literal></entry><entry>delete all messages in the current thread</entry></row>
894 <row><entry>^U</entry><entry><literal><undelete-thread></literal></entry><entry>undelete all messages in the current thread</entry></row>
895 <row><entry>^N</entry><entry><literal><next-thread></literal></entry><entry>jump to the start of the next thread</entry></row>
896 <row><entry>^P</entry><entry><literal><previous-thread></literal></entry><entry>jump to the start of the previous thread</entry></row>
897 <row><entry>^R</entry><entry><literal><read-thread></literal></entry><entry>mark the current thread as read</entry></row>
898 <row><entry>Esc d</entry><entry><literal><delete-subthread></literal></entry><entry>delete all messages in the current subthread</entry></row>
899 <row><entry>Esc u</entry><entry><literal><undelete-subthread></literal></entry><entry>undelete all messages in the current subthread</entry></row>
900 <row><entry>Esc n</entry><entry><literal><next-subthread></literal></entry><entry>jump to the start of the next subthread</entry></row>
901 <row><entry>Esc p</entry><entry><literal><previous-subthread></literal></entry><entry>jump to the start of the previous subthread</entry></row>
902 <row><entry>Esc r</entry><entry><literal><read-subthread></literal></entry><entry>mark the current subthread as read</entry></row>
903 <row><entry>Esc t</entry><entry><literal><tag-thread></literal></entry><entry>toggle the tag on the current thread</entry></row>
904 <row><entry>Esc v</entry><entry><literal><collapse-thread></literal></entry><entry>toggle collapse for the current thread</entry></row>
905 <row><entry>Esc V</entry><entry><literal><collapse-all></literal></entry><entry>toggle collapse for all threads</entry></row>
906 <row><entry>P</entry><entry><literal><parent-message></literal></entry><entry>jump to parent message in thread</entry></row>
912 Collapsing a thread displays only the first message in the thread and
913 hides the others. This is useful when threads contain so many messages
914 that you can only see a handful of threads on the screen. See %M in
915 <link linkend="index-format">$index_format</link>. For example, you
916 could use <quote>%?M?(#%03M)&(%4l)?</quote> in <link
917 linkend="index-format">$index_format</link> to optionally display the
918 number of hidden messages if the thread is collapsed. The
919 <literal>%?<char>?<if-part>&<else-part>?</literal>
920 syntax is explained in detail in <link
921 linkend="formatstrings-conditionals">format string conditionals</link>.
925 Technically, every reply should contain a list of its parent messages in
926 the thread tree, but not all do. In these cases, Mutt groups them by
927 subject which can be controlled using the <link
928 linkend="strict-threads">$strict_threads</link> variable.
933 <sect2 id="reading-misc">
934 <title>Miscellaneous Functions</title>
937 In addition, the <emphasis>index</emphasis> and
938 <emphasis>pager</emphasis> menus have these interesting functions:
945 <literal><create-alias></literal><anchor id="create-alias"/>
950 Creates a new alias based upon the current message (or prompts for a new
951 one). Once editing is complete, an <link
952 linkend="alias"><command>alias</command></link> command is added to the
953 file specified by the <link linkend="alias-file">$alias_file</link>
954 variable for future use
959 Mutt does not read the <link linkend="alias-file">$alias_file</link>
960 upon startup so you must explicitly <link
961 linkend="source"><command>source</command></link> the file.
969 <literal><check-traditional-pgp></literal><anchor
970 id="check-traditional-pgp"/> (default: Esc P)
974 This function will search the current message for content signed or
975 encrypted with PGP the <quote>traditional</quote> way, that is, without
976 proper MIME tagging. Technically, this function will temporarily change
977 the MIME content types of the body parts containing PGP data; this is
979 linkend="edit-type"><literal><edit-type></literal></link>
987 <literal><edit></literal><anchor id="edit"/> (default: e)
991 This command (available in the index and pager) allows you to edit the
992 raw current message as it's present in the mail folder. After you have
993 finished editing, the changed message will be appended to the current
994 folder, and the original message will be marked for deletion; if the
995 message is unchanged it won't be replaced.
1002 <literal><edit-type></literal><anchor id="edit-type"/> (default:
1003 ^E on the attachment menu, and in the pager and index menus; ^T on the
1008 This command is used to temporarily edit an attachment's content type to
1009 fix, for instance, bogus character set parameters. When invoked from
1010 the index or from the pager, you'll have the opportunity to edit the
1011 top-level attachment's content type. On the <link
1012 linkend="attach-menu">attachment menu</link>, you can change any
1013 attachment's content type. These changes are not persistent, and get
1014 lost upon changing folders.
1018 Note that this command is also available on the <link
1019 linkend="compose-menu">compose menu</link>. There, it's used to
1020 fine-tune the properties of attachments you are going to send.
1027 <literal><enter-command></literal><anchor id="enter-command"/>
1028 (default: <quote>:</quote>)
1032 This command is used to execute any command you would normally put in a
1033 configuration file. A common use is to check the settings of variables,
1034 or in conjunction with <link linkend="macro">macros</link> to change
1035 settings on the fly.
1042 <literal><extract-keys></literal><anchor id="extract-keys"/>
1047 This command extracts PGP public keys from the current or tagged
1048 message(s) and adds them to your PGP public key ring.
1055 <literal><forget-passphrase></literal><anchor
1056 id="forget-passphrase"/> (default: ^F)
1060 This command wipes the passphrase(s) from memory. It is useful, if you
1061 misspelled the passphrase.
1068 <literal><list-reply></literal><anchor id="list-reply"/> (default:
1073 Reply to the current or tagged message(s) by extracting any addresses
1074 which match the regular expressions given by the <link
1075 linkend="lists"><command>lists</command> or
1076 <command>subscribe</command></link> commands, but also honor any
1077 <literal>Mail-Followup-To</literal> header(s) if the <link
1078 linkend="honor-followup-to">$honor_followup_to</link> configuration
1079 variable is set. Using this when replying to messages posted to mailing
1080 lists helps avoid duplicate copies being sent to the author of the
1081 message you are replying to.
1088 <literal><pipe-message></literal><anchor id="pipe-message"/>
1093 Asks for an external Unix command and pipes the current or tagged
1094 message(s) to it. The variables <link
1095 linkend="pipe-decode">$pipe_decode</link>, <link
1096 linkend="pipe-split">$pipe_split</link>, <link
1097 linkend="pipe-sep">$pipe_sep</link> and <link
1098 linkend="wait-key">$wait_key</link> control the exact behavior of this
1106 <literal><resend-message></literal><anchor id="resend-message"/>
1111 Mutt takes the current message as a template for a new message. This
1112 function is best described as "recall from arbitrary folders". It can
1113 conveniently be used to forward MIME messages while preserving the
1114 original mail structure. Note that the amount of headers included here
1115 depends on the value of the <link linkend="weed">$weed</link> variable.
1119 This function is also available from the attachment menu. You can use
1120 this to easily resend a message which was included with a bounce message
1121 as a <literal>message/rfc822</literal> body part.
1128 <literal><shell-escape></literal><anchor id="shell-escape"/>
1133 Asks for an external Unix command and executes it. The <link
1134 linkend="wait-key">$wait_key</link> can be used to control whether Mutt
1135 will wait for a key to be pressed when the command returns (presumably
1136 to let the user read the output of the command), based on the return
1137 status of the named command. If no command is given, an interactive
1145 <literal><toggle-quoted></literal><anchor id="toggle-quoted"/>
1150 The pager uses the <link linkend="quote-regexp">$quote_regexp</link>
1151 variable to detect quoted text when displaying the body of the message.
1152 This function toggles the display of the quoted material in the message.
1153 It is particularly useful when being interested in just the response and
1154 there is a large amount of quoted text in the way.
1161 <literal><skip-quoted></literal><anchor id="skip-quoted"/>
1166 This function will go to the next line of non-quoted text which comes
1167 after a line of quoted text in the internal pager.
1178 <sect1 id="sending">
1179 <title>Sending Mail</title>
1181 <sect2 id="sending-intro">
1182 <title>Introduction</title>
1185 The bindings shown in <xref linkend="tab-key-send"/> are available in
1186 the <emphasis>index</emphasis> and <emphasis>pager</emphasis> to start a
1190 <table id="tab-key-send">
1191 <title>Most common mail sending keys</title>
1194 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
1197 <row><entry>m</entry><entry><literal><compose></literal></entry><entry>compose a new message</entry></row>
1198 <row><entry>r</entry><entry><literal><reply></literal></entry><entry>reply to sender</entry></row>
1199 <row><entry>g</entry><entry><literal><group-reply></literal></entry><entry>reply to all recipients</entry></row>
1200 <row><entry>L</entry><entry><literal><list-reply></literal></entry><entry>reply to mailing list address</entry></row>
1201 <row><entry>f</entry><entry><literal><forward></literal></entry><entry>forward message</entry></row>
1202 <row><entry>b</entry><entry><literal><bounce></literal></entry><entry>bounce (remail) message</entry></row>
1203 <row><entry>Esc k</entry><entry><literal><mail-key></literal></entry><entry>mail a PGP public key to someone</entry></row>
1209 <emphasis>Bouncing</emphasis> a message sends the message as-is to the
1210 recipient you specify. <emphasis>Forwarding</emphasis> a message allows
1211 you to add comments or modify the message you are forwarding. These
1212 items are discussed in greater detail in the next section <quote><link
1213 linkend="forwarding-mail">Forwarding and Bouncing Mail</link>.</quote>
1217 Mutt will then enter the <emphasis>compose</emphasis> menu and prompt
1218 you for the recipients to place on the <quote>To:</quote> header field
1219 when you hit <literal>m</literal> to start a new message. Next, it will
1220 ask you for the <quote>Subject:</quote> field for the message, providing
1221 a default if you are replying to or forwarding a message. You again have
1222 the chance to adjust recipients, subject, and security settings right
1223 before actually sending the message. See also <link
1224 linkend="askcc">$askcc</link>, <link linkend="askbcc">$askbcc</link>,
1225 <link linkend="autoedit">$autoedit</link>, <link
1226 linkend="bounce">$bounce</link>, <link
1227 linkend="fast-reply">$fast_reply</link>, and <link
1228 linkend="include">$include</link> for changing how and if Mutt asks
1233 When replying, Mutt fills these fields with proper values depending on
1234 the reply type. The types of replying supported are:
1239 <term>Simple reply</term>
1242 Reply to the author directly.
1247 <term>Group reply</term>
1250 Reply to the author as well to all recipients except you; this consults
1251 <link linkend="alternates"><command>alternates</command></link>.
1256 <term>List reply</term>
1259 Reply to all mailing list addresses found, either specified via
1260 configuration or auto-detected. See <xref linkend="lists"/> for
1268 After getting recipients for new messages, forwards or replies, Mutt
1269 will then automatically start your <link linkend="editor">$editor</link>
1270 on the message body. If the <link
1271 linkend="edit-headers">$edit_headers</link> variable is set, the headers
1272 will be at the top of the message in your editor. Any messages you are
1273 replying to will be added in sort order to the message, with appropriate
1274 <link linkend="attribution">$attribution</link>, <link
1275 linkend="indent-string">$indent_string</link> and <link
1276 linkend="post-indent-string">$post_indent_string</link>. When
1277 forwarding a message, if the <link
1278 linkend="mime-forward">$mime_forward</link> variable is unset, a copy of
1279 the forwarded message will be included. If you have specified a <link
1280 linkend="signature">$signature</link>, it will be appended to the
1285 Once you have finished editing the body of your mail message, you are
1286 returned to the <emphasis>compose</emphasis> menu providing the
1287 functions shown in <xref linkend="tab-func-compose"/> to modify, send or
1288 postpone the message.
1291 <table id="tab-func-compose">
1292 <title>Most common compose menu keys</title>
1295 <row><entry>Key</entry><entry>Function</entry><entry>Description</entry></row>
1298 <row><entry>a</entry><entry><literal><attach-file></literal></entry><entry>attach a file</entry></row>
1299 <row><entry>A</entry><entry><literal><attach-message></literal></entry><entry>attach message(s) to the message</entry></row>
1300 <row><entry>Esc k</entry><entry><literal><attach-key></literal></entry><entry>attach a PGP public key</entry></row>
1301 <row><entry>d</entry><entry><literal><edit-description></literal></entry><entry>edit description on attachment</entry></row>
1302 <row><entry>D</entry><entry><literal><detach-file></literal></entry><entry>detach a file</entry></row>
1303 <row><entry>t</entry><entry><literal><edit-to></literal></entry><entry>edit the To field</entry></row>
1304 <row><entry>Esc f</entry><entry><literal><edit-from></literal></entry><entry>edit the From field</entry></row>
1305 <row><entry>r</entry><entry><literal><edit-reply-to></literal></entry><entry>edit the Reply-To field</entry></row>
1306 <row><entry>c</entry><entry><literal><edit-cc></literal></entry><entry>edit the Cc field</entry></row>
1307 <row><entry>b</entry><entry><literal><edit-bcc></literal></entry><entry>edit the Bcc field</entry></row>
1308 <row><entry>y</entry><entry><literal><send-message></literal></entry><entry>send the message</entry></row>
1309 <row><entry>s</entry><entry><literal><edit-subject></literal></entry><entry>edit the Subject</entry></row>
1310 <row><entry>S</entry><entry><literal><smime-menu></literal></entry><entry>select S/MIME options</entry></row>
1311 <row><entry>f</entry><entry><literal><edit-fcc></literal></entry><entry>specify an <quote>Fcc</quote> mailbox</entry></row>
1312 <row><entry>p</entry><entry><literal><pgp-menu></literal></entry><entry>select PGP options</entry></row>
1313 <row><entry>P</entry><entry><literal><postpone-message></literal></entry><entry>postpone this message until later</entry></row>
1314 <row><entry>q</entry><entry><literal><quit></literal></entry><entry>quit (abort) sending the message</entry></row>
1315 <row><entry>w</entry><entry><literal><write-fcc></literal></entry><entry>write the message to a folder</entry></row>
1316 <row><entry>i</entry><entry><literal><ispell></literal></entry><entry>check spelling (if available on your system)</entry></row>
1317 <row><entry>^F</entry><entry><literal><forget-passphrase></literal></entry><entry>wipe passphrase(s) from memory</entry></row>
1323 The compose menu is also used to edit the attachments for a message
1324 which can be either files or other messages. The
1325 <literal><attach-message></literal> function to will prompt you
1326 for a folder to attach messages from. You can now tag messages in that
1327 folder and they will be attached to the message you are sending.
1332 Note that certain operations like composing a new mail, replying,
1333 forwarding, etc. are not permitted when you are in that folder. The %r
1334 in <link linkend="status-format">$status_format</link> will change to a
1335 <quote>A</quote> to indicate that you are in attach-message mode.
1341 <sect2 id="edit-header">
1342 <title>Editing the Message Header</title>
1345 When editing the header because of <link
1346 linkend="edit-headers">$edit_headers</link> being set, there are a
1347 several pseudo headers available which will not be included in sent
1348 messages but trigger special Mutt behavior.
1351 <sect3 id="fcc-header">
1352 <title>Fcc: Pseudo Header</title>
1359 <literal>Fcc:</literal> <emphasis>filename</emphasis>
1363 as a header, Mutt will pick up <emphasis>filename</emphasis> just as if
1364 you had used the <literal><edit-fcc></literal> function in the
1365 <emphasis>compose</emphasis> menu. It can later be changed from the
1371 <sect3 id="attach-header">
1372 <title>Attach: Pseudo Header</title>
1375 You can also attach files to your message by specifying
1379 <literal>Attach:</literal> <emphasis>filename</emphasis>
1380 [ <emphasis>description</emphasis> ]
1384 where <emphasis>filename</emphasis> is the file to attach and
1385 <emphasis>description</emphasis> is an optional string to use as the
1386 description of the attached file. Spaces in filenames have to be escaped
1387 using backslash (<quote>\</quote>). The file can be removed as well as
1388 more added from the compose menu.
1393 <sect3 id="pgp-header">
1394 <title>Pgp: Pseudo Header</title>
1397 If you want to use PGP, you can specify
1401 <literal>Pgp:</literal> [ <literal>E</literal> | <literal>S</literal> | <literal>S</literal><emphasis><id></emphasis> ]
1406 <quote>E</quote> selects encryption, <quote>S</quote> selects signing
1407 and <quote>S<id></quote> selects signing with the given key,
1408 setting <link linkend="pgp-sign-as">$pgp_sign_as</link> permanently. The
1409 selection can later be changed in the compose menu.
1414 <sect3 id="in-reply-to-header">
1415 <title>In-Reply-To: Header</title>
1418 When replying to messages, the <emphasis>In-Reply-To:</emphasis> header
1419 contains the Message-Id of the message(s) you reply to. If you remove or
1420 modify its value, Mutt will not generate a
1421 <emphasis>References:</emphasis> field, which allows you to create a new
1422 message thread, for example to create a new message to a mailing list
1423 without having to enter the mailing list's address.
1427 If you intend to start a new thread by replying, please make really sure
1428 you remove the <emphasis>In-Reply-To:</emphasis> header in your
1429 editor. Otherwise, though you'll produce a technically valid reply, some
1430 netiquette guardians will be annoyed by this so-called <quote>thread
1438 <sect2 id="sending-crypto">
1439 <title>Sending Cryptographically Signed/Encrypted Messages</title>
1442 If you have told Mutt to PGP or S/MIME encrypt a message, it will guide
1443 you through a key selection process when you try to send the message.
1444 Mutt will not ask you any questions about keys which have a certified
1445 user ID matching one of the message recipients' mail addresses.
1446 However, there may be situations in which there are several keys, weakly
1447 certified user ID fields, or where no matching keys can be found.
1451 In these cases, you are dropped into a menu with a list of keys from
1452 which you can select one. When you quit this menu, or Mutt can't find
1453 any matching keys, you are prompted for a user ID. You can, as usually,
1454 abort this prompt using <literal>^G</literal>. When you do so, Mutt
1455 will return to the compose screen.
1459 Once you have successfully finished the key selection, the message will
1460 be encrypted using the selected public keys when sent out.
1464 Most fields of the entries in the key selection menu (see also <link
1465 linkend="pgp-entry-format">$pgp_entry_format</link>) have obvious
1466 meanings. But some explanations on the capabilities, flags, and
1467 validity fields are in order.
1471 The flags sequence (<quote>%f</quote>) will expand to one of the flags
1472 in <xref linkend="tab-pgp-menuflags"/>.
1475 <table id="tab-pgp-menuflags">
1476 <title>PGP key menu flags</title>
1479 <row><entry>Flag</entry><entry>Description</entry></row>
1482 <row><entry>R</entry><entry>The key has been revoked and can't be used.</entry></row>
1483 <row><entry>X</entry><entry>The key is expired and can't be used.</entry></row>
1484 <row><entry>d</entry><entry>You have marked the key as disabled.</entry></row>
1485 <row><entry>c</entry><entry>There are unknown critical self-signature packets.</entry></row>
1491 The capabilities field (<quote>%c</quote>) expands to a two-character
1492 sequence representing a key's capabilities. The first character gives
1493 the key's encryption capabilities: A minus sign (<quote>-</quote>) means
1494 that the key cannot be used for encryption. A dot (<quote>.</quote>)
1495 means that it's marked as a signature key in one of the user IDs, but
1496 may also be used for encryption. The letter <quote>e</quote> indicates
1497 that this key can be used for encryption.
1501 The second character indicates the key's signing capabilities. Once
1502 again, a <quote>-</quote> implies <quote>not for signing</quote>,
1503 <quote>.</quote> implies that the key is marked as an encryption key in
1504 one of the user-ids, and <quote>s</quote> denotes a key which can be
1509 Finally, the validity field (<quote>%t</quote>) indicates how
1510 well-certified a user-id is. A question mark (<quote>?</quote>)
1511 indicates undefined validity, a minus character (<quote>-</quote>) marks
1512 an untrusted association, a space character means a partially trusted
1513 association, and a plus character (<quote>+</quote>) indicates complete
1520 <title>Sending Format=Flowed Messages</title>
1522 <sect3 id="ff-concept">
1523 <title>Concept</title>
1526 <literal>format=flowed</literal>-style messages (or
1527 <literal>f=f</literal> for short) are <literal>text/plain</literal>
1528 messages that consist of paragraphs which a receiver's mail client may
1529 reformat to its own needs which mostly means to customize line lengths
1530 regardless of what the sender sent. Technically this is achieved by
1531 letting lines of a <quote>flowable</quote> paragraph end in spaces
1532 except for the last line.
1536 While for text-mode clients like Mutt it's the best way to assume only a
1537 standard 80x25 character cell terminal, it may be desired to let the
1538 receiver decide completely how to view a message.
1543 <sect3 id="ff-support">
1544 <title>Mutt Support</title>
1547 Mutt only supports setting the required <literal>format=flowed</literal>
1548 MIME parameter on outgoing messages if the <link
1549 linkend="text-flowed">$text_flowed</link> variable is set, specifically
1550 it does not add the trailing spaces.
1554 After editing the initial message text and before entering the compose
1555 menu, Mutt properly space-stuffs the message.
1556 <emphasis>Space-stuffing</emphasis> is required by RfC3676 defining
1557 <literal>format=flowed</literal> and means to prepend a space to:
1561 <listitem><para>all lines starting with a space</para></listitem>
1562 <listitem><para>lines starting with the word
1563 <quote><literal>From</literal></quote> followed by
1564 space</para></listitem>
1565 <listitem><para>all lines starting with
1566 <quote><literal>></literal></quote> which is not intended to be a
1567 quote character</para></listitem>
1572 Mutt only supports space-stuffing for the first two types of lines but
1573 not for the third: It is impossible to safely detect whether a leading
1574 <literal>></literal> character starts a quote or not. Furthermore,
1575 Mutt only applies space-stuffing <emphasis>once</emphasis> after the
1576 initial edit is finished.
1581 All leading spaces are to be removed by receiving clients to restore the
1582 original message prior to further processing.
1587 <sect3 id="ff-editor">
1588 <title>Editor Considerations</title>
1591 As Mutt provides no additional features to compose
1592 <literal>f=f</literal> messages, it's completely up to the user and his
1593 editor to produce proper messages. Please consider your editor's
1594 documentation if you intend to send <literal>f=f</literal> messages.
1598 Please note that when editing messages from the compose menu several
1599 times before really sending a mail, it's up to the user to ensure that
1600 the message is properly space-stuffed.
1604 For example, <emphasis>vim</emphasis> provides the <literal>w</literal>
1605 flag for its <literal>formatoptions</literal> setting to assist in
1606 creating <literal>f=f</literal> messages, see <literal>:help
1607 fo-table</literal> for details.
1616 <sect1 id="forwarding-mail">
1617 <title>Forwarding and Bouncing Mail</title>
1620 Bouncing and forwarding let you send an existing message to recipients
1621 that you specify. Bouncing a message sends a verbatim copy of a message
1622 to alternative addresses as if they were the message's original
1623 recipients specified in the Bcc header. Forwarding a message, on the
1624 other hand, allows you to modify the message before it is resent (for
1625 example, by adding your own comments). Bouncing is done using the
1626 <literal><bounce></literal> function and forwarding using the
1627 <literal><forward></literal> function bound to <quote>b</quote>
1628 and <quote>f</quote> respectively.
1632 Forwarding can be done by including the original message in the new
1633 message's body (surrounded by indicating lines) or including it as a
1634 MIME attachment, depending on the value of the <link
1635 linkend="mime-forward">$mime_forward</link> variable. Decoding of
1636 attachments, like in the pager, can be controlled by the <link
1637 linkend="forward-decode">$forward_decode</link> and <link
1638 linkend="mime-forward-decode">$mime_forward_decode</link> variables,
1639 respectively. The desired forwarding format may depend on the content,
1640 therefore <link linkend="mime-forward">$mime_forward</link> is a
1641 quadoption which, for example, can be set to <quote>ask-no</quote>.
1645 The inclusion of headers is controlled by the current setting of the
1646 <link linkend="weed">$weed</link> variable, unless <link
1647 linkend="mime-forward">$mime_forward</link> is set.
1651 Editing the message to forward follows the same procedure as sending or
1652 replying to a message does.
1657 <sect1 id="postponing-mail">
1658 <title>Postponing Mail</title>
1661 At times it is desirable to delay sending a message that you have
1662 already begun to compose. When the
1663 <literal><postpone-message></literal> function is used in the
1664 <emphasis>compose</emphasis> menu, the body of your message and
1665 attachments are stored in the mailbox specified by the <link
1666 linkend="postponed">$postponed</link> variable. This means that you can
1667 recall the message even if you exit Mutt and then restart it at a later
1672 Once a message is postponed, there are several ways to resume it. From
1673 the command line you can use the <quote>-p</quote> option, or if you
1674 compose a new message from the <emphasis>index</emphasis> or
1675 <emphasis>pager</emphasis> you will be prompted if postponed messages
1676 exist. If multiple messages are currently postponed, the
1677 <emphasis>postponed</emphasis> menu will pop up and you can select which
1678 message you would like to resume.
1683 If you postpone a reply to a message, the reply setting of the message
1684 is only updated when you actually finish the message and send it. Also,
1685 you must be in the same folder with the message you replied to for the
1686 status of the message to be updated.
1691 See also the <link linkend="postpone">$postpone</link> quad-option.
1698 <chapter id="configuration">
1699 <title>Configuration</title>
1701 <sect1 id="configuration-files">
1702 <title>Location of Initialization Files</title>
1705 While the default configuration (or <quote>preferences</quote>) make
1706 Mutt usable right out of the box, it is often desirable to tailor Mutt
1707 to suit your own tastes. When Mutt is first invoked, it will attempt to
1708 read the <quote>system</quote> configuration file (defaults set by your
1709 local system administrator), unless the <quote>-n</quote> <link
1710 linkend="commandline">command line</link> option is specified. This
1711 file is typically <literal>/usr/local/share/mutt/Muttrc</literal> or
1712 <literal>/etc/Muttrc</literal>. Mutt will next look for a file named
1713 <literal>.muttrc</literal> in your home directory. If this file does
1714 not exist and your home directory has a subdirectory named
1715 <literal>.mutt</literal>, Mutt tries to load a file named
1716 <literal>.mutt/muttrc</literal>.
1720 <literal>.muttrc</literal> is the file where you will usually place your
1721 <link linkend="commands">commands</link> to configure Mutt.
1725 In addition, Mutt supports version specific configuration files that are
1726 parsed instead of the default files as explained above. For instance,
1727 if your system has a <literal>Muttrc-0.88</literal> file in the system
1728 configuration directory, and you are running version 0.88 of Mutt, this
1729 file will be sourced instead of the <literal>Muttrc</literal> file. The
1730 same is true of the user configuration file, if you have a file
1731 <literal>.muttrc-0.88.6</literal> in your home directory, when you run
1732 Mutt version 0.88.6, it will source this file instead of the default
1733 <literal>.muttrc</literal> file. The version number is the same which
1734 is visible using the <quote>-v</quote> <link
1735 linkend="commandline">command line</link> switch or using the
1736 <literal>show-version</literal> key (default: V) from the index menu.
1741 <sect1 id="muttrc-syntax" xreflabel="Syntax of Initialization Files">
1742 <title>Syntax of Initialization Files</title>
1745 An initialization file consists of a series of <link
1746 linkend="commands">commands</link>. Each line of the file may contain
1747 one or more commands. When multiple commands are used, they must be
1748 separated by a semicolon (<quote>;</quote>).
1751 <example id="ex-rc-multiple-cmds">
1752 <title>Multiple configuration commands per line</title>
1754 set realname='Mutt user' ; ignore x-
1759 The hash mark, or pound sign (<quote>#</quote>), is used as a
1760 <quote>comment</quote> character. You can use it to annotate your
1761 initialization file. All text after the comment character to the end of
1762 the line is ignored.
1765 <example id="ex-ec-comment">
1766 <title>Commenting configuration files</title>
1768 my_hdr X-Disclaimer: Why are you listening to me? <emphasis role="comment"># This is a comment</emphasis>
1773 Single quotes (<quote>'</quote>) and double quotes (<quote>"</quote>)
1774 can be used to quote strings which contain spaces or other special
1775 characters. The difference between the two types of quotes is similar
1776 to that of many popular shell programs, namely that a single quote is
1777 used to specify a literal string (one that is not interpreted for shell
1778 variables or quoting with a backslash [see next paragraph]), while
1779 double quotes indicate a string for which should be evaluated. For
1780 example, backticks are evaluated inside of double quotes, but
1781 <emphasis>not</emphasis> for single quotes.
1785 <quote>\</quote> quotes the next character, just as in shells such as
1786 bash and zsh. For example, if want to put quotes <quote>"</quote>
1787 inside of a string, you can use <quote>\</quote> to force the next
1788 character to be a literal instead of interpreted character.
1791 <example id="ex-rc-quote">
1792 <title>Escaping quotes in configuration files</title>
1794 set realname="Michael \"MuttDude\" Elkins"
1799 <quote>\\</quote> means to insert a literal <quote>\</quote> into the line.
1800 <quote>\n</quote> and <quote>\r</quote> have their usual C meanings of linefeed and
1801 carriage-return, respectively.
1805 A <quote>\</quote> at the end of a line can be used to split commands
1806 over multiple lines as it <quote>escapes</quote> the line end, provided
1807 that the split points don't appear in the middle of command names. Lines
1808 are first concatenated before interpretation so that a multi-line can be
1809 commented by commenting out the first line only.
1812 <example id="ex-rc-split">
1813 <title>Splitting long configuration commands over several lines</title>
1815 set status_format="some very \
1822 It is also possible to substitute the output of a Unix command in an
1823 initialization file. This is accomplished by enclosing the command in
1824 backticks (``). In <xref linkend="ex-rc-backtick"/>, the output of the
1825 Unix command <quote>uname -a</quote> will be substituted before the line
1826 is parsed. Since initialization files are line oriented, only the first
1827 line of output from the Unix command will be substituted.
1830 <example id="ex-rc-backtick">
1831 <title>Using external command's output in configuration files</title>
1833 my_hdr X-Operating-System: `uname -a`
1838 Both environment variables and Mutt variables can be accessed by
1839 prepending <quote>$</quote> to the name of the variable. For example,
1842 <example id="ex-rc-env">
1843 <title>Using environment variables in configuration files</title>
1845 set record=+sent_on_$HOSTNAME
1850 will cause Mutt to save outgoing messages to a folder named
1851 <quote>sent_on_kremvax</quote> if the environment variable
1852 <literal>$HOSTNAME</literal> is set to <quote>kremvax.</quote> (See
1853 <link linkend="record">$record</link> for details.)
1857 Mutt expands the variable when it is assigned, not when it is used. If
1858 the value of a variable on the right-hand side of an assignment changes
1859 after the assignment, the variable on the left-hand side will not be
1864 The commands understood by Mutt are explained in the next paragraphs.
1865 For a complete list, see the <link linkend="commands">command
1870 All configuration files are expected to be in the current locale as
1871 specified by the <link linkend="charset">$charset</link> variable which
1872 doesn't have a default value since it's determined by Mutt at startup.
1873 If a configuration file is not encoded in the same character set the
1874 <link linkend="config-charset">$config_charset</link> variable should be
1875 used: all lines starting with the next are recoded from <link
1876 linkend="config-charset">$config_charset</link> to <link
1877 linkend="charset">$charset</link>.
1881 This mechanism should be avoided if possible as it has the following
1887 <listitem><para>These variables should be set early in a configuration
1888 file with <link linkend="charset">$charset</link> preceding <link
1889 linkend="config-charset">$config_charset</link> so Mutt knows what
1890 character set to convert to.</para></listitem>
1892 <listitem><para>If <link linkend="config-charset">$config_charset</link>
1893 is set, it should be set in each configuration file because the value is
1894 global and <emphasis>not</emphasis> per configuration
1895 file.</para></listitem>
1897 <listitem><para>Because Mutt first recodes a line before it attempts to
1898 parse it, a conversion introducing question marks or other characters as
1899 part of errors (unconvertable characters, transliteration) may introduce
1900 syntax errors or silently change the meaning of certain tokens
1901 (e.g. inserting question marks into regular
1902 expressions).</para></listitem>
1908 <sect1 id="addrgroup">
1909 <title>Address Groups</title>
1914 <command>group</command>
1915 <arg choice="opt" rep="repeat">
1916 <option>-group</option>
1917 <replaceable class="parameter">name</replaceable>
1919 <group choice="req">
1920 <arg choice="plain" rep="repeat">
1921 <option>-rx</option>
1922 <replaceable class="parameter">expr</replaceable>
1924 <arg choice="plain" rep="repeat">
1925 <option>-addr</option>
1926 <replaceable class="parameter">expr</replaceable>
1930 <command>ungroup</command>
1931 <arg choice="opt" rep="repeat">
1932 <option>-group</option>
1933 <replaceable class="parameter">name</replaceable>
1935 <group choice="req">
1936 <arg choice="plain">
1937 <replaceable class="parameter">*</replaceable>
1939 <arg choice="plain" rep="repeat">
1940 <option>-rx</option>
1941 <replaceable class="parameter">expr</replaceable>
1943 <arg choice="plain" rep="repeat">
1944 <option>-addr</option>
1945 <replaceable class="parameter">expr</replaceable>
1951 Mutt supports grouping addresses logically into named groups. An address
1952 or address pattern can appear in several groups at the same time. These
1953 groups can be used in <link linkend="patterns">patterns</link> (for searching, limiting and tagging) and
1954 in hooks by using group patterns. This can be useful to classify mail
1955 and take certain actions depending on in what groups the message is.
1956 For example, the mutt user's mailing list would fit into the categories
1957 <quote>mailing list</quote> and <quote>mutt-related</quote>. Using <link
1958 linkend="send-hook"><literal>send-hook</literal></link>, the sender can
1959 be set to a dedicated one for writing mailing list messages, and the
1960 signature could be set to a mutt-related one for writing to a mutt list
1961 — for other lists, the list sender setting still applies but a
1962 different signature can be selected. Or, given a group only containing
1963 recipients known to accept encrypted mail,
1964 <quote>auto-encryption</quote> can be achieved easily.
1968 The <command>group</command> command is used to directly add either
1969 addresses or regular expressions to the specified group or groups. The
1970 different categories of arguments to the <command>group</command>
1971 command can be in any order. The flags <literal>-rx</literal> and
1972 <literal>-addr</literal> specify what the following strings (that cannot
1973 begin with a hyphen) should be interpreted as: either a regular
1974 expression or an email address, respectively.
1978 These address groups can also be created implicitly by the <link
1979 linkend="alias"><command>alias</command></link>, <link
1980 linkend="lists"><command>lists</command></link>, <link
1981 linkend="lists"><command>subscribe</command></link> and <link
1982 linkend="alternates"><command>alternates</command></link> commands by
1983 specifying the optional <literal>-group</literal> option. For example,
1987 alternates -group me address1 address2
1988 alternates -group me -group work address3
1992 would create a group named <quote>me</quote> which contains all your
1993 addresses and a group named <quote>work</quote> which contains only your
1994 work address <emphasis>address3</emphasis>. Besides many other
1995 possibilities, this could be used to automatically mark your own
1996 messages in a mailing list folder as read or use a special signature for
1997 work-related messages.
2001 The <command>ungroup</command> command is used to remove addresses or
2002 regular expressions from the specified group or groups. The syntax is
2003 similar to the <command>group</command> command, however the special
2004 character <literal>*</literal> can be used to empty a group of all of
2005 its contents. As soon as a group gets empty because all addresses and
2006 regular expressions have been removed, it'll internally be removed, too
2007 (i.e. there cannot be an empty group). When removing regular expressions
2008 from a group, the pattern must be specified exactly as given to the
2009 <command>group</command> command or <literal>-group</literal> argument.
2015 <title>Defining/Using Aliases</title>
2020 <command>alias</command>
2021 <arg choice="opt" rep="repeat">
2022 <option>-group</option>
2023 <replaceable class="parameter">name</replaceable>
2025 <arg choice="plain">
2026 <replaceable class="parameter">key</replaceable>
2028 <arg choice="plain">
2029 <replaceable class="parameter">address</replaceable>
2031 <arg choice="opt" rep="repeat">
2032 <replaceable class="parameter">address</replaceable>
2035 <command>unalias</command>
2036 <arg choice="opt" rep="repeat">
2037 <option>-group</option>
2038 <replaceable>name</replaceable>
2040 <group choice="req">
2041 <arg choice="plain">
2042 <replaceable class="parameter">*</replaceable>
2044 <arg choice="plain" rep="repeat">
2045 <replaceable class="parameter">key</replaceable>
2051 It's usually very cumbersome to remember or type out the address of
2052 someone you are communicating with. Mutt allows you to create
2053 <quote>aliases</quote> which map a short string to a full address.
2058 If you want to create an alias for more than one address, you
2059 <emphasis>must</emphasis> separate the addresses with a comma
2065 The optional <literal>-group</literal> argument to
2066 <command>alias</command> causes the aliased address(es) to be added to
2067 the named <emphasis>group</emphasis>.
2071 To remove an alias or aliases (<quote>*</quote> means all aliases):
2075 alias muttdude me@cs.hmc.edu (Michael Elkins)
2076 alias theguys manny, moe, jack
2080 Unlike other mailers, Mutt doesn't require aliases to be defined in a
2081 special file. The <command>alias</command> command can appear anywhere
2082 in a configuration file, as long as this file is <link
2083 linkend="source"><command>source</command>d</link>. Consequently, you
2084 can have multiple alias files, or you can have all aliases defined in
2085 your <literal>.muttrc</literal>.
2089 On the other hand, the <link
2090 linkend="create-alias"><literal><create-alias></literal></link>
2091 function can use only one file, the one pointed to by the <link
2092 linkend="alias-file">$alias_file</link> variable (which is
2093 <literal>~/.muttrc</literal> by default). This file is not special
2094 either, in the sense that Mutt will happily append aliases to any file,
2095 but in order for the new aliases to take effect you need to explicitly
2096 <link linkend="source"><command>source</command></link> this file too.
2099 <example id="ex-alias-external">
2100 <title>Configuring external alias files</title>
2102 source /usr/local/share/Mutt.aliases
2103 source ~/.mail_aliases
2104 set alias_file=~/.mail_aliases
2109 To use aliases, you merely use the alias at any place in Mutt where Mutt
2110 prompts for addresses, such as the <emphasis>To:</emphasis> or
2111 <emphasis>Cc:</emphasis> prompt. You can also enter aliases in your
2112 editor at the appropriate headers if you have the <link
2113 linkend="edit-headers">$edit_headers</link> variable set.
2117 In addition, at the various address prompts, you can use the tab
2118 character to expand a partial alias to the full alias. If there are
2119 multiple matches, Mutt will bring up a menu with the matching aliases.
2120 In order to be presented with the full list of aliases, you must hit tab
2121 without a partial alias, such as at the beginning of the prompt or after
2122 a comma denoting multiple addresses.
2126 In the alias menu, you can select as many aliases as you want with the
2127 <literal>select-entry</literal> key (default: <Return>), and use
2128 the <emphasis>exit</emphasis> key (default: q) to return to the address
2135 <title>Changing the Default Key Bindings</title>
2140 <command>bind</command>
2141 <arg choice="plain">
2142 <replaceable class="parameter">map</replaceable>
2144 <arg choice="plain">
2145 <replaceable class="parameter">key</replaceable>
2147 <arg choice="plain">
2148 <replaceable class="parameter">function</replaceable>
2153 This command allows you to change the default key bindings (operation
2154 invoked when pressing a key).
2158 <emphasis>map</emphasis> specifies in which menu the binding belongs.
2159 Multiple maps may be specified by separating them with commas (no
2160 additional whitespace is allowed). The currently defined maps are:
2167 <term>generic</term>
2170 This is not a real menu, but is used as a fallback for all of the other
2171 menus except for the pager and editor modes. If a key is not defined in
2172 another menu, Mutt will look for a binding to use in this menu. This
2173 allows you to bind a key to a certain function in multiple menus instead
2174 of having multiple <command>bind</command> statements to accomplish the
2183 The alias menu is the list of your personal aliases as defined in your
2184 <literal>.muttrc</literal>. It is the mapping from a short alias name
2185 to the full email address(es) of the recipient(s).
2193 The attachment menu is used to access the attachments on received
2199 <term>browser</term>
2202 The browser is used for both browsing the local directory structure, and
2203 for listing all of your incoming mailboxes.
2211 The editor is used to allow the user to enter a single line of text, such as
2212 the <emphasis>To</emphasis> or <emphasis>Subject</emphasis> prompts in the
2213 <literal>compose</literal> menu.
2221 The index is the list of messages contained in a mailbox.
2226 <term>compose</term>
2229 The compose menu is the screen used when sending a new message.
2237 The pager is the mode used to display message/attachment data, and help
2246 The pgp menu is used to select the OpenPGP keys used to encrypt outgoing
2255 The smime menu is used to select the OpenSSL certificates used to
2256 encrypt outgoing messages.
2261 <term>postpone</term>
2264 The postpone menu is similar to the index menu, except is used when
2265 recalling a message the user was composing, but saved until later.
2273 The query menu is the browser for results returned by <link
2274 linkend="query-command">$query_command</link>.
2282 The mixmaster screen is used to select remailer options for outgoing
2283 messages (if Mutt is compiled with Mixmaster support).
2290 <emphasis>key</emphasis> is the key (or key sequence) you wish to bind.
2291 To specify a control character, use the sequence
2292 <emphasis>\Cx</emphasis>, where <emphasis>x</emphasis> is the letter of
2293 the control character (for example, to specify control-A use
2294 <quote>\Ca</quote>). Note that the case of <emphasis>x</emphasis> as
2295 well as <emphasis>\C</emphasis> is ignored, so that
2296 <emphasis>\CA</emphasis>, <emphasis>\Ca</emphasis>,
2297 <emphasis>\cA</emphasis> and <emphasis>\ca</emphasis> are all
2298 equivalent. An alternative form is to specify the key as a three digit
2299 octal number prefixed with a <quote>\</quote> (for example
2300 <emphasis>\177</emphasis> is equivalent to <emphasis>\c?</emphasis>). In
2301 addition, <emphasis>key</emphasis> may be a symbolic name as shown in
2302 <xref linkend="tab-key-names"/>.
2305 <table id="tab-key-names">
2306 <title>Symbolic key names</title>
2309 <row><entry>Symbolic name</entry><entry>Meaning</entry></row>
2312 <row><entry>\t</entry><entry>tab</entry></row>
2313 <row><entry><tab></entry><entry>tab</entry></row>
2314 <row><entry><backtab></entry><entry>backtab / shift-tab</entry></row>
2315 <row><entry>\r</entry><entry>carriage return</entry></row>
2316 <row><entry>\n</entry><entry>newline</entry></row>
2317 <row><entry>\e</entry><entry>escape</entry></row>
2318 <row><entry><esc></entry><entry>escape</entry></row>
2319 <row><entry><up></entry><entry>up arrow</entry></row>
2320 <row><entry><down></entry><entry>down arrow</entry></row>
2321 <row><entry><left></entry><entry>left arrow</entry></row>
2322 <row><entry><right></entry><entry>right arrow</entry></row>
2323 <row><entry><pageup></entry><entry>Page Up</entry></row>
2324 <row><entry><pagedown></entry><entry>Page Down</entry></row>
2325 <row><entry><backspace></entry><entry>Backspace</entry></row>
2326 <row><entry><delete></entry><entry>Delete</entry></row>
2327 <row><entry><insert></entry><entry>Insert</entry></row>
2328 <row><entry><enter></entry><entry>Enter</entry></row>
2329 <row><entry><return></entry><entry>Return</entry></row>
2330 <row><entry><home></entry><entry>Home</entry></row>
2331 <row><entry><end></entry><entry>End</entry></row>
2332 <row><entry><space></entry><entry>Space bar</entry></row>
2333 <row><entry><f1></entry><entry>function key 1</entry></row>
2334 <row><entry><f10></entry><entry>function key 10</entry></row>
2340 <emphasis>key</emphasis> does not need to be enclosed in quotes unless
2341 it contains a space (<quote> </quote>) or semi-colon
2346 <emphasis>function</emphasis> specifies which action to take when
2347 <emphasis>key</emphasis> is pressed. For a complete list of functions,
2348 see the <link linkend="functions">reference</link>. Note that the
2349 <command>bind</command> expects <emphasis>function</emphasis> to be
2350 specified without angle brackets.
2354 The special function <literal><noop></literal> unbinds the
2355 specified key sequence.
2360 <sect1 id="charset-hook">
2361 <title>Defining Aliases for Character Sets</title>
2366 <command>charset-hook</command>
2367 <arg choice="plain">
2368 <replaceable class="parameter">alias</replaceable>
2370 <arg choice="plain">
2371 <replaceable class="parameter">charset</replaceable>
2374 <command>iconv-hook<anchor id="iconv-hook"/></command>
2375 <arg choice="plain">
2376 <replaceable class="parameter">charset</replaceable>
2378 <arg choice="plain">
2379 <replaceable class="parameter">local-charset</replaceable>
2384 The <command>charset-hook</command> command defines an alias for a
2385 character set. This is useful to properly display messages which are
2386 tagged with a character set name not known to Mutt.
2390 The <command>iconv-hook</command> command defines a system-specific name
2391 for a character set. This is helpful when your systems character
2392 conversion library insists on using strange, system-specific names for
2398 <sect1 id="folder-hook">
2399 <title>Setting Variables Based Upon Mailbox</title>
2404 <command>folder-hook</command>
2405 <arg choice="plain">
2406 <replaceable class="parameter">[!]regexp</replaceable>
2408 <arg choice="plain">
2409 <replaceable class="parameter">command</replaceable>
2414 It is often desirable to change settings based on which mailbox you are
2415 reading. The <command>folder-hook</command> command provides a method
2416 by which you can execute any configuration command.
2417 <emphasis>regexp</emphasis> is a regular expression specifying in which
2418 mailboxes to execute <emphasis>command</emphasis> before loading. If a
2419 mailbox matches multiple <command>folder-hook</command>s, they are
2420 executed in the order given in the <literal>.muttrc</literal>.
2425 If you use the <quote>!</quote> shortcut for <link
2426 linkend="spoolfile">$spoolfile</link> at the beginning of the pattern,
2427 you must place it inside of double or single quotes in order to
2428 distinguish it from the logical <emphasis>not</emphasis> operator for
2435 Settings are <emphasis>not</emphasis> restored when you leave the
2436 mailbox. For example, a command action to perform is to change the
2437 sorting method based upon the mailbox being read:
2441 folder-hook mutt "set sort=threads"</screen>
2444 However, the sorting method is not restored to its previous value when
2445 reading a different mailbox. To specify a <emphasis>default</emphasis>
2446 command, use the pattern <quote>.</quote> before other
2447 <command>folder-hook</command>s adjusting a value on a per-folder basis
2448 because <command>folder-hook</command>s are evaluated in the order given
2449 in the configuration file.
2454 The following example will set the <link linkend="sort">sort</link>
2455 variable to <literal>date-sent</literal> for all folders but to
2456 <literal>threads</literal> for all folders containing
2457 <quote>mutt</quote> in their name.
2460 <example id="ex-folder-sorting">
2461 <title>Setting sort method based on mailbox name</title>
2463 folder-hook . "set sort=date-sent"
2464 folder-hook mutt "set sort=threads"
2471 <title>Keyboard Macros</title>
2476 <command>macro</command>
2477 <arg choice="plain">
2478 <replaceable class="parameter">menu</replaceable>
2480 <arg choice="plain">
2481 <replaceable class="parameter">key</replaceable>
2483 <arg choice="plain">
2484 <replaceable class="parameter">sequence</replaceable>
2487 <replaceable class="parameter">description</replaceable>
2492 Macros are useful when you would like a single key to perform a series
2493 of actions. When you press <emphasis>key</emphasis> in menu
2494 <emphasis>menu</emphasis>, Mutt will behave as if you had typed
2495 <emphasis>sequence</emphasis>. So if you have a common sequence of
2496 commands you type, you can create a macro to execute those commands with
2497 a single key or fewer keys.
2501 <emphasis>menu</emphasis> is the <link linkend="maps">map</link> which
2502 the macro will be bound in. Multiple maps may be specified by
2503 separating multiple menu arguments by commas. Whitespace may not be used
2504 in between the menu arguments and the commas separating them.
2508 <emphasis>key</emphasis> and <emphasis>sequence</emphasis> are expanded
2509 by the same rules as the <link linkend="bind">key bindings</link> with
2510 some additions. The first is that control characters in
2511 <emphasis>sequence</emphasis> can also be specified as
2512 <emphasis>^x</emphasis>. In order to get a caret (<quote>^</quote>) you
2513 need to use <emphasis>^^</emphasis>. Secondly, to specify a certain key
2514 such as <emphasis>up</emphasis> or to invoke a function directly, you
2515 can use the format <emphasis><key name></emphasis> and
2516 <emphasis><function name></emphasis>. For a listing of key names
2517 see the section on <link linkend="bind">key bindings</link>. Functions
2518 are listed in the <link linkend="functions">reference</link>.
2522 The advantage with using function names directly is that the macros will
2523 work regardless of the current key bindings, so they are not dependent
2524 on the user having particular key definitions. This makes them more
2525 robust and portable, and also facilitates defining of macros in files
2526 used by more than one user (e.g., the system Muttrc).
2530 Optionally you can specify a descriptive text after
2531 <emphasis>sequence</emphasis>, which is shown in the help screens if
2532 they contain a description.
2537 Macro definitions (if any) listed in the help screen(s), are
2538 silently truncated at the screen width, and are not wrapped.
2545 <title>Using Color and Mono Video Attributes</title>
2550 <command>color</command>
2551 <arg choice="plain">
2552 <replaceable class="parameter">object</replaceable>
2554 <arg choice="plain">
2555 <replaceable class="parameter">foreground</replaceable>
2557 <arg choice="plain">
2558 <replaceable class="parameter">background</replaceable>
2561 <command>color</command>
2562 <group choice="req">
2563 <arg choice="plain">
2564 <option>header</option>
2566 <arg choice="plain">
2567 <option>body</option>
2570 <arg choice="plain">
2571 <replaceable class="parameter">foreground</replaceable>
2573 <arg choice="plain">
2574 <replaceable class="parameter">background</replaceable>
2576 <arg choice="plain">
2577 <replaceable class="parameter">regexp</replaceable>
2580 <command>color</command>
2581 <arg choice="plain">
2582 <option>index</option>
2584 <arg choice="plain">
2585 <replaceable class="parameter">foreground</replaceable>
2587 <arg choice="plain">
2588 <replaceable class="parameter">background</replaceable>
2590 <arg choice="plain">
2591 <replaceable class="parameter">pattern</replaceable>
2594 <command>uncolor</command>
2595 <group choice="req">
2596 <arg choice="plain">
2597 <option>index</option>
2599 <arg choice="plain">
2600 <option>header</option>
2602 <arg choice="plain">
2603 <option>body</option>
2606 <group choice="req">
2607 <arg choice="plain">
2608 <replaceable>*</replaceable>
2610 <arg choice="plain" rep="repeat">
2611 <replaceable>pattern</replaceable>
2617 If your terminal supports color, you can spice up Mutt by creating your
2618 own color scheme. To define the color of an object (type of
2619 information), you must specify both a foreground color
2620 <emphasis>and</emphasis> a background color (it is not possible to only
2621 specify one or the other).
2625 <emphasis>header</emphasis> and <emphasis>body</emphasis> match
2626 <emphasis>regexp</emphasis> in the header/body of a message,
2627 <emphasis>index</emphasis> matches <emphasis>pattern</emphasis> (see
2628 <xref linkend="patterns"/>) in the message index.
2632 <emphasis>object</emphasis> can be one of:
2636 <listitem><para>attachment</para></listitem>
2637 <listitem><para>bold (highlighting bold patterns in the body of messages)</para></listitem>
2638 <listitem><para>error (error messages printed by Mutt)</para></listitem>
2639 <listitem><para>hdrdefault (default color of the message header in the pager)</para></listitem>
2640 <listitem><para>indicator (arrow or bar used to indicate the current item in a menu)</para></listitem>
2641 <listitem><para>markers (the <quote>+</quote> markers at the beginning of wrapped lines in the pager)</para></listitem>
2642 <listitem><para>message (informational messages)</para></listitem>
2643 <listitem><para>normal</para></listitem>
2644 <listitem><para>quoted (text matching <link linkend="quote-regexp">$quote_regexp</link> in the body of a message)</para></listitem>
2645 <listitem><para>quoted1, quoted2, ..., quoted<emphasis>N</emphasis> (higher levels of quoting)</para></listitem>
2646 <listitem><para>search (highlighting of words in the pager)</para></listitem>
2647 <listitem><para>signature</para></listitem><listitem><para>status (mode lines used to display info about the mailbox or message)</para></listitem>
2648 <listitem><para>tilde (the <quote>~</quote> used to pad blank lines in the pager)</para></listitem>
2649 <listitem><para>tree (thread tree drawn in the message index and attachment menu)</para></listitem>
2650 <listitem><para>underline (highlighting underlined patterns in the body of messages)</para></listitem>
2654 <emphasis>foreground</emphasis> and <emphasis>background</emphasis> can
2655 be one of the following:
2659 <listitem><para>white</para></listitem>
2660 <listitem><para>black</para></listitem>
2661 <listitem><para>green</para></listitem>
2662 <listitem><para>magenta</para></listitem>
2663 <listitem><para>blue</para></listitem>
2664 <listitem><para>cyan</para></listitem>
2665 <listitem><para>yellow</para></listitem>
2666 <listitem><para>red</para></listitem>
2667 <listitem><para>default</para></listitem>
2668 <listitem><para>color<emphasis>x</emphasis></para>
2673 <emphasis>foreground</emphasis> can optionally be prefixed with the
2674 keyword <literal>bright</literal> to make the foreground color boldfaced
2675 (e.g., <literal>brightred</literal>).
2679 If your terminal supports it, the special keyword
2680 <emphasis>default</emphasis> can be used as a transparent color. The
2681 value <emphasis>brightdefault</emphasis> is also valid. If Mutt is
2682 linked against the <emphasis>S-Lang</emphasis> library, you also need to
2683 set the <literal>$COLORFGBG</literal> environment variable to the
2684 default colors of your terminal for this to work; for example (for
2685 Bourne-like shells):
2689 set COLORFGBG="green;black"
2695 The <emphasis>S-Lang</emphasis> library requires you to use the
2696 <emphasis>lightgray</emphasis> and <emphasis>brown</emphasis> keywords
2697 instead of <emphasis>white</emphasis> and <emphasis>yellow</emphasis>
2698 when setting this variable.
2704 The <command>uncolor</command> command can be applied to the index,
2705 header and body objects only. It removes entries from the list. You
2706 <emphasis>must</emphasis> specify the same pattern specified in the
2707 <command>color</command> command for it to be removed. The pattern
2708 <quote>*</quote> is a special token which means to clear the color list
2714 Mutt also recognizes the keywords <emphasis>color0</emphasis>,
2715 <emphasis>color1</emphasis>, ...,
2716 <emphasis>color</emphasis><emphasis>N-1</emphasis>
2717 (<emphasis>N</emphasis> being the number of colors supported by your
2718 terminal). This is useful when you remap the colors for your display
2719 (for example by changing the color associated with
2720 <emphasis>color2</emphasis> for your xterm), since color names may then
2721 lose their normal meaning.
2726 If your terminal does not support color, it is still possible change the
2727 video attributes through the use of the <quote>mono</quote>
2732 <command>mono</command>
2733 <arg choice="plain">
2734 <replaceable class="parameter">object</replaceable>
2736 <arg choice="plain">
2737 <replaceable class="parameter">attribute</replaceable>
2740 <command>mono</command>
2741 <group choice="req">
2742 <arg choice="plain">
2743 <option>header</option>
2745 <arg choice="plain">
2746 <option>body</option>
2749 <arg choice="plain">
2750 <replaceable class="parameter">attribute</replaceable>
2752 <arg choice="plain">
2753 <replaceable class="parameter">regexp</replaceable>
2756 <command>mono</command>
2757 <arg choice="plain">
2758 <option>index</option>
2760 <arg choice="plain">
2761 <replaceable class="parameter">attribute</replaceable>
2763 <arg choice="plain">
2764 <replaceable class="parameter">pattern</replaceable>
2767 <command>unmono</command>
2768 <group choice="req">
2769 <arg choice="plain">
2770 <option>index</option>
2772 <arg choice="plain">
2773 <option>header</option>
2775 <arg choice="plain">
2776 <option>body</option>
2779 <group choice="req">
2780 <arg choice="plain">
2781 <replaceable>*</replaceable>
2783 <arg choice="plain" rep="repeat">
2784 <replaceable>pattern</replaceable>
2790 For <emphasis>object</emphasis>, see the <command>color</command>
2791 command. <emphasis>attribute</emphasis> can be one of the following:
2795 <listitem><para>none</para></listitem>
2796 <listitem><para>bold</para></listitem>
2797 <listitem><para>underline</para></listitem>
2798 <listitem><para>reverse</para></listitem>
2799 <listitem><para>standout</para></listitem>
2804 <sect1 id="msg-hdr-display">
2805 <title>Message Header Display</title>
2807 <sect2 id="hdr-folding">
2808 <title>Header Display</title>
2811 When displaying a message in the pager, Mutt folds long header lines at
2812 <link linkend="wrap">$wrap</link> columns. Though there're precise rules
2813 about where to break and how, Mutt always folds headers using a tab for
2814 readability. (Note that the sending side is not affected by this, Mutt
2815 tries to implement standards compliant folding.)
2821 <title>Selecting Headers</title>
2826 <command>ignore</command>
2827 <arg choice="plain">
2828 <replaceable class="parameter">pattern</replaceable>
2830 <arg choice="opt" rep="repeat">
2831 <replaceable class="parameter">pattern</replaceable>
2834 <command>unignore</command>
2835 <group choice="req">
2836 <arg choice="plain">
2837 <replaceable>*</replaceable>
2839 <arg choice="plain" rep="repeat">
2840 <replaceable>pattern</replaceable>
2846 Messages often have many header fields added by automatic processing
2847 systems, or which may not seem useful to display on the screen. This
2848 command allows you to specify header fields which you don't normally
2849 want to see in the pager.
2853 You do not need to specify the full header field name. For example,
2854 <quote>ignore content-</quote> will ignore all header fields that begin
2855 with the pattern <quote>content-</quote>. <quote>ignore *</quote> will
2860 To remove a previously added token from the list, use the
2861 <quote>unignore</quote> command. The <quote>unignore</quote> command
2862 will make Mutt display headers with the given pattern. For example, if
2863 you do <quote>ignore x-</quote> it is possible to <quote>unignore
2868 <quote>unignore *</quote> will remove all tokens from the ignore list.
2871 <example id="ex-header-weeding">
2872 <title>Header weeding</title>
2874 <emphasis role="comment"># Sven's draconian header weeding</emphasis>
2876 unignore from date subject to cc
2877 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
2884 <sect2 id="hdr-order">
2885 <title>Ordering Displayed Headers</title>
2890 <command>hdr_order</command>
2891 <arg choice="plain">
2892 <replaceable class="parameter">header</replaceable>
2894 <arg choice="opt" rep="repeat">
2895 <replaceable class="parameter">header</replaceable>
2898 <command>unhdr_order</command>
2899 <group choice="req">
2900 <arg choice="plain">
2901 <replaceable>*</replaceable>
2903 <arg choice="plain" rep="repeat">
2904 <replaceable>header</replaceable>
2910 With the <command>hdr_order</command> command you can specify an order
2911 in which Mutt will attempt to present these headers to you when viewing
2916 <quote><command>unhdr_order</command> *</quote> will clear all previous
2917 headers from the order list, thus removing the header order effects set
2918 by the system-wide startup file.
2921 <example id="ex-hdr-order">
2922 <title>Configuring header display order</title>
2924 hdr_order From Date: From: To: Cc: Subject:
2931 <sect1 id="alternates">
2932 <title>Alternative Addresses</title>
2937 <command>alternates</command>
2938 <arg choice="opt" rep="repeat">
2939 <option>-group</option>
2940 <replaceable>name</replaceable>
2942 <arg choice="plain">
2943 <replaceable>regexp</replaceable>
2945 <arg choice="opt" rep="repeat">
2946 <replaceable>regexp</replaceable>
2949 <command>unalternates</command>
2950 <arg choice="opt" rep="repeat">
2951 <option>-group</option>
2952 <replaceable>name</replaceable>
2954 <group choice="req">
2955 <arg choice="plain">
2956 <replaceable>*</replaceable>
2958 <arg choice="plain" rep="repeat">
2959 <replaceable>regexp</replaceable>
2965 With various functions, Mutt will treat messages differently, depending
2966 on whether you sent them or whether you received them from someone else.
2967 For instance, when replying to a message that you sent to a different
2968 party, Mutt will automatically suggest to send the response to the
2969 original message's recipients — responding to yourself won't make
2970 much sense in many cases. (See <link
2971 linkend="reply-to">$reply_to</link>.)
2975 Many users receive e-mail under a number of different addresses. To
2976 fully use Mutt's features here, the program must be able to recognize
2977 what e-mail addresses you receive mail under. That's the purpose of the
2978 <command>alternates</command> command: It takes a list of regular
2979 expressions, each of which can identify an address under which you
2984 As addresses are matched using regular expressions and not exact strict
2985 comparisons, you should make sure you specify your addresses as precise
2986 as possible to avoid mismatches. For example, if you specify:
2990 alternates user@example
2994 Mutt will consider <quote><literal>some-user@example</literal></quote>
2995 as being your address, too which may not be desired. As a solution, in
2996 such cases addresses should be specified as:
3000 alternates '^user@example$'
3004 The <literal>-group</literal> flag causes all of the subsequent regular
3005 expressions to be added to the named group.
3009 The <command>unalternates</command> command can be used to write
3010 exceptions to <command>alternates</command> patterns. If an address
3011 matches something in an <command>alternates</command> command, but you
3012 nonetheless do not think it is from you, you can list a more precise
3013 pattern under an <command>unalternates</command> command.
3017 To remove a regular expression from the <command>alternates</command>
3018 list, use the <command>unalternates</command> command with exactly the
3019 same <emphasis>regexp</emphasis>. Likewise, if the
3020 <emphasis>regexp</emphasis> for an <command>alternates</command> command
3021 matches an entry on the <command>unalternates</command> list, that
3022 <command>unalternates</command> entry will be removed. If the
3023 <emphasis>regexp</emphasis> for <command>unalternates</command> is
3024 <quote>*</quote>, <emphasis>all entries</emphasis> on
3025 <command>alternates</command> will be removed.
3031 <title>Mailing Lists</title>
3033 <anchor id="subscribe"/>
3037 <command>lists</command>
3038 <arg choice="opt" rep="repeat">
3039 <option>-group</option>
3040 <replaceable class="parameter">name</replaceable>
3042 <arg choice="plain">
3043 <replaceable class="parameter">regexp</replaceable>
3045 <arg choice="opt" rep="repeat">
3046 <replaceable class="parameter">regexp</replaceable>
3049 <command>unlists</command>
3050 <group choice="req">
3051 <arg choice="plain">
3052 <replaceable class="parameter">*</replaceable>
3054 <arg choice="plain" rep="repeat">
3055 <replaceable class="parameter">regexp</replaceable>
3059 <command>subscribe</command>
3060 <arg choice="opt" rep="repeat">
3061 <option>-group</option>
3062 <replaceable class="parameter">name</replaceable>
3064 <arg choice="plain">
3065 <replaceable class="parameter">regexp</replaceable>
3067 <arg choice="opt" rep="repeat">
3068 <replaceable class="parameter">regexp</replaceable>
3071 <command>unsubscribe</command>
3072 <group choice="req">
3073 <arg choice="plain">
3074 <replaceable class="parameter">*</replaceable>
3076 <arg choice="plain" rep="repeat">
3077 <replaceable class="parameter">regexp</replaceable>
3083 Mutt has a few nice features for <link linkend="using-lists">handling
3084 mailing lists</link>. In order to take advantage of them, you must
3085 specify which addresses belong to mailing lists, and which mailing lists
3086 you are subscribed to. Mutt also has limited support for auto-detecting
3087 mailing lists: it supports parsing <literal>mailto:</literal> links in
3088 the common <literal>List-Post:</literal> header which has the same
3089 effect as specifying the list address via the <command>lists</command>
3090 command (except the group feature). Once you have done this, the <link
3091 linkend="list-reply"><literal><list-reply></literal></link>
3092 function will work for all known lists. Additionally, when you send a
3093 message to a subscribed list, Mutt will add a Mail-Followup-To header to
3094 tell other users' mail user agents not to send copies of replies to your
3100 The Mail-Followup-To header is a non-standard extension which is not
3101 supported by all mail user agents. Adding it is not bullet-proof
3102 against receiving personal CCs of list messages. Also note that the
3103 generation of the Mail-Followup-To header is controlled by the <link
3104 linkend="followup-to">$followup_to</link> configuration variable since
3105 it's common practice on some mailing lists to send Cc upon replies
3106 (which is more a group- than a list-reply).
3111 More precisely, Mutt maintains lists of patterns for the addresses of
3112 known and subscribed mailing lists. Every subscribed mailing list is
3113 known. To mark a mailing list as known, use the <command>list</command>
3114 command. To mark it as subscribed, use <command>subscribe</command>.
3118 You can use regular expressions with both commands. To mark all messages
3119 sent to a specific bug report's address on Debian's bug tracking system
3120 as list mail, for instance, you could say
3124 subscribe [0-9]*.*@bugs.debian.org</screen>
3127 as it's often sufficient to just give a portion of the list's e-mail
3132 Specify as much of the address as you need to to remove ambiguity. For
3133 example, if you've subscribed to the Mutt mailing list, you will receive
3134 mail addressed to <literal>mutt-users@mutt.org</literal>. So, to tell
3135 Mutt that this is a mailing list, you could add <literal>lists
3136 mutt-users@</literal> to your initialization file. To tell Mutt that
3137 you are subscribed to it, add <literal><command>subscribe</command>
3138 mutt-users</literal> to your initialization file instead. If you also
3139 happen to get mail from someone whose address is
3140 <literal>mutt-users@example.com</literal>, you could use
3141 <literal><command>lists</command> ^mutt-users@mutt\\.org$</literal> or
3142 <literal><command>subscribe</command> ^mutt-users@mutt\\.org$</literal>
3143 to match only mail from the actual list.
3147 The <literal>-group</literal> flag adds all of the subsequent regular
3148 expressions to the named <link linkend="addrgroup">address group</link>
3149 in addition to adding to the specified address list.
3153 The <quote>unlists</quote> command is used to remove a token from the
3154 list of known and subscribed mailing-lists. Use <quote>unlists *</quote>
3155 to remove all tokens.
3159 To remove a mailing list from the list of subscribed mailing lists, but
3160 keep it on the list of known mailing lists, use
3161 <command>unsubscribe</command>.
3166 <sect1 id="mbox-hook">
3167 <title>Using Multiple Spool Mailboxes</title>
3172 <command>mbox-hook</command>
3173 <arg choice="plain">
3174 <replaceable class="parameter">[!]pattern</replaceable>
3176 <arg choice="plain">
3177 <replaceable class="parameter">mailbox</replaceable>
3182 This command is used to move read messages from a specified mailbox to a
3183 different mailbox automatically when you quit or change folders.
3184 <emphasis>pattern</emphasis> is a regular expression specifying the
3185 mailbox to treat as a <quote>spool</quote> mailbox and
3186 <emphasis>mailbox</emphasis> specifies where mail should be saved when
3191 Unlike some of the other <emphasis>hook</emphasis> commands, only the
3192 <emphasis>first</emphasis> matching pattern is used (it is not possible
3193 to save read mail in more than a single mailbox).
3198 <sect1 id="mailboxes">
3199 <title>Monitoring Incoming Mail</title>
3204 <command>mailboxes</command>
3205 <arg choice="plain">
3206 <replaceable class="parameter">mailbox</replaceable>
3208 <arg choice="opt" rep="repeat">
3209 <replaceable class="parameter">mailbox</replaceable>
3212 <command>unmailboxes</command>
3213 <group choice="req">
3214 <arg choice="plain">
3215 <replaceable class="parameter">*</replaceable>
3217 <arg choice="plain" rep="repeat">
3218 <replaceable class="parameter">mailbox</replaceable>
3224 This command specifies folders which can receive mail and which will be
3225 checked for new messages periodically.
3229 <emphasis>folder</emphasis> can either be a local file or directory
3230 (Mbox/Mmdf or Maildir/Mh). If Mutt was built with POP and/or IMAP
3231 support, <emphasis>folder</emphasis> can also be a POP/IMAP folder
3232 URL. The URL syntax is described in <xref linkend="url-syntax"/>, POP
3233 and IMAP are described in <xref linkend="pop"/> and <xref
3234 linkend="imap"/> respectively.
3238 Mutt provides a number of advanced features for handling (possibly many)
3239 folders and new mail within them, please refer to <xref
3240 linkend="new-mail"/> for details (including in what situations and how
3241 often Mutt checks for new mail).
3245 The <quote>unmailboxes</quote> command is used to remove a token from
3246 the list of folders which receive mail. Use <quote>unmailboxes *</quote>
3247 to remove all tokens.
3252 The folders in the <command>mailboxes</command> command are resolved
3253 when the command is executed, so if these names contain <link
3254 linkend="shortcuts">shortcut characters</link> (such as <quote>=</quote>
3255 and <quote>!</quote>), any variable definition that affects these
3256 characters (like <link linkend="folder">$folder</link> and <link
3257 linkend="spoolfile">$spoolfile</link>) should be set before the
3258 <command>mailboxes</command> command. If none of these shortcuts are
3259 used, a local path should be absolute as otherwise Mutt tries to find it
3260 relative to the directory from where Mutt was started which may not
3268 <title>User-Defined Headers</title>
3273 <command>my_hdr</command>
3274 <arg choice="plain">
3275 <replaceable class="parameter">string</replaceable>
3278 <command>unmy_hdr</command>
3279 <group choice="req">
3280 <arg choice="plain">
3281 <replaceable class="parameter">*</replaceable>
3283 <arg choice="plain" rep="repeat">
3284 <replaceable class="parameter">field</replaceable>
3290 The <command>my_hdr</command> command allows you to create your own
3291 header fields which will be added to every message you send and appear
3292 in the editor if <link linkend="edit-headers">$edit_headers</link> is
3297 For example, if you would like to add an <quote>Organization:</quote>
3298 header field to all of your outgoing messages, you can put the command
3299 something like shown in <xref linkend="ex-my-hdr"/> in your
3300 <literal>.muttrc</literal>.
3303 <example id="ex-my-hdr">
3304 <title>Defining custom headers</title>
3306 my_hdr Organization: A Really Big Company, Anytown, USA
3312 Space characters are <emphasis>not</emphasis> allowed between the
3313 keyword and the colon (<quote>:</quote>). The standard for electronic
3314 mail (RFC2822) says that space is illegal there, so Mutt enforces the
3320 If you would like to add a header field to a single message, you should
3321 either set the <link linkend="edit-headers">$edit_headers</link>
3322 variable, or use the <literal><edit-headers></literal> function
3323 (default: <quote>E</quote>) in the compose menu so that you can edit the
3324 header of your message along with the body.
3328 To remove user defined header fields, use the
3329 <command>unmy_hdr</command> command. You may specify an asterisk
3330 (<quote>*</quote>) to remove all header fields, or the fields to
3331 remove. For example, to remove all <quote>To</quote> and
3332 <quote>Cc</quote> header fields, you could use:
3341 <sect1 id="save-hook">
3342 <title>Specify Default Save Mailbox</title>
3347 <command>save-hook</command>
3348 <arg choice="plain">
3349 <replaceable class="parameter">[!]pattern</replaceable>
3351 <arg choice="plain">
3352 <replaceable class="parameter">mailbox</replaceable>
3357 This command is used to override the default mailbox used when saving
3358 messages. <emphasis>mailbox</emphasis> will be used as the default if
3359 the message matches <emphasis>pattern</emphasis>, see <xref
3360 linkend="pattern-hook"/> for information on the exact format.
3364 To provide more flexibility and good defaults, Mutt applies the expandos
3365 of <link linkend="index-format">$index_format</link> to
3366 <emphasis>mailbox</emphasis> after it was expanded.
3369 <example id="ex-save-hook-exando">
3370 <title>Using %-expandos in <command>save-hook</command></title>
3372 <emphasis role="comment"># default: save all to ~/Mail/<author name></emphasis>
3373 save-hook . ~/Mail/%F
3375 <emphasis role="comment"># save from me@turing.cs.hmc.edu and me@cs.hmc.edu to $folder/elkins</emphasis>
3376 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
3378 <emphasis role="comment"># save from aol.com to $folder/spam</emphasis>
3379 save-hook aol\\.com$ +spam
3385 linkend="fcc-save-hook"><command>fcc-save-hook</command></link> command.
3390 <sect1 id="fcc-hook">
3391 <title>Specify Default Fcc: Mailbox When Composing</title>
3396 <command>fcc-hook</command>
3397 <arg choice="plain">
3398 <replaceable class="parameter">[!]pattern</replaceable>
3400 <arg choice="plain">
3401 <replaceable class="parameter">mailbox</replaceable>
3406 This command is used to save outgoing mail in a mailbox other than <link
3407 linkend="record">$record</link>. Mutt searches the initial list of
3408 message recipients for the first matching <emphasis>regexp</emphasis>
3409 and uses <emphasis>mailbox</emphasis> as the default Fcc: mailbox. If
3410 no match is found the message will be saved to <link
3411 linkend="record">$record</link> mailbox.
3415 To provide more flexibility and good defaults, Mutt applies the
3416 expandos of <link linkend="index-format">$index_format</link> to
3417 <emphasis>mailbox</emphasis> after it was expanded.
3421 See <xref linkend="pattern-hook"/> for information on the exact format
3422 of <emphasis>pattern</emphasis>.
3425 <screen>fcc-hook [@.]aol\\.com$ +spammers</screen>
3428 ...will save a copy of all messages going to the aol.com domain to the
3429 `+spammers' mailbox by default. Also see the <link
3430 linkend="fcc-save-hook"><command>fcc-save-hook</command></link> command.
3435 <sect1 id="fcc-save-hook">
3436 <title>Specify Default Save Filename and Default Fcc: Mailbox at Once</title>
3441 <command>fcc-save-hook</command>
3442 <arg choice="plain">
3443 <replaceable class="parameter">[!]pattern</replaceable>
3445 <arg choice="plain">
3446 <replaceable class="parameter">mailbox</replaceable>
3451 This command is a shortcut, equivalent to doing both a <link
3452 linkend="fcc-hook"><command>fcc-hook</command></link> and a <link
3453 linkend="save-hook"><command>save-hook</command></link> with its
3454 arguments, including %-expansion on <emphasis>mailbox</emphasis>
3455 according to <link linkend="index-format">$index_format</link>.
3460 <sect1 id="send-hook">
3461 <title>Change Settings Based Upon Message Recipients</title>
3463 <anchor id="reply-hook"/>
3464 <anchor id="send2-hook"/>
3469 <command>reply-hook</command>
3470 <arg choice="plain">
3471 <replaceable class="parameter">[!]pattern</replaceable>
3473 <arg choice="plain">
3474 <replaceable class="parameter">command</replaceable>
3477 <command>send-hook</command>
3478 <arg choice="plain">
3479 <replaceable class="parameter">[!]pattern</replaceable>
3481 <arg choice="plain">
3482 <replaceable class="parameter">command</replaceable>
3485 <command>send2-hook</command>
3486 <arg choice="plain">
3487 <replaceable class="parameter">[!]pattern</replaceable>
3489 <arg choice="plain">
3490 <replaceable class="parameter">command</replaceable>
3495 These commands can be used to execute arbitrary configuration commands
3496 based upon recipients of the message. <emphasis>pattern</emphasis> is
3497 used to match the message, see <xref linkend="pattern-hook"/> for
3498 details. <emphasis>command</emphasis> is executed when
3499 <emphasis>pattern</emphasis> matches.
3503 <command>reply-hook</command> is matched against the message you are
3504 <emphasis>replying to</emphasis>, instead of the message you are
3505 <emphasis>sending</emphasis>. <command>send-hook</command> is matched
3506 against all messages, both <emphasis>new</emphasis> and
3507 <emphasis>replies</emphasis>.
3512 <command>reply-hook</command>s are matched <emphasis>before</emphasis>
3513 the <command>send-hook</command>, <emphasis>regardless</emphasis> of the
3514 order specified in the user's configuration file.
3519 <command>send2-hook</command> is matched every time a message is
3520 changed, either by editing it, or by using the compose menu to change
3521 its recipients or subject. <command>send2-hook</command> is executed
3522 after <command>send-hook</command>, and can, e.g., be used to set
3523 parameters such as the <link linkend="sendmail">$sendmail</link>
3524 variable depending on the message's sender address.
3528 For each type of <command>send-hook</command> or
3529 <command>reply-hook</command>, when multiple matches occur, commands are
3530 executed in the order they are specified in the
3531 <literal>.muttrc</literal> (for that type of hook).
3535 Example: <literal><command>send-hook</command> mutt
3536 "<command>set</command> mime_forward signature=''"</literal>
3540 Another typical use for this command is to change the values of the
3541 <link linkend="attribution">$attribution</link>, <link
3542 linkend="signature">$signature</link> and <link
3543 linkend="locale">$locale</link> variables in order to change the
3544 language of the attributions and signatures based upon the recipients.
3549 <command>send-hook</command>'s are only executed once after getting the
3550 initial list of recipients. Adding a recipient after replying or
3551 editing the message will not cause any <command>send-hook</command> to
3552 be executed, similarly if <link linkend="autoedit">$autoedit</link> is
3553 set (as then the initial list of recipients is empty). Also note that
3554 <link linkend="my-hdr"><command>my_hdr</command></link> commands which
3555 modify recipient headers, or the message's subject, don't have any
3556 effect on the current message when executed from a
3557 <command>send-hook</command>.
3563 <sect1 id="message-hook">
3564 <title>Change Settings Before Formatting a Message</title>
3569 <command>message-hook</command>
3570 <arg choice="plain">
3571 <replaceable class="parameter">[!]pattern</replaceable>
3573 <arg choice="plain">
3574 <replaceable class="parameter">command</replaceable>
3579 This command can be used to execute arbitrary configuration commands
3580 before viewing or formatting a message based upon information about the
3581 message. <emphasis>command</emphasis> is executed if the
3582 <emphasis>pattern</emphasis> matches the message to be displayed. When
3583 multiple matches occur, commands are executed in the order they are
3584 specified in the <literal>.muttrc</literal>.
3588 See <xref linkend="pattern-hook"/> for information on the exact format
3589 of <emphasis>pattern</emphasis>.
3597 message-hook ~A 'set pager=builtin'
3598 message-hook '~f freshmeat-news' 'set pager="less \"+/^ subject: .*\""'
3603 <sect1 id="crypt-hook">
3604 <title>Choosing the Cryptographic Key of the Recipient</title>
3609 <command>crypt-hook</command>
3610 <arg choice="plain">
3611 <replaceable class="parameter">pattern</replaceable>
3613 <arg choice="plain">
3614 <replaceable class="parameter">keyid</replaceable>
3619 When encrypting messages with PGP/GnuPG or OpenSSL, you may want to
3620 associate a certain key with a given e-mail address automatically,
3621 either because the recipient's public key can't be deduced from the
3622 destination address, or because, for some reasons, you need to override
3623 the key Mutt would normally use. The <command>crypt-hook</command>
3624 command provides a method by which you can specify the ID of the public
3625 key to be used when encrypting messages to a certain recipient.
3629 The meaning of <emphasis>keyid</emphasis> is to be taken broadly in this
3630 context: You can either put a numerical key ID here, an e-mail address,
3631 or even just a real name.
3637 <title>Adding Key Sequences to the Keyboard Buffer</title>
3642 <command>push</command>
3643 <arg choice="plain">
3644 <replaceable class="parameter">string</replaceable>
3649 This command adds the named string to the keyboard buffer. The string
3650 may contain control characters, key names and function names like the
3651 sequence string in the <link linkend="macro">macro</link> command. You
3652 may use it to automatically run a sequence of commands at startup, or
3653 when entering certain folders. For example, <xref
3654 linkend="ex-folder-hook-push"/> shows how to automatically collapse all
3655 threads when entering a folder.
3658 <example id="ex-folder-hook-push">
3659 <title>Embedding <command>push</command> in <command>folder-hook</command></title>
3661 folder-hook . 'push <collapse-all>'
3666 For using functions like shown in the example, it's important to use
3667 angle brackets (<quote><</quote> and <quote>></quote>) to make
3668 Mutt recognize the input as a function name. Otherwise it will simulate
3669 individual just keystrokes, i.e. <quote><literal>push
3670 collapse-all</literal></quote> would be interpreted as if you had typed
3671 <quote>c</quote>, followed by <quote>o</quote>, followed by
3672 <quote>l</quote>, ..., which is not desired and may lead to very
3673 unexpected behavior.
3677 Keystrokes can be used, too, but are less portable because of
3678 potentially changed key bindings. With default bindings, this is
3679 equivalent to the above example:
3683 folder-hook . 'push \eV'
3687 because it simulates that Esc+V was pressed (which is the default
3688 binding of <literal><collapse-all></literal>).
3694 <title>Executing Functions</title>
3699 <command>exec</command>
3700 <arg choice="plain">
3701 <replaceable class="parameter">function</replaceable>
3703 <arg choice="opt" rep="repeat">
3704 <replaceable class="parameter">function</replaceable>
3709 This command can be used to execute any function. Functions are listed
3710 in the <link linkend="functions">function reference</link>.
3711 <quote><command>exec</command> <literal>function</literal></quote> is
3712 equivalent to <quote><literal>push <function></literal></quote>.
3717 <sect1 id="score-command">
3718 <title>Message Scoring</title>
3723 <command>score</command>
3724 <arg choice="plain">
3725 <replaceable class="parameter">pattern</replaceable>
3727 <arg choice="plain">
3728 <replaceable class="parameter">value</replaceable>
3731 <command>unscore</command>
3732 <group choice="req">
3733 <arg choice="plain">
3734 <replaceable class="parameter">*</replaceable>
3736 <arg choice="plain" rep="repeat">
3737 <replaceable class="parameter">pattern</replaceable>
3743 The <command>score</command> commands adds <emphasis>value</emphasis> to
3744 a message's score if <emphasis>pattern</emphasis> matches it.
3745 <emphasis>pattern</emphasis> is a string in the format described in the
3746 <link linkend="patterns">patterns</link> section (note: For efficiency
3747 reasons, patterns which scan information not available in the index,
3748 such as <literal>~b</literal>, <literal>~B</literal> or
3749 <literal>~h</literal>, may not be used). <emphasis>value</emphasis> is
3750 a positive or negative integer. A message's final score is the sum
3751 total of all matching <command>score</command> entries. However, you
3752 may optionally prefix <emphasis>value</emphasis> with an equal sign
3753 (<quote>=</quote>) to cause evaluation to stop at a particular entry if
3754 there is a match. Negative final scores are rounded up to 0.
3758 The <command>unscore</command> command removes score entries from the
3759 list. You <emphasis>must</emphasis> specify the same pattern specified
3760 in the <command>score</command> command for it to be removed. The
3761 pattern <quote>*</quote> is a special token which means to clear the
3762 list of all score entries.
3768 <title>Spam Detection</title>
3773 <command>spam</command>
3774 <arg choice="plain">
3775 <replaceable class="parameter">pattern</replaceable>
3777 <arg choice="plain">
3778 <replaceable class="parameter">format</replaceable>
3781 <command>nospam</command>
3782 <group choice="req">
3783 <arg choice="plain">
3784 <replaceable class="parameter">*</replaceable>
3786 <arg choice="plain">
3787 <replaceable class="parameter">pattern</replaceable>
3793 Mutt has generalized support for external spam-scoring filters. By
3794 defining your spam patterns with the <command>spam</command> and
3795 <literal>nospam</literal> commands, you can <emphasis>limit</emphasis>,
3796 <emphasis>search</emphasis>, and <emphasis>sort</emphasis> your mail
3797 based on its spam attributes, as determined by the external filter. You
3798 also can display the spam attributes in your index display using the
3799 <literal>%H</literal> selector in the <link
3800 linkend="index-format">$index_format</link> variable. (Tip: try
3801 <literal>%?H?[%H] ?</literal> to display spam tags only when they are
3802 defined for a given message.)
3806 Your first step is to define your external filter's spam patterns using
3807 the <command>spam</command> command. <emphasis>pattern</emphasis> should
3808 be a regular expression that matches a header in a mail message. If any
3809 message in the mailbox matches this regular expression, it will receive
3810 a <quote>spam tag</quote> or <quote>spam attribute</quote> (unless it
3811 also matches a <command>nospam</command> pattern — see below.) The
3812 appearance of this attribute is entirely up to you, and is governed by
3813 the <emphasis>format</emphasis> parameter. <emphasis>format</emphasis>
3814 can be any static text, but it also can include back-references from the
3815 <emphasis>pattern</emphasis> expression. (A regular expression
3816 <quote>back-reference</quote> refers to a sub-expression contained
3817 within parentheses.) <literal>%1</literal> is replaced with the first
3818 back-reference in the regex, <literal>%2</literal> with the second, etc.
3822 To match spam tags, mutt needs the corresponding header information
3823 which is always the case for local and POP folders but not for IMAP in
3824 the default configuration. Depending on the spam header to be analyzed,
3825 <link linkend="imap-headers">$imap_headers</link> may need to be
3830 If you're using multiple spam filters, a message can have more than one
3831 spam-related header. You can define <command>spam</command> patterns for
3832 each filter you use. If a message matches two or more of these patterns,
3833 and the <link linkend="spam-separator">$spam_separator</link> variable
3834 is set to a string, then the message's spam tag will consist of all the
3835 <emphasis>format</emphasis> strings joined together, with the value of
3836 <link linkend="spam-separator">$spam_separator</link> separating them.
3840 For example, suppose one uses DCC, SpamAssassin, and PureMessage, then
3841 the configuration might look like in <xref linkend="ex-spam"/>.
3844 <example id="ex-spam">
3845 <title>Configuring spam detection</title>
3847 spam "X-DCC-.*-Metrics:.*(....)=many" "90+/DCC-%1"
3848 spam "X-Spam-Status: Yes" "90+/SA"
3849 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
3850 set spam_separator=", "
3855 If then a message is received that DCC registered with
3856 <quote>many</quote> hits under the <quote>Fuz2</quote> checksum, and
3857 that PureMessage registered with a 97% probability of being spam, that
3858 message's spam tag would read <literal>90+/DCC-Fuz2,
3859 97/PM</literal>. (The four characters before <quote>=many</quote> in a
3860 DCC report indicate the checksum used — in this case,
3861 <quote>Fuz2</quote>.)
3865 If the <link linkend="spam-separator">$spam_separator</link> variable is
3866 unset, then each spam pattern match supersedes the previous one. Instead
3867 of getting joined <emphasis>format</emphasis> strings, you'll get only
3868 the last one to match.
3872 The spam tag is what will be displayed in the index when you use
3873 <literal>%H</literal> in the <link
3874 linkend="index-format">$index_format</link> variable. It's also the
3875 string that the <literal>~H</literal> pattern-matching expression
3876 matches against for <literal><search></literal> and
3877 <literal><limit></literal> functions. And it's what sorting by
3878 spam attribute will use as a sort key.
3882 That's a pretty complicated example, and most people's actual
3883 environments will have only one spam filter. The simpler your
3884 configuration, the more effective Mutt can be, especially when it comes
3889 Generally, when you sort by spam tag, Mutt will sort
3890 <emphasis>lexically</emphasis> — that is, by ordering strings
3891 alphanumerically. However, if a spam tag begins with a number, Mutt will
3892 sort numerically first, and lexically only when two numbers are equal in
3893 value. (This is like UNIX's <literal>sort -n</literal>.) A message with
3894 no spam attributes at all — that is, one that didn't match
3895 <emphasis>any</emphasis> of your <command>spam</command> patterns
3896 — is sorted at lowest priority. Numbers are sorted next, beginning
3897 with 0 and ranging upward. Finally, non-numeric strings are sorted, with
3898 <quote>a</quote> taking lower priority than <quote>z</quote>. Clearly,
3899 in general, sorting by spam tags is most effective when you can coerce
3900 your filter to give you a raw number. But in case you can't, Mutt can
3901 still do something useful.
3905 The <command>nospam</command> command can be used to write exceptions to
3906 <command>spam</command> patterns. If a header pattern matches something
3907 in a <command>spam</command> command, but you nonetheless do not want it
3908 to receive a spam tag, you can list a more precise pattern under a
3909 <command>nospam</command> command.
3913 If the <emphasis>pattern</emphasis> given to <command>nospam</command>
3914 is exactly the same as the <emphasis>pattern</emphasis> on an existing
3915 <command>spam</command> list entry, the effect will be to remove the
3916 entry from the spam list, instead of adding an exception. Likewise, if
3917 the <emphasis>pattern</emphasis> for a <command>spam</command> command
3918 matches an entry on the <command>nospam</command> list, that nospam
3919 entry will be removed. If the <emphasis>pattern</emphasis> for
3920 <command>nospam</command> is <quote>*</quote>, <emphasis>all entries on
3921 both lists</emphasis> will be removed. This might be the default action
3922 if you use <command>spam</command> and <command>nospam</command> in
3923 conjunction with a <command>folder-hook</command>.
3927 You can have as many <command>spam</command> or
3928 <command>nospam</command> commands as you like. You can even do your
3929 own primitive <command>spam</command> detection within Mutt — for
3930 example, if you consider all mail from <literal>MAILER-DAEMON</literal>
3931 to be spam, you can use a <command>spam</command> command like this:
3935 spam "^From: .*MAILER-DAEMON" "999"
3941 <title>Setting and Querying Variables</title>
3943 <sect2 id="var-types">
3944 <title>Variable Types</title>
3947 Mutt supports these types of configuration variables:
3952 <term>boolean</term>
3955 A boolean expression, either <quote>yes</quote> or <quote>no</quote>.
3963 A signed integer number in the range -32768 to 32767.
3979 A specialized string for representing paths including support for
3980 mailbox shortcuts (see <xref linkend="shortcuts"/>) as well as tilde
3981 (<quote>~</quote>) for a user's home directory and more.
3986 <term>quadoption</term>
3989 Like a boolean but triggers a prompt when set to <quote>ask-yes</quote>
3990 or <quote>ask-no</quote> with <quote>yes</quote> and <quote>no</quote>
3991 preselected respectively.
3996 <term>sort order</term>
3999 A specialized string allowing only particular words as values depending
4005 <term>regular expression</term>
4008 A regular expression, see <xref linkend="regexp"/> for an introduction.
4013 <term>folder magic</term>
4016 Specifies the type of folder to use: <emphasis>mbox</emphasis>,
4017 <emphasis>mmdf</emphasis>, <emphasis>mh</emphasis> or
4018 <emphasis>maildir</emphasis>. Currently only used to determine the type
4019 for newly created folders.
4024 <term>e-mail address</term>
4027 An e-mail address either with or without realname. The older
4028 <quote><literal>user@example.org (Joe User)</literal></quote> form is
4029 supported but strongly deprecated.
4034 <term>user-defined</term>
4037 Arbitrary text, see <xref linkend="set-myvar"/> for details.
4045 <sect2 id="set-commands">
4046 <title>Commands</title>
4049 The following commands are available to manipulate and query variables:
4055 <command>set</command>
4056 <group choice="req">
4057 <arg choice="plain">
4058 <group choice="opt">
4059 <arg choice="plain"><option>no</option></arg>
4060 <arg choice="plain"><option>inv</option></arg>
4062 <replaceable class="parameter">variable</replaceable>
4064 <arg choice="plain">
4065 <replaceable class="parameter">variable=value</replaceable>
4068 <arg choice="opt" rep="repeat"></arg>
4070 <command>toggle</command>
4071 <arg choice="plain">
4072 <replaceable class="parameter">variable</replaceable>
4074 <arg choice="opt" rep="repeat">
4075 <replaceable class="parameter">variable</replaceable>
4078 <command>unset</command>
4079 <arg choice="plain">
4080 <replaceable class="parameter">variable</replaceable>
4082 <arg choice="opt" rep="repeat">
4083 <replaceable class="parameter">variable</replaceable>
4086 <command>reset</command>
4087 <arg choice="plain">
4088 <replaceable class="parameter">variable</replaceable>
4090 <arg choice="opt" rep="repeat">
4091 <replaceable class="parameter">variable</replaceable>
4096 This command is used to set (and unset) <link
4097 linkend="variables">configuration variables</link>. There are four
4098 basic types of variables: boolean, number, string and quadoption.
4099 <emphasis>boolean</emphasis> variables can be <emphasis>set</emphasis>
4100 (true) or <emphasis>unset</emphasis> (false).
4101 <emphasis>number</emphasis> variables can be assigned a positive integer
4102 value. <emphasis>string</emphasis> variables consist of any number of
4103 printable characters and must be enclosed in quotes if they contain
4104 spaces or tabs. You may also use the escape sequences <quote>\n</quote>
4105 and <quote>\t</quote> for newline and tab, respectively.
4106 <emphasis>quadoption</emphasis> variables are used to control whether or
4107 not to be prompted for certain actions, or to specify a default action.
4108 A value of <emphasis>yes</emphasis> will cause the action to be carried
4109 out automatically as if you had answered yes to the question.
4110 Similarly, a value of <emphasis>no</emphasis> will cause the action to
4111 be carried out as if you had answered <quote>no.</quote> A value of
4112 <emphasis>ask-yes</emphasis> will cause a prompt with a default answer
4113 of <quote>yes</quote> and <emphasis>ask-no</emphasis> will provide a
4114 default answer of <quote>no.</quote>
4118 Prefixing a variable with <quote>no</quote> will unset it. Example:
4119 <literal><command>set</command> noaskbcc</literal>.
4123 For <emphasis>boolean</emphasis> variables, you may optionally prefix
4124 the variable name with <literal>inv</literal> to toggle the value (on or
4125 off). This is useful when writing macros. Example:
4126 <literal><command>set</command> invsmart_wrap</literal>.
4130 The <command>toggle</command> command automatically prepends the
4131 <literal>inv</literal> prefix to all specified variables.
4135 The <command>unset</command> command automatically prepends the
4136 <literal>no</literal> prefix to all specified variables.
4140 Using the <literal><enter-command></literal> function in the
4141 <emphasis>index</emphasis> menu, you can query the value of a variable
4142 by prefixing the name of the variable with a question mark:
4150 The question mark is actually only required for boolean and quadoption
4155 The <command>reset</command> command resets all given variables to the
4156 compile time defaults (hopefully mentioned in this manual). If you use
4157 the command <command>set</command> and prefix the variable with
4158 <quote>&</quote> this has the same behavior as the
4159 <command>reset</command> command.
4163 With the <command>reset</command> command there exists the special
4164 variable <quote>all</quote>, which allows you to reset all variables to
4165 their system defaults.
4170 <sect2 id="set-myvar">
4171 <title>User-Defined Variables</title>
4173 <sect3 id="set-myvar-intro">
4174 <title>Introduction</title>
4177 Along with the variables listed in the <link
4178 linkend="variables">Configuration variables</link> section, Mutt
4179 supports user-defined variables with names starting with
4180 <literal>my_</literal> as in, for example, <literal>my_cfgdir</literal>.
4184 The <command>set</command> command either creates a custom
4185 <literal>my_</literal> variable or changes its value if it does exist
4186 already. The <command>unset</command> and <command>reset</command>
4187 commands remove the variable entirely.
4191 Since user-defined variables are expanded in the same way that
4192 environment variables are (except for the <link
4193 linkend="shell-escape">shell-escape</link> command and backtick
4194 expansion), this feature can be used to make configuration files more
4200 <sect3 id="set-myvar-examples">
4201 <title>Examples</title>
4204 The following example defines and uses the variable
4205 <literal>my_cfgdir</literal> to abbreviate the calls of the <link
4206 linkend="source"><command>source</command></link> command:
4209 <example id="ex-myvar1">
4210 <title>Using user-defined variables for config file readability</title>
4212 set my_cfgdir = $HOME/mutt/config
4214 source $my_cfgdir/hooks
4215 source $my_cfgdir/macros
4216 <emphasis role="comment"># more source commands...</emphasis>
4221 A custom variable can also be used in macros to backup the current value
4222 of another variable. In the following example, the value of the <link
4223 linkend="delete">$delete</link> is changed temporarily while its
4224 original value is saved as <literal>my_delete</literal>. After the
4225 macro has executed all commands, the original value of <link
4226 linkend="delete">$delete</link> is restored.
4229 <example id="ex-myvar2">
4230 <title>Using user-defined variables for backing up other config option values</title>
4233 <enter-command>set my_delete=$delete<enter>\
4234 <enter-command>set delete=yes<enter>\
4236 <enter-command>set delete=$my_delete<enter>'
4241 Since Mutt expands such values already when parsing the configuration
4242 file(s), the value of <literal>$my_delete</literal> in the
4243 last example would be the value of <link linkend="delete">$delete</link> exactly
4244 as it was at that point during parsing the configuration file. If
4245 another statement would change the value for <link linkend="delete">$delete</link>
4246 later in the same or another file, it would have no effect on
4247 <literal>$my_delete</literal>. However, the expansion can
4248 be deferred to runtime, as shown in the next example, when escaping the
4252 <example id="ex-myvar3">
4253 <title>Deferring user-defined variable expansion to runtime</title>
4255 macro pager <PageDown> "\
4256 <enter-command> set my_old_pager_stop=\$pager_stop pager_stop<Enter>\
4258 <enter-command> set pager_stop=\$my_old_pager_stop<Enter>\
4259 <enter-command> unset my_old_pager_stop<Enter>"
4264 Note that there is a space between
4265 <literal><enter-command></literal> and the <command>set</command>
4266 configuration command, preventing Mutt from recording the
4267 <command>macro</command>'s commands into its history.
4274 <sect2 id="set-conversions">
4275 <title>Type Conversions</title>
4278 Variables are always assigned string values which Mutt parses into its
4279 internal representation according to the type of the variable, for
4280 example an integer number for numeric types. For all queries (including
4281 $-expansion) the value is converted from its internal type back into
4282 string. As a result, any variable can be assigned any value given that
4283 its content is valid for the target. This also counts for custom
4284 variables which are of type string. In case of parsing errors, Mutt will
4285 print error messages. <xref linkend="ex-myvar4"/> demonstrates type
4289 <example id="ex-myvar4">
4290 <title>Type conversions using variables</title>
4292 set my_lines = "5" <emphasis role="comment"># value is string "5"</emphasis>
4293 set pager_index_lines = $my_lines <emphasis role="comment"># value is integer 5</emphasis>
4295 set my_sort = "date-received" <emphasis role="comment"># value is string "date-received"</emphasis>
4296 set sort = "last-$my_sort" <emphasis role="comment"># value is sort last-date-received</emphasis>
4298 set my_inc = $read_inc <emphasis role="comment"># value is string "10" (default of $read_inc)</emphasis>
4299 set my_foo = $my_inc <emphasis role="comment"># value is string "10"</emphasis>
4304 These assignments are all valid. If, however, the value of
4305 <literal>$my_lines</literal> would have been
4306 <quote>five</quote> (or something else that cannot be parsed into a
4307 number), the assignment to
4308 <literal>$pager_index_lines</literal> would have
4309 produced an error message.
4313 Type conversion applies to all configuration commands which take
4314 arguments. But please note that every expanded value of a variable is
4315 considered just a single token. A working example is:
4319 set my_pattern = "~A"
4320 set my_number = "10"
4322 <emphasis role="comment"># same as: score ~A +10</emphasis>
4323 score $my_pattern +$my_number</screen>
4326 What does <emphasis>not</emphasis> work is:
4330 set my_mx = "+mailbox1 +mailbox2"
4331 mailboxes $my_mx +mailbox3</screen>
4334 because the value of <literal>$my_mx</literal> is interpreted as a
4335 single mailbox named <quote>+mailbox1 +mailbox2</quote> and not two
4344 <title>Reading Initialization Commands From Another File</title>
4349 <command>source</command>
4350 <arg choice="plain">
4351 <replaceable class="parameter">filename</replaceable>
4356 This command allows the inclusion of initialization commands from other
4357 files. For example, I place all of my aliases in
4358 <literal>~/.mail_aliases</literal> so that I can make my
4359 <literal>~/.muttrc</literal> readable and keep my aliases private.
4363 If the filename begins with a tilde (<quote>~</quote>), it will be
4364 expanded to the path of your home directory.
4368 If the filename ends with a vertical bar (<quote>|</quote>), then
4369 <emphasis>filename</emphasis> is considered to be an executable program
4370 from which to read input (e.g. <literal><command>source</command>
4371 ~/bin/myscript|</literal>).
4377 <title>Removing Hooks</title>
4382 <command>unhook</command>
4383 <group choice="req">
4384 <arg choice="plain">
4385 <replaceable class="parameter">*</replaceable>
4387 <arg choice="plain">
4388 <replaceable class="parameter">hook-type</replaceable>
4394 This command permits you to flush hooks you have previously defined.
4395 You can either remove all hooks by giving the <quote>*</quote> character
4396 as an argument, or you can remove all hooks of a specific type by saying
4397 something like <literal><command>unhook</command> send-hook</literal>.
4402 <sect1 id="formatstrings">
4403 <title>Format Strings</title>
4405 <sect2 id="formatstrings-basics">
4406 <title>Basic usage</title>
4409 Format strings are a general concept you'll find in several locations
4410 through the Mutt configuration, especially in the <link
4411 linkend="index-format">$index_format</link>, <link
4412 linkend="pager-format">$pager_format</link>, <link
4413 linkend="status-format">$status_format</link>, and other related
4414 variables. These can be very straightforward, and it's quite possible
4415 you already know how to use them.
4419 The most basic format string element is a percent symbol followed by
4420 another character. For example, <literal>%s</literal> represents a
4421 message's Subject: header in the <link
4422 linkend="index-format">$index_format</link> variable. The
4423 <quote>expandos</quote> available are documented with each format
4424 variable, but there are general modifiers available with all formatting
4425 expandos, too. Those are our concern here.
4429 Some of the modifiers are borrowed right out of C (though you might know
4430 them from Perl, Python, shell, or another language). These are the
4431 <literal>[-]m.n</literal> modifiers, as in
4432 <literal>%-12.12s</literal>. As with such programming languages, these
4433 modifiers allow you to specify the minimum and maximum size of the
4434 resulting string, as well as its justification. If the <quote>-</quote>
4435 sign follows the percent, the string will be left-justified instead of
4436 right-justified. If there's a number immediately following that, it's
4437 the minimum amount of space the formatted string will occupy — if
4438 it's naturally smaller than that, it will be padded out with spaces. If
4439 a decimal point and another number follow, that's the maximum space
4440 allowable — the string will not be permitted to exceed that width,
4441 no matter its natural size. Each of these three elements is optional, so
4442 that all these are legal format strings: <literal>%-12s</literal>,
4443 <literal>%4c</literal>, <literal>%.15F</literal> and
4444 <literal>%-12.15L</literal>.
4448 Mutt adds some other modifiers to format strings. If you use an equals
4449 symbol (<literal>=</literal>) as a numeric prefix (like the minus
4450 above), it will force the string to be centered within its minimum space
4451 range. For example, <literal>%=14y</literal> will reserve 14 characters
4452 for the %y expansion — that's the X-Label: header, in <link
4453 linkend="index-format">$index_format</link>. If the expansion results in
4454 a string less than 14 characters, it will be centered in a 14-character
4455 space. If the X-Label for a message were <quote>test</quote>, that
4456 expansion would look like
4457 <quote> test </quote>.
4461 There are two very little-known modifiers that affect the way that an
4462 expando is replaced. If there is an underline (<quote>_</quote>)
4463 character between any format modifiers (as above) and the expando
4464 letter, it will expands in all lower case. And if you use a colon
4465 (<quote>:</quote>), it will replace all decimal points with underlines.
4470 <sect2 id="formatstrings-conditionals">
4471 <title>Conditionals</title>
4474 Depending on the format string variable, some of its sequences can be
4475 used to optionally print a string if their value is nonzero. For
4476 example, you may only want to see the number of flagged messages if such
4477 messages exist, since zero is not particularly meaningful. To optionally
4478 print a string based upon one of the above sequences, the following
4483 %?<sequence_char>?<optional_string>?</screen>
4486 where <emphasis>sequence_char</emphasis> is an expando, and
4487 <emphasis>optional_string</emphasis> is the string you would like
4488 printed if <emphasis>sequence_char</emphasis> is nonzero.
4489 <emphasis>optional_string</emphasis> may contain other sequences as well
4490 as normal text, but you may not nest optional strings.
4494 Here is an example illustrating how to optionally print the number of
4495 new messages in a mailbox in <link
4496 linkend="status-format">$status_format</link>:
4500 %?n?%n new messages.?</screen>
4503 You can also switch between two strings using the following construct:
4507 %?<sequence_char>?<if_string>&<else_string>?</screen>
4510 If the value of <emphasis>sequence_char</emphasis> is non-zero,
4511 <emphasis>if_string</emphasis> will be expanded, otherwise
4512 <emphasis>else_string</emphasis> will be expanded.
4517 <sect2 id="formatstrings-filters">
4518 <title>Filters</title>
4521 Any format string ending in a vertical bar (<quote>|</quote>) will be
4522 expanded and piped through the first word in the string, using spaces as
4523 separator. The string returned will be used for display. If the
4524 returned string ends in %, it will be passed through the formatter a
4525 second time. This allows the filter to generate a replacement format
4526 string including % expandos.
4530 All % expandos in a format string are expanded before the script is
4534 <example id="ex-fmtpipe">
4535 <title>Using external filters in format strings</title>
4537 set status_format="script.sh '%r %f (%L)'|"
4542 will make Mutt expand <literal>%r</literal>, <literal>%f</literal> and
4543 <literal>%L</literal> before calling the script. The example also shows
4544 that arguments can be quoted: the script will receive the expanded
4545 string between the single quotes as the only argument.
4549 A practical example is the <literal>mutt_xtitle</literal> script
4550 installed in the <literal>samples</literal> subdirectory of the Mutt
4551 documentation: it can be used as filter for <link
4552 linkend="status-format">$status_format</link> to set the current
4553 terminal's title, if supported.
4558 <sect2 id="formatstrings-padding">
4559 <title>Padding</title>
4562 In most format strings, Mutt supports different types of padding using
4568 <term><literal>%|X</literal></term>
4571 When this occurs, Mutt will fill the rest of the line with the character
4572 <literal>X</literal>. For example, filling the rest of the line with
4573 dashes is done by setting:
4576 set status_format = "%v on %h: %B: %?n?%n&no? new messages %|-"</screen>
4581 <literal>%>X</literal>
4585 Since the previous expando stops at the end of line, there must be a way
4586 to fill the gap between two items via the <literal>%>X</literal>
4587 expando: it puts as many characters <literal>X</literal> in between two
4588 items so that the rest of the line will be right-justified. For example,
4589 to not put the version string and hostname the above example on the left
4590 but on the right and fill the gap with spaces, one might use (note the
4591 space after <literal>%></literal>):
4594 set status_format = "%B: %?n?%n&no? new messages %> (%v on %h)"</screen>
4598 <term><literal>%*X</literal>
4602 Normal right-justification will print everything to the left of the
4603 <literal>%></literal>, displaying padding and whatever lies to the
4604 right only if there's room. By contrast, <quote>soft-fill</quote> gives
4605 priority to the right-hand side, guaranteeing space to display it and
4606 showing padding only if there's still room. If necessary, soft-fill will
4607 eat text leftwards to make room for rightward text. For example, to
4608 right-justify the subject making sure as much as possible of it fits on
4609 screen, one might use (note two spaces after <literal>%* </literal>: the
4610 second ensures there's a space between the truncated right-hand side and
4614 set index_format="%4C %Z %{%b %d} %-15.15L (%?l?%4l&%4c?)%* %s"</screen>
4625 <chapter id="advancedusage">
4626 <title>Advanced Usage</title>
4628 <sect1 id="charset-handling">
4629 <title>Character Set Handling</title>
4632 A <quote>character set</quote> is basically a mapping between bytes and
4633 glyphs and implies a certain character encoding scheme. For example, for
4634 the ISO 8859 family of character sets, an encoding of 8bit per character
4635 is used. For the Unicode character set, different character encodings
4636 may be used, UTF-8 being the most popular. In UTF-8, a character is
4637 represented using a variable number of bytes ranging from 1 to 4.
4641 Since Mutt is a command-line tool run from a shell, and delegates
4642 certain tasks to external tools (such as an editor for composing/editing
4643 messages), all of these tools need to agree on a character set and
4644 encoding. There exists no way to reliably deduce the character set a
4645 plain text file has. Interoperability is gained by the use of
4646 well-defined environment variables. The full set can be printed by
4647 issuing <literal>locale</literal> on the command line.
4651 Upon startup, Mutt determines the character set on its own using
4652 routines that inspect locale-specific environment variables. Therefore,
4653 it is generally not necessary to set the <literal>$charset</literal>
4654 variable in Mutt. It may even be counter-productive as Mutt uses system
4655 and library functions that derive the character set themselves and on
4656 which Mutt has no influence. It's safest to let Mutt work out the locale
4661 If you happen to work with several character sets on a regular basis,
4662 it's highly advisable to use Unicode and an UTF-8 locale. Unicode can
4663 represent nearly all characters in a message at the same time. When not
4664 using a Unicode locale, it may happen that you receive messages with
4665 characters not representable in your locale. When displaying such a
4666 message, or replying to or forwarding it, information may get lost
4667 possibly rendering the message unusable (not only for you but also for
4668 the recipient, this breakage is not reversible as lost information
4673 A Unicode locale makes all conversions superfluous which eliminates the
4674 risk of conversion errors. It also eliminates potentially wrong
4675 expectations about the character set between Mutt and external programs.
4679 The terminal emulator used also must be properly configured for the
4680 current locale. Terminal emulators usually do <emphasis>not</emphasis>
4681 derive the locale from environment variables, they need to be configured
4682 separately. If the terminal is incorrectly configured, Mutt may display
4683 random and unexpected characters (question marks, octal codes, or just
4684 random glyphs), format strings may not work as expected, you may not be
4685 abled to enter non-ascii characters, and possible more. Data is always
4686 represented using bytes and so a correct setup is very important as to
4687 the machine, all character sets <quote>look</quote> the same.
4691 Warning: A mismatch between what system and library functions think the
4692 locale is and what Mutt was told what the locale is may make it behave
4693 badly with non-ascii input: it will fail at seemingly random places.
4694 This warning is to be taken seriously since not only local mail handling
4695 may suffer: sent messages may carry wrong character set information the
4696 <emphasis>receiver</emphasis> has too deal with. The need to set
4697 <literal>$charset</literal> directly in most cases points at terminal
4698 and environment variable setup problems, not Mutt problems.
4702 A list of officially assigned and known character sets can be found at
4703 <ulink url="http://www.iana.org/assignments/character-sets">IANA</ulink>,
4704 a list of locally supported locales can be obtained by running
4705 <literal>locale -a</literal>.
4711 <title>Regular Expressions</title>
4714 All string patterns in Mutt including those in more complex <link
4715 linkend="patterns">patterns</link> must be specified using regular
4716 expressions (regexp) in the <quote>POSIX extended</quote> syntax (which
4717 is more or less the syntax used by egrep and GNU awk). For your
4718 convenience, we have included below a brief description of this syntax.
4722 The search is case sensitive if the pattern contains at least one upper
4723 case letter, and case insensitive otherwise.
4728 <quote>\</quote> must be quoted if used for a regular expression in an
4729 initialization command: <quote>\\</quote>.
4734 A regular expression is a pattern that describes a set of strings.
4735 Regular expressions are constructed analogously to arithmetic
4736 expressions, by using various operators to combine smaller expressions.
4741 The regular expression can be enclosed/delimited by either " or ' which
4742 is useful if the regular expression includes a white-space character.
4743 See <xref linkend="muttrc-syntax"/> for more information on " and '
4744 delimiter processing. To match a literal " or ' you must preface it
4750 The fundamental building blocks are the regular expressions that match a
4751 single character. Most characters, including all letters and digits,
4752 are regular expressions that match themselves. Any metacharacter with
4753 special meaning may be quoted by preceding it with a backslash.
4757 The period <quote>.</quote> matches any single character. The caret
4758 <quote>^</quote> and the dollar sign <quote>$</quote> are metacharacters
4759 that respectively match the empty string at the beginning and end of a
4764 A list of characters enclosed by <quote>[</quote> and <quote>]</quote>
4765 matches any single character in that list; if the first character of the
4766 list is a caret <quote>^</quote> then it matches any character
4767 <emphasis>not</emphasis> in the list. For example, the regular
4768 expression <emphasis>[0123456789]</emphasis> matches any single digit.
4769 A range of ASCII characters may be specified by giving the first and
4770 last characters, separated by a hyphen <quote>-</quote>. Most
4771 metacharacters lose their special meaning inside lists. To include a
4772 literal <quote>]</quote> place it first in the list. Similarly, to
4773 include a literal <quote>^</quote> place it anywhere but first.
4774 Finally, to include a literal hyphen <quote>-</quote> place it last.
4778 Certain named classes of characters are predefined. Character classes
4779 consist of <quote>[:</quote>, a keyword denoting the class, and
4780 <quote>:]</quote>. The following classes are defined by the POSIX
4782 <xref linkend="posix-regex-char-classes"/>
4785 <table id="posix-regex-char-classes">
4786 <title>POSIX regular expression character classes</title>
4789 <row><entry>Character class</entry><entry>Description</entry></row>
4792 <row><entry>[:alnum:]</entry><entry>Alphanumeric characters</entry></row>
4793 <row><entry>[:alpha:]</entry><entry>Alphabetic characters</entry></row>
4794 <row><entry>[:blank:]</entry><entry>Space or tab characters</entry></row>
4795 <row><entry>[:cntrl:]</entry><entry>Control characters</entry></row>
4796 <row><entry>[:digit:]</entry><entry>Numeric characters</entry></row>
4797 <row><entry>[:graph:]</entry><entry>Characters that are both printable and visible. (A space is printable, but not visible, while an <quote>a</quote> is both)</entry></row>
4798 <row><entry>[:lower:]</entry><entry>Lower-case alphabetic characters</entry></row>
4799 <row><entry>[:print:]</entry><entry>Printable characters (characters that are not control characters)</entry></row>
4800 <row><entry>[:punct:]</entry><entry>Punctuation characters (characters that are not letter, digits, control characters, or space characters)</entry></row>
4801 <row><entry>[:space:]</entry><entry>Space characters (such as space, tab and formfeed, to name a few)</entry></row>
4802 <row><entry>[:upper:]</entry><entry>Upper-case alphabetic characters</entry></row>
4803 <row><entry>[:xdigit:]</entry><entry>Characters that are hexadecimal digits</entry></row>
4809 A character class is only valid in a regular expression inside the
4810 brackets of a character list.
4815 Note that the brackets in these class names are part of the symbolic
4816 names, and must be included in addition to the brackets delimiting the
4817 bracket list. For example, <emphasis>[[:digit:]]</emphasis> is
4818 equivalent to <emphasis>[0-9]</emphasis>.
4823 Two additional special sequences can appear in character lists. These
4824 apply to non-ASCII character sets, which can have single symbols (called
4825 collating elements) that are represented with more than one character,
4826 as well as several characters that are equivalent for collating or
4833 <term>Collating Symbols</term>
4836 A collating symbol is a multi-character collating element enclosed in
4837 <quote>[.</quote> and <quote>.]</quote>. For example, if
4838 <quote>ch</quote> is a collating element, then
4839 <emphasis>[[.ch.]]</emphasis> is a regexp that matches this collating
4840 element, while <emphasis>[ch]</emphasis> is a regexp that matches either
4841 <quote>c</quote> or <quote>h</quote>.
4846 <term>Equivalence Classes</term>
4849 An equivalence class is a locale-specific name for a list of characters
4850 that are equivalent. The name is enclosed in <quote>[=</quote> and
4851 <quote>=]</quote>. For example, the name <quote>e</quote> might be used
4852 to represent all of <quote>e</quote> with grave
4853 (<quote>è</quote>), <quote>e</quote> with acute
4854 (<quote>é</quote>) and <quote>e</quote>. In this case,
4855 <emphasis>[[=e=]]</emphasis> is a regexp that matches any of:
4856 <quote>e</quote> with grave (<quote>è</quote>), <quote>e</quote>
4857 with acute (<quote>é</quote>) and <quote>e</quote>.
4864 A regular expression matching a single character may be followed by one
4865 of several repetition operators described in <xref
4866 linkend="regex-repeat"/>.
4869 <table id="regex-repeat">
4870 <title>Regular expression repetition operators</title>
4873 <row><entry>Operator</entry><entry>Description</entry></row>
4876 <row><entry>?</entry><entry>The preceding item is optional and matched at most once</entry></row>
4877 <row><entry>*</entry><entry>The preceding item will be matched zero or more times</entry></row>
4878 <row><entry>+</entry><entry>The preceding item will be matched one or more times</entry></row>
4879 <row><entry>{n}</entry><entry>The preceding item is matched exactly <emphasis>n</emphasis> times</entry></row>
4880 <row><entry>{n,}</entry><entry>The preceding item is matched <emphasis>n</emphasis> or more times</entry></row>
4881 <row><entry>{,m}</entry><entry>The preceding item is matched at most <emphasis>m</emphasis> times</entry></row>
4882 <row><entry>{n,m}</entry><entry>The preceding item is matched at least <emphasis>n</emphasis> times, but no more than <emphasis>m</emphasis> times</entry></row>
4888 Two regular expressions may be concatenated; the resulting regular
4889 expression matches any string formed by concatenating two substrings
4890 that respectively match the concatenated subexpressions.
4894 Two regular expressions may be joined by the infix operator
4895 <quote>|</quote>; the resulting regular expression matches any string
4896 matching either subexpression.
4900 Repetition takes precedence over concatenation, which in turn takes
4901 precedence over alternation. A whole subexpression may be enclosed in
4902 parentheses to override these precedence rules.
4907 If you compile Mutt with the included regular expression engine, the
4908 following operators may also be used in regular expressions as described
4909 in <xref linkend="regex-gnu-ext"/>.
4913 <table id="regex-gnu-ext">
4914 <title>GNU regular expression extensions</title>
4917 <row><entry>Expression</entry><entry>Description</entry></row>
4920 <row><entry>\\y</entry><entry>Matches the empty string at either the beginning or the end of a word</entry></row>
4921 <row><entry>\\B</entry><entry>Matches the empty string within a word</entry></row>
4922 <row><entry>\\<</entry><entry>Matches the empty string at the beginning of a word</entry></row>
4923 <row><entry>\\></entry><entry>Matches the empty string at the end of a word</entry></row>
4924 <row><entry>\\w</entry><entry>Matches any word-constituent character (letter, digit, or underscore)</entry></row>
4925 <row><entry>\\W</entry><entry>Matches any character that is not word-constituent</entry></row>
4926 <row><entry>\\`</entry><entry>Matches the empty string at the beginning of a buffer (string)</entry></row>
4927 <row><entry>\\'</entry><entry>Matches the empty string at the end of a buffer</entry></row>
4933 Please note however that these operators are not defined by POSIX, so
4934 they may or may not be available in stock libraries on various systems.
4939 <sect1 id="patterns">
4940 <title>Patterns: Searching, Limiting and Tagging</title>
4942 <sect2 id="patterns-modifier">
4943 <title>Pattern Modifier</title>
4946 Many of Mutt's commands allow you to specify a pattern to match
4947 (<literal>limit</literal>, <literal>tag-pattern</literal>,
4948 <literal>delete-pattern</literal>, etc.). <xref linkend="tab-patterns"/>
4949 shows several ways to select messages.
4952 <table id="tab-patterns">
4953 <title>Pattern modifiers</title>
4956 <row><entry>Pattern modifier</entry><entry>Description</entry></row>
4959 <row><entry>~A</entry><entry>all messages</entry></row>
4960 <row><entry>~b <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the message body</entry></row>
4961 <row><entry>=b <emphasis>STRING</emphasis></entry><entry>messages which contain <emphasis>STRING</emphasis> in the message body. If IMAP is enabled, searches for <emphasis>STRING</emphasis> on the server, rather than downloading each message and searching it locally.</entry></row>
4962 <row><entry>~B <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the whole message</entry></row>
4963 <row><entry>~c <emphasis>EXPR</emphasis></entry><entry>messages carbon-copied to <emphasis>EXPR</emphasis></entry></row>
4964 <row><entry>%c <emphasis>GROUP</emphasis></entry><entry>messages carbon-copied to any member of <emphasis>GROUP</emphasis></entry></row>
4965 <row><entry>~C <emphasis>EXPR</emphasis></entry><entry>messages either to: or cc: <emphasis>EXPR</emphasis></entry></row>
4966 <row><entry>%C <emphasis>GROUP</emphasis></entry><entry>messages either to: or cc: to any member of <emphasis>GROUP</emphasis></entry></row>
4967 <row><entry>~d [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages with <quote>date-sent</quote> in a Date range</entry></row>
4968 <row><entry>~D</entry><entry>deleted messages</entry></row>
4969 <row><entry>~e <emphasis>EXPR</emphasis></entry><entry>messages which contains <emphasis>EXPR</emphasis> in the <quote>Sender</quote> field</entry></row>
4970 <row><entry>%e <emphasis>GROUP</emphasis></entry><entry>messages which contain a member of <emphasis>GROUP</emphasis> in the <quote>Sender</quote> field</entry></row>
4971 <row><entry>~E</entry><entry>expired messages</entry></row>
4972 <row><entry>~F</entry><entry>flagged messages</entry></row>
4973 <row><entry>~f <emphasis>EXPR</emphasis></entry><entry>messages originating from <emphasis>EXPR</emphasis></entry></row>
4974 <row><entry>%f <emphasis>GROUP</emphasis></entry><entry>messages originating from any member of <emphasis>GROUP</emphasis></entry></row>
4975 <row><entry>~g</entry><entry>cryptographically signed messages</entry></row>
4976 <row><entry>~G</entry><entry>cryptographically encrypted messages</entry></row>
4977 <row><entry>~h <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the message header</entry></row>
4978 <row><entry>~H <emphasis>EXPR</emphasis></entry><entry>messages with a spam attribute matching <emphasis>EXPR</emphasis></entry></row>
4979 <row><entry>~i <emphasis>EXPR</emphasis></entry><entry>messages which match <emphasis>EXPR</emphasis> in the <quote>Message-ID</quote> field</entry></row>
4980 <row><entry>~k</entry><entry>messages which contain PGP key material</entry></row>
4981 <row><entry>~L <emphasis>EXPR</emphasis></entry><entry>messages either originated or received by <emphasis>EXPR</emphasis></entry></row>
4982 <row><entry>%L <emphasis>GROUP</emphasis></entry><entry>message either originated or received by any member of <emphasis>GROUP</emphasis></entry></row>
4983 <row><entry>~l</entry><entry>messages addressed to a known mailing list</entry></row>
4984 <row><entry>~m [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *)</entry></row>
4985 <row><entry>~n [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages with a score in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *)</entry></row>
4986 <row><entry>~N</entry><entry>new messages</entry></row>
4987 <row><entry>~O</entry><entry>old messages</entry></row>
4988 <row><entry>~p</entry><entry>messages addressed to you (consults <command>alternates</command>)</entry></row>
4989 <row><entry>~P</entry><entry>messages from you (consults <command>alternates</command>)</entry></row>
4990 <row><entry>~Q</entry><entry>messages which have been replied to</entry></row>
4991 <row><entry>~r [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages with <quote>date-received</quote> in a Date range</entry></row>
4992 <row><entry>~R</entry><entry>read messages</entry></row>
4993 <row><entry>~s <emphasis>EXPR</emphasis></entry><entry>messages having <emphasis>EXPR</emphasis> in the <quote>Subject</quote> field.</entry></row>
4994 <row><entry>~S</entry><entry>superseded messages</entry></row>
4995 <row><entry>~t <emphasis>EXPR</emphasis></entry><entry>messages addressed to <emphasis>EXPR</emphasis></entry></row>
4996 <row><entry>~T</entry><entry>tagged messages</entry></row>
4997 <row><entry>~u</entry><entry>messages addressed to a subscribed mailing list</entry></row>
4998 <row><entry>~U</entry><entry>unread messages</entry></row>
4999 <row><entry>~v</entry><entry>messages part of a collapsed thread.</entry></row>
5000 <row><entry>~V</entry><entry>cryptographically verified messages</entry></row>
5001 <row><entry>~x <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the <quote>References</quote> or <quote>In-Reply-To</quote> field</entry></row>
5002 <row><entry>~X [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages with <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> attachments *)</entry></row>
5003 <row><entry>~y <emphasis>EXPR</emphasis></entry><entry>messages which contain <emphasis>EXPR</emphasis> in the <quote>X-Label</quote> field</entry></row>
5004 <row><entry>~z [<emphasis>MIN</emphasis>]-[<emphasis>MAX</emphasis>]</entry><entry>messages with a size in the range <emphasis>MIN</emphasis> to <emphasis>MAX</emphasis> *) **)</entry></row>
5005 <row><entry>~=</entry><entry>duplicated messages (see <link linkend="duplicate-threads">$duplicate_threads</link>)</entry></row>
5006 <row><entry>~$</entry><entry>unreferenced messages (requires threaded view)</entry></row>
5007 <row><entry>~(<emphasis>PATTERN</emphasis>)</entry><entry>messages in threads
5008 containing messages matching <emphasis>PATTERN</emphasis>, e.g. all
5009 threads containing messages from you: ~(~P)</entry></row>
5015 Where <emphasis>EXPR</emphasis> is a <link linkend="regexp">regular expression</link>, and <emphasis>GROUP</emphasis> is an
5016 <link linkend="addrgroup">address group</link>.
5020 *) The forms <quote><[<emphasis>MAX</emphasis>]</quote>,
5021 <quote>>[<emphasis>MIN</emphasis>]</quote>,
5022 <quote>[<emphasis>MIN</emphasis>]-</quote> and
5023 <quote>-[<emphasis>MAX</emphasis>]</quote> are allowed, too.
5027 **) The suffixes <quote>K</quote> and <quote>M</quote> are allowed to
5028 specify kilobyte and megabyte respectively.
5032 Special attention has to be payed when using regular expressions inside
5033 of patterns. Specifically, Mutt's parser for these patterns will strip
5034 one level of backslash (<quote>\</quote>), which is normally used for
5035 quoting. If it is your intention to use a backslash in the regular
5036 expression, you will need to use two backslashes instead
5037 (<quote>\\</quote>). You can force Mutt to treat
5038 <emphasis>EXPR</emphasis> as a simple string instead of a regular
5039 expression by using = instead of ~ in the pattern name. For example,
5040 <literal>=b *.*</literal> will find all messages that contain the
5041 literal string <quote>*.*</quote>. Simple string matches are less
5042 powerful than regular expressions but can be considerably faster. This
5043 is especially true for IMAP folders, because string matches can be
5044 performed on the server instead of by fetching every message. IMAP
5045 treats <literal>=h</literal> specially: it must be of the form
5046 <quote>header: substring</quote> and will not partially match header
5047 names. The substring part may be omitted if you simply wish to find
5048 messages containing a particular header without regard to its value.
5052 Patterns matching lists of addresses (notably c, C, p, P and t) match if
5053 there is at least one match in the whole list. If you want to make sure
5054 that all elements of that list match, you need to prefix your pattern
5055 with <quote>^</quote>. This example matches all mails which only has
5056 recipients from Germany.
5059 <example id="ex-recips">
5060 <title>Matching all addresses in address lists</title>
5068 <sect2 id="simple-searches">
5069 <title>Simple Searches</title>
5072 Mutt supports two versions of so called <quote>simple
5073 searches</quote>. These are issued if the query entered for searching,
5074 limiting and similar operations does not seem to contain a valid pattern
5075 modifier (i.e. it does not contain one of these characters:
5076 <quote>~</quote>, <quote>=</quote> or <quote>%</quote>). If the query is
5077 supposed to contain one of these special characters, they must be
5078 escaped by prepending a backslash (<quote>\</quote>).
5082 The first type is by checking whether the query string equals
5083 a keyword case-insensitively from <xref linkend="tab-simplesearch-keywords"/>:
5084 If that is the case, Mutt will use the shown pattern modifier instead.
5085 If a keyword would conflict with your search keyword, you need to turn
5086 it into a regular expression to avoid matching the keyword table. For
5087 example, if you want to find all messages matching <quote>flag</quote>
5088 (using <link linkend="simple-search">$simple_search</link>)
5089 but don't want to match flagged messages, simply search for
5090 <quote><literal>[f]lag</literal></quote>.
5093 <table id="tab-simplesearch-keywords">
5094 <title>Simple search keywords</title>
5097 <row><entry>Keyword</entry><entry>Pattern modifier</entry></row>
5100 <row><entry>all</entry><entry>~A</entry></row>
5101 <row><entry>.</entry><entry>~A</entry></row>
5102 <row><entry>^</entry><entry>~A</entry></row>
5103 <row><entry>del</entry><entry>~D</entry></row>
5104 <row><entry>flag</entry><entry>~F</entry></row>
5105 <row><entry>new</entry><entry>~N</entry></row>
5106 <row><entry>old</entry><entry>~O</entry></row>
5107 <row><entry>repl</entry><entry>~Q</entry></row>
5108 <row><entry>read</entry><entry>~R</entry></row>
5109 <row><entry>tag</entry><entry>~T</entry></row>
5110 <row><entry>unread</entry><entry>~U</entry></row>
5116 The second type of simple search is to build a complex search pattern
5117 using <link linkend="simple-search">$simple_search</link> as a
5118 template. Mutt will insert your query properly quoted and search for the
5119 composed complex query.
5124 <sect2 id="complex-patterns">
5125 <title>Nesting and Boolean Operators</title>
5128 Logical AND is performed by specifying more than one criterion. For
5137 would select messages which contain the word <quote>mutt</quote> in the
5138 list of recipients <emphasis>and</emphasis> that have the word
5139 <quote>elkins</quote> in the <quote>From</quote> header field.
5143 Mutt also recognizes the following operators to create more complex
5151 ! — logical NOT operator
5157 | — logical OR operator
5163 () — logical grouping operator
5170 Here is an example illustrating a complex search pattern. This pattern
5171 will select all messages which do not contain <quote>mutt</quote> in the
5172 <quote>To</quote> or <quote>Cc</quote> field and which are from
5173 <quote>elkins</quote>.
5176 <example id="ex-pattern-bool">
5177 <title>Using boolean operators in patterns</title>
5179 !(~t mutt|~c mutt) ~f elkins
5184 Here is an example using white space in the regular expression (note the
5185 <quote>'</quote> and <quote>"</quote> delimiters). For this to match,
5186 the mail's subject must match the <quote>^Junk +From +Me$</quote> and it
5187 must be from either <quote>Jim +Somebody</quote> or <quote>Ed
5188 +SomeoneElse</quote>:
5192 '~s "^Junk +From +Me$" ~f ("Jim +Somebody"|"Ed +SomeoneElse")'
5197 If a regular expression contains parenthesis, or a vertical bar ("|"),
5198 you <emphasis>must</emphasis> enclose the expression in double or single
5199 quotes since those characters are also used to separate different parts
5200 of Mutt's pattern language. For example: <literal>~f
5201 "me@(mutt\.org|cs\.hmc\.edu)"</literal> Without the quotes, the
5202 parenthesis wouldn't end. This would be separated to two OR'd patterns:
5203 <emphasis>~f me@(mutt\.org</emphasis> and
5204 <emphasis>cs\.hmc\.edu)</emphasis>. They are never what you want.
5210 <sect2 id="date-patterns">
5211 <title>Searching by Date</title>
5214 Mutt supports two types of dates, <emphasis>absolute</emphasis> and
5215 <emphasis>relative</emphasis>.
5218 <sect3 id="date-absolute">
5219 <title>Absolute Dates</title>
5222 Dates <emphasis>must</emphasis> be in DD/MM/YY format (month and year
5223 are optional, defaulting to the current month and year). An example of
5224 a valid range of dates is:
5228 Limit to messages matching: ~d 20/1/95-31/10
5232 If you omit the minimum (first) date, and just specify
5233 <quote>-DD/MM/YY</quote>, all messages <emphasis>before</emphasis> the
5234 given date will be selected. If you omit the maximum (second) date, and
5235 specify <quote>DD/MM/YY-</quote>, all messages
5236 <emphasis>after</emphasis> the given date will be selected. If you
5237 specify a single date with no dash (<quote>-</quote>), only messages
5238 sent on the given date will be selected.
5242 You can add error margins to absolute dates. An error margin is a sign
5243 (+ or -), followed by a digit, followed by one of the units in <xref
5244 linkend="tab-date-units"/>. As a special case, you can replace the sign
5245 by a <quote>*</quote> character, which is equivalent to giving identical
5246 plus and minus error margins.
5249 <table id="tab-date-units">
5250 <title>Date units</title>
5253 <row><entry>Unit</entry><entry>Description</entry></row>
5256 <row><entry>y</entry><entry>Years</entry></row>
5257 <row><entry>m</entry><entry>Months</entry></row>
5258 <row><entry>w</entry><entry>Weeks</entry></row>
5259 <row><entry>d</entry><entry>Days</entry></row>
5265 Example: To select any messages two weeks around January 15, 2001, you'd
5266 use the following pattern:
5270 Limit to messages matching: ~d 15/1/2001*2w
5275 <sect3 id="dates-relative">
5276 <title>Relative Dates</title>
5279 This type of date is relative to the current date, and may be specified
5287 ><emphasis>offset</emphasis> for messages older than
5288 <emphasis>offset</emphasis> units
5294 <<emphasis>offset</emphasis> for messages newer than
5295 <emphasis>offset</emphasis> units
5301 =<emphasis>offset</emphasis> for messages exactly
5302 <emphasis>offset</emphasis> units old
5309 <emphasis>offset</emphasis> is specified as a positive number with one
5310 of the units from <xref linkend="tab-date-units"/>.
5314 Example: to select messages less than 1 month old, you would use
5318 Limit to messages matching: ~d <1m
5323 All dates used when searching are relative to the
5324 <emphasis>local</emphasis> time zone, so unless you change the setting
5325 of your <link linkend="index-format">$index_format</link> to include a
5326 <literal>%[...]</literal> format, these are <emphasis>not</emphasis> the
5327 dates shown in the main index.
5338 <title>Using Tags</title>
5341 Sometimes it is desirable to perform an operation on a group of messages
5342 all at once rather than one at a time. An example might be to save
5343 messages to a mailing list to a separate folder, or to delete all
5344 messages with a given subject. To tag all messages matching a pattern,
5345 use the <literal><tag-pattern></literal> function, which is bound
5346 to <quote>shift-T</quote> by default. Or you can select individual
5347 messages by hand using the <literal><tag-message></literal>
5348 function, which is bound to <quote>t</quote> by default. See <link
5349 linkend="patterns">patterns</link> for Mutt's pattern matching syntax.
5353 Once you have tagged the desired messages, you can use the
5354 <quote>tag-prefix</quote> operator, which is the <quote>;</quote>
5355 (semicolon) key by default. When the <quote>tag-prefix</quote> operator
5356 is used, the <emphasis>next</emphasis> operation will be applied to all
5357 tagged messages if that operation can be used in that manner. If the
5358 <link linkend="auto-tag">$auto_tag</link> variable is set, the next
5359 operation applies to the tagged messages automatically, without
5360 requiring the <quote>tag-prefix</quote>.
5364 In <link linkend="macro"><command>macro</command>s</link> or <link
5365 linkend="push"><command>push</command></link> commands, you can use the
5366 <literal><tag-prefix-cond></literal> operator. If there are no
5367 tagged messages, Mutt will <quote>eat</quote> the rest of the macro to
5368 abort it's execution. Mutt will stop <quote>eating</quote> the macro
5369 when it encounters the <literal><end-cond></literal> operator;
5370 after this operator the rest of the macro will be executed as normal.
5376 <title>Using Hooks</title>
5379 A <emphasis>hook</emphasis> is a concept found in many other programs
5380 which allows you to execute arbitrary commands before performing some
5381 operation. For example, you may wish to tailor your configuration based
5382 upon which mailbox you are reading, or to whom you are sending mail. In
5383 the Mutt world, a <emphasis>hook</emphasis> consists of a <link
5384 linkend="regexp">regular expression</link> or <link
5385 linkend="patterns">pattern</link> along with a configuration
5386 option/command. See:
5392 <link linkend="account-hook"><command>account-hook</command></link>
5398 <link linkend="charset-hook"><command>charset-hook</command></link>
5404 <link linkend="crypt-hook"><command>crypt-hook</command></link>
5410 <link linkend="fcc-hook"><command>fcc-hook</command></link>
5416 <link linkend="fcc-save-hook"><command>fcc-save-hook</command></link>
5422 <link linkend="folder-hook"><command>folder-hook</command></link>
5428 <link linkend="iconv-hook"><command>iconv-hook</command></link>
5434 <link linkend="mbox-hook"><command>mbox-hook</command></link>
5440 <link linkend="message-hook"><command>message-hook</command></link>
5446 <link linkend="reply-hook"><command>reply-hook</command></link>
5452 <link linkend="save-hook"><command>save-hook</command></link>
5458 <link linkend="send-hook"><command>send-hook</command></link>
5464 <link linkend="send2-hook"><command>send2-hook</command></link>
5470 for specific details on each type of <emphasis>hook</emphasis> available.
5475 If a hook changes configuration settings, these changes remain effective
5476 until the end of the current Mutt session. As this is generally not
5477 desired, a <quote>default</quote> hook needs to be added before all
5478 other hooks of that type to restore configuration defaults.
5482 <example id="ex-default-hook">
5483 <title>Specifying a <quote>default</quote> hook</title>
5485 send-hook . 'unmy_hdr From:'
5486 send-hook ~C'^b@b\.b$' my_hdr from: c@c.c
5491 In <xref linkend="ex-default-hook"/>, by default the value of <link
5492 linkend="from">$from</link> and <link
5493 linkend="realname">$realname</link> is not overridden. When sending
5494 messages either To: or Cc: to <literal><b@b.b></literal>, the
5495 From: header is changed to <literal><c@c.c></literal>.
5498 <sect2 id="pattern-hook" xreflabel="Message Matching in Hooks">
5499 <title>Message Matching in Hooks</title>
5502 Hooks that act upon messages (<command>message-hook</command>,
5503 <command>reply-hook</command>, <command>send-hook</command>,
5504 <command>send2-hook</command>, <command>save-hook</command>,
5505 <command>fcc-hook</command>) are evaluated in a slightly different
5506 manner. For the other types of hooks, a <link linkend="regexp">regular
5507 expression</link> is sufficient. But in dealing with messages a finer
5508 grain of control is needed for matching since for different purposes you
5509 want to match different criteria.
5513 Mutt allows the use of the <link linkend="patterns">search
5514 pattern</link> language for matching messages in hook commands. This
5515 works in exactly the same way as it would when
5516 <emphasis>limiting</emphasis> or <emphasis>searching</emphasis> the
5517 mailbox, except that you are restricted to those operators which match
5518 information Mutt extracts from the header of the message (i.e., from,
5519 to, cc, date, subject, etc.).
5523 For example, if you wanted to set your return address based upon sending
5524 mail to a specific address, you could do something like:
5528 send-hook '~t ^me@cs\.hmc\.edu$' 'my_hdr From: Mutt User <user@host>'
5532 which would execute the given command when sending mail to
5533 <emphasis>me@cs.hmc.edu</emphasis>.
5537 However, it is not required that you write the pattern to match using
5538 the full searching language. You can still specify a simple
5539 <emphasis>regular expression</emphasis> like the other hooks, in which
5540 case Mutt will translate your pattern into the full language, using the
5541 translation specified by the <link
5542 linkend="default-hook">$default_hook</link> variable. The pattern is
5543 translated at the time the hook is declared, so the value of <link
5544 linkend="default-hook">$default_hook</link> that is in effect at that
5553 <title>External Address Queries</title>
5556 Mutt supports connecting to external directory databases such as LDAP,
5557 ph/qi, bbdb, or NIS through a wrapper script which connects to Mutt
5558 using a simple interface. Using the <link
5559 linkend="query-command">$query_command</link> variable, you specify the
5560 wrapper command to use. For example:
5564 set query_command = "mutt_ldap_query.pl %s"
5568 The wrapper script should accept the query on the command-line. It
5569 should return a one line message, then each matching response on a
5570 single line, each line containing a tab separated address then name then
5571 some other optional information. On error, or if there are no matching
5572 addresses, return a non-zero exit code and a one line error message.
5576 An example multiple response output:
5580 Searching database ... 20 entries ... 3 matching:
5581 me@cs.hmc.edu Michael Elkins mutt dude
5582 blong@fiction.net Brandon Long mutt and more
5583 roessler@does-not-exist.org Thomas Roessler mutt pgp
5587 There are two mechanisms for accessing the query function of Mutt. One
5588 is to do a query from the index menu using the
5589 <literal><query></literal> function (default: Q). This will
5590 prompt for a query, then bring up the query menu which will list the
5591 matching responses. From the query menu, you can select addresses to
5592 create aliases, or to mail. You can tag multiple addresses to mail,
5593 start a new query, or have a new query appended to the current
5598 The other mechanism for accessing the query function is for address
5599 completion, similar to the alias completion. In any prompt for address
5600 entry, you can use the <literal><complete-query></literal>
5601 function (default: ^T) to run a query based on the current address you
5602 have typed. Like aliases, Mutt will look for what you have typed back
5603 to the last space or comma. If there is a single response for that
5604 query, Mutt will expand the address in place. If there are multiple
5605 responses, Mutt will activate the query menu. At the query menu, you
5606 can select one or more addresses to be added to the prompt.
5611 <sect1 id="mailbox-formats">
5612 <title>Mailbox Formats</title>
5615 Mutt supports reading and writing of four different local mailbox
5616 formats: mbox, MMDF, MH and Maildir. The mailbox type is auto detected,
5617 so there is no need to use a flag for different mailbox types. When
5618 creating new mailboxes, Mutt uses the default specified with the <link
5619 linkend="mbox-type">$mbox_type</link> variable. A short description of
5620 the formats follows.
5624 <emphasis>mbox</emphasis>. This is a widely used mailbox format for
5625 UNIX. All messages are stored in a single file. Each message has a
5630 From me@cs.hmc.edu Fri, 11 Apr 1997 11:44:56 PST
5634 to denote the start of a new message (this is often referred to as the
5635 <quote>From_</quote> line). The mbox format requires mailbox locking, is
5636 prone to mailbox corruption with concurrently writing clients or
5637 misinterpreted From_ lines. Depending on the environment, new mail
5638 detection can be unreliable. Mbox folders are fast to open and easy to
5643 <emphasis>MMDF</emphasis>. This is a variant of the
5644 <emphasis>mbox</emphasis> format. Each message is surrounded by lines
5645 containing <quote>^A^A^A^A</quote> (four times control-A's). The same
5646 problems as for mbox apply (also with finding the right message
5647 separator as four control-A's may appear in message bodies).
5651 <emphasis>MH</emphasis>. A radical departure from
5652 <emphasis>mbox</emphasis> and <emphasis>MMDF</emphasis>, a mailbox
5653 consists of a directory and each message is stored in a separate file.
5654 The filename indicates the message number (however, this is may not
5655 correspond to the message number Mutt displays). Deleted messages are
5656 renamed with a comma (<quote>,</quote>) prepended to the filename. Mutt
5657 detects this type of mailbox by looking for either
5658 <literal>.mh_sequences</literal> or <literal>.xmhcache</literal> files
5659 (needed to distinguish normal directories from MH mailboxes). MH is more
5660 robust with concurrent clients writing the mailbox, but still may suffer
5661 from lost flags; message corruption is less likely to occur than with
5662 mbox/mmdf. It's usually slower to open compared to mbox/mmdf since many
5663 small files have to be read (Mutt provides <xref
5664 linkend="header-caching"/> to greatly speed this process up). Depending
5665 on the environment, MH is not very disk-space efficient.
5669 <emphasis>Maildir</emphasis>. The newest of the mailbox formats, used
5670 by the Qmail MTA (a replacement for sendmail). Similar to
5671 <emphasis>MH</emphasis>, except that it adds three subdirectories of the
5672 mailbox: <emphasis>tmp</emphasis>, <emphasis>new</emphasis> and
5673 <emphasis>cur</emphasis>. Filenames for the messages are chosen in such
5674 a way they are unique, even when two programs are writing the mailbox
5675 over NFS, which means that no file locking is needed and corruption is
5676 very unlikely. Maildir maybe slower to open without caching in Mutt, it
5677 too is not very disk-space efficient depending on the environment. Since
5678 no additional files are used for metadata (which is embedded in the
5679 message filenames) and Maildir is locking-free, it's easy to sync across
5680 different machines using file-level synchronization tools.
5685 <sect1 id="shortcuts">
5686 <title>Mailbox Shortcuts</title>
5689 There are a number of built in shortcuts which refer to specific
5690 mailboxes. These shortcuts can be used anywhere you are prompted for a
5691 file or mailbox path or in path-related configuration variables. Note
5692 that these only work at the beginning of a string.
5695 <table id="tab-mailbox-shortcuts">
5696 <title>Mailbox shortcuts</title>
5699 <row><entry>Shortcut</entry><entry>Refers to...</entry></row>
5702 <row><entry><literal>!</literal></entry><entry>your <link linkend="spoolfile">$spoolfile</link> (incoming) mailbox</entry></row>
5703 <row><entry><literal>></literal></entry><entry>your <link linkend="mbox">$mbox</link> file</entry></row>
5704 <row><entry><literal><</literal></entry><entry>your <link linkend="record">$record</link> file</entry></row>
5705 <row><entry><literal>^</literal></entry><entry>the current mailbox</entry></row>
5706 <row><entry><literal>-</literal> or <literal>!!</literal></entry><entry>the file you've last visited</entry></row>
5707 <row><entry><literal>~</literal></entry><entry>your home directory</entry></row>
5708 <row><entry><literal>=</literal> or <literal>+</literal></entry><entry>your <link linkend="folder">$folder</link> directory</entry></row>
5709 <row><entry><emphasis>@alias</emphasis></entry><entry>to the <link linkend="save-hook">default save folder</link> as determined by the address of the alias</entry></row>
5715 For example, to store a copy of outgoing messages in the folder they
5716 were composed in, a <link
5717 linkend="folder-hook"><command>folder-hook</command></link> can be used
5718 to set <link linkend="record">$record</link>:
5722 folder-hook . 'set record=^'</screen>
5726 <sect1 id="using-lists">
5727 <title>Handling Mailing Lists</title>
5730 Mutt has a few configuration options that make dealing with large
5731 amounts of mail easier. The first thing you must do is to let Mutt know
5732 what addresses you consider to be mailing lists (technically this does
5733 not have to be a mailing list, but that is what it is most often used
5734 for), and what lists you are subscribed to. This is accomplished
5735 through the use of the <link linkend="lists"><command>lists</command>
5736 and <command>subscribe</command></link> commands in your
5737 <literal>.muttrc</literal>.
5741 Now that Mutt knows what your mailing lists are, it can do several
5742 things, the first of which is the ability to show the name of a list
5743 through which you received a message (i.e., of a subscribed list) in the
5744 <emphasis>index</emphasis> menu display. This is useful to distinguish
5745 between personal and list mail in the same mailbox. In the <link
5746 linkend="index-format">$index_format</link> variable, the expando
5747 <quote>%L</quote> will print the string <quote>To <list></quote>
5748 when <quote>list</quote> appears in the <quote>To</quote> field, and
5749 <quote>Cc <list></quote> when it appears in the <quote>Cc</quote>
5750 field (otherwise it prints the name of the author).
5754 Often times the <quote>To</quote> and <quote>Cc</quote> fields in
5755 mailing list messages tend to get quite large. Most people do not bother
5756 to remove the author of the message they reply to from the list,
5757 resulting in two or more copies being sent to that person. The
5758 <literal><list-reply></literal> function, which by default is
5759 bound to <quote>L</quote> in the <emphasis>index</emphasis> menu and
5760 <emphasis>pager</emphasis>, helps reduce the clutter by only replying to
5761 the known mailing list addresses instead of all recipients (except as
5762 specified by <literal>Mail-Followup-To</literal>, see below).
5766 Mutt also supports the <literal>Mail-Followup-To</literal> header. When
5767 you send a message to a list of recipients which includes one or several
5768 subscribed mailing lists, and if the <link
5769 linkend="followup-to">$followup_to</link> option is set, Mutt will
5770 generate a Mail-Followup-To header which contains all the recipients to
5771 whom you send this message, but not your address. This indicates that
5772 group-replies or list-replies (also known as <quote>followups</quote>)
5773 to this message should only be sent to the original recipients of the
5774 message, and not separately to you - you'll receive your copy through
5775 one of the mailing lists you are subscribed to.
5779 Conversely, when group-replying or list-replying to a message which has
5780 a <literal>Mail-Followup-To</literal> header, Mutt will respect this
5782 linkend="honor-followup-to">$honor_followup_to</link> configuration
5783 variable is set. Using <link linkend="list-reply">list-reply</link>
5784 will in this case also make sure that the reply goes to the mailing
5785 list, even if it's not specified in the list of recipients in the
5786 <literal>Mail-Followup-To</literal>.
5791 When header editing is enabled, you can create a
5792 <literal>Mail-Followup-To</literal> header manually. Mutt will only
5793 auto-generate this header if it doesn't exist when you send the message.
5798 The other method some mailing list admins use is to generate a
5799 <quote>Reply-To</quote> field which points back to the mailing list
5800 address rather than the author of the message. This can create problems
5801 when trying to reply directly to the author in private, since most mail
5802 clients will automatically reply to the address given in the
5803 <quote>Reply-To</quote> field. Mutt uses the <link
5804 linkend="reply-to">$reply_to</link> variable to help decide which
5805 address to use. If set to <emphasis>ask-yes</emphasis> or
5806 <emphasis>ask-no</emphasis>, you will be prompted as to whether or not
5807 you would like to use the address given in the <quote>Reply-To</quote>
5808 field, or reply directly to the address given in the <quote>From</quote>
5809 field. When set to <emphasis>yes</emphasis>, the
5810 <quote>Reply-To</quote> field will be used when present.
5814 The <quote>X-Label:</quote> header field can be used to further identify
5815 mailing lists or list subject matter (or just to annotate messages
5816 individually). The <link linkend="index-format">$index_format</link>
5817 variable's <quote>%y</quote> and <quote>%Y</quote> expandos can be used
5818 to expand <quote>X-Label:</quote> fields in the index, and Mutt's
5819 pattern-matcher can match regular expressions to <quote>X-Label:</quote>
5820 fields with the <quote>~y</quote> selector. <quote>X-Label:</quote> is
5821 not a standard message header field, but it can easily be inserted by
5822 procmail and other mail filtering agents.
5826 Lastly, Mutt has the ability to <link linkend="sort">sort</link> the
5827 mailbox into <link linkend="threads">threads</link>. A thread is a
5828 group of messages which all relate to the same subject. This is usually
5829 organized into a tree-like structure where a message and all of its
5830 replies are represented graphically. If you've ever used a threaded
5831 news client, this is the same concept. It makes dealing with large
5832 volume mailing lists easier because you can easily delete uninteresting
5833 threads and quickly find topics of value.
5838 <sect1 id="new-mail">
5839 <title>New Mail Detection</title>
5842 Mutt supports setups with multiple folders, allowing all of them to be
5843 monitored for new mail (see <xref linkend="mailboxes"/> for details).
5846 <sect2 id="new-mail-formats">
5847 <title>How New Mail Detection Works</title>
5850 For Mbox and Mmdf folders, new mail is detected by comparing access
5851 and/or modification times of files: Mutt assumes a folder has new mail
5852 if it wasn't accessed after it was last modified. Utilities like
5853 <literal>biff</literal> or <literal>frm</literal> or any other program
5854 which accesses the mailbox might cause Mutt to never detect new mail for
5855 that mailbox if they do not properly reset the access time. Other
5856 possible causes of Mutt not detecting new mail in these folders are
5857 backup tools (updating access times) or filesystems mounted without
5858 access time update support (for Linux systems, see the
5859 <literal>relatime</literal> option).
5864 Contrary to older Mutt releases, it now maintains the new mail status of
5865 a folder by properly resetting the access time if the folder contains at
5866 least one message which is neither read, nor deleted, nor marked as old.
5871 In cases where new mail detection for Mbox or Mmdf folders appears to be
5872 unreliable, the <link linkend="check-mbox-size">$check_mbox_size</link>
5873 option can be used to make Mutt track and consult file sizes for new
5874 mail detection instead which won't work for size-neutral changes.
5878 New mail for Maildir is assumed if there is one message in the
5879 <literal>new/</literal> subdirectory which is not marked deleted (see
5880 <link linkend="maildir-trash">$maildir_trash</link>). For MH folders, a
5881 mailbox is considered having new mail if there's at least one message in
5882 the <quote>unseen</quote> sequence as specified by <link
5883 linkend="mh-seq-unseen">$mh_seq_unseen</link>.
5887 Mutt does not poll POP3 folders for new mail, it only periodically
5888 checks the currently opened folder (if it's a POP3 folder).
5892 For IMAP, by default Mutt uses recent message counts provided by the
5893 server to detect new mail. If the <link
5894 linkend="imap-idle">$imap_idle</link> option is set, it'll use the IMAP
5895 IDLE extension if advertised by the server.
5900 <sect2 id="new-mail-polling">
5901 <title>Polling For New Mail</title>
5904 When in the index menu and being idle (also see <link
5905 linkend="timeout">$timeout</link>), Mutt periodically checks for new
5906 mail in all folders which have been configured via the
5907 <command>mailboxes</command> command. The interval depends on the folder
5908 type: for local/IMAP folders it consults <link
5909 linkend="mail-check">$mail_check</link> and <link
5910 linkend="pop-checkinterval">$pop_checkinterval</link> for POP folders.
5914 Outside the index menu the directory browser supports checking for new
5915 mail using the <literal><check-new></literal> function which is
5916 unbound by default. Pressing TAB will bring up a menu showing the files
5917 specified by the <command>mailboxes</command> command, and indicate
5918 which contain new messages. Mutt will automatically enter this mode when
5919 invoked from the command line with the <literal>-y</literal> option.
5923 For the pager, index and directory browser menus, Mutt contains the
5924 <literal><buffy-list></literal> function (bound to
5925 <quote>.</quote> by default) which will print a list of folders with new
5926 mail in the command line at the bottom of the screen.
5930 For the index, by default Mutt displays the number of mailboxes with new
5931 mail in the status bar, please refer to the <link
5932 linkend="status-format">$status_format</link> variable for details.
5936 When changing folders, Mutt fills the prompt with the first folder from
5937 the mailboxes list containing new mail (if any), pressing
5938 <literal><Space></literal> will cycle through folders with new
5939 mail. The (by default unbound) function
5940 <literal><next-unread-mailbox></literal> in the index can be used
5941 to immediately open the next folder with unread mail (if any).
5948 <sect1 id="editing-threads">
5949 <title>Editing Threads</title>
5952 Mutt has the ability to dynamically restructure threads that are broken
5953 either by misconfigured software or bad behavior from some
5954 correspondents. This allows to clean your mailboxes from these
5955 annoyances which make it hard to follow a discussion.
5958 <sect2 id="link-threads">
5959 <title>Linking Threads</title>
5962 Some mailers tend to <quote>forget</quote> to correctly set the
5963 <quote>In-Reply-To:</quote> and <quote>References:</quote> headers when
5964 replying to a message. This results in broken discussions because Mutt
5965 has not enough information to guess the correct threading. You can fix
5966 this by tagging the reply, then moving to the parent message and using
5967 the <literal><link-threads></literal> function (bound to & by
5968 default). The reply will then be connected to this parent message.
5972 You can also connect multiple children at once, tagging them and using
5973 the <literal><tag-prefix></literal> command (<quote>;</quote>) or
5974 the <link linkend="auto-tag">$auto_tag</link> option.
5979 <sect2 id="break-threads">
5980 <title>Breaking Threads</title>
5983 On mailing lists, some people are in the bad habit of starting a new
5984 discussion by hitting <quote>reply</quote> to any message from the list
5985 and changing the subject to a totally unrelated one. You can fix such
5986 threads by using the <literal><break-thread></literal> function
5987 (bound by default to #), which will turn the subthread starting from the
5988 current message into a whole different thread.
5996 <title>Delivery Status Notification (DSN) Support</title>
5999 RFC1894 defines a set of MIME content types for relaying information
6000 about the status of electronic mail messages. These can be thought of
6001 as <quote>return receipts.</quote>
6005 To support DSN, there are two variables. <link
6006 linkend="dsn-notify">$dsn_notify</link> is used to request receipts for
6007 different results (such as failed message, message delivered, etc.).
6008 <link linkend="dsn-return">$dsn_return</link> requests how much of your
6009 message should be returned with the receipt (headers or full message).
6013 When using <link linkend="sendmail">$sendmail</link> for mail delivery,
6014 you need to use either Berkeley sendmail 8.8.x (or greater) a MTA
6015 supporting DSN command line options compatible to Sendmail: The -N and
6016 -R options can be used by the mail client to make requests as to what
6017 type of status messages should be returned. Please consider your MTA
6018 documentation whether DSN is supported.
6022 For SMTP delivery using <link linkend="smtp-url">$smtp_url</link>, it
6023 depends on the capabilities announced by the server whether Mutt will
6024 attempt to request DSN or not.
6029 <sect1 id="urlview">
6030 <title>Start a WWW Browser on URLs</title>
6033 If a message contains URLs, it is efficient to get a menu with all the
6034 URLs and start a WWW browser on one of them. This functionality is
6035 provided by the external urlview program which can be retrieved at
6037 url="ftp://ftp.mutt.org/mutt/contrib/">ftp://ftp.mutt.org/mutt/contrib/</ulink>
6038 and the configuration commands:
6042 macro index \cb |urlview\n
6043 macro pager \cb |urlview\n
6048 <sect1 id="misc-topics">
6049 <title>Miscellany</title>
6052 This section documents various features that fit nowhere else.
6058 Address normalization
6062 Mutt normalizes all e-mail addresses to the simplest form possible. If
6063 an address contains a realname, the form <emphasis>Joe User
6064 <joe@example.com></emphasis> is used and the pure e-mail address
6065 without angle brackets otherwise, i.e. just
6066 <emphasis>joe@example.com</emphasis>.
6069 This normalization affects all headers Mutt generates including aliases.
6075 Initial folder selection
6079 The folder Mutt opens at startup is determined as follows: the folder
6080 specified in the <literal>$MAIL</literal> environment variable if
6081 present. Otherwise, the value of <literal>$MAILDIR</literal> is taken
6082 into account. If that isn't present either, Mutt takes the user's
6083 mailbox in the mailspool as determined at compile-time (which may also
6084 reside in the home directory). The <link
6085 linkend="spoolfile">$spoolfile</link> setting overrides this
6086 selection. Highest priority has the mailbox given with the
6087 <literal>-f</literal> command line option.
6097 <chapter id="mimesupport">
6098 <title>Mutt's MIME Support</title>
6101 Quite a bit of effort has been made to make Mutt the premier text-mode
6102 MIME MUA. Every effort has been made to provide the functionality that
6103 the discerning MIME user requires, and the conformance to the standards
6104 wherever possible. When configuring Mutt for MIME, there are two extra
6105 types of configuration files which Mutt uses. One is the
6106 <literal>mime.types</literal> file, which contains the mapping of file
6107 extensions to IANA MIME types. The other is the
6108 <literal>mailcap</literal> file, which specifies the external commands
6109 to use for handling specific MIME types.
6112 <sect1 id="using-mime">
6113 <title>Using MIME in Mutt</title>
6115 <sect2 id="mime-overview">
6116 <title>MIME Overview</title>
6119 MIME is short for <quote>Multipurpose Internet Mail Extension</quote>
6120 and describes mechanisms to internationalize and structure mail
6121 messages. Before the introduction of MIME, messages had a single text
6122 part and were limited to us-ascii header and content. With MIME,
6123 messages can have attachments (and even attachments which itself have
6124 attachments and thus form a tree structure), nearly arbitrary characters
6125 can be used for sender names, recipients and subjects.
6129 Besides the handling of non-ascii characters in message headers, to Mutt
6130 the most important aspect of MIME are so-called MIME types. These are
6131 constructed using a <emphasis>major</emphasis> and
6132 <emphasis>minor</emphasis> type separated by a forward slash. These
6133 specify details about the content that follows. Based upon these, Mutt
6134 decides how to handle this part. The most popular major type is
6135 <quote><literal>text</literal></quote> with minor types for plain text,
6136 HTML and various other formats. Major types also exist for images,
6137 audio, video and of course general application data (e.g. to separate
6138 cryptographically signed data with a signature, send office documents,
6139 and in general arbitrary binary data). There's also the
6140 <literal>multipart</literal> major type which represents the root of a
6141 subtree of MIME parts. A list of supported MIME types can be found in
6142 <xref linkend="supported-mime-types"/>.
6146 MIME also defines a set of encoding schemes for transporting MIME
6147 content over the network: <literal>7bit</literal>,
6148 <literal>8bit</literal>, <literal>quoted-printable</literal>,
6149 <literal>base64</literal> and <literal>binary</literal>. There're some
6150 rules when to choose what for encoding headers and/or body (if needed),
6151 and Mutt will in general make a good choice.
6155 Mutt does most of MIME encoding/decoding behind the scenes to form
6156 messages conforming to MIME on the sending side. On reception, it can be
6157 flexibly configured as to how what MIME structure is displayed (and if
6158 it's displayed): these decisions are based on the content's MIME type.
6159 There are three areas/menus in dealing with MIME: the pager (while
6160 viewing a message), the attachment menu and the compose menu.
6165 <sect2 id="mime-pager">
6166 <title>Viewing MIME Messages in the Pager</title>
6169 When you select a message from the index and view it in the pager, Mutt
6170 decodes as much of a message as possible to a text representation. Mutt
6171 internally supports a number of MIME types, including the
6172 <literal>text</literal> major type (with all minor types), the
6173 <literal>message/rfc822</literal> (mail messages) type and some
6174 <literal>multipart</literal> types. In addition, it recognizes a variety
6175 of PGP MIME types, including PGP/MIME and
6176 <literal>application/pgp</literal>.
6180 Mutt will denote attachments with a couple lines describing them.
6181 These lines are of the form:
6185 [-- Attachment #1: Description --]
6186 [-- Type: text/plain, Encoding: 7bit, Size: 10000 --]
6190 Where the <emphasis>Description</emphasis> is the description or
6191 filename given for the attachment, and the <emphasis>Encoding</emphasis>
6192 is one of the already mentioned content encodings.
6196 If Mutt cannot deal with a MIME type, it will display a message like:
6200 [-- image/gif is unsupported (use 'v' to view this part) --]
6205 <sect2 id="attach-menu">
6206 <title>The Attachment Menu</title>
6209 The default binding for <literal><view-attachments></literal> is
6210 <quote>v</quote>, which displays the attachment menu for a message. The
6211 attachment menu displays a list of the attachments in a message. From
6212 the attachment menu, you can save, print, pipe, delete, and view
6213 attachments. You can apply these operations to a group of attachments
6214 at once, by tagging the attachments and by using the
6215 <literal><tag-prefix></literal> operator. You can also reply to
6216 the current message from this menu, and only the current attachment (or
6217 the attachments tagged) will be quoted in your reply. You can view
6218 attachments as text, or view them using the mailcap viewer definition
6219 (the mailcap mechanism is explained later in detail).
6223 Finally, you can apply the usual message-related functions (like <link
6224 linkend="resend-message"><literal><resend-message></literal></link>,
6225 and the <literal><reply></literal> and
6226 <literal><forward></literal> functions) to attachments of type
6227 <literal>message/rfc822</literal>.
6231 See table <xref linkend="tab-attachment-bindings"/> for all available
6237 <sect2 id="compose-menu">
6238 <title>The Compose Menu</title>
6241 The compose menu is the menu you see before you send a message. It
6242 allows you to edit the recipient list, the subject, and other aspects of
6243 your message. It also contains a list of the attachments of your
6244 message, including the main body. From this menu, you can print, copy,
6245 filter, pipe, edit, compose, review, and rename an attachment or a list
6246 of tagged attachments. You can also modifying the attachment
6247 information, notably the type, encoding and description.
6251 Attachments appear as follows by default:
6255 - 1 [text/plain, 7bit, 1K] /tmp/mutt-euler-8082-0 <no description>
6256 2 [applica/x-gunzip, base64, 422K] ~/src/mutt-0.85.tar.gz <no description>
6260 The <quote>-</quote> denotes that Mutt will delete the file after
6261 sending (or postponing, or canceling) the message. It can be toggled
6262 with the <literal><toggle-unlink></literal> command (default: u).
6263 The next field is the MIME content-type, and can be changed with the
6264 <literal><edit-type></literal> command (default: ^T). The next
6265 field is the encoding for the attachment, which allows a binary message
6266 to be encoded for transmission on 7bit links. It can be changed with
6267 the <literal><edit-encoding></literal> command (default: ^E). The
6268 next field is the size of the attachment, rounded to kilobytes or
6269 megabytes. The next field is the filename, which can be changed with
6270 the <literal><rename-file></literal> command (default: R). The
6271 final field is the description of the attachment, and can be changed
6272 with the <literal><edit-description></literal> command (default:
6273 d). See <link linkend="attach-format">$attach_format</link> for a full
6274 list of available expandos to format this display to your needs.
6281 <sect1 id="mime-types">
6282 <title>MIME Type Configuration with <literal>mime.types</literal></title>
6285 To get most out of MIME, it's important that a MIME part's content type
6286 matches the content as closely as possible so that the recipient's
6287 client can automatically select the right viewer for the
6288 content. However, there's no reliable for Mutt to know how to detect
6289 every possible file type. Instead, it uses a simple plain text mapping
6290 file that specifies what file extension corresponds to what MIME
6291 type. This file is called <literal>mime.types</literal>.
6295 When you add an attachment to your mail message, Mutt searches your
6296 personal <literal>mime.types</literal> file at
6297 <literal>$HOME/.mime.types</literal>, and then the system
6298 <literal>mime.types</literal> file at
6299 <literal>/usr/local/share/mutt/mime.types</literal> or
6300 <literal>/etc/mime.types</literal>
6304 Each line starts with the full MIME type, followed by a space and
6305 space-separated list of file extensions. For example you could use:
6308 <example id="ex-mime-types">
6309 <title><literal>mime.types</literal></title>
6311 application/postscript ps eps
6313 audio/x-aiff aif aifc aiff
6318 A sample <literal>mime.types</literal> file comes with the Mutt
6319 distribution, and should contain most of the MIME types you are likely
6324 If Mutt can not determine the MIME type by the extension of the file you
6325 attach, it will look at the file. If the file is free of binary
6326 information, Mutt will assume that the file is plain text, and mark it
6327 as <literal>text/plain</literal>. If the file contains binary
6328 information, then Mutt will mark it as
6329 <literal>application/octet-stream</literal>. You can change the MIME
6330 type that Mutt assigns to an attachment by using the
6331 <literal><edit-type></literal> command from the compose menu
6332 (default: ^T), see <xref linkend="supported-mime-types"/> for supported
6333 major types. Mutt recognizes all of these if the appropriate entry is
6334 found in the <literal>mime.types</literal> file. Non-recognized mime
6335 types should only be used if the recipient of the message is likely to
6336 be expecting such attachments.
6339 <table id="supported-mime-types">
6340 <title>Supported MIME types</title>
6343 <row><entry>MIME major type</entry><entry>Standard</entry><entry>Description</entry></row>
6346 <row><entry><literal>application</literal></entry><entry>yes</entry><entry>General application data</entry></row>
6347 <row><entry><literal>audio</literal></entry><entry>yes</entry><entry>Audio data</entry></row>
6348 <row><entry><literal>image</literal></entry><entry>yes</entry><entry>Image data</entry></row>
6349 <row><entry><literal>message</literal></entry><entry>yes</entry><entry>Mail messages, message status information</entry></row>
6350 <row><entry><literal>model</literal></entry><entry>yes</entry><entry>VRML and other modeling data</entry></row>
6351 <row><entry><literal>multipart</literal></entry><entry>yes</entry><entry>Container for other MIME parts</entry></row>
6352 <row><entry><literal>text</literal></entry><entry>yes</entry><entry>Text data</entry></row>
6353 <row><entry><literal>video</literal></entry><entry>yes</entry><entry>Video data</entry></row>
6354 <row><entry><literal>chemical</literal></entry><entry>no</entry><entry>Mostly molecular data</entry></row>
6360 MIME types are not arbitrary, they need to be assigned by <ulink
6361 url="http://www.iana.org/assignments/media-types/">IANA</ulink>.
6366 <sect1 id="mailcap">
6367 <title>MIME Viewer Configuration with Mailcap</title>
6370 Mutt supports RFC 1524 MIME Configuration, in particular the Unix
6371 specific format specified in Appendix A of RFC 1524. This file format
6372 is commonly referred to as the <quote>mailcap</quote> format. Many MIME
6373 compliant programs utilize the mailcap format, allowing you to specify
6374 handling for all MIME types in one place for all programs. Programs
6375 known to use this format include Firefox, lynx and metamail.
6379 In order to handle various MIME types that Mutt doesn't have built-in
6380 support for, it parses a series of external configuration files to find
6381 an external handler. The default search string for these files is a
6382 colon delimited list containing the following files:
6386 <listitem><para><literal>$HOME/.mailcap</literal></para></listitem>
6387 <listitem><para><literal>$PKGDATADIR/mailcap</literal></para></listitem>
6388 <listitem><para><literal>$SYSCONFDIR/mailcap</literal></para></listitem>
6389 <listitem><para><literal>/etc/mailcap</literal></para></listitem>
6390 <listitem><para><literal>/usr/etc/mailcap</literal></para></listitem>
6391 <listitem><para><literal>/usr/local/etc/mailcap</literal></para></listitem>
6395 where <literal>$HOME</literal> is your home directory. The
6396 <literal>$PKGDATADIR</literal> and the <literal>$SYSCONFDIR</literal>
6397 directories depend on where Mutt is installed: the former is the default
6398 for shared data, the latter for system configuration files.
6402 The default search path can be obtained by running the following
6407 mutt -nF /dev/null -Q mailcap_path
6411 In particular, the metamail distribution will install a mailcap file,
6412 usually as <literal>/usr/local/etc/mailcap</literal>, which contains
6413 some baseline entries.
6416 <sect2 id="mailcap-basics">
6417 <title>The Basics of the Mailcap File</title>
6420 A mailcap file consists of a series of lines which are comments, blank,
6425 A comment line consists of a # character followed by anything you want.
6429 A blank line is blank.
6433 A definition line consists of a content type, a view command, and any
6434 number of optional fields. Each field of a definition line is divided
6435 by a semicolon <quote>;</quote> character.
6439 The content type is specified in the MIME standard
6440 <quote>type/subtype</quote> notation. For example,
6441 <literal>text/plain</literal>, <literal>text/html</literal>,
6442 <literal>image/gif</literal>, etc. In addition, the mailcap format
6443 includes two formats for wildcards, one using the special
6444 <quote>*</quote> subtype, the other is the implicit wild, where you only
6445 include the major type. For example, <literal>image/*</literal>, or
6446 <literal>video</literal> will match all image types and video types,
6451 The view command is a Unix command for viewing the type specified. There
6452 are two different types of commands supported. The default is to send
6453 the body of the MIME message to the command on stdin. You can change
6454 this behavior by using <literal>%s</literal> as a parameter to your view
6455 command. This will cause Mutt to save the body of the MIME message to a
6456 temporary file, and then call the view command with the
6457 <literal>%s</literal> replaced by the name of the temporary file. In
6458 both cases, Mutt will turn over the terminal to the view program until
6459 the program quits, at which time Mutt will remove the temporary file if
6460 it exists. This means that mailcap does <emphasis>not</emphasis> work
6461 out of the box with programs which detach themselves from the terminal
6462 right after starting, like <literal>open</literal> on Mac OS X. In order
6463 to nevertheless use these programs with mailcap, you probably need
6464 custom shell scripts.
6468 So, in the simplest form, you can send a <literal>text/plain</literal>
6469 message to the external pager more on standard input:
6477 Or, you could send the message as a file:
6485 Perhaps you would like to use lynx to interactively view a
6486 <literal>text/html</literal> message:
6494 In this case, lynx does not support viewing a file from standard input,
6495 so you must use the <literal>%s</literal> syntax.
6500 <emphasis>Some older versions of lynx contain a bug where they will
6501 check the mailcap file for a viewer for <literal>text/html</literal>.
6502 They will find the line which calls lynx, and run it. This causes lynx
6503 to continuously spawn itself to view the object.</emphasis>
6508 On the other hand, maybe you don't want to use lynx interactively, you
6509 just want to have it convert the <literal>text/html</literal> to
6510 <literal>text/plain</literal>, then you can use:
6514 text/html; lynx -dump %s | more
6518 Perhaps you wish to use lynx to view <literal>text/html</literal> files,
6519 and a pager on all other text formats, then you would use the following:
6529 <sect2 id="secure-mailcap">
6530 <title>Secure Use of Mailcap</title>
6533 The interpretation of shell meta-characters embedded in MIME parameters
6534 can lead to security problems in general. Mutt tries to quote
6535 parameters in expansion of <literal>%s</literal> syntaxes properly, and
6536 avoids risky characters by substituting them, see the <link
6537 linkend="mailcap-sanitize">$mailcap_sanitize</link> variable.
6541 Although Mutt's procedures to invoke programs with mailcap seem to be
6542 safe, there are other applications parsing mailcap, maybe taking less
6543 care of it. Therefore you should pay attention to the following rules:
6547 <emphasis>Keep the %-expandos away from shell quoting.</emphasis> Don't
6548 quote them with single or double quotes. Mutt does this for you, the
6549 right way, as should any other program which interprets mailcap. Don't
6550 put them into backtick expansions. Be highly careful with evil
6551 statements, and avoid them if possible at all. Trying to fix broken
6552 behavior with quotes introduces new leaks — there is no
6553 alternative to correct quoting in the first place.
6557 If you have to use the %-expandos' values in context where you need
6558 quoting or backtick expansions, put that value into a shell variable and
6559 reference the shell variable where necessary, as in the following
6560 example (using <literal>$charset</literal> inside the backtick expansion
6561 is safe, since it is not itself subject to any further expansion):
6565 text/test-mailcap-bug; cat %s; copiousoutput; test=charset=%{charset} \
6566 && test "`echo $charset | tr '[A-Z]' '[a-z]'`" != iso-8859-1
6571 <sect2 id="advanced-mailcap">
6572 <title>Advanced Mailcap Usage</title>
6574 <sect3 id="optional-mailcap-fields">
6575 <title>Optional Fields</title>
6578 In addition to the required content-type and view command fields, you
6579 can add semi-colon <quote>;</quote> separated fields to set flags and
6580 other options. Mutt recognizes the following optional fields:
6586 <term>copiousoutput</term>
6589 This flag tells Mutt that the command passes possibly large amounts of
6590 text on standard output. This causes Mutt to invoke a pager (either
6591 the internal pager or the external pager defined by the pager variable)
6592 on the output of the view command. Without this flag, Mutt assumes that
6593 the command is interactive. One could use this to replace the pipe to
6594 <literal>more</literal> in the <literal>lynx -dump</literal> example in
6599 text/html; lynx -dump %s ; copiousoutput
6603 This will cause lynx to format the <literal>text/html</literal> output
6604 as <literal>text/plain</literal> and Mutt will use your standard pager
6605 to display the results.
6609 Note that when using the built-in pager, <emphasis>only</emphasis>
6610 entries with this flag will be considered a handler for a MIME type
6611 — all other entries will be ignored.
6616 <term>needsterminal</term>
6619 Mutt uses this flag when viewing attachments with <link
6620 linkend="auto-view"><command>auto_view</command></link>, in order to
6621 decide whether it should honor the setting of the <link
6622 linkend="wait-key">$wait_key</link> variable or not. When an attachment
6623 is viewed using an interactive program, and the corresponding mailcap
6624 entry has a <emphasis>needsterminal</emphasis> flag, Mutt will use <link
6625 linkend="wait-key">$wait_key</link> and the exit status of the program
6626 to decide if it will ask you to press a key after the external program
6627 has exited. In all other situations it will not prompt you for a key.
6632 <term>compose=<command></term>
6635 This flag specifies the command to use to create a new attachment of a
6636 specific MIME type. Mutt supports this from the compose menu.
6641 <term>composetyped=<command></term>
6644 This flag specifies the command to use to create a new attachment of a
6645 specific MIME type. This command differs from the compose command in
6646 that Mutt will expect standard MIME headers on the data. This can be
6647 used to specify parameters, filename, description, etc. for a new
6648 attachment. Mutt supports this from the compose menu.
6653 <term>print=<command></term>
6656 This flag specifies the command to use to print a specific MIME type.
6657 Mutt supports this from the attachment and compose menus.
6662 <term>edit=<command></term>
6665 This flag specifies the command to use to edit a specific MIME type.
6666 Mutt supports this from the compose menu, and also uses it to compose
6667 new attachments. Mutt will default to the defined <link
6668 linkend="editor">$editor</link> for text attachments.
6673 <term>nametemplate=<template></term>
6676 This field specifies the format for the file denoted by
6677 <literal>%s</literal> in the command fields. Certain programs will
6678 require a certain file extension, for instance, to correctly view a
6679 file. For instance, lynx will only interpret a file as
6680 <literal>text/html</literal> if the file ends in
6681 <literal>.html</literal>. So, you would specify lynx as a
6682 <literal>text/html</literal> viewer with a line in the mailcap file
6687 text/html; lynx %s; nametemplate=%s.html
6693 <term>test=<command></term>
6696 This field specifies a command to run to test whether this mailcap entry
6697 should be used. The command is defined with the command expansion rules
6698 defined in the next section. If the command returns 0, then the test
6699 passed, and Mutt uses this entry. If the command returns non-zero, then
6700 the test failed, and Mutt continues searching for the right entry. Note
6701 that the content-type must match before Mutt performs the test. For
6706 text/html; firefox -remote 'openURL(%s)' ; test=RunningX
6711 In this example, Mutt will run the program <literal>RunningX</literal>
6712 which will return 0 if the X Window manager is running, and non-zero if
6713 it isn't. If <literal>RunningX</literal> returns 0, then Mutt will run
6714 firefox to display the <literal>text/html</literal> object. If RunningX
6715 doesn't return 0, then Mutt will go on to the next entry and use lynx to
6716 display the <literal>text/html</literal> object.
6724 <sect3 id="mailcap-search-order">
6725 <title>Search Order</title>
6728 When searching for an entry in the mailcap file, Mutt will search for
6729 the most useful entry for its purpose. For instance, if you are
6730 attempting to print an <literal>image/gif</literal>, and you have the
6731 following entries in your mailcap file, Mutt will search for an entry
6732 with the print command:
6737 image/gif; ; print= anytopnm %s | pnmtops | lpr; \
6742 Mutt will skip the <literal>image/*</literal> entry and use the
6743 <literal>image/gif</literal> entry with the print command.
6747 In addition, you can use this with <link
6748 linkend="auto-view"><command>auto_view</command></link> to denote two
6749 commands for viewing an attachment, one to be viewed automatically, the
6750 other to be viewed interactively from the attachment menu using the
6751 <literal><view-mailcap></literal> function (bound to
6752 <quote>m</quote> by default). In addition, you can then use the test
6753 feature to determine which viewer to use interactively depending on your
6758 text/html; firefox -remote 'openURL(%s)' ; test=RunningX
6759 text/html; lynx %s; nametemplate=%s.html
6760 text/html; lynx -dump %s; nametemplate=%s.html; copiousoutput
6764 For <link linkend="auto-view"><command>auto_view</command></link>, Mutt
6765 will choose the third entry because of the
6766 <literal>copiousoutput</literal> tag. For interactive viewing, Mutt
6767 will run the program <literal>RunningX</literal> to determine if it
6768 should use the first entry. If the program returns non-zero, Mutt will
6769 use the second entry for interactive viewing. The last entry is for
6770 inline display in the pager and the
6771 <literal><view-attach></literal> function in the attachment menu.
6775 Entries with the <literal>copiousoutput</literal> tag should always be
6776 specified as the last one per type. For non-interactive use, the last
6777 entry will then actually be the first matching one with the tag set.
6778 For non-interactive use, only <literal>copiousoutput</literal>-tagged
6779 entries are considered. For interactive use, Mutt ignores this tag and
6780 treats all entries equally. Therefore, if not specified last, all
6781 following entries without this tag would never be considered for
6782 <literal><view-attach></literal> because the
6783 <literal>copiousoutput</literal> before them matched already.
6788 <sect3 id="mailcap-command-expansion">
6789 <title>Command Expansion</title>
6792 The various commands defined in the mailcap files are passed to the
6793 <literal>/bin/sh</literal> shell using the <literal>system(3)</literal>
6794 function. Before the command is passed to <literal>/bin/sh
6795 -c</literal>, it is parsed to expand various special parameters with
6796 information from Mutt. The keywords Mutt expands are:
6805 As seen in the basic mailcap section, this variable is expanded to a
6806 filename specified by the calling program. This file contains the body
6807 of the message to view/print/edit or where the composing program should
6808 place the results of composition. In addition, the use of this keyword
6809 causes Mutt to not pass the body of the message to the view/print/edit
6818 Mutt will expand <literal>%t</literal> to the text representation of the
6819 content type of the message in the same form as the first parameter of
6820 the mailcap definition line, i.e. <literal>text/html</literal> or
6821 <literal>image/gif</literal>.
6826 <term>%{<parameter>}</term>
6829 Mutt will expand this to the value of the specified parameter from the
6830 Content-Type: line of the mail message. For instance, if your mail
6835 Content-Type: text/plain; charset=iso-8859-1
6839 then Mutt will expand <literal>%{charset}</literal> to
6840 <quote>iso-8859-1</quote>. The default metamail mailcap file uses this
6841 feature to test the charset to spawn an xterm using the right charset to
6850 This will be replaced by a literal <literal>%</literal>.
6857 Mutt does not currently support the <literal>%F</literal> and
6858 <literal>%n</literal> keywords specified in RFC 1524. The main purpose
6859 of these parameters is for multipart messages, which is handled
6867 <sect2 id="mailcap-example">
6868 <title>Example Mailcap Files</title>
6871 This mailcap file is fairly simple and standard:
6875 <emphasis role="comment"># I'm always running X :)</emphasis>
6876 video/*; xanim %s > /dev/null
6877 image/*; xv %s > /dev/null
6879 <emphasis role="comment"># I'm always running firefox (if my computer had more memory, maybe)</emphasis>
6880 text/html; firefox -remote 'openURL(%s)'
6884 This mailcap file shows quite a number of examples:
6888 <emphasis role="comment"># Use xanim to view all videos Xanim produces a header on startup,
6889 # send that to /dev/null so I don't see it</emphasis>
6890 video/*; xanim %s > /dev/null
6892 <emphasis role="comment"># Send html to a running firefox by remote</emphasis>
6893 text/html; firefox -remote 'openURL(%s)'; test=RunningFirefox
6895 <emphasis role="comment"># If I'm not running firefox but I am running X, start firefox on the
6897 text/html; firefox %s; test=RunningX
6899 <emphasis role="comment"># Else use lynx to view it as text</emphasis>
6902 <emphasis role="comment"># This version would convert the text/html to text/plain</emphasis>
6903 text/html; lynx -dump %s; copiousoutput
6905 <emphasis role="comment"># I use enscript to print text in two columns to a page</emphasis>
6906 text/*; more %s; print=enscript -2Gr %s
6908 <emphasis role="comment"># Firefox adds a flag to tell itself to view jpegs internally</emphasis>
6909 image/jpeg;xv %s; x-mozilla-flags=internal
6911 <emphasis role="comment"># Use xv to view images if I'm running X</emphasis>
6912 <emphasis role="comment"># In addition, this uses the \ to extend the line and set my editor</emphasis>
6913 <emphasis role="comment"># for images</emphasis>
6914 image/*;xv %s; test=RunningX; \
6917 <emphasis role="comment"># Convert images to text using the netpbm tools</emphasis>
6918 image/*; (anytopnm %s | pnmscale -xysize 80 46 | ppmtopgm | pgmtopbm |
6919 pbmtoascii -1x2 ) 2>&1 ; copiousoutput
6921 <emphasis role="comment"># Send excel spreadsheets to my NT box</emphasis>
6922 application/ms-excel; open.pl %s
6929 <sect1 id="auto-view">
6930 <title>MIME Autoview</title>
6937 <command>auto_view</command>
6938 <arg choice="plain">
6939 <replaceable>mimetype</replaceable>
6941 <arg choice="opt" rep="repeat">
6942 <replaceable>mimetype</replaceable>
6945 <command>unauto_view</command>
6946 <group choice="req">
6947 <arg choice="plain">
6948 <replaceable>*</replaceable>
6950 <arg choice="plain" rep="repeat">
6951 <replaceable>mimetype</replaceable>
6957 In addition to explicitly telling Mutt to view an attachment with the
6958 MIME viewer defined in the mailcap file from the attachments menu, Mutt
6959 has support for automatically viewing MIME attachments while in the
6964 For this to work, you must define a viewer in the mailcap file which
6965 uses the <literal>copiousoutput</literal> option to denote that it is
6966 non-interactive. Usually, you also use the entry to convert the
6967 attachment to a text representation which you can view in the pager.
6971 You then use the <command>auto_view</command> configuration command to
6972 list the content-types that you wish to view automatically. For
6973 instance, if you set it to:
6977 auto_view text/html application/x-gunzip \
6978 application/postscript image/gif application/x-tar-gz
6982 ...Mutt would try to find corresponding entries for rendering
6983 attachments of these types as text. A corresponding mailcap could look
6988 text/html; lynx -dump %s; copiousoutput; nametemplate=%s.html
6989 image/*; anytopnm %s | pnmscale -xsize 80 -ysize 50 | ppmtopgm | \
6990 pgmtopbm | pbmtoascii ; copiousoutput
6991 application/x-gunzip; gzcat; copiousoutput
6992 application/x-tar-gz; gunzip -c %s | tar -tf - ; copiousoutput
6993 application/postscript; ps2ascii %s; copiousoutput
6997 <command>unauto_view</command> can be used to remove previous entries
6998 from the <command>auto_view</command> list. This can be used with <link
6999 linkend="message-hook"><command>message-hook</command></link> to
7000 autoview messages based on size, etc.
7001 <quote><command>unauto_view</command> *</quote> will remove all previous
7007 <sect1 id="alternative-order">
7008 <title>MIME Multipart/Alternative</title>
7011 The <literal>multipart/alternative</literal> container type only has
7012 child MIME parts which represent the same content in an alternative
7013 way. This is often used to send HTML messages which contain an
7014 alternative plain text representation.
7018 Mutt has some heuristics for determining which attachment of a
7019 <literal>multipart/alternative</literal> type to display:
7025 First, Mutt will check the <command>alternative_order</command> list to
7026 determine if one of the available types is preferred. It consists of a
7027 number of MIME types in order, including support for implicit and
7028 explicit wildcards. For example:
7032 alternative_order text/enriched text/plain text \
7033 application/postscript image/*
7038 Next, Mutt will check if any of the types have a defined <link
7039 linkend="auto-view"><command>auto_view</command></link>, and use that.
7044 Failing that, Mutt will look for any text type.
7049 As a last attempt, Mutt will look for any type it knows how to handle.
7055 To remove a MIME type from the <command>alternative_order</command>
7056 list, use the <command>unalternative_order</command> command.
7061 <sect1 id="attachments">
7062 <title>Attachment Searching and Counting</title>
7065 If you ever lose track of attachments in your mailboxes, Mutt's
7066 attachment-counting and -searching support might be for you. You can
7067 make your message index display the number of qualifying attachments in
7068 each message, or search for messages by attachment count. You also can
7069 configure what kinds of attachments qualify for this feature with the
7070 <command>attachments</command> and <command>unattachments</command>
7075 In order to provide this information, Mutt needs to fully MIME-parse all
7076 messages affected first. This can slow down operation especially for
7077 remote mail folders such as IMAP because all messages have to be
7078 downloaded first regardless whether the user really wants to view them
7079 or not though using <xref linkend="body-caching"/> usually means to
7080 download the message just once.
7088 <command>attachments</command>
7089 <arg choice="plain">
7090 <replaceable>{ + | - }disposition</replaceable>
7092 <arg choice="plain">
7093 <replaceable>mime-type</replaceable>
7096 <command>unattachments</command>
7097 <arg choice="plain">
7098 <replaceable>{ + | - }disposition</replaceable>
7100 <arg choice="plain">
7101 <replaceable>mime-type</replaceable>
7104 <command>attachments</command>
7105 <arg choice="plain">
7106 <replaceable>?</replaceable>
7111 <emphasis>disposition</emphasis> is the attachment's Content-Disposition
7112 type — either <literal>inline</literal> or
7113 <literal>attachment</literal>. You can abbreviate this to
7114 <literal>I</literal> or <literal>A</literal>.
7118 Disposition is prefixed by either a <quote>+</quote> symbol or a
7119 <quote>-</quote> symbol. If it's a <quote>+</quote>, you're saying that
7120 you want to allow this disposition and MIME type to qualify. If it's a
7121 <quote>-</quote>, you're saying that this disposition and MIME type is
7122 an exception to previous <quote>+</quote> rules. There are examples
7123 below of how this is useful.
7127 <emphasis>mime-type</emphasis> is the MIME type of the attachment you
7128 want the command to affect. A MIME type is always of the format
7129 <literal>major/minor</literal>, where <literal>major</literal> describes
7130 the broad category of document you're looking at, and
7131 <literal>minor</literal> describes the specific type within that
7132 category. The major part of mime-type must be literal text (or the
7133 special token <quote><literal>*</literal></quote>), but the minor part
7134 may be a regular expression. (Therefore,
7135 <quote><literal>*/.*</literal></quote> matches any MIME type.)
7139 The MIME types you give to the <command>attachments</command> directive
7140 are a kind of pattern. When you use the <command>attachments</command>
7141 directive, the patterns you specify are added to a list. When you use
7142 <command>unattachments</command>, the pattern is removed from the list.
7143 The patterns are not expanded and matched to specific MIME types at this
7144 time — they're just text in a list. They're only matched when
7145 actually evaluating a message.
7149 Some examples might help to illustrate. The examples that are not
7150 commented out define the default configuration of the lists.
7153 <example id="ex-attach-count">
7154 <title>Attachment counting</title>
7156 <emphasis role="comment">
7157 # Removing a pattern from a list removes that pattern literally. It
7158 # does not remove any type matching the pattern.
7160 # attachments +A */.*
7161 # attachments +A image/jpeg
7162 # unattachments +A */.*
7164 # This leaves "attached" image/jpeg files on the allowed attachments
7165 # list. It does not remove all items, as you might expect, because the
7166 # second */.* is not a matching expression at this time.
7168 # Remember: "unattachments" only undoes what "attachments" has done!
7169 # It does not trigger any matching on actual messages.
7171 # Qualify any MIME part with an "attachment" disposition, EXCEPT for
7172 # text/x-vcard and application/pgp parts. (PGP parts are already known
7173 # to mutt, and can be searched for with ~g, ~G, and ~k.)
7175 # I've added x-pkcs7 to this, since it functions (for S/MIME)
7176 # analogously to PGP signature attachments. S/MIME isn't supported
7177 # in a stock mutt build, but we can still treat it specially here.
7181 attachments -A text/x-vcard application/pgp.*
7182 attachments -A application/x-pkcs7-.*
7184 <emphasis role="comment">
7185 # Discount all MIME parts with an "inline" disposition, unless they're
7186 # text/plain. (Why inline a text/plain part unless it's external to the
7189 attachments +I text/plain
7191 <emphasis role="comment">
7192 # These two lines make Mutt qualify MIME containers. (So, for example,
7193 # a message/rfc822 forward will count as an attachment.) The first
7194 # line is unnecessary if you already have "attach-allow */.*", of
7195 # course. These are off by default! The MIME elements contained
7196 # within a message/* or multipart/* are still examined, even if the
7197 # containers themselves don't qualify.
7199 #attachments +A message/.* multipart/.*
7200 #attachments +I message/.* multipart/.*
7203 <emphasis role="comment">## You probably don't really care to know about deleted attachments.</emphasis>
7204 attachments -A message/external-body
7205 attachments -I message/external-body
7210 Entering the command <quote><command>attachments</command> ?</quote> as
7211 a command will list your current settings in Muttrc format, so that it
7212 can be pasted elsewhere.
7217 <sect1 id="mime-lookup">
7218 <title>MIME Lookup</title>
7225 <command>mime-lookup</command>
7226 <arg choice="plain">
7227 <replaceable>mimetype</replaceable>
7229 <arg choice="opt" rep="repeat">
7230 <replaceable>mimetype</replaceable>
7233 <command>unmime-lookup</command>
7234 <group choice="req">
7235 <arg choice="plain">
7236 <replaceable>*</replaceable>
7238 <arg choice="plain" rep="repeat">
7239 <replaceable>mimetype</replaceable>
7245 Mutt's <command>mime_lookup</command> list specifies a list of MIME
7246 types that should <emphasis>not</emphasis> be treated according to their
7247 mailcap entry. This option is designed to deal with binary types such
7248 as <literal>application/octet-stream</literal>. When an attachment's
7249 MIME type is listed in <command>mime_lookup</command>, then the
7250 extension of the filename will be compared to the list of extensions in
7251 the <literal>mime.types</literal> file. The MIME type associated with
7252 this extension will then be used to process the attachment according to
7253 the rules in the mailcap file and according to any other configuration
7254 options (such as <command>auto_view</command>) specified. Common usage
7259 mime_lookup application/octet-stream application/X-Lotus-Manuscript
7263 In addition, the <literal>unmime_lookup</literal> command may be used to
7264 disable this feature for any particular MIME type if it had been set,
7265 for example, in a global <literal>.muttrc</literal>.
7272 <chapter id="optionalfeatures">
7273 <title>Optional Features</title>
7275 <sect1 id="optionalfeatures-notes">
7276 <title>General Notes</title>
7278 <sect2 id="compile-time-features">
7279 <title>Enabling/Disabling Features</title>
7282 Mutt supports several of optional features which can be enabled or
7283 disabled at compile-time by giving the <emphasis>configure</emphasis>
7284 script certain arguments. These are listed in the <quote>Optional
7285 features</quote> section of the <emphasis>configure --help</emphasis>
7290 Which features are enabled or disabled can later be determined from the
7291 output of <literal>mutt -v</literal>. If a compile option starts with
7292 <quote>+</quote> it is enabled and disabled if prefixed with
7293 <quote>-</quote>. For example, if Mutt was compiled using GnuTLS for
7294 encrypted communication instead of OpenSSL, <literal>mutt -v</literal>
7299 -USE_SSL_OPENSSL +USE_SSL_GNUTLS</screen>
7303 <sect2 id="url-syntax">
7304 <title>URL Syntax</title>
7307 Mutt optionally supports the IMAP, POP3 and SMTP protocols which require
7308 to access servers using URLs. The canonical syntax for specifying URLs
7309 in Mutt is (an item enclosed in <literal>[]</literal> means it is
7310 optional and may be omitted):
7314 proto[s]://[username[:password]@]server[:port][/path]
7318 <emphasis>proto</emphasis> is the communication protocol:
7319 <literal>imap</literal> for IMAP, <literal>pop</literal> for POP3 and
7320 <literal>smtp</literal> for SMTP. If <quote>s</quote> for <quote>secure
7321 communication</quote> is appended, Mutt will attempt to establish an
7322 encrypted communication using SSL or TLS.
7326 Since all protocols supported by Mutt support/require authentication,
7327 login credentials may be specified in the URL. This has the advantage
7328 that multiple IMAP, POP3 or SMTP servers may be specified (which isn't
7329 possible using, for example, <link
7330 linkend="imap-user">$imap_user</link>). The username may contain the
7331 <quote>@</quote> symbol being used by many mail systems as part of the
7332 login name. The special characters <quote>/</quote>
7333 (<literal>%2F</literal>), <quote>:</quote> (<literal>%3A</literal>) and
7334 <quote>%</quote> (<literal>%25</literal>) have to be URL-encoded in
7335 usernames using the <literal>%</literal>-notation.
7339 A password can be given, too but is not recommended if the URL is
7340 specified in a configuration file on disk.
7344 If no port number is given, Mutt will use the system's default for the
7345 given protocol (usually consulting <literal>/etc/services</literal>).
7349 The optional path is only relevant for IMAP and ignored elsewhere.
7352 <example id="ex-url">
7356 imaps://user@host/INBOX/Sent
7357 smtp://user@host:587/
7366 <title>SSL/TLS Support</title>
7369 If Mutt is compiled with IMAP, POP3 and/or SMTP support, it can also be
7370 compiled with support for SSL or TLS using either OpenSSL or GnuTLS ( by
7371 running the <emphasis>configure</emphasis> script with the
7372 <emphasis>--enable-ssl=...</emphasis> option for OpenSSL or
7373 <emphasis>--enable-gnutls=...</emphasis> for GnuTLS). Mutt can then
7374 attempt to encrypt communication with remote servers if these protocols
7375 are suffixed with <quote>s</quote> for <quote>secure
7376 communication</quote>.
7382 <title>POP3 Support</title>
7385 If Mutt is compiled with POP3 support (by running the
7386 <emphasis>configure</emphasis> script with the
7387 <emphasis>--enable-pop</emphasis> flag), it has the ability to work with
7388 mailboxes located on a remote POP3 server and fetch mail for local
7393 Remote POP3 servers can be accessed using URLs with the
7394 <literal>pop</literal> protocol for unencrypted and
7395 <literal>pops</literal> for encrypted communication, see <xref
7396 linkend="url-syntax"/> for details.
7400 Polling for new mail is more expensive over POP3 than locally. For this
7401 reason the frequency at which Mutt will check for mail remotely can be
7402 controlled by the <link
7403 linkend="pop-checkinterval">$pop_checkinterval</link> variable, which
7404 defaults to every 60 seconds.
7408 POP is read-only which doesn't allow for some features like editing
7409 messages or changing flags. However, using <xref
7410 linkend="header-caching"/> and <xref linkend="body-caching"/> Mutt
7411 simulates the new/old/read flags as well as flagged and replied. Mutt
7412 applies some logic on top of remote messages but cannot change them so
7413 that modifications of flags are lost when messages are downloaded from
7414 the POP server (either by Mutt or other tools).
7417 <anchor id="fetch-mail"/>
7419 Another way to access your POP3 mail is the
7420 <literal><fetch-mail></literal> function (default: G). It allows
7421 to connect to <link linkend="pop-host">$pop_host</link>, fetch all your
7422 new mail and place it in the local <link
7423 linkend="spoolfile">$spoolfile</link>. After this point, Mutt runs
7424 exactly as if the mail had always been local.
7429 If you only need to fetch all messages to a local mailbox you should
7430 consider using a specialized program, such as
7431 <literal>fetchmail(1)</literal>, <literal>getmail(1)</literal> or
7439 <title>IMAP Support</title>
7442 If Mutt was compiled with IMAP support (by running the
7443 <emphasis>configure</emphasis> script with the
7444 <emphasis>--enable-imap</emphasis> flag), it has the ability to work
7445 with folders located on a remote IMAP server.
7449 You can access the remote inbox by selecting the folder by its URL (see
7450 <xref linkend="url-syntax"/> for details) using the
7451 <literal>imap</literal> or <literal>imaps</literal> protocol.
7452 Alternatively, a pine-compatible notation is also supported, i.e.
7453 <literal>{[username@]imapserver[:port][/ssl]}path/to/folder</literal>
7457 Note that not all servers use <quote>/</quote> as the hierarchy
7458 separator. Mutt should correctly notice which separator is being used
7459 by the server and convert paths accordingly.
7463 When browsing folders on an IMAP server, you can toggle whether to look
7464 at only the folders you are subscribed to, or all folders with the
7465 <emphasis>toggle-subscribed</emphasis> command. See also the <link
7466 linkend="imap-list-subscribed">$imap_list_subscribed</link> variable.
7470 Polling for new mail on an IMAP server can cause noticeable delays. So,
7471 you'll want to carefully tune the <link
7472 linkend="mail-check">$mail_check</link> and <link
7473 linkend="timeout">$timeout</link> variables. Reasonable values are:
7482 with relatively good results even over slow modem lines.
7487 Note that if you are using mbox as the mail store on UW servers prior to
7488 v12.250, the server has been reported to disconnect a client if another
7489 client selects the same folder.
7493 <sect2 id="imap-browser">
7494 <title>The IMAP Folder Browser</title>
7497 As of version 1.2, Mutt supports browsing mailboxes on an IMAP
7498 server. This is mostly the same as the local file browser, with the
7499 following differences:
7506 In lieu of file permissions, Mutt displays the string
7507 <quote>IMAP</quote>, possibly followed by the symbol <quote>+</quote>,
7508 indicating that the entry contains both messages and subfolders. On
7509 Cyrus-like servers folders will often contain both messages and
7516 For the case where an entry can contain both messages and subfolders,
7517 the selection key (bound to <literal>enter</literal> by default) will
7518 choose to descend into the subfolder view. If you wish to view the
7519 messages in that folder, you must use <literal>view-file</literal>
7520 instead (bound to <literal>space</literal> by default).
7526 You can create, delete and rename mailboxes with the
7527 <literal><create-mailbox></literal>,
7528 <literal><delete-mailbox></literal>, and
7529 <literal><rename-mailbox></literal> commands (default bindings:
7530 <literal>C</literal>, <literal>d</literal> and <literal>r</literal>,
7531 respectively). You may also <literal><subscribe></literal> and
7532 <literal><unsubscribe></literal> to mailboxes (normally these are
7533 bound to <literal>s</literal> and <literal>u</literal>, respectively).
7541 <sect2 id="imap-authentication">
7542 <title>Authentication</title>
7545 Mutt supports four authentication methods with IMAP servers: SASL,
7546 GSSAPI, CRAM-MD5, and LOGIN (there is a patch by Grant Edwards to add
7547 NTLM authentication for you poor exchange users out there, but it has
7548 yet to be integrated into the main tree). There is also support for the
7549 pseudo-protocol ANONYMOUS, which allows you to log in to a public IMAP
7550 server without having an account. To use ANONYMOUS, simply make your
7551 username blank or <quote>anonymous</quote>.
7555 SASL is a special super-authenticator, which selects among several
7556 protocols (including GSSAPI, CRAM-MD5, ANONYMOUS, and DIGEST-MD5) the
7557 most secure method available on your host and the server. Using some of
7558 these methods (including DIGEST-MD5 and possibly GSSAPI), your entire
7559 session will be encrypted and invisible to those teeming network
7560 snoops. It is the best option if you have it. To use it, you must have
7561 the Cyrus SASL library installed on your system and compile Mutt with
7562 the <emphasis>--with-sasl</emphasis> flag.
7566 Mutt will try whichever methods are compiled in and available on the
7567 server, in the following order: SASL, ANONYMOUS, GSSAPI, CRAM-MD5,
7572 There are a few variables which control authentication:
7579 <link linkend="imap-user">$imap_user</link> - controls the username
7580 under which you request authentication on the IMAP server, for all
7581 authenticators. This is overridden by an explicit username in the
7582 mailbox path (i.e. by using a mailbox name of the form
7583 <literal>{user@host}</literal>).
7589 <link linkend="imap-pass">$imap_pass</link> - a password which you may
7590 preset, used by all authentication methods where a password is needed.
7596 <link linkend="imap-authenticators">$imap_authenticators</link> - a
7597 colon-delimited list of IMAP authentication methods to try, in the order
7598 you wish to try them. If specified, this overrides Mutt's default
7599 (attempt everything, in the order listed above).
7610 <title>SMTP Support</title>
7613 Besides supporting traditional mail delivery through a
7614 sendmail-compatible program, Mutt supports delivery through SMTP if it
7615 was configured and built with <literal>--enable-smtp</literal>.
7619 If the configuration variable <link linkend="smtp-url">$smtp_url</link>
7620 is set, Mutt will contact the given SMTP server to deliver messages; if
7621 it is unset, Mutt will use the program specified by <link
7622 linkend="sendmail">$sendmail</link>.
7626 For details on the URL syntax, please see <xref linkend="url-syntax"/>.
7630 The built-in SMTP support supports encryption (the
7631 <literal>smtps</literal> protocol using SSL or TLS) as well as SMTP
7632 authentication using SASL. The authentication mechanisms for SASL are
7634 linkend="smtp-authenticators">$smtp_authenticators</link> defaulting to
7635 an empty list which makes Mutt try all available methods from
7636 most-secure to least-secure.
7641 <sect1 id="account-hook">
7642 <title>Managing Multiple Accounts</title>
7649 <command>account-hook</command>
7650 <arg choice="plain">
7651 <replaceable class="parameter">pattern</replaceable>
7653 <arg choice="plain">
7654 <replaceable class="parameter">command</replaceable>
7659 If you happen to have accounts on multiple IMAP, POP and/or SMTP
7660 servers, you may find managing all the authentication settings
7661 inconvenient and error-prone. The <link
7662 linkend="account-hook"><command>account-hook</command></link> command
7663 may help. This hook works like <link
7664 linkend="folder-hook"><command>folder-hook</command></link> but is
7665 invoked whenever Mutt needs to access a remote mailbox (including inside
7666 the folder browser), not just when you open the mailbox. This includes
7667 (for example) polling for new mail, storing Fcc messages and saving
7668 messages to a folder. As a consequence, <link
7669 linkend="account-hook"><command>account-hook</command></link> should
7670 only be used to set connection-related settings such as passwords or
7671 tunnel commands but not settings such as sender address or name (because
7672 in general it should be considered unpredictable which <link
7673 linkend="account-hook"><command>account-hook</command></link> was last
7682 account-hook . 'unset imap_user; unset imap_pass; unset tunnel'
7683 account-hook imap://host1/ 'set imap_user=me1 imap_pass=foo'
7684 account-hook imap://host2/ 'set tunnel="ssh host2 /usr/libexec/imapd"'
7685 account-hook smtp://user@host3/ 'set tunnel="ssh host3 /usr/libexec/smtpd"'
7689 To manage multiple accounts with, for example, different values of <link
7690 linkend="record">$record</link> or sender addresses, <link
7691 linkend="folder-hook"><command>folder-hook</command></link> has to be be
7692 used together with the <link
7693 linkend="mailboxes"><command>mailboxes</command></link> command.
7696 <example id="ex-multiaccount">
7697 <title>Managing multiple accounts</title>
7699 mailboxes imap://user@host1/INBOX
7700 folder-hook imap://user@host1/ 'set folder=imap://host1/ ; set record=+INBOX/Sent'
7702 mailboxes imap://user@host2/INBOX
7703 folder-hook imap://user@host2/ 'set folder=imap://host2/ ; set record=+INBOX/Sent'
7708 In example <xref linkend="ex-multiaccount"/> the folders are defined
7709 using <link linkend="mailboxes"><command>mailboxes</command></link> so
7710 Mutt polls them for new mail. Each <link
7711 linkend="folder-hook"><command>folder-hook</command></link> triggers
7712 when one mailbox below each IMAP account is opened and sets <link
7713 linkend="folder">$folder</link> to the account's root folder. Next, it
7714 sets <link linkend="record">$record</link> to the
7715 <emphasis>INBOX/Sent</emphasis> folder below the newly set <link
7716 linkend="folder">$folder</link>. Please notice that the value the
7717 <quote>+</quote> <link linkend="shortcuts">mailbox shortcut</link>
7718 refers to depends on the <emphasis>current</emphasis> value of <link
7719 linkend="folder">$folder</link> and therefore has to be set separately
7720 per account. Setting other values like <link linkend="from">$from</link>
7721 or <link linkend="signature">$signature</link> is analogous to setting
7722 <link linkend="record">$record</link>.
7727 <sect1 id="caching">
7728 <title>Local Caching</title>
7731 Mutt contains two types of local caching: <emphasis>(1)</emphasis> the
7732 so-called <quote>header caching</quote> and <emphasis>(2)</emphasis> the
7733 so-called <quote>body caching</quote> which are both described in this
7738 Header caching is optional as it depends on external libraries, body
7739 caching is always enabled if Mutt is compiled with POP and/or IMAP
7740 support as these use it (body caching requires no external library).
7743 <sect2 id="header-caching">
7744 <title>Header Caching</title>
7747 Mutt provides optional support for caching message headers for the
7748 following types of folders: IMAP, POP, Maildir and MH. Header caching
7749 greatly speeds up opening large folders because for remote folders,
7750 headers usually only need to be downloaded once. For Maildir and MH,
7751 reading the headers from a single file is much faster than looking at
7752 possibly thousands of single files (since Maildir and MH use one file
7757 Header caching can be enabled via the configure script and the
7758 <emphasis>--enable-hcache</emphasis> option. It's not turned on by
7759 default because external database libraries are required: one of
7760 tokyocabinet, qdbm, gdbm or bdb must be present.
7764 If enabled, <link linkend="header-cache">$header_cache</link> can be
7765 used to either point to a file or a directory. If set to point to a
7766 file, one database file for all folders will be used (which may result
7767 in lower performance), but one file per folder if it points to a
7773 <sect2 id="body-caching">
7774 <title>Body Caching</title>
7777 Both cache methods can be combined using the same directory for storage
7778 (and for IMAP/POP even provide meaningful file names) which simplifies
7779 manual maintenance tasks.
7783 In addition to caching message headers only, Mutt can also cache whole
7784 message bodies. This results in faster display of messages for POP and
7785 IMAP folders because messages usually have to be downloaded only once.
7789 For configuration, the variable <link linkend="message-cachedir"
7790 >$message_cachedir</link> must point to a directory. There, Mutt will
7791 create a hierarchy of subdirectories named like the account and mailbox
7792 path the cache is for.
7797 <sect2 id="cache-dirs">
7798 <title>Cache Directories</title>
7801 For using both, header and body caching, <link
7802 linkend="header-cache">$header_cache</link> and <link
7803 linkend="message-cachedir" >$message_cachedir</link> can be safely set
7808 In a header or body cache directory, Mutt creates a directory hierarchy
7809 named like: <literal>proto:user@hostname</literal> where
7810 <literal>proto</literal> is either <quote>pop</quote> or
7811 <quote>imap.</quote> Within there, for each folder, Mutt stores messages
7812 in single files and header caches in files with the
7813 <quote>.hcache</quote> extension. All files can be removed as needed if
7814 the consumed disk space becomes an issue as Mutt will silently fetch
7815 missing items again. Pathnames are always stored in UTF-8 encoding.
7819 For Maildir and MH, the header cache files are named after the MD5
7820 checksum of the path.
7825 <sect2 id="maint-cache">
7826 <title>Maintenance</title>
7829 Mutt does not (yet) support maintenance features for header cache
7830 database files so that files have to be removed in case they grow too
7831 big. It depends on the database library used for header caching whether
7832 disk space freed by removing messages is re-used.
7836 For body caches, Mutt can keep the local cache in sync with the remote
7837 mailbox if the <link
7838 linkend="message-cache-clean">$message_cache_clean</link> variable is
7839 set. Cleaning means to remove messages from the cache which are no
7840 longer present in the mailbox which only happens when other mail clients
7841 or instances of Mutt using a different body cache location delete
7842 messages (Mutt itself removes deleted messages from the cache when
7843 syncing a mailbox). As cleaning can take a noticeable amount of time, it
7844 should not be set in general but only occasionally.
7851 <sect1 id="exact-address">
7852 <title>Exact Address Generation</title>
7855 Mutt supports the <quote>Name <user@host></quote> address syntax
7856 for reading and writing messages, the older <quote>user@host
7857 (Name)</quote> syntax is only supported when reading messages. The
7858 <emphasis>--enable-exact-address</emphasis> switch can be given to
7859 configure to build it with write-support for the latter
7860 syntax. <literal>EXACT_ADDRESS</literal> in the output of <literal>mutt
7861 -v</literal> indicates whether it's supported.
7866 <sect1 id="sending-mixmaster">
7867 <title>Sending Anonymous Messages via Mixmaster</title>
7870 You may also have compiled Mutt to co-operate with Mixmaster, an
7871 anonymous remailer. Mixmaster permits you to send your messages
7872 anonymously using a chain of remailers. Mixmaster support in Mutt is for
7873 mixmaster version 2.04 or later.
7877 To use it, you'll have to obey certain restrictions. Most important,
7878 you cannot use the <literal>Cc</literal> and <literal>Bcc</literal>
7879 headers. To tell Mutt to use mixmaster, you have to select a remailer
7880 chain, using the mix function on the compose menu.
7884 The chain selection screen is divided into two parts. In the (larger)
7885 upper part, you get a list of remailers you may use. In the lower part,
7886 you see the currently selected chain of remailers.
7890 You can navigate in the chain using the
7891 <literal><chain-prev></literal> and
7892 <literal><chain-next></literal> functions, which are by default
7893 bound to the left and right arrows and to the <literal>h</literal> and
7894 <literal>l</literal> keys (think vi keyboard bindings). To insert a
7895 remailer at the current chain position, use the
7896 <literal><insert></literal> function. To append a remailer behind
7897 the current chain position, use <literal><select-entry></literal>
7898 or <literal><append></literal>. You can also delete entries from
7899 the chain, using the corresponding function. Finally, to abandon your
7900 changes, leave the menu, or <literal><accept></literal> them
7901 pressing (by default) the <literal>Return</literal> key.
7905 Note that different remailers do have different capabilities, indicated
7906 in the %c entry of the remailer menu lines (see <link
7907 linkend="mix-entry-format">$mix_entry_format</link>). Most important is
7908 the <quote>middleman</quote> capability, indicated by a capital
7909 <quote>M</quote>: This means that the remailer in question cannot be
7910 used as the final element of a chain, but will only forward messages to
7911 other mixmaster remailers. For details on the other capabilities,
7912 please have a look at the mixmaster documentation.
7919 <chapter id="security">
7920 <title>Security Considerations</title>
7923 First of all, Mutt contains no security holes included by intention but
7924 may contain unknown security holes. As a consequence, please run Mutt
7925 only with as few permissions as possible. Especially, do not run Mutt as
7930 When configuring Mutt, there're some points to note about secure setups
7931 so please read this chapter carefully.
7934 <sect1 id="security-passwords">
7935 <title>Passwords</title>
7938 Although Mutt can be told the various passwords for accounts, please
7939 never store passwords in configuration files. Besides the fact that the
7940 system's operator can always read them, you could forget to mask it out
7941 when reporting a bug or asking for help via a mailing list. Even worse,
7942 your mail including your password could be archived by internet search
7943 engines, mail-to-news gateways etc. It may already be too late before
7944 you notice your mistake.
7949 <sect1 id="security-tempfiles">
7950 <title>Temporary Files</title>
7953 Mutt uses many temporary files for viewing messages, verifying digital
7954 signatures, etc. As long as being used, these files are visible by other
7955 users and maybe even readable in case of misconfiguration. Also, a
7956 different location for these files may be desired which can be changed
7957 via the <link linkend="tmpdir">$tmpdir</link> variable.
7962 <sect1 id="security-leaks">
7963 <title>Information Leaks</title>
7965 <sect2 id="security-leaks-mid">
7966 <title>Message-Id: headers</title>
7969 Message-Id: headers contain a local part that is to be created in a
7970 unique fashion. In order to do so, Mutt will <quote>leak</quote> some
7971 information to the outside world when sending messages: the generation
7972 of this header includes a step counter which is increased (and rotated)
7973 with every message sent. In a longer running mutt session, others can
7974 make assumptions about your mailing habits depending on the number of
7975 messages sent. If this is not desired, the header can be manually
7976 provided using <link linkend="edit-headers">$edit_headers</link> (though
7982 <sect2 id="security-leaks-mailto">
7983 <title><literal>mailto:</literal>-style Links</title>
7986 As Mutt be can be set up to be the mail client to handle
7987 <literal>mailto:</literal> style links in websites, there're security
7988 considerations, too. Arbitrary header fields can be embedded in these
7989 links which could override existing header fields or attach arbitrary
7990 files using <link linkend="attach-header">the Attach:
7991 pseudoheader</link>. This may be problematic if the <link
7992 linkend="edit-headers">$edit-headers</link> variable is
7993 <emphasis>unset</emphasis>, i.e. the user doesn't want to see header
7994 fields while editing the message and doesn't pay enough attention to the
7995 compose menu's listing of attachments.
7999 For example, following a link like
8003 mailto:joe@host?Attach=~/.gnupg/secring.gpg</screen>
8006 will send out the user's private gnupg keyring to
8007 <literal>joe@host</literal> if the user doesn't follow the information
8008 on screen carefully enough.
8015 <sect1 id="security-external">
8016 <title>External Applications</title>
8019 Mutt in many places has to rely on external applications or for
8020 convenience supports mechanisms involving external applications.
8024 One of these is the <literal>mailcap</literal> mechanism as defined by
8025 RfC1524. Details about a secure use of the mailcap mechanisms is given
8026 in <xref linkend="secure-mailcap"/>.
8030 Besides the mailcap mechanism, Mutt uses a number of other external
8031 utilities for operation, for example to provide crypto support, in
8032 backtick expansion in configuration files or format string filters. The
8033 same security considerations apply for these as for tools involved via
8042 <chapter id="tuning">
8043 <title>Performance Tuning</title>
8045 <sect1 id="tuning-mailboxes">
8046 <title>Reading and Writing Mailboxes</title>
8049 Mutt's performance when reading mailboxes can be improved in two ways:
8056 For remote folders (IMAP and POP) as well as folders using one-file-per
8057 message storage (Maildir and MH), Mutt's performance can be greatly
8058 improved using <link linkend="header-caching">header caching</link>.
8059 using a single database per folder.
8065 Mutt provides the <link linkend="read-inc">$read_inc</link> and <link
8066 linkend="write-inc">$write_inc</link> variables to specify at which rate
8067 to update progress counters. If these values are too low, Mutt may spend
8068 more time on updating the progress counter than it spends on actually
8069 reading/writing folders.
8073 For example, when opening a maildir folder with a few thousand messages,
8074 the default value for <link linkend="read-inc">$read_inc</link> may be
8075 too low. It can be tuned on on a folder-basis using <link
8076 linkend="folder-hook"><command>folder-hook</command>s</link>:
8080 <emphasis role="comment"># use very high $read_inc to speed up reading hcache'd maildirs</emphasis>
8081 folder-hook . 'set read_inc=1000'
8082 <emphasis role="comment"># use lower value for reading slower remote IMAP folders</emphasis>
8083 folder-hook ^imap 'set read_inc=100'
8084 <emphasis role="comment"># use even lower value for reading even slower remote POP folders</emphasis>
8085 folder-hook ^pop 'set read_inc=1'</screen>
8091 These settings work on a per-message basis. However, as messages may
8092 greatly differ in size and certain operations are much faster than
8093 others, even per-folder settings of the increment variables may not be
8094 desirable as they produce either too few or too much progress updates.
8095 Thus, Mutt allows to limit the number of progress updates per second
8096 it'll actually send to the terminal using the <link
8097 linkend="time-inc">$time_inc</link> variable.
8102 <sect1 id="tuning-messages">
8103 <title>Reading Messages from Remote Folders</title>
8106 Reading messages from remote folders such as IMAP an POP can be slow
8107 especially for large mailboxes since Mutt only caches a very limited
8108 number of recently viewed messages (usually 10) per session (so that it
8109 will be gone for the next session.)
8113 To improve performance and permanently cache whole messages, please
8114 refer to Mutt's so-called <link linkend="body-caching">body
8115 caching</link> for details.
8120 <sect1 id="tuning-search">
8121 <title>Searching and Limiting</title>
8124 When searching mailboxes either via a search or a limit action, for some
8125 patterns Mutt distinguishes between regular expression and string
8126 searches. For regular expressions, patterns are prefixed with
8127 <quote>~</quote> and with <quote>=</quote> for string searches.
8131 Even though a regular expression search is fast, it's several times
8132 slower than a pure string search which is noticeable especially on large
8133 folders. As a consequence, a string search should be used instead of a
8134 regular expression search if the user already knows enough about the
8139 For example, when limiting a large folder to all messages sent to or by
8140 an author, it's much faster to search for the initial part of an e-mail
8141 address via <literal>=Luser@</literal> instead of
8142 <literal>~Luser@</literal>. This is especially true for searching
8143 message bodies since a larger amount of input has to be searched.
8147 As for regular expressions, a lower case string search pattern makes
8148 Mutt perform a case-insensitive search except for IMAP (because for IMAP
8149 Mutt performs server-side searches which don't support
8150 case-insensitivity).
8157 <chapter id="reference">
8158 <title>Reference</title>
8160 <sect1 id="commandline">
8161 <title>Command-Line Options</title>
8164 Running <literal>mutt</literal> with no arguments will make Mutt attempt
8165 to read your spool mailbox. However, it is possible to read other
8166 mailboxes and to send messages from the command line as well.
8169 <table id="tab-commandline-options">
8170 <title>Command line options</title>
8173 <row><entry>Option</entry><entry>Description</entry></row>
8176 <row><entry>-A</entry><entry>expand an alias</entry></row>
8177 <row><entry>-a</entry><entry>attach a file to a message</entry></row>
8178 <row><entry>-b</entry><entry>specify a blind carbon-copy (BCC) address</entry></row>
8179 <row><entry>-c</entry><entry>specify a carbon-copy (Cc) address</entry></row>
8180 <row><entry>-D</entry><entry>print the value of all Mutt variables to stdout</entry></row>
8181 <row><entry>-e</entry><entry>specify a config command to be run after initialization files are read</entry></row>
8182 <row><entry>-f</entry><entry>specify a mailbox to load</entry></row>
8183 <row><entry>-F</entry><entry>specify an alternate file to read initialization commands</entry></row>
8184 <row><entry>-h</entry><entry>print help on command line options</entry></row>
8185 <row><entry>-H</entry><entry>specify a draft file from which to read a header and body</entry></row>
8186 <row><entry>-i</entry><entry>specify a file to include in a message composition</entry></row>
8187 <row><entry>-m</entry><entry>specify a default mailbox type</entry></row>
8188 <row><entry>-n</entry><entry>do not read the system Muttrc</entry></row>
8189 <row><entry>-p</entry><entry>recall a postponed message</entry></row>
8190 <row><entry>-Q</entry><entry>query a configuration variable</entry></row>
8191 <row><entry>-R</entry><entry>open mailbox in read-only mode</entry></row>
8192 <row><entry>-s</entry><entry>specify a subject (enclose in quotes if it contains spaces)</entry></row>
8193 <row><entry>-v</entry><entry>show version number and compile-time definitions</entry></row>
8194 <row><entry>-x</entry><entry>simulate the mailx(1) compose mode</entry></row>
8195 <row><entry>-y</entry><entry>show a menu containing the files specified by the <command>mailboxes</command> command</entry></row>
8196 <row><entry>-z</entry><entry>exit immediately if there are no messages in the mailbox</entry></row>
8197 <row><entry>-Z</entry><entry>open the first folder with new message, exit immediately if none</entry></row>
8203 To read messages in a mailbox
8207 <command>mutt</command>
8208 <arg choice="opt"><option>-nz</option></arg>
8209 <arg choice="opt"><option>-F</option>
8210 <replaceable>muttrc</replaceable>
8212 <arg choice="opt"><option>-m</option>
8213 <replaceable>type</replaceable>
8215 <arg choice="opt"><option>-f</option>
8216 <replaceable>mailbox</replaceable>
8221 To compose a new message
8225 <command>mutt</command>
8226 <arg choice="opt"><option>-n</option></arg>
8227 <arg choice="opt"><option>-F</option>
8228 <replaceable>muttrc</replaceable>
8230 <arg choice="opt"><option>-c</option>
8231 <replaceable>address</replaceable>
8233 <arg choice="opt"><option>-i</option>
8234 <replaceable>filename</replaceable>
8236 <arg choice="opt"><option>-s</option>
8237 <replaceable>subject</replaceable>
8241 <replaceable>file</replaceable>
8242 <arg choice="opt" rep="repeat"/>
8245 <group choice="plain" rep="repeat">
8246 <arg choice="plain">
8247 <replaceable>address</replaceable>
8249 <arg choice="plain">
8250 <replaceable>mailto_url</replaceable>
8256 Mutt also supports a <quote>batch</quote> mode to send prepared
8257 messages. Simply redirect input from the file you wish to send. For
8262 mutt -s "data set for run #2" professor@bigschool.edu < ~/run2.dat</screen>
8265 will send a message to
8266 <literal><professor@bigschool.edu></literal> with a subject of
8267 <quote>data set for run #2</quote>. In the body of the message will be
8268 the contents of the file <quote>~/run2.dat</quote>.
8272 All files passed with <literal>-a</literal> <emphasis>file</emphasis>
8273 will be attached as a MIME part to the message. To attach a single or
8274 several files, use <quote>--</quote> to separate files and recipient
8279 mutt -a image.png -- some@one.org</screen>
8286 mutt -a *.png -- some@one.org</screen>
8290 The <literal>-a</literal> option must be last in the option list.
8295 In addition to accepting a list of email addresses, Mutt also accepts a URL with
8296 the <literal>mailto:</literal> schema as specified in RFC2368. This is useful
8297 when configuring a web browser to launch Mutt when clicking on mailto links.
8301 mutt mailto:some@one.org?subject=test&cc=other@one.org</screen>
8305 <sect1 id="commands">
8306 <title>Configuration Commands</title>
8309 The following are the commands understood by Mutt:
8316 <command><link linkend="account-hook">account-hook</link></command>
8317 <arg choice="plain">
8318 <replaceable>pattern</replaceable>
8319 <replaceable>command</replaceable>
8326 <command><link linkend="alias">alias</link></command>
8327 <arg choice="opt" rep="repeat">
8328 <option>-group</option>
8329 <replaceable class="parameter">name</replaceable>
8331 <arg choice="plain">
8332 <replaceable class="parameter">key</replaceable>
8334 <arg choice="plain">
8335 <replaceable class="parameter">address</replaceable>
8337 <arg choice="opt" rep="repeat">
8338 <replaceable class="parameter">address</replaceable>
8341 <command><link linkend="alias">unalias</link></command>
8342 <arg choice="opt" rep="repeat">
8343 <option>-group</option>
8344 <replaceable>name</replaceable>
8346 <group choice="req">
8347 <arg choice="plain">
8348 <replaceable class="parameter">*</replaceable>
8350 <arg choice="plain" rep="repeat">
8351 <replaceable class="parameter">key</replaceable>
8359 <command><link linkend="alternates">alternates</link></command>
8360 <arg choice="opt" rep="repeat">
8361 <option>-group</option>
8362 <replaceable>name</replaceable>
8364 <arg choice="plain">
8365 <replaceable>regexp</replaceable>
8367 <arg choice="opt" rep="repeat">
8368 <replaceable>regexp</replaceable>
8371 <command><link linkend="alternates">unalternates</link></command>
8372 <arg choice="opt" rep="repeat">
8373 <option>-group</option>
8374 <replaceable>name</replaceable>
8376 <group choice="req">
8377 <arg choice="plain">
8378 <replaceable>*</replaceable>
8380 <arg choice="plain" rep="repeat">
8381 <replaceable>regexp</replaceable>
8389 <command><link linkend="alternative-order">alternative-order</link></command>
8390 <arg choice="plain">
8391 <replaceable>mimetype</replaceable>
8393 <arg choice="opt" rep="repeat">
8394 <replaceable>mimetype</replaceable>
8397 <command><link linkend="alternative-order">unalternative-order</link></command>
8398 <group choice="req">
8399 <arg choice="plain">
8400 <replaceable>*</replaceable>
8402 <arg choice="plain" rep="repeat">
8403 <replaceable>mimetype</replaceable>
8411 <command><link linkend="attachments">attachments</link></command>
8412 <arg choice="plain">
8413 <replaceable>{ + | - }disposition</replaceable>
8415 <arg choice="plain">
8416 <replaceable>mime-type</replaceable>
8419 <command><link linkend="attachments">unattachments</link></command>
8420 <arg choice="plain">
8421 <replaceable>{ + | - }disposition</replaceable>
8423 <arg choice="plain">
8424 <replaceable>mime-type</replaceable>
8431 <command><link linkend="auto-view">auto_view</link></command>
8432 <arg choice="plain">
8433 <replaceable>mimetype</replaceable>
8435 <arg choice="opt" rep="repeat">
8436 <replaceable>mimetype</replaceable>
8439 <command><link linkend="auto-view">unauto_view</link></command>
8440 <group choice="req">
8441 <arg choice="plain">
8442 <replaceable>*</replaceable>
8444 <arg choice="plain" rep="repeat">
8445 <replaceable>mimetype</replaceable>
8453 <command><link linkend="bind">bind</link></command>
8454 <arg choice="plain">
8455 <replaceable class="parameter">map</replaceable>
8457 <arg choice="plain">
8458 <replaceable class="parameter">key</replaceable>
8460 <arg choice="plain">
8461 <replaceable class="parameter">function</replaceable>
8468 <command><link linkend="charset-hook">charset-hook</link></command>
8469 <arg choice="plain">
8470 <replaceable class="parameter">alias</replaceable>
8472 <arg choice="plain">
8473 <replaceable class="parameter">charset</replaceable>
8480 <command><link linkend="iconv-hook">iconv-hook</link></command>
8481 <arg choice="plain">
8482 <replaceable class="parameter">charset</replaceable>
8484 <arg choice="plain">
8485 <replaceable class="parameter">local-charset</replaceable>
8492 <command><link linkend="color">color</link></command>
8493 <arg choice="plain">
8494 <replaceable class="parameter">object</replaceable>
8496 <arg choice="plain">
8497 <replaceable class="parameter">foreground</replaceable>
8499 <arg choice="plain">
8500 <replaceable class="parameter">background</replaceable>
8503 <command><link linkend="color">color</link></command>
8504 <group choice="req">
8505 <arg choice="plain">
8506 <option>header</option>
8508 <arg choice="plain">
8509 <option>body</option>
8512 <arg choice="plain">
8513 <replaceable class="parameter">foreground</replaceable>
8515 <arg choice="plain">
8516 <replaceable class="parameter">background</replaceable>
8518 <arg choice="plain">
8519 <replaceable class="parameter">regexp</replaceable>
8522 <command><link linkend="color">color</link></command>
8523 <arg choice="plain">
8524 <option>index</option>
8526 <arg choice="plain">
8527 <replaceable class="parameter">foreground</replaceable>
8529 <arg choice="plain">
8530 <replaceable class="parameter">background</replaceable>
8532 <arg choice="plain">
8533 <replaceable class="parameter">pattern</replaceable>
8536 <command><link linkend="color">uncolor</link></command>
8537 <group choice="req">
8538 <arg choice="plain">
8539 <option>index</option>
8541 <arg choice="plain">
8542 <option>header</option>
8544 <arg choice="plain">
8545 <option>body</option>
8548 <group choice="req">
8549 <arg choice="plain">
8550 <replaceable>*</replaceable>
8552 <arg choice="plain" rep="repeat">
8553 <replaceable>pattern</replaceable>
8561 <command><link linkend="crypt-hook">crypt-hook</link></command>
8562 <arg choice="plain">
8563 <replaceable class="parameter">pattern</replaceable>
8565 <arg choice="plain">
8566 <replaceable class="parameter">keyid</replaceable>
8573 <command><link linkend="exec">exec</link></command>
8574 <arg choice="plain">
8575 <replaceable class="parameter">function</replaceable>
8577 <arg choice="opt" rep="repeat">
8578 <replaceable class="parameter">function</replaceable>
8585 <command><link linkend="fcc-hook">fcc-hook</link></command>
8586 <arg choice="plain">
8587 <replaceable class="parameter">[!]pattern</replaceable>
8589 <arg choice="plain">
8590 <replaceable class="parameter">mailbox</replaceable>
8597 <command><link linkend="fcc-save-hook">fcc-save-hook</link></command>
8598 <arg choice="plain">
8599 <replaceable class="parameter">[!]pattern</replaceable>
8601 <arg choice="plain">
8602 <replaceable class="parameter">mailbox</replaceable>
8609 <command><link linkend="folder-hook">folder-hook</link></command>
8610 <arg choice="plain">
8611 <replaceable class="parameter">[!]regexp</replaceable>
8613 <arg choice="plain">
8614 <replaceable class="parameter">command</replaceable>
8621 <command><link linkend="addrgroup">group</link></command>
8622 <arg choice="opt" rep="repeat">
8623 <option>-group</option>
8624 <replaceable class="parameter">name</replaceable>
8626 <group choice="req">
8627 <arg choice="plain" rep="repeat">
8628 <option>-rx</option>
8629 <replaceable class="parameter">expr</replaceable>
8631 <arg choice="plain" rep="repeat">
8632 <option>-addr</option>
8633 <replaceable class="parameter">expr</replaceable>
8637 <command><link linkend="addrgroup">ungroup</link></command>
8638 <arg choice="opt" rep="repeat">
8639 <option>-group</option>
8640 <replaceable class="parameter">name</replaceable>
8642 <group choice="req">
8643 <arg choice="plain">
8644 <replaceable class="parameter">*</replaceable>
8646 <arg choice="plain" rep="repeat">
8647 <option>-rx</option>
8648 <replaceable class="parameter">expr</replaceable>
8650 <arg choice="plain" rep="repeat">
8651 <option>-addr</option>
8652 <replaceable class="parameter">expr</replaceable>
8660 <command><link linkend="hdr-order">hdr_order</link></command>
8661 <arg choice="plain">
8662 <replaceable class="parameter">header</replaceable>
8664 <arg choice="opt" rep="repeat">
8665 <replaceable class="parameter">header</replaceable>
8668 <command><link linkend="hdr-order">unhdr_order</link></command>
8669 <group choice="req">
8670 <arg choice="plain">
8671 <replaceable>*</replaceable>
8673 <arg choice="plain" rep="repeat">
8674 <replaceable>header</replaceable>
8682 <command><link linkend="ignore">ignore</link></command>
8683 <arg choice="plain">
8684 <replaceable class="parameter">pattern</replaceable>
8686 <arg choice="opt" rep="repeat">
8687 <replaceable class="parameter">pattern</replaceable>
8690 <command><link linkend="ignore">unignore</link></command>
8691 <group choice="req">
8692 <arg choice="plain">
8693 <replaceable>*</replaceable>
8695 <arg choice="plain" rep="repeat">
8696 <replaceable>pattern</replaceable>
8704 <command><link linkend="lists">lists</link></command>
8706 <option>-group</option>
8707 <replaceable class="parameter">name</replaceable>
8709 <arg choice="plain">
8710 <replaceable class="parameter">regexp</replaceable>
8712 <arg choice="opt" rep="repeat">
8713 <replaceable class="parameter">regexp</replaceable>
8716 <command><link linkend="lists">unlists</link></command>
8717 <arg choice="opt" rep="repeat">
8718 <option>-group</option>
8719 <replaceable>name</replaceable>
8721 <group choice="req">
8722 <arg choice="plain">
8723 <replaceable>*</replaceable>
8725 <arg choice="plain" rep="repeat">
8726 <replaceable>regexp</replaceable>
8734 <command><link linkend="macro">macro</link></command>
8735 <arg choice="plain">
8736 <replaceable class="parameter">menu</replaceable>
8738 <arg choice="plain">
8739 <replaceable class="parameter">key</replaceable>
8741 <arg choice="plain">
8742 <replaceable class="parameter">sequence</replaceable>
8745 <replaceable class="parameter">description</replaceable>
8752 <command><link linkend="mailboxes">mailboxes</link></command>
8753 <arg choice="plain">
8754 <replaceable class="parameter">mailbox</replaceable>
8756 <arg choice="opt" rep="repeat">
8757 <replaceable class="parameter">mailbox</replaceable>
8760 <command><link linkend="mailboxes">unmailboxes</link></command>
8761 <group choice="req">
8762 <arg choice="plain">
8763 <replaceable class="parameter">*</replaceable>
8765 <arg choice="plain" rep="repeat">
8766 <replaceable class="parameter">mailbox</replaceable>
8774 <command><link linkend="mbox-hook">mbox-hook</link></command>
8775 <arg choice="plain">
8776 <replaceable class="parameter">[!]pattern</replaceable>
8778 <arg choice="plain">
8779 <replaceable class="parameter">mailbox</replaceable>
8786 <command><link linkend="message-hook">message-hook</link></command>
8787 <arg choice="plain">
8788 <replaceable class="parameter">[!]pattern</replaceable>
8790 <arg choice="plain">
8791 <replaceable class="parameter">command</replaceable>
8798 <command><link linkend="mime-lookup">mime-lookup</link></command>
8799 <arg choice="plain">
8800 <replaceable>mimetype</replaceable>
8802 <arg choice="opt" rep="repeat">
8803 <replaceable>mimetype</replaceable>
8806 <command><link linkend="mime-lookup">unmime-lookup</link></command>
8807 <group choice="req">
8808 <arg choice="plain">
8809 <replaceable>*</replaceable>
8811 <arg choice="plain" rep="repeat">
8812 <replaceable>mimetype</replaceable>
8820 <command><link linkend="mono">mono</link></command>
8821 <arg choice="plain">
8822 <replaceable class="parameter">object</replaceable>
8824 <arg choice="plain">
8825 <replaceable class="parameter">attribute</replaceable>
8828 <command><link linkend="mono">mono</link></command>
8829 <group choice="req">
8830 <arg choice="plain">
8831 <option>header</option>
8833 <arg choice="plain">
8834 <option>body</option>
8837 <arg choice="plain">
8838 <replaceable class="parameter">attribute</replaceable>
8840 <arg choice="plain">
8841 <replaceable class="parameter">regexp</replaceable>
8844 <command><link linkend="mono">mono</link></command>
8845 <arg choice="plain">
8846 <option>index</option>
8848 <arg choice="plain">
8849 <replaceable class="parameter">attribute</replaceable>
8851 <arg choice="plain">
8852 <replaceable class="parameter">pattern</replaceable>
8855 <command><link linkend="mono">unmono</link></command>
8856 <group choice="req">
8857 <arg choice="plain">
8858 <option>index</option>
8860 <arg choice="plain">
8861 <option>header</option>
8863 <arg choice="plain">
8864 <option>body</option>
8867 <group choice="req">
8868 <arg choice="plain">
8869 <replaceable class="parameter">*</replaceable>
8871 <arg choice="plain" rep="repeat">
8872 <replaceable class="parameter">pattern</replaceable>
8880 <command><link linkend="my-hdr">my_hdr</link></command>
8881 <arg choice="plain">
8882 <replaceable class="parameter">string</replaceable>
8885 <command><link linkend="my-hdr">unmy_hdr</link></command>
8886 <group choice="req">
8887 <arg choice="plain">
8888 <replaceable class="parameter">*</replaceable>
8890 <arg choice="plain" rep="repeat">
8891 <replaceable class="parameter">field</replaceable>
8899 <command><link linkend="push">push</link></command>
8900 <arg choice="plain">
8901 <replaceable class="parameter">string</replaceable>
8908 <command><link linkend="save-hook">save-hook</link></command>
8909 <arg choice="plain">
8910 <replaceable class="parameter">[!]pattern</replaceable>
8912 <arg choice="plain">
8913 <replaceable class="parameter">mailbox</replaceable>
8920 <command><link linkend="score">score</link></command>
8921 <arg choice="plain">
8922 <replaceable class="parameter">pattern</replaceable>
8924 <arg choice="plain">
8925 <replaceable class="parameter">value</replaceable>
8928 <command><link linkend="score">unscore</link></command>
8929 <group choice="req">
8930 <arg choice="plain">
8931 <replaceable class="parameter">*</replaceable>
8933 <arg choice="plain" rep="repeat">
8934 <replaceable class="parameter">pattern</replaceable>
8942 <command><link linkend="reply-hook">reply-hook</link></command>
8943 <arg choice="plain">
8944 <replaceable class="parameter">[!]pattern</replaceable>
8946 <arg choice="plain">
8947 <replaceable class="parameter">command</replaceable>
8954 <command><link linkend="send-hook">send-hook</link></command>
8955 <arg choice="plain">
8956 <replaceable class="parameter">[!]pattern</replaceable>
8958 <arg choice="plain">
8959 <replaceable class="parameter">command</replaceable>
8966 <command><link linkend="send2-hook">send2-hook</link></command>
8967 <arg choice="plain">
8968 <replaceable class="parameter">[!]pattern</replaceable>
8970 <arg choice="plain">
8971 <replaceable class="parameter">command</replaceable>
8978 <command><link linkend="set">set</link></command>
8979 <group choice="req">
8980 <arg choice="plain">
8981 <group choice="opt">
8982 <arg choice="plain"><option>no</option></arg>
8983 <arg choice="plain"><option>inv</option></arg>
8985 <replaceable class="parameter">variable</replaceable>
8987 <arg choice="plain">
8988 <replaceable class="parameter">variable=value</replaceable>
8991 <arg choice="opt" rep="repeat"></arg>
8993 <command><link linkend="set">toggle</link></command>
8994 <arg choice="plain">
8995 <replaceable class="parameter">variable</replaceable>
8997 <arg choice="opt" rep="repeat">
8998 <replaceable class="parameter">variable</replaceable>
9001 <command><link linkend="set">unset</link></command>
9002 <arg choice="plain">
9003 <replaceable class="parameter">variable</replaceable>
9005 <arg choice="opt" rep="repeat">
9006 <replaceable class="parameter">variable</replaceable>
9009 <command><link linkend="set">reset</link></command>
9010 <arg choice="plain">
9011 <replaceable class="parameter">variable</replaceable>
9013 <arg choice="opt" rep="repeat">
9014 <replaceable class="parameter">variable</replaceable>
9021 <command><link linkend="source">source</link></command>
9022 <arg choice="plain">
9023 <replaceable class="parameter">filename</replaceable>
9030 <command><link linkend="spam">spam</link></command>
9031 <arg choice="plain">
9032 <replaceable class="parameter">pattern</replaceable>
9034 <arg choice="plain">
9035 <replaceable class="parameter">format</replaceable>
9038 <command><link linkend="spam">nospam</link></command>
9039 <group choice="req">
9040 <arg choice="plain">
9041 <replaceable class="parameter">*</replaceable>
9043 <arg choice="plain">
9044 <replaceable class="parameter">pattern</replaceable>
9052 <command><link linkend="subscribe">subscribe</link></command>
9053 <arg choice="opt" rep="repeat">
9054 <option>-group</option>
9055 <replaceable class="parameter">name</replaceable>
9057 <arg choice="plain">
9058 <replaceable class="parameter">regexp</replaceable>
9060 <arg choice="opt" rep="repeat">
9061 <replaceable class="parameter">regexp</replaceable>
9064 <command><link linkend="subscribe">unsubscribe</link></command>
9065 <arg choice="opt" rep="repeat">
9066 <option>-group</option>
9067 <replaceable>name</replaceable>
9069 <group choice="req">
9070 <arg choice="plain">
9071 <replaceable class="parameter">*</replaceable>
9073 <arg choice="plain" rep="repeat">
9074 <replaceable class="parameter">regexp</replaceable>
9082 <command><link linkend="unhook">unhook</link></command>
9083 <group choice="req">
9084 <arg choice="plain">
9085 <replaceable class="parameter">*</replaceable>
9087 <arg choice="plain">
9088 <replaceable class="parameter">hook-type</replaceable>
9098 <sect1 id="variables">
9099 <title>Configuration Variables</title>