1 The Mutt Next Generation E-Mail Client
15 Michael Elinks on mutt, circa 1995: ``All mail clients suck. This one just
18 Sven Guckes on mutt, ca. 2003: ``But it still sucks!''
20 --------------------------------------------------------------------------
32 4. Software Distribution Sites
44 1.1. Screens and Menus
76 3. Moving Around in Menus
78 4. Editing Input Fields
80 5. Reading Mail - The Index and Pager
82 5.1. The Message Index
88 5.4. Miscellaneous Functions
92 6.1. Composing new messages
96 6.3. Editing the message header
98 6.4. Using Mutt-ng with PGP
100 6.5. Sending anonymous messages via mixmaster
102 7. Forwarding and Bouncing Mail
108 1. Locations of Configuration Files
110 2. Basic Syntax of Initialization Files
112 3. Expansion within variables
114 3.1. Commands' Output
116 3.2. Environment Variables
118 3.3. Configuration Variables
120 3.4. Self-Defined Variables
122 3.5. Pre-Defined Variables
124 3.6. Type Conversions
126 4. Defining/Using aliases
128 5. Changing the default key bindings
130 6. Defining aliases for character sets
132 7. Setting variables based upon mailbox
136 9. Using color and mono video attributes
138 10. Ignoring (weeding) unwanted message headers
140 11. Alternative addresses
146 12.2. Receiving: Display Setup
150 12.4. Additional Notes
154 14. Using Multiple spool mailboxes
156 15. Defining mailboxes which receive mail
158 16. User defined headers
160 17. Defining the order of headers when viewing messages
162 18. Specify default save filename
164 19. Specify default Fcc: mailbox when composing
166 20. Specify default save filename and default Fcc: mailbox at
169 21. Change settings based upon message recipients
171 22. Change settings before formatting a message
173 23. Choosing the cryptographic key of the recipient
175 24. Adding key sequences to the keyboard buffer
177 25. Executing functions
183 28. Setting variables
185 29. Reading initialization commands from another file
195 31.3. Conditional parts
197 32. Obsolete Variables
201 1. Regular Expressions
205 2.1. Complex Patterns
207 2.2. Patterns and Dates
213 3.2. Conditional Expansion
215 3.3. Modifications and Padding
221 5.1. Message Matching in Hooks
225 7. External Address Queries
231 10. Handling Mailing Lists
235 11.1. Linking threads
237 11.2. Breaking threads
239 12. Delivery Status Notification (DSN) Support
241 13. POP3 Support (OPTIONAL)
243 14. IMAP Support (OPTIONAL)
245 14.1. The Folder Browser
249 15. NNTP Support (OPTIONAL)
253 16. SMTP Support (OPTIONAL)
255 17. Managing multiple IMAP/POP/NNTP accounts (OPTIONAL)
257 18. Start a WWW Browser on URLs (EXTERNAL)
259 19. Compressed folders Support (OPTIONAL)
261 19.1. Open a compressed mailbox for reading
263 19.2. Write a compressed mailbox
265 19.3. Append a message to a compressed mailbox
267 19.4. Encrypted folders
269 5. Mutt-ng's MIME Support
271 1. Using MIME in Mutt
273 1.1. Viewing MIME messages in the pager
275 1.2. The Attachment Menu
277 1.3. The Compose Menu
279 2. MIME Type configuration with mime.types
281 3. MIME Viewer configuration with mailcap
283 3.1. The Basics of the mailcap file
285 3.2. Secure use of mailcap
287 3.3. Advanced mailcap Usage
289 3.4. Example mailcap files
293 5. MIME Multipart/Alternative
297 6. Security Considerations
305 3.1. Message-ID: headers
307 3.2. mailto:-style links
309 4. External applications
317 1. Command line options
321 3. Configuration Commands
323 4. Configuration variables
355 2.1. Default Menu Movement Keys
357 2.2. Built-In Editor Functions
359 2.3. Default Index Menu Bindings
361 2.4. Default Pager Menu Bindings
363 2.5. ANSI Escape Sequences
367 2.7. Default Thread Function Bindings
369 2.8. Default Mail Composition Bindings
371 2.9. Default Compose Menu Bindings
373 2.10. PGP Key Menu Flags
375 3.1. Alternative Key Names
377 4.1. Default Sidebar Function Bindings
379 7.1. Mutt-NG Command Line Options
383 7.3. Obsolete Variables
385 Chapter 1. Introduction
395 4. Software Distribution Sites
405 Mutt-ng is a small but very powerful text-based MIME mail client. Mutt-ng
406 is highly configurable, and is well suited to the mail power user with
407 advanced features like key bindings, keyboard macros, mail threading,
408 regular expression searches and a powerful pattern matching language for
409 selecting groups of messages.
411 This documentation additionally contains documentation to Mutt-NG ,a fork
412 from Mutt with the goal to fix all the little annoyances of Mutt, to
413 integrate all the Mutt patches that are floating around in the web, and to
414 add other new features. Features specific to Mutt-ng will be discussed in
415 an extra section. Don't be confused when most of the documentation talk
416 about Mutt and not Mutt-ng, Mutt-ng contains all Mutt features, plus many
421 http://www.muttng.org
425 o <mutt-ng-users@lists.berlios.de>: This is where the mutt-ng user
428 o <mutt-ng-devel@lists.berlios.de>: The development mailing list for
431 4. Software Distribution Sites
433 So far, there are no official releases of Mutt-ng, but you can download
434 daily snapshots from http://mutt-ng.berlios.de/snapshots/
438 Visit channel #muttng on irc.freenode.net (www.freenode.net) to chat with
439 other people interested in Mutt-ng.
443 If you want to read fresh news about the latest development in Mutt-ng,
444 and get informed about stuff like interesting, Mutt-ng-related articles
445 and packages for your favorite distribution, you can read and/or subscribe
446 to our Mutt-ng development weblog.
450 Mutt is Copyright (C) 1996-2000 Michael R. Elkins <me@cs.hmc.edu> and
453 This program is free software; you can redistribute it and/or modify it
454 under the terms of the GNU General Public License as published by the Free
455 Software Foundation; either version 2 of the License, or (at your option)
458 This program is distributed in the hope that it will be useful, but
459 WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
460 or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
463 You should have received a copy of the GNU General Public License along
464 with this program; if not, write to the Free Software Foundation, Inc., 59
465 Temple Place - Suite 330, Boston, MA 02111, USA.
467 Chapter 2. Getting Started
473 1.1. Screens and Menus
505 3. Moving Around in Menus
507 4. Editing Input Fields
509 5. Reading Mail - The Index and Pager
511 5.1. The Message Index
517 5.4. Miscellaneous Functions
521 6.1. Composing new messages
525 6.3. Editing the message header
527 6.4. Using Mutt-ng with PGP
529 6.5. Sending anonymous messages via mixmaster
531 7. Forwarding and Bouncing Mail
537 1.1. Screens and Menus
539 mutt-ng offers different screens of which every has its special purpose:
541 o The index displays the contents of the currently opened mailbox.
543 o The pager is responsible for displaying messages, that is, the header,
544 the body and all attached parts.
546 o The file browser offers operations on and displays information of all
547 folders mutt-ng should watch for mail.
549 o The sidebar offers a permanent view of which mailboxes contain how
550 many total, new and/or flagged mails.
552 o The help screen lists for all currently available commands how to
553 invoke them as well as a short description.
555 o The compose menu is a comfortable interface take last actions before
556 sending mail: change subjects, attach files, remove attachements, etc.
558 o The attachement menu gives a summary and the tree structure of the
559 attachements of the current message.
561 o The alias menu lists all or a fraction of the aliases a user has
564 o The key menu used in connection with encryption lets users choose the
565 right key to encrypt with.
567 When mutt-ng is started without any further options, it'll open the users
568 default mailbox and display the index.
572 Mutt-ng does not feature an internal configuration interface or menu due
573 to the simple fact that this would be too complex to handle (currently
574 there are several hundred variables which fine-tune the behaviour.)
576 Mutt-ng is configured using configuration files which allow users to add
577 comments or manage them via version control systems to ease maintenance.
579 Also, mutt-ng comes with a shell script named grml-muttng kindly
580 contributed by users which really helps and eases the creation of a user's
581 configuration file. When downloading the source code via a snapshot or via
582 subversion, it can be found in the contrib directory.
586 Mutt-ng offers great flexibility due to the use of functions: internally,
587 every action a user can make mutt-ng perform is named ``function.'' Those
588 functions are assigned to keys (or even key sequences) and may be
589 completely adjusted to user's needs. The basic idea is that the impatient
590 users get a very intuitive interface to start off with and advanced users
591 virtually get no limits to adjustments.
595 Mutt-ng has two basic concepts of user interaction:
597 1. There is one dedicated line on the screen used to query the user for
598 input, issue any command, query variables and display error and
599 informational messages. As for every type of user input, this requires
600 manual action leading to the need of input.
602 2. The automatized interface for interaction are the so called hooks.
603 Hooks specify actions the user wants to be performed at well-defined
604 situations: what to do when entering which folder, what to do when
605 displaying or replying to what kind of message, etc. These are
606 optional, i.e. a user doesn't need to specify them but can do so.
610 Although mutt-ng has many functionality built-in, many features can be
611 delegated to external tools to increase flexibility: users can define
612 programs to filter a message through before displaying, users can use any
613 program they want for displaying a message, message types (such as PDF or
614 PostScript) for which mutt-ng doesn't have a built-in filter can be
615 rendered by arbitrary tools and so forth. Although mutt-ng has an alias
616 mechanism built-in, it features using external tools to query for nearly
617 every type of addresses from sources like LDAP, databases or just the list
618 of locally known users.
622 Mutt-ng has a built-in pattern matching ``language'' which is as widely
623 used as possible to present a consistent interface to users. The same
624 ``pattern terms'' can be used for searching, scoring, message selection
631 The index is the screen that you usually see first when you start mutt-ng.
632 It gives an overview over your emails in the currently opened mailbox. By
633 default, this is your system mailbox. The information you see in the index
634 is a list of emails, each with its number on the left, its flags (new
635 email, important email, email that has been forwarded or replied to,
636 tagged email, ...), the date when email was sent, its sender, the email
637 size, and the subject. Additionally, the index also shows thread
638 hierarchies: when you reply to an email, and the other person replies
639 back, you can see the other's person email in a "sub-tree" below. This is
640 especially useful for personal email between a group of people or when
641 you've subscribed to mailing lists.
645 The pager is responsible for showing the email content. On the top of the
646 pager you have an overview over the most important email headers like the
647 sender, the recipient, the subject, and much more information. How much
648 information you actually see depends on your configuration, which we'll
651 Below the headers, you see the email body which usually contains the
652 message. If the email contains any attachments, you will see more
653 information about them below the email body, or, if the attachments are
654 text files, you can view them directly in the pager.
656 To give the user a good overview, it is possible to configure mutt-ng to
657 show different things in the pager with different colors. Virtually
658 everything that can be described with a regular expression can be colored,
659 e.g. URLs, email addresses or smileys.
663 The file browser is the interface to the local or remote file system. When
664 selecting a mailbox to open, the browser allows custom sorting of items,
665 limiting the items shown by a regular expression and a freely adjustable
666 format of what to display in which way. It also allows for easy navigation
667 through the file system when selecting file(s) to attach to a message,
668 select multiple files to attach and many more.
672 The sidebar comes in handy to manage mails which are spread over different
673 folders. All folders users setup mutt-ng to watch for new mail will be
674 listed. The listing includes not only the name but also the number of
675 total messages, the number of new and flagged messages. Items with new
676 mail may be colored different from those with flagged mail, items may be
677 shortened or compress if they're they to long to be printed in full form
678 so that by abbreviated names, user still now what the name stands for.
682 The help screen is meant to offer a quick help to the user. It lists the
683 current configuration of key bindings and their associated commands
684 including a short description, and currently unbound functions that still
685 need to be associated with a key binding (or alternatively, they can be
686 called via the mutt-ng command prompt).
690 The compose menu features a split screen containing the information which
691 really matter before actually sending a message by mail or posting an
692 article to a newsgroup: who gets the message as what (recipient,
693 newsgroup, who gets what kind of copy). Additionally, users may set
694 security options like deciding whether to sign, encrypt or sign and
695 encrypt a message with/for what keys.
697 Also, it's used to attach messages, news articles or files to a message,
698 to re-edit any attachment including the message itself.
702 The alias menu is used to help users finding the recipients of messages.
703 For users who need to contact many people, there's no need to remember
704 addresses or names completely because it allows for searching, too. The
705 alias mechanism and thus the alias menu also features grouping several
706 addresses by a shorter nickname, the actual alias, so that users don't
707 have to select each single recipient manually.
711 As will be later discussed in detail, mutt-ng features a good and stable
712 MIME implementation, that is, is greatly supports sending and receiving
713 messages of arbitrary type. The attachment menu displays a message's
714 structure in detail: what content parts are attached to which parent part
715 (which gives a true tree structure), which type is of what type and what
716 size. Single parts may saved, deleted or modified to offer great and easy
717 access to message's internals.
723 3. Moving Around in Menus
725 Information is presented in menus, very similar to ELM. Here is a
726 tableshowing the common keys used to navigate menus in Mutt-ng.
728 Table 2.1. Default Menu Movement Keys
730 +------------------------------------------------------------------------+
731 | Key | Function | Description |
732 |-------------+----------------+-----------------------------------------|
733 | j or Down | next-entry | move to the next entry |
734 |-------------+----------------+-----------------------------------------|
735 | k or Up | previous-entry | move to the previous entry |
736 |-------------+----------------+-----------------------------------------|
737 | z or PageDn | page-down | go to the next page |
738 |-------------+----------------+-----------------------------------------|
739 | Z or PageUp | page-up | go to the previous page |
740 |-------------+----------------+-----------------------------------------|
741 | = or Home | first-entry | jump to the first entry |
742 |-------------+----------------+-----------------------------------------|
743 | * or End | last-entry | jump to the last entry |
744 |-------------+----------------+-----------------------------------------|
745 | q | quit | exit the current menu |
746 |-------------+----------------+-----------------------------------------|
747 | ? | help | list all key bindings for the current |
749 +------------------------------------------------------------------------+
751 4. Editing Input Fields
753 Mutt-ng has a builtin line editor which is used as the primary way to
754 input textual data such as email addresses or filenames. The keys used to
755 move around while editing are very similar to those of Emacs.
757 Table 2.2. Built-In Editor Functions
759 +------------------------------------------------------------------------+
760 | Key | Function | Description |
761 |----------------+-----------------+-------------------------------------|
762 | ^A or <Home> | bol | move to the start of the line |
763 |----------------+-----------------+-------------------------------------|
764 | ^B or <Left> | backward-char | move back one char |
765 |----------------+-----------------+-------------------------------------|
766 | Esc B | backward-word | move back one word |
767 |----------------+-----------------+-------------------------------------|
768 | ^D or <Delete> | delete-char | delete the char under the cursor |
769 |----------------+-----------------+-------------------------------------|
770 | ^E or <End> | eol | move to the end of the line |
771 |----------------+-----------------+-------------------------------------|
772 | ^F or <Right> | forward-char | move forward one char |
773 |----------------+-----------------+-------------------------------------|
774 | Esc F | forward-word | move forward one word |
775 |----------------+-----------------+-------------------------------------|
776 | <Tab> | complete | complete filename or alias |
777 |----------------+-----------------+-------------------------------------|
778 | ^T | complete-query | complete address with query |
779 |----------------+-----------------+-------------------------------------|
780 | ^K | kill-eol | delete to the end of the line |
781 |----------------+-----------------+-------------------------------------|
782 | ESC d | kill-eow | delete to the end of the word |
783 |----------------+-----------------+-------------------------------------|
784 | ^W | kill-word | kill the word in front of the |
786 |----------------+-----------------+-------------------------------------|
787 | ^U | kill-line | delete entire line |
788 |----------------+-----------------+-------------------------------------|
789 | ^V | quote-char | quote the next typed key |
790 |----------------+-----------------+-------------------------------------|
791 | <Up> | history-up | recall previous string from history |
792 |----------------+-----------------+-------------------------------------|
793 | <Down> | history-down | recall next string from history |
794 |----------------+-----------------+-------------------------------------|
795 | <BackSpace> | backspace | kill the char in front of the |
797 |----------------+-----------------+-------------------------------------|
798 | Esc u | upcase-word | convert word to upper case |
799 |----------------+-----------------+-------------------------------------|
800 | Esc l | downcase-word | convert word to lower case |
801 |----------------+-----------------+-------------------------------------|
802 | Esc c | capitalize-word | capitalize the word |
803 |----------------+-----------------+-------------------------------------|
805 |----------------+-----------------+-------------------------------------|
806 | <Return> | n/a | finish editing |
807 +------------------------------------------------------------------------+
809 You can remap the editor functions using the bind command. For example, to
810 make the Delete key delete the character in front of the cursor rather
811 than under, you could use
813 bind editor <delete> backspace
815 5. Reading Mail - The Index and Pager
817 Similar to many other mail clients, there are two modes in which mail
818 isread in Mutt-ng. The first is the index of messages in the mailbox,
819 which is called the ``index'' in Mutt-ng. The second mode is the display
820 of the message contents. This is called the ``pager.''
822 The next few sections describe the functions provided in each of these
825 5.1. The Message Index
827 Table 2.3. Default Index Menu Bindings
829 +-------------------------------------------------------------------+
830 | Key | Function | Description |
831 |----------+----------+---------------------------------------------|
832 | c | | change to a different mailbox |
833 |----------+----------+---------------------------------------------|
834 | ESC c | | change to a folder in read-only mode |
835 |----------+----------+---------------------------------------------|
836 | C | | copy the current message to another mailbox |
837 |----------+----------+---------------------------------------------|
838 | ESC C | | decode a message and copy it to a folder |
839 |----------+----------+---------------------------------------------|
840 | ESC s | | decode a message and save it to a folder |
841 |----------+----------+---------------------------------------------|
842 | D | | delete messages matching a pattern |
843 |----------+----------+---------------------------------------------|
844 | d | | delete the current message |
845 |----------+----------+---------------------------------------------|
846 | F | | mark as important |
847 |----------+----------+---------------------------------------------|
848 | l | | show messages matching a pattern |
849 |----------+----------+---------------------------------------------|
850 | N | | mark message as new |
851 |----------+----------+---------------------------------------------|
852 | o | | change the current sort method |
853 |----------+----------+---------------------------------------------|
854 | O | | reverse sort the mailbox |
855 |----------+----------+---------------------------------------------|
856 | q | | save changes and exit |
857 |----------+----------+---------------------------------------------|
858 | s | | save-message |
859 |----------+----------+---------------------------------------------|
860 | T | | tag messages matching a pattern |
861 |----------+----------+---------------------------------------------|
862 | t | | toggle the tag on a message |
863 |----------+----------+---------------------------------------------|
864 | ESC t | | toggle tag on entire message thread |
865 |----------+----------+---------------------------------------------|
866 | U | | undelete messages matching a pattern |
867 |----------+----------+---------------------------------------------|
868 | u | | undelete-message |
869 |----------+----------+---------------------------------------------|
870 | v | | view-attachments |
871 |----------+----------+---------------------------------------------|
872 | x | | abort changes and exit |
873 |----------+----------+---------------------------------------------|
874 | <Return> | | display-message |
875 |----------+----------+---------------------------------------------|
876 | <Tab> | | jump to the next new or unread message |
877 |----------+----------+---------------------------------------------|
878 | @ | | show the author's full e-mail address |
879 |----------+----------+---------------------------------------------|
880 | $ | | save changes to mailbox |
881 |----------+----------+---------------------------------------------|
883 |----------+----------+---------------------------------------------|
884 | ESC / | | search-reverse |
885 |----------+----------+---------------------------------------------|
886 | ^L | | clear and redraw the screen |
887 |----------+----------+---------------------------------------------|
888 | ^T | | untag messages matching a pattern |
889 +-------------------------------------------------------------------+
893 In addition to who sent the message and the subject, a short summary of
894 the disposition of each message is printed beside the message number. Zero
895 or more of the following ``flags'' may appear, which mean:
899 message is deleted (is marked for deletion)
903 message have attachments marked for deletion
907 contains a PGP public key
919 message is PGP encrypted
923 message has been replied to
927 message is signed, and the signature is succesfully verified
941 Some of the status flags can be turned on or off using
943 o set-flag (default: w)
945 o clear-flag (default: W)
947 Furthermore, the following flags reflect who the message is addressed to.
948 They can be customized with the $to_chars variable.
952 message is to you and you only
956 message is to you, but also to or cc'ed to others
960 message is cc'ed to you
968 message is sent to a subscribed mailing list
972 By default, Mutt-ng uses its builtin pager to display the body of
973 messages. The pager is very similar to the Unix program less though not
974 nearly as featureful.
976 Table 2.4. Default Pager Menu Bindings
978 +------------------------------------------------------------------------+
979 | Key | Function | Description |
980 |----------+----------+--------------------------------------------------|
981 | <Return> | | go down one line |
982 |----------+----------+--------------------------------------------------|
983 | <Space> | | display the next page (or next message if at the |
984 | | | end of a message) |
985 |----------+----------+--------------------------------------------------|
986 | - | | go back to the previous page |
987 |----------+----------+--------------------------------------------------|
988 | n | | search for next match |
989 |----------+----------+--------------------------------------------------|
990 | S | | skip beyond quoted text |
991 |----------+----------+--------------------------------------------------|
992 | T | | toggle display of quoted text |
993 |----------+----------+--------------------------------------------------|
994 | ? | | show key bindings |
995 |----------+----------+--------------------------------------------------|
996 | / | | search for a regular expression (pattern) |
997 |----------+----------+--------------------------------------------------|
998 | ESC / | | search backwards for a regular expression |
999 |----------+----------+--------------------------------------------------|
1000 | \ | | toggle search pattern coloring |
1001 |----------+----------+--------------------------------------------------|
1002 | ^ | | jump to the top of the message |
1003 +------------------------------------------------------------------------+
1005 In addition, many of the functions from the index are available in the
1006 pager, such as delete-message or copy-message (this is one advantage over
1007 using an external pager to view messages).
1009 Also, the internal pager supports a couple other advanced features. For
1010 one, it will accept and translate the ``standard'' nroff sequences forbold
1011 and underline. These sequences are a series of either the letter,
1012 backspace (^H), the letter again for bold or the letter, backspace, ``_''
1013 for denoting underline. Mutt-ng will attempt to display these in bold and
1014 underline respectively if your terminal supports them. If not, you can use
1015 the bold and underline color objects to specify a color or mono attribute
1018 Additionally, the internal pager supports the ANSI escape sequences for
1019 character attributes. Mutt-ng translates them into the correct color and
1020 character settings. The sequences Mutt-ng supports are: ESC [
1021 Ps;Ps;Ps;...;Ps m (see table below for possible values for Ps).
1023 Table 2.5. ANSI Escape Sequences
1025 +-------------------------------------------------+
1026 | Value | Attribute |
1027 |-------+-----------------------------------------|
1028 | 0 | All Attributes Off |
1029 |-------+-----------------------------------------|
1031 |-------+-----------------------------------------|
1032 | 4 | Underline on |
1033 |-------+-----------------------------------------|
1035 |-------+-----------------------------------------|
1036 | 7 | Reverse video on |
1037 |-------+-----------------------------------------|
1038 | 3x | Foreground color is x (see table below) |
1039 |-------+-----------------------------------------|
1040 | 4x | Background color is x (see table below) |
1041 +-------------------------------------------------+
1043 Table 2.6. ANSI Colors
1045 +------------------+
1047 |--------+---------|
1049 |--------+---------|
1051 |--------+---------|
1053 |--------+---------|
1055 |--------+---------|
1057 |--------+---------|
1059 |--------+---------|
1061 |--------+---------|
1063 +------------------+
1065 Mutt-ng uses these attributes for handling text/enriched messages, and
1066 they can also be used by an external autoview script for highlighting
1067 purposes. Note: If you change the colors for your display, for example by
1068 changing the color associated with color2 for your xterm, then that color
1069 will be used instead of green.
1073 When the mailbox is sorted by threads ,there are a few additional
1074 functions available in the index and pager modes.
1076 Table 2.7. Default Thread Function Bindings
1078 +------------------------------------------------------------------------+
1079 | Key | Function | Description |
1080 |-------+--------------------+-------------------------------------------|
1081 | ^D | delete-thread | delete all messages in the current thread |
1082 |-------+--------------------+-------------------------------------------|
1083 | ^U | undelete-thread | undelete all messages in the current |
1085 |-------+--------------------+-------------------------------------------|
1086 | ^N | next-thread | jump to the start of the next thread |
1087 |-------+--------------------+-------------------------------------------|
1088 | ^P | previous-thread | jump to the start of the previous thread |
1089 |-------+--------------------+-------------------------------------------|
1090 | ^R | read-thread | mark the current thread as read |
1091 |-------+--------------------+-------------------------------------------|
1092 | ESC d | delete-subthread | delete all messages in the current |
1094 |-------+--------------------+-------------------------------------------|
1095 | ESC u | undelete-subthread | undelete all messages in the current |
1097 |-------+--------------------+-------------------------------------------|
1098 | ESC n | next-subthread | jump to the start of the next subthread |
1099 |-------+--------------------+-------------------------------------------|
1100 | ESC p | previous-subthread | jump to the start of the previous |
1102 |-------+--------------------+-------------------------------------------|
1103 | ESC r | read-subthread | mark the current subthread as read |
1104 |-------+--------------------+-------------------------------------------|
1105 | ESC t | tag-thread | toggle the tag on the current thread |
1106 |-------+--------------------+-------------------------------------------|
1107 | ESC v | collapse-thread | toggle collapse for the current thread |
1108 |-------+--------------------+-------------------------------------------|
1109 | ESC V | collapse-all | toggle collapse for all threads |
1110 |-------+--------------------+-------------------------------------------|
1111 | P | parent-message | jump to parent message in thread |
1112 +------------------------------------------------------------------------+
1114 Note: Collapsing a thread displays only the first message in the thread
1115 and hides the others. This is useful when threads contain so many messages
1116 that you can only see a handful of threads onthe screen. See %M in
1117 index-format . For example, you could use "%?M?(#%03M)&(%4l)?" in
1118 index-format to optionally display the number of hidden messages if the
1119 thread is collapsed.
1121 See also: strict-threads.
1123 5.4. Miscellaneous Functions
1125 create-alias (default: a)
1127 Creates a new alias based upon the current message (or prompts for a new
1128 one). Once editing is complete, an alias command is added to the file
1129 specified by the alias-file variable for future use. Note: Specifying an
1130 alias-file does not add the aliases specified there-in, you must also
1133 check-traditional-pgp (default: ESC P)
1135 This function will search the current message for content signed or
1136 encrypted with PGP the "traditional" way, that is, without proper MIME
1137 tagging. Technically, this function will temporarily change the MIME
1138 content types of the body parts containing PGP data; this is similar to
1139 the edit-type function's effect.
1141 display-toggle-weed (default: h)
1143 Toggles the weeding of message header fields specified by ignore commands.
1147 This command (available in the ``index'' and ``pager'') allows you to edit
1148 the raw current message as it's present in the mail folder. After you have
1149 finished editing, the changed message will be appended to the current
1150 folder, and the original message will be marked for deletion.
1152 edit-type (default: ^E on the attachment menu, and in the pager and index
1153 menus; ^T on the compose menu)
1155 This command is used to temporarily edit an attachment's content type to
1156 fix, for instance, bogus character set parameters. When invoked from the
1157 index or from the pager, you'll have the opportunity to edit the top-level
1158 attachment's content type. On the attach-menu, you can change any
1159 attachment's content type. These changes are not persistent, and get lost
1160 upon changing folders.
1162 Note that this command is also available on the compose-menu .There, it's
1163 used to fine-tune the properties of attachments you are going to send.
1165 enter-command (default: ``:'')
1167 This command is used to execute any command you would normally put in a
1168 configuration file. A common use is to check the settings of variables, or
1169 in conjunction with macro to change settings on the fly.
1171 extract-keys (default: ^K)
1173 This command extracts PGP public keys from the current or tagged
1174 message(s) and adds them to your PGP public key ring.
1176 forget-passphrase (default: ^F)
1178 This command wipes the passphrase(s) from memory. It is useful, if you
1179 misspelled the passphrase.
1181 list-reply (default: L)
1183 Reply to the current or tagged message(s) by extracting any addresses
1184 which match the regular expressions given by the lists commands, but also
1185 honor any Mail-Followup-To header(s) if the honor-followup-to
1186 configuration variable is set. Using this when replying to messages posted
1187 to mailing lists helps avoid duplicate copies being sent to the author of
1188 the message you are replying to.
1190 pipe-message (default: |)
1192 Asks for an external Unix command and pipes the current or tagged
1193 message(s) to it. The variables pipe-decode ,pipe-split, pipe-sep and
1194 wait-key control the exact behavior of this function.
1196 resend-message (default: ESC e)
1198 With resend-message, mutt takes the current message as a template for a
1199 new message. This function is best described as "recall from arbitrary
1200 folders". It can conveniently be used to forward MIME messages while
1201 preserving the original mail structure. Note that the amount of headers
1202 included here depends on the value of the weed variable.
1204 This function is also available from the attachment menu. You can use this
1205 to easily resend a message which was included with a bounce message as a
1206 message/rfc822 body part.
1208 shell-escape (default: !)
1210 Asks for an external Unix command and executes it. The wait-key can be
1211 used to control whether Mutt-ng will wait for a key to be pressed when the
1212 command returns (presumably to let the user read the output of the
1213 command), based on the return status of the named command.
1215 toggle-quoted (default: T)
1217 The pager uses the quote-regexp variable to detect quoted text when
1218 displaying the body of the message. This function toggles the displayof
1219 the quoted material in the message. It is particularly useful when are
1220 interested in just the response and there is a large amount of quoted text
1223 skip-quoted (default: S)
1225 This function will go to the next line of non-quoted text which come after
1226 a line of quoted text in the internal pager.
1230 The following bindings are available in the index for sending messages.
1232 Table 2.8. Default Mail Composition Bindings
1234 +--------------------------------------------------------+
1235 | Key | Function | Description |
1236 |-------+-------------+----------------------------------|
1237 | m | compose | compose a new message |
1238 |-------+-------------+----------------------------------|
1239 | r | reply | reply to sender |
1240 |-------+-------------+----------------------------------|
1241 | g | group-reply | reply to all recipients |
1242 |-------+-------------+----------------------------------|
1243 | L | list-reply | reply to mailing list address |
1244 |-------+-------------+----------------------------------|
1245 | f | forward | forward message |
1246 |-------+-------------+----------------------------------|
1247 | b | bounce | bounce (remail) message |
1248 |-------+-------------+----------------------------------|
1249 | ESC k | mail-key | mail a PGP public key to someone |
1250 +--------------------------------------------------------+
1252 Bouncing a message sends the message as is to the recipient you specify.
1253 Forwarding a message allows you to add comments or modify the message you
1254 are forwarding. These items are discussed in greater detail in the next
1255 chapter forwarding-mail .
1257 6.1. Composing new messages
1259 When you want to send an email using mutt-ng, simply press m on your
1260 keyboard. Then, mutt-ng asks for the recipient via a prompt in the last
1265 After you've finished entering the recipient(s), press return. If you want
1266 to send an email to more than one recipient, separate the email addresses
1267 using the comma ",". Mutt-ng then asks you for the email subject. Again,
1268 press return after you've entered it. After that, mutt-ng got the most
1269 important information from you, and starts up an editor where you can then
1272 The editor that is called is selected in the following way: you can e.g.
1273 set it in the mutt-ng configuration:
1275 set editor = "vim +/^$/ -c ':set tw=72'"
1277 set editor = "emacs"
1279 If you don't set your preferred editor in your configuration, mutt-ng
1280 first looks whether the environment variable $VISUAL is set, and if so, it
1281 takes its value as editor command. Otherwise, it has a look at $EDITOR and
1282 takes its value if it is set. If no editor command can be found, mutt-ng
1283 simply assumes vi to be the default editor, since it's the most widespread
1284 editor in the Unix world and it's pretty safe to assume that it is
1285 installed and available.
1287 When you've finished entering your message, save it and quit your editor.
1288 Mutt-ng will then present you with a summary screen, the compose menu. On
1289 the top, you see a summary of the most important available key commands.
1290 Below that, you see the sender, the recipient(s), Cc and/or Bcc
1291 recipient(s), the subject, the reply-to address, and optionally
1292 information where the sent email will be stored and whether it should be
1293 digitally signed and/or encrypted.
1295 Below that, you see a list of "attachments". The mail you've just entered
1296 before is also an attachment, but due to its special type (it's plain
1297 text), it will be displayed as the normal message on the receiver's side.
1299 At this point, you can add more attachments, pressing a, you can edit the
1300 recipient addresses, pressing t for the "To:" field, c for the "Cc:"
1301 field, and b for the "Bcc: field. You can also edit the subject the
1302 subject by simply pressing s or the email message that you've entered
1303 before by pressing e. You will then again return to the editor. You can
1304 even edit the sender, by pressing <esc>f, but this shall only be used with
1307 Alternatively, you can configure mutt-ng in a way that most of the above
1308 settings can be edited using the editor. Therefore, you only need to add
1309 the following to your configuration:
1313 Once you have finished editing the body of your mail message, you are
1314 returned to the compose menu. The following options are available:
1316 Table 2.9. Default Compose Menu Bindings
1318 +------------------------------------------------------------------------+
1319 | Key | Function | Description |
1320 |-------+-------------------+--------------------------------------------|
1321 | a | attach-file | attach a file |
1322 |-------+-------------------+--------------------------------------------|
1323 | A | attach-message | attach message(s) to the message |
1324 |-------+-------------------+--------------------------------------------|
1325 | ESC k | attach-key | attach a PGP public key |
1326 |-------+-------------------+--------------------------------------------|
1327 | d | edit-description | edit description on attachment |
1328 |-------+-------------------+--------------------------------------------|
1329 | D | detach-file | detach a file |
1330 |-------+-------------------+--------------------------------------------|
1331 | t | edit-to | edit the To field |
1332 |-------+-------------------+--------------------------------------------|
1333 | ESC f | edit-from | edit the From field |
1334 |-------+-------------------+--------------------------------------------|
1335 | r | edit-reply-to | edit the Reply-To field |
1336 |-------+-------------------+--------------------------------------------|
1337 | c | edit-cc | edit the Cc field |
1338 |-------+-------------------+--------------------------------------------|
1339 | b | edit-bcc | edit the Bcc field |
1340 |-------+-------------------+--------------------------------------------|
1341 | y | send-message | send the message |
1342 |-------+-------------------+--------------------------------------------|
1343 | s | edit-subject | edit the Subject |
1344 |-------+-------------------+--------------------------------------------|
1345 | S | smime-menu | select S/MIME options |
1346 |-------+-------------------+--------------------------------------------|
1347 | f | edit-fcc | specify an ``Fcc'' mailbox |
1348 |-------+-------------------+--------------------------------------------|
1349 | p | pgp-menu | select PGP options |
1350 |-------+-------------------+--------------------------------------------|
1351 | P | postpone-message | postpone this message until later |
1352 |-------+-------------------+--------------------------------------------|
1353 | q | quit | quit (abort) sending the message |
1354 |-------+-------------------+--------------------------------------------|
1355 | w | write-fcc | write the message to a folder |
1356 |-------+-------------------+--------------------------------------------|
1357 | i | ispell | check spelling (if available on your |
1359 |-------+-------------------+--------------------------------------------|
1360 | ^F | forget-passphrase | wipe passphrase(s) from memory |
1361 +------------------------------------------------------------------------+
1363 Note: The attach-message function will prompt you for a folder to attach
1364 messages from. You can now tag messages in that folder and theywill be
1365 attached to the message you are sending. Note that certainoperations like
1366 composing a new mail, replying, forwarding, etc. are not permitted when
1367 you are in that folder. The %r in status-format will change to a 'A' to
1368 indicate that you are in attach-message mode.
1372 6.2.1. Simple Replies
1374 When you want to reply to an email message, select it in the index menu
1375 and then press r. Mutt-ng's behaviour is then similar to the behaviour
1376 when you compose a message: first, you will be asked for the recipient,
1377 then for the subject, and then, mutt-ng will start the editor with the
1378 quote attribution and the quoted message. This can e.g. look like the
1381 On Mon, Mar 07, 2005 at 05:02:12PM +0100, Michael Svensson wrote:
1382 > Bill, can you please send last month's progress report to Mr.
1383 > Morgan? We also urgently need the cost estimation for the new
1384 > production server that we want to set up before our customer's
1385 > project will go live.
1387 You can start editing the email message. It is strongly recommended to put
1388 your answer below the quoted text and to only quote what is really
1389 necessary and that you refer to. Putting your answer on top of the quoted
1390 message, is, although very widespread, very often not considered to be a
1391 polite way to answer emails.
1393 The quote attribution is configurable, by default it is set to
1395 set attribution = "On %d, %n wrote:"
1397 It can also be set to something more compact, e.g.
1399 set attribution = "attribution="* %n <%a> [%(%y-%m-%d %H:%M)]:"
1401 The example above results in the following attribution:
1403 * Michael Svensson <svensson@foobar.com> [05-03-06 17:02]:
1404 > Bill, can you please send last month's progress report to Mr.
1405 > Morgan? We also urgently need the cost estimation for the new
1406 > production server that we want to set up before our customer's
1407 > project will go live.
1409 Generally, try to keep your attribution short yet information-rich. It is
1410 not the right place for witty quotes, long "attribution" novels or
1411 anything like that: the right place for such things is - if at all - the
1412 email signature at the very bottom of the message.
1414 When you're done with writing your message, save and quit the editor. As
1415 before, you will return to the compose menu, which is used in the same way
1418 6.2.2. Group Replies
1420 In the situation where a group of people uses email as a discussion, most
1421 of the emails will have one or more recipients, and probably several "Cc:"
1422 recipients. The group reply functionalityensures that when you press g
1423 instead of r to do a reply, each and every recipient that is contained in
1424 the original message will receive a copy of the message, either as normal
1425 recipient or as "Cc:" recipient.
1429 When you use mailing lists, it's generally better to send your reply to a
1430 message only to the list instead of the list and the original author. To
1431 make this easy to use, mutt-ng features list replies.
1433 To do a list reply, simply press L. If the email contains a
1434 Mail-Followup-To: header, its value will be used as reply address.
1435 Otherwise, mutt-ng searches through all mail addresses in the original
1436 message and tries to match them a list of regular expressions which can be
1437 specified using the lists command. If any of the regular expression
1438 matches, a mailing list address has been found, and it will be used as
1441 lists linuxevent@luga\.at vuln-dev@ mutt-ng-users@
1443 Nowadays, most mailing list software like GNU Mailman adds a
1444 Mail-Followup-To: header to their emails anyway, so setting lists is
1445 hardly ever necessary in practice.
1447 6.3. Editing the message header
1449 When editing the header of your outgoing message, there are a couple of
1450 special features available.
1452 If you specify Fcc: filename Mutt-ng will pick up filename just as if you
1453 had used the edit-fcc function in the compose menu.
1455 You can also attach files to your message by specifying Attach: filename [
1456 description ] where filename is the file to attach and description is an
1457 optional string to use as the description of the attached file.
1459 When replying to messages, if you remove the In-Reply-To: field from the
1460 header field, Mutt-ng will not generate a References: field, which allows
1461 you to create a new message thread.
1463 Also see edit-headers.
1465 6.4. Using Mutt-ng with PGP
1467 If you want to use PGP, you can specify
1469 Pgp: [ E | S | S<id> ]
1471 ``E'' encrypts, ``S'' signs and ``S<id>'' signs with the given key,
1472 setting pgp-sign-as permanently.
1474 If you have told mutt to PGP encrypt a message, it will guide you through
1475 a key selection process when you try to send the message. Mutt-ng will not
1476 ask you any questions about keys which have a certified user ID matching
1477 one of the message recipients' mail addresses. However, there may be
1478 situations in which there are several keys, weakly certified user ID
1479 fields, or where no matching keys can be found.
1481 In these cases, you are dropped into a menu with a list of keys from which
1482 you can select one. When you quit this menu, or mutt can't find any
1483 matching keys, you are prompted for a user ID. You can, as usually, abort
1484 this prompt using ^G. When you do so, mutt will return to the compose
1487 Once you have successfully finished the key selection, the message will be
1488 encrypted using the selected public keys, and sent out.
1490 Most fields of the entries in the key selection menu (see also
1491 pgp-entry-format ) have obvious meanings. But some explanations on the
1492 capabilities, flags, and validity fields are in order.
1494 The flags sequence (%f) will expand to one of the following flags:
1496 Table 2.10. PGP Key Menu Flags
1498 +-----------------------------------------------------------+
1499 | Flag | Description |
1500 |------+----------------------------------------------------|
1501 | R | The key has been revoked and can't be used. |
1502 |------+----------------------------------------------------|
1503 | X | The key is expired and can't be used. |
1504 |------+----------------------------------------------------|
1505 | d | You have marked the key as disabled. |
1506 |------+----------------------------------------------------|
1507 | c | There are unknown critical self-signature packets. |
1508 +-----------------------------------------------------------+
1510 The capabilities field (%c) expands to a two-character
1511 sequencerepresenting a key's capabilities. The first character gives the
1512 key's encryption capabilities: A minus sign (- )means that the key cannot
1513 be used for encryption. A dot (. )means that it's marked as a signature
1514 key in one of the user IDs, but may also be used for encryption. The
1515 letter e indicates that this key can be used for encryption.
1517 The second character indicates the key's signing capabilities. Once again,
1518 a ``-'' implies ``not for signing'', ``.'' implies that the key is marked
1519 as an encryption key in one of the user-ids, and ``s'' denotes a key which
1520 can be used for signing.
1522 Finally, the validity field (%t) indicates how well-certified a user-id
1523 is. A question mark (?) indicates undefined validity, a minus character
1524 (-) marks an untrusted association, a space character means a partially
1525 trusted association, and a plus character (+ ) indicates complete
1528 6.5. Sending anonymous messages via mixmaster
1530 You may also have configured mutt to co-operate with Mixmaster, an
1531 anonymous remailer. Mixmaster permits you to send your messages
1532 anonymously using a chain of remailers. Mixmaster support in mutt is for
1533 mixmaster version 2.04 (beta 45 appears to be the latest) and 2.03. It
1534 does not support earlier versions or the later so-called version 3 betas,
1535 of which the latest appears to be called 2.9b23.
1537 To use it, you'll have to obey certain restrictions. Most important, you
1538 cannot use the Cc and Bcc headers. To tell Mutt-ng to use mixmaster, you
1539 have to select a remailer chain, using the mix function on the compose
1542 The chain selection screen is divided into two parts. In the (larger)
1543 upper part, you get a list of remailers you may use. In the lower part,
1544 you see the currently selected chain of remailers.
1546 You can navigate in the chain using the chain-prev and chain-next
1547 functions, which are by default bound to the left and right arrows and to
1548 the h and l keys (think vi keyboard bindings). To insert a remailer at the
1549 current chain position, use the insert function. To append a remailer
1550 behind the current chain position, use select-entry or append . You can
1551 also delete entries from the chain, using the corresponding function.
1552 Finally, to abandon your changes, leave the menu, or accept them pressing
1553 (by default) the Return key.
1555 Note that different remailers do have different capabilities, indicated in
1556 the %c entry of the remailer menu lines (see mix-entry-format). Most
1557 important is the ``middleman'' capability, indicated by a capital ``M'':
1558 This means that the remailer in question cannot be used as the final
1559 element of a chain, but will only forward messages to other mixmaster
1560 remailers. For details on the other capabilities, please have a look at
1561 the mixmaster documentation.
1563 7. Forwarding and Bouncing Mail
1565 Often, it is necessary to forward mails to other people. Therefore,
1566 mutt-ng supports forwarding messages in two different ways.
1568 The first one is regular forwarding, as you probably know it from other
1569 mail clients. You simply press f, enter the recipient email address, the
1570 subject of the forwarded email, and then you can edit the message to be
1571 forwarded in the editor. The forwarded message is separated from the rest
1572 of the message via the two following markers:
1574 ----- Forwarded message from Lucas User <luser@example.com> -----
1576 From: Lucas User <luser@example.com>
1577 Date: Thu, 02 Dec 2004 03:08:34 +0100
1578 To: Michael Random <mrandom@example.com>
1579 Subject: Re: blackmail
1581 Pay me EUR 50,000.- cash or your favorite stuffed animal will die
1584 ----- End forwarded message -----
1586 When you're done with editing the mail, save and quit the editor, and you
1587 will return to the compose menu, the same menu you also encounter when
1588 composing or replying to mails.
1590 The second mode of forwarding emails with mutt-ng is the so-called
1591 bouncing: when you bounce an email to another address, it will be sent in
1592 practically the same format you send it (except for headers that are
1593 created during transporting the message). To bounce a message, press b and
1594 enter the recipient email address. By default, you are then asked whether
1595 you really want to bounce the message to the specified recipient. If you
1596 answer with yes, the message will then be bounced.
1598 To the recipient, the bounced email will look as if he got it like a
1599 regular email where he was Bcc: recipient. The only possibility to find
1600 out whether it was a bounced email is to carefully study the email headers
1601 and to find out which host really sent the email.
1605 At times it is desirable to delay sending a message that you have already
1606 begun to compose. When the postpone-message function is used in the
1607 compose menu, the body of your message and attachments are stored in the
1608 mailbox specified by the postponed variable. This means that you can
1609 recall the message even if you exit Mutt-ng and then restart it at a later
1612 Once a message is postponed, there are several ways to resume it. From the
1613 command line you can use the ``-p'' option, or if you compose a new
1614 message from the index or pager you will be prompted if postponed messages
1615 exist. If multiple messages are currently postponed, the postponed menu
1616 will pop up and you can select which message you would like to resume.
1618 Note: If you postpone a reply to a message, the reply setting of the
1619 message is only updated when you actually finish the message and send it.
1620 Also, you must be in the same folder with the message you replied to for
1621 the status of the message to be updated.
1623 See also the postpone quad-option.
1625 Chapter 3. Configuration
1629 1. Locations of Configuration Files
1631 2. Basic Syntax of Initialization Files
1633 3. Expansion within variables
1635 3.1. Commands' Output
1637 3.2. Environment Variables
1639 3.3. Configuration Variables
1641 3.4. Self-Defined Variables
1643 3.5. Pre-Defined Variables
1645 3.6. Type Conversions
1647 4. Defining/Using aliases
1649 5. Changing the default key bindings
1651 6. Defining aliases for character sets
1653 7. Setting variables based upon mailbox
1657 9. Using color and mono video attributes
1659 10. Ignoring (weeding) unwanted message headers
1661 11. Alternative addresses
1667 12.2. Receiving: Display Setup
1671 12.4. Additional Notes
1675 14. Using Multiple spool mailboxes
1677 15. Defining mailboxes which receive mail
1679 16. User defined headers
1681 17. Defining the order of headers when viewing messages
1683 18. Specify default save filename
1685 19. Specify default Fcc: mailbox when composing
1687 20. Specify default save filename and default Fcc: mailbox at once
1689 21. Change settings based upon message recipients
1691 22. Change settings before formatting a message
1693 23. Choosing the cryptographic key of the recipient
1695 24. Adding key sequences to the keyboard buffer
1697 25. Executing functions
1703 28. Setting variables
1705 29. Reading initialization commands from another file
1711 31.1. Character Sets
1713 31.2. Modularization
1715 31.3. Conditional parts
1717 32. Obsolete Variables
1719 1. Locations of Configuration Files
1721 While the default configuration (or ``preferences'') make Mutt-ng usable
1722 right out of the box, it is often desirable to tailor Mutt-ng to suit your
1723 own tastes. When Mutt-ng is first invoked, it will attempt to read the
1724 ``system'' configuration file (defaults set by your local system
1725 administrator), unless the ``-n'' commandline option is specified. This
1726 file is typically /usr/local/share/muttng/Muttngrc or /etc/Muttngrc ,
1727 Mutt-ng users will find this file in /usr/local/share/muttng/Muttrc or
1728 /etc/Muttngrc. Mutt will next look for a file named .muttrc in your home
1729 directory, Mutt-ng will look for .muttngrc. If this file does not exist
1730 and your home directory has a subdirectory named .mutt , mutt try to load
1731 a file named .muttng/muttngrc.
1733 .muttrc (or .muttngrc for Mutt-ng) is the file where you will usually
1734 place your commands to configure Mutt-ng.
1736 2. Basic Syntax of Initialization Files
1738 An initialization file consists of a series of commands .Each line of the
1739 file may contain one or more commands. When multiple commands are used,
1740 they must be separated by a semicolon (;).
1742 set realname='Mutt-ng user' ; ignore x-
1744 The hash mark, or pound sign (``#''), is used as a ``comment'' character.
1745 You can use it to annotate your initialization file. All text after the
1746 comment character to the end of the line is ignored. For example,
1748 my_hdr X-Disclaimer: Why are you listening to me? # This is a comment
1750 Single quotes (') and double quotes (") can be used to quote strings which
1751 contain spaces or other special characters. The difference between the two
1752 types of quotes is similar to that of many popular shell programs, namely
1753 that a single quote is used to specify a literal string (one that is not
1754 interpreted for shell variables or quoting with a backslash [see next
1755 paragraph]), while double quotes indicate a string for which should be
1756 evaluated. For example, backtics are evaluated inside of double quotes,
1757 but not for single quotes.
1759 \ quotes the next character, just as in shells such as bash and zsh. For
1760 example, if want to put quotes ``"'' inside of a string, you can use ``\''
1761 to force the next character to be a literal instead of interpreted
1764 set realname="Michael \"MuttDude\" Elkins"
1766 ``\\'' means to insert a literal ``\'' into the line. ``\n'' and ``\r''
1767 have their usual C meanings of linefeed and carriage-return, respectively.
1769 A \ at the end of a line can be used to split commands over multiple
1770 lines, provided that the split points don't appear in the middle of
1773 Please note that, unlike the various shells, mutt-ng interprets a ``\'' at
1774 the end of a line also in comments. This allows you to disable a command
1775 split over multiple lines with only one ``#''.
1778 set realname="Michael \"MuttDude\" Elkins"
1780 When testing your config files, beware the following caveat. The backslash
1781 at the end of the commented line extends the current line with the next
1782 line - then referred to as a ``continuation line''. As the first line is
1783 commented with a hash (#) all following continuation lines are also part
1784 of a comment and therefore are ignored, too. So take care of comments when
1785 continuation lines are involved within your setup files!
1795 line1 ``continues'' until line4. however, the part after the # is a
1796 comment which includes line3 and line4. line5 is a new line of its own and
1797 thus is interpreted again.
1799 The commands understood by mutt are explained in the next paragraphs. For
1800 a complete list, see the commands.
1802 3. Expansion within variables
1804 Besides just assign static content to variables, there's plenty of ways of
1805 adding external and more or less dynamic content.
1807 3.1. Commands' Output
1809 It is possible to substitute the output of a Unix command in an
1810 initialization file. This is accomplished by enclosing the command in
1811 backquotes (``) as in, for example:
1813 my_hdr X-Operating-System: `uname -a`
1815 The output of the Unix command ``uname -a'' will be substituted before the
1816 line is parsed. Note that since initialization files are line oriented,
1817 only the first line of output from the Unix command will be substituted.
1819 3.2. Environment Variables
1821 UNIX environments can be accessed like the way it is done in shells like
1822 sh and bash: Prepend the name of the environment by a ``$'' sign. For
1825 set record=+sent_on_$HOSTNAME
1827 sets the record variable to the string +sent_on_ and appends the value of
1828 the evironment variable $HOSTNAME.
1830 Note: There will be no warning if an environment variable is not defined.
1831 The result will of the expansion will then be empty.
1833 3.3. Configuration Variables
1835 As for environment variables, the values of all configuration variables as
1836 string can be used in the same way, too. For example,
1838 set imap_home_namespace = $folder
1840 would set the value of imap-home-namespace to the value to which folder is
1843 Note: There're no logical links established in such cases so that the the
1844 value for imap-home-namespace won't change even if folder gets changed.
1846 Note: There will be no warning if a configuration variable is not defined
1847 or is empty. The result will of the expansion will then be empty.
1849 3.4. Self-Defined Variables
1851 Mutt-ng flexibly allows users to define their own variables. To avoid
1852 conflicts with the standard set and to prevent misleading error messages,
1853 there's a reserved namespace for them: all user-defined variables must be
1854 prefixed with user_ and can be used just like any ordinary configuration
1855 or environment variable.
1857 For example, to view the manual, users can either define two macros like
1860 macro generic <F1> "!less -r /path/to/manual" "Show manual"
1861 macro pager <F1> "!less -r /path/to/manual" "Show manual"
1863 for generic, pager and index .The alternative is to define a custom
1866 set user_manualcmd = "!less -r /path/to_manual"
1867 macro generic <F1> "$user_manualcmd<enter>" "Show manual"
1868 macro pager <F1> "$user_manualcmd<enter>" "Show manual"
1869 macro index <F1> "$user_manualcmd<enter>" "Show manual"
1871 to re-use the command sequence as in:
1873 macro index <F2> "$user_manualcmd | grep '\^[ ]\\+~. '" "Show Patterns"
1875 Using this feature, arbitrary sequences can be defined once and recalled
1876 and reused where necessary. More advanced scenarios could include to save
1877 a variable's value at the beginning of macro sequence and restore it at
1880 When the variable is first defined, the first value it gets assigned is
1881 also the initial value to which it can be reset using the reset command.
1883 The complete removal is done via the unset keyword.
1885 After the following sequence:
1890 the variable $user_foo has a current value of 666 and an initial of 42.
1895 will show 666. After doing the reset via
1899 a following query will give 42 as the result. After unsetting it via
1903 any query or operation (except the noted expansion within other
1904 statements) will lead to an error message.
1906 3.5. Pre-Defined Variables
1908 In order to allow users to share one setup over a number of different
1909 machines without having to change its contents, there's a number of
1910 pre-defined variables. These are prefixed with muttng_ and are read-only,
1911 i.e. they cannot be set, unset or reset. The reference chapter lists all
1912 available variables.
1914 Please consult the local copy of your manual for their values as they may
1915 differ from different manual sources. Where the manual is installed in can
1916 be queried (already using such a variable) by running:
1918 muttng -Q muttng_docdir
1920 To extend the example for viewing the manual via self-defined variables,
1921 it can be made more readable and more portable by changing the real path
1924 set user_manualcmd = '!less -r /path/to_manual'
1928 set user_manualcmd = "!less -r $muttng_docdir/manual.txt"
1930 which works everywhere if a manual is installed.
1932 Please note that by the type of quoting, muttng determines when to expand
1933 these values: when it finds double quotes, the value will be expanded
1934 during reading the setup files but when it finds single quotes, it'll
1935 expand it at runtime as needed.
1937 For example, the statement
1939 folder-hook . "set user_current_folder = $muttng_folder_name"
1941 will be already be translated to the following when reading the startup
1944 folder-hook . "set user_current_folder = some_folder"
1946 with some_folder being the name of the first folder muttng opens. On the
1949 folder-hook . 'set user_current_folder = $muttng_folder_name'
1951 will be executed at runtime because of the single quotes so that
1952 user_current_folder will always have the value of the currently opened
1955 A more practical example is:
1957 folder-hook . 'source ~/.mutt/score-$muttng_folder_name'
1959 which can be used to source files containing score commands depending on
1960 the folder the user enters.
1962 3.6. Type Conversions
1964 A note about variable's types during conversion: internally values are
1965 stored in internal types but for any dump/query or set operation they're
1966 converted to and from string. That means that there's no need to worry
1967 about types when referencing any variable. As an example, the following
1968 can be used without harm (besides makeing muttng very likely behave
1972 set folder = $read_inc
1973 set read_inc = $folder
1974 set user_magic_number = 42
1975 set folder = $user_magic_number
1977 4. Defining/Using aliases
1979 Usage: alias key address [ , address, ... ]
1981 It's usually very cumbersome to remember or type out the address of
1982 someone you are communicating with. Mutt-ng allows you to create
1983 ``aliases'' which map a short string to a full address.
1985 Note: if you want to create an alias for a group (by specifying more than
1986 one address), you must separate the addresses with a comma (``,'').
1988 To remove an alias or aliases (``*'' means all aliases):
1990 unalias [ * | key ... ]
1992 alias muttdude me@cs.hmc.edu (Michael Elkins)
1993 alias theguys manny, moe, jack
1995 Unlike other mailers, Mutt-ng doesn't require aliases to be defined in a
1996 special file. The alias command can appear anywhere in a configuration
1997 file, as long as this file is source .Consequently, you can have multiple
1998 alias files, or you can have all aliases defined in your muttrc.
2000 On the other hand, the create-alias function can use only one file, the
2001 one pointed to by the alias-file variable (which is ˜/.muttrc by
2002 default). This file is not special either, in the sense that Mutt-ng will
2003 happily append aliases to any file, but in order for the new aliases to
2004 take effect you need to explicitly source this file too.
2008 source /usr/local/share/Mutt-ng.aliases
2009 source ~/.mail_aliases
2010 set alias_file=~/.mail_aliases
2012 To use aliases, you merely use the alias at any place in mutt where
2013 muttprompts for addresses, such as the To: or Cc: prompt. You can also
2014 enter aliases in your editor at the appropriate headers if you have the
2015 edit-headers variable set.
2017 In addition, at the various address prompts, you can use the tab character
2018 to expand a partial alias to the full alias. If there are multiple
2019 matches, mutt will bring up a menu with the matching aliases. In order to
2020 be presented with the full list of aliases, you must hit tab with out a
2021 partial alias, such as at the beginning of the prompt or after a comma
2022 denoting multiple addresses.
2024 In the alias menu, you can select as many aliases as you want with the
2025 select-entry key (default: RET), and use the exit key (default: q) to
2026 return to the address prompt.
2028 5. Changing the default key bindings
2030 Usage: bind map key function
2032 This command allows you to change the default key bindings (operation
2033 invoked when pressing a key).
2035 map specifies in which menu the binding belongs. Multiple maps may be
2036 specified by separating them with commas (no additional whitespace
2037 isallowed). The currently defined maps are:
2041 This is not a real menu, but is used as a fallback for all of the
2042 other menus except for the pager and editor modes. If a key is not
2043 defined in another menu, Mutt-ng will look for a binding to use in
2044 this menu. This allows you to bind a key to a certain function in
2045 multiple menus instead of having multiple bind statements to
2046 accomplish the same task.
2050 The alias menu is the list of your personal aliases as defined in
2051 your muttrc. It is the mapping from a short alias name to the full
2052 email address(es) of the recipient(s).
2056 The attachment menu is used to access the attachments on received
2061 The browser is used for both browsing the local directory
2062 structure, and for listing all of your incoming mailboxes.
2066 The editor is the line-based editor the user enters text data.
2070 The index is the list of messages contained in a mailbox.
2074 The compose menu is the screen used when sending a new message.
2078 The pager is the mode used to display message/attachment data, and
2083 The pgp menu is used to select the OpenPGP keys used for
2084 encrypting outgoing messages.
2088 The postpone menu is similar to the index menu, except is used
2089 when recalling a message the user was composing, but saved until
2092 key is the key (or key sequence) you wish to bind. To specify a control
2093 character, use the sequence \Cx, where x is the letter of the control
2094 character (for example, to specify control-A use ``\Ca''). Note that the
2095 case of x as well as \C is ignored, so that \CA, \Ca, \cA and \ca are all
2096 equivalent. An alternative form is to specify the key as a three digit
2097 octal number prefixed with a ``\'' (for example \177 is equivalent to
2100 In addition, key may consist of:
2102 Table 3.1. Alternative Key Names
2104 +-----------------------------------+
2105 | Sequence | Description |
2106 |-------------+---------------------|
2108 |-------------+---------------------|
2110 |-------------+---------------------|
2111 | <backtab> | backtab / shift-tab |
2112 |-------------+---------------------|
2113 | \r | carriage return |
2114 |-------------+---------------------|
2116 |-------------+---------------------|
2118 |-------------+---------------------|
2120 |-------------+---------------------|
2122 |-------------+---------------------|
2123 | <down> | down arrow |
2124 |-------------+---------------------|
2125 | <left> | left arrow |
2126 |-------------+---------------------|
2127 | <right> | right arrow |
2128 |-------------+---------------------|
2129 | <pageup> | Page Up |
2130 |-------------+---------------------|
2131 | <pagedown> | Page Down |
2132 |-------------+---------------------|
2133 | <backspace> | Backspace |
2134 |-------------+---------------------|
2135 | <delete> | Delete |
2136 |-------------+---------------------|
2137 | <insert> | Insert |
2138 |-------------+---------------------|
2140 |-------------+---------------------|
2141 | <return> | Return |
2142 |-------------+---------------------|
2144 |-------------+---------------------|
2146 |-------------+---------------------|
2147 | <space> | Space bar |
2148 |-------------+---------------------|
2149 | <f1> | function key 1 |
2150 |-------------+---------------------|
2151 | <f10> | function key 10 |
2152 +-----------------------------------+
2154 key does not need to be enclosed in quotes unless it contains a space (``
2157 function specifies which action to take when key is pressed. For a
2158 complete list of functions, see the functions .The special function noop
2159 unbinds the specified key sequence.
2161 6. Defining aliases for character sets
2163 Usage: charset-hook alias charset Usage: iconv-hook charset local-charset
2165 The charset-hook command defines an alias for a character set. This is
2166 useful to properly display messages which are tagged with a character set
2167 name not known to mutt.
2169 The iconv-hook command defines a system-specific name for a character set.
2170 This is helpful when your systems character conversion library insists on
2171 using strange, system-specific names for character sets.
2173 7. Setting variables based upon mailbox
2175 Usage: folder-hook [!]regexp command
2177 It is often desirable to change settings based on which mailbox you are
2178 reading. The folder-hook command provides a method by which you can
2179 execute any configuration command. regexp is a regular expression
2180 specifying in which mailboxes to execute command before loading. If a
2181 mailbox matches multiple folder-hook's, they are executed in the order
2182 given in the muttrc.
2184 Note: if you use the ``!'' shortcut for spoolfile at the beginning of the
2185 pattern, you must place it inside of double or single quotes in order to
2186 distinguish it from the logical not operator for the expression.
2188 Note that the settings are not restored when you leave the mailbox. For
2189 example, a command action to perform is to change the sorting methodbased
2190 upon the mailbox being read:
2192 folder-hook mutt set sort=threads
2194 However, the sorting method is not restored to its previous value when
2195 reading a different mailbox. To specify a default command, use the pattern
2198 folder-hook . set sort=date-sent
2202 Usage: macro menu key sequence [ description ]
2204 Macros are useful when you would like a single key to perform a series of
2205 actions. When you press key in menu menu ,Mutt-ng will behave as if you
2206 had typed sequence. So if you have a common sequence of commands you type,
2207 you can create a macro to execute those commands with a singlekey.
2209 menu is the maps which the macro will be bound. Multiple maps may be
2210 specified by separating multiple menu arguments by commas. Whitespace may
2211 not be used in between the menu arguments and thecommas separating them.
2213 key and sequence are expanded by the same rules as the bind. There are
2214 some additions however. The first is that control characters in sequence
2215 can also be specified as ^x. In order to get a caret (`^'') you need to
2216 use ^^. Secondly, to specify a certain key such as up or to invoke a
2217 function directly, you can use the format <key name> and <function name>
2218 .For a listing of key names see the section on bind. Functions are listed
2221 The advantage with using function names directly is that the macros
2222 willwork regardless of the current key bindings, so they are not dependent
2223 on the user having particular key definitions. This makes them more
2224 robustand portable, and also facilitates defining of macros in files used
2225 by more than one user (eg. the system Muttngrc).
2227 Optionally you can specify a descriptive text after sequence, which is
2228 shown in the help screens.
2230 Note: Macro definitions (if any) listed in the help screen(s), are
2231 silently truncated at the screen width, and are not wrapped.
2233 9. Using color and mono video attributes
2235 Usage: color object foreground background [ regexp ] Usage: color index
2236 foreground background pattern Usage: uncolor index pattern [ pattern ... ]
2238 If your terminal supports color, you can spice up Mutt-ng by creating your
2239 own color scheme. To define the color of an object (type of information),
2240 you must specify both a foreground color and a background color (it is not
2241 possible to only specify one or the other).
2243 object can be one of:
2247 o body (match regexp in the body of messages)
2249 o bold (highlighting bold patterns in the body of messages)
2251 o error (error messages printed by Mutt-ng)
2253 o header (match regexp in the message header)
2255 o hdrdefault (default color of the message header in the pager)
2257 o index (match pattern in the message index)
2259 o indicator (arrow or bar used to indicate the current item in a menu)
2261 o markers (the ``+'' markers at the beginning of wrapped lines in the
2264 o message (informational messages)
2268 o quoted (text matching quote-regexp in the body of a message)
2270 o quoted1, quoted2, ..., quotedN (higher levels of quoting)
2272 o search (highlighting of words in the pager)
2276 o status (mode lines used to display info about the mailbox or message)
2278 o tilde (the ``˜'' used to pad blank lines in the pager)
2280 o tree (thread tree drawn in the message index and attachment menu)
2282 o underline (highlighting underlined patterns in the body of messages)
2284 foreground and background can be one of the following:
2306 foreground can optionally be prefixed with the keyword bright to make the
2307 foreground color boldfaced (e.g., brightred).
2309 If your terminal supports it, the special keyword default can be used as a
2310 transparent color. The value brightdefault is also valid. If Mutt-ng is
2311 linked against the S-Lang library, you also need to set the COLORFGBG
2312 environment variable to the default colors of your terminal for this to
2313 work; for example (for Bourne-like shells):
2315 set COLORFGBG="green;black"
2318 Note: The S-Lang library requires you to use the lightgray and brown
2319 keywords instead of white and yellow when setting this variable.
2321 Note: The uncolor command can be applied to the index object only. It
2322 removes entries from the list. You must specify the same pattern specified
2323 in the color command for it to be removed. The pattern ``*'' is a special
2324 token which means to clear the color index list of all entries.
2326 Mutt-ng also recognizes the keywords color0, color1 ,…, colorN-1 (N
2327 being the number of colors supported by your terminal). This is useful
2328 when you remap the colors for your display (for example by changing the
2329 color associated with color2 for your xterm), since color names may then
2330 lose their normal meaning.
2332 If your terminal does not support color, it is still possible change the
2333 video attributes through the use of the ``mono'' command:
2335 Usage: mono <object> <attribute> [ regexp ] Usage: mono index attribute
2336 pattern Usage: unmono index pattern [ pattern ... ]
2338 where attribute is one of the following:
2350 10. Ignoring (weeding) unwanted message headers
2352 Usage: [un]ignore pattern [ pattern ... ]
2354 Messages often have many header fields added by automatic processing
2355 systems, or which may not seem useful to display on the screen. This
2356 command allows you to specify header fields which you don't normally want
2359 You do not need to specify the full header field name. For example,
2360 ``ignore content-'' will ignore all header fields that begin with the
2361 pattern ``content-''. ``ignore *'' will ignore all headers.
2363 To remove a previously added token from the list, use the ``unignore''
2364 command. The ``unignore'' command will make Mutt-ng display headers with
2365 the given pattern. For example, if you do ``ignore x-'' it is possible to
2366 ``unignore x-mailer''.
2368 ``unignore *'' will remove all tokens from the ignore list.
2372 # Sven's draconian header weeding
2374 unignore from date subject to cc
2375 unignore organization organisation x-mailer: x-newsreader: x-mailing-list:
2378 11. Alternative addresses
2380 Usage: [un]alternates regexp [ regexp ... ]
2382 With various functions, mutt will treat messages differently, depending on
2383 whether you sent them or whether you received them from someone else. For
2384 instance, when replying to a message that you sent to a different party,
2385 mutt will automatically suggest to send the response to the original
2386 message's recipients -- responding to yourself won't make much sense in
2387 many cases. (See reply-to .)
2389 Many users receive e-mail under a number of different addresses. To fully
2390 use mutt's features here, the program must be able to recognize what
2391 e-mail addresses you receive mail under. That's the purpose of the
2392 alternates command: It takes a list of regular expressions, each of which
2393 can identify an address under which you receive e-mail.
2395 The unalternates command can be used to write exceptions to alternates
2396 patterns. If an address matches something in an alternates command, but
2397 you nonetheless do not think it is from you, you can list a more precise
2398 pattern under an unalternates command.
2400 To remove a regular expression from the alternates list, use the
2401 unalternates command with exactly the same regexp . Likewise, if the
2402 regexp for a alternates command matches an entry on the unalternates list,
2403 that unalternates entry will be removed. If the regexp for unalternates is
2404 ``*'', all entries on alternates will be removed.
2410 Mutt-ng contains support for so-called format=flowed messages. In the
2411 beginning of email, each message had a fixed line width, and it was enough
2412 for displaying them on fixed-size terminals. But times changed, and
2413 nowadays hardly anybody still uses fixed-size terminals: more people
2414 nowaydays use graphical user interfaces, with dynamically resizable
2415 windows. This led to the demand of a new email format that makes it
2416 possible for the email client to make the email look nice in a resizable
2417 window without breaking quoting levels and creating an incompatible email
2418 format that can also be displayed nicely on old fixed-size terminals.
2420 For introductory information on format=flowed messages, see
2421 <http://www.joeclark.org/ffaq.html>.
2423 12.2. Receiving: Display Setup
2425 When you receive emails that are marked as format=flowed messages, and is
2426 formatted correctly, mutt-ng will try to reformat the message to optimally
2427 fit on your terminal. If you want a fixed margin on the right side of your
2428 terminal, you can set the following:
2432 The code above makes the line break 10 columns before the right side of
2435 If your terminal is so wide that the lines are embarrassingly long, you
2436 can also set a maximum line length:
2438 set max_line_length = 120
2440 The example above will give you lines not longer than 120 characters.
2442 When you view at format=flowed messages, you will often see the quoting
2443 hierarchy like in the following example:
2445 >Bill, can you please send last month's progress report to Mr.
2446 >Morgan? We also urgently need the cost estimation for the new
2447 >production server that we want to set up before our customer's
2448 >project will go live.
2450 This obviously doesn't look very nice, and it makes it very hard to
2451 differentiate between text and quoting character. The solution is to
2452 configure mutt-ng to "stuff" the quoting:
2456 This will lead to a nicer result that is easier to read:
2458 > Bill, can you please send last month's progress report to Mr.
2459 > Morgan? We also urgently need the cost estimation for the new
2460 > production server that we want to set up before our customer's
2461 > project will go live.
2465 If you want mutt-ng to send emails with format=flowed set, you need to
2470 Additionally, you have to use an editor which supports writing
2471 format=flowed-conforming emails. For vim, this is done by adding w to the
2472 formatoptions (see :h formatoptions and :h fo-table) when writing emails.
2474 Also note that format=flowed knows about ``space-stuffing'', that is, when
2475 sending messages, some kinds of lines have to be indented with a single
2476 space on the sending side. On the receiving side, the first space (if any)
2477 is removed. As a consequence and in addition to the above simple setting,
2478 please keep this in mind when making manual formattings within the editor.
2479 Also note that mutt-ng currently violates the standard (RfC 3676) as it
2480 does not space-stuff lines starting with:
2482 o > This is not the quote character but a right angle used for other
2485 o From with a trailing space.
2487 o just a space for formatting reasons
2489 Please make sure that you manually prepend a space to each of them.
2491 12.4. Additional Notes
2493 For completeness, the delete-space variable provides the mechanism to
2494 generate a DelSp=yes parameter on outgoing messages. According to the
2495 standard, clients receiving a format=flowed messages should delete the
2496 last space of a flowed line but still interpret the line as flowed.
2497 Because flowed lines usually contain only one space at the end, this
2498 parameter would make the receiving client concatenate the last word of the
2499 previous with the first of the current line without a space. This makes
2500 ordinary text unreadable and is intended for languages rarely using
2501 spaces. So please use this setting only if you're sure what you're doing.
2505 Usage: [un]lists regexp [ regexp ... ] Usage: [un]subscribe regexp [
2508 Mutt-ng has a few nice features for using-lists .In order to take
2509 advantage of them, you must specify which addresses belong to mailing
2510 lists, and which mailing lists you are subscribed to. Once you have done
2511 this, the list-reply function will work for all known lists. Additionally,
2512 when you send a message to a subscribed list, mutt will add a
2513 Mail-Followup-To header to tell other users' mail user agents not to send
2514 copies of replies to your personal address. Note that the Mail-Followup-To
2515 header is a non-standard extension which is not supported by all mail user
2516 agents. Adding it is not bullet-proof against receiving personal CCs of
2517 list messages. Also note that the generation of the Mail-Followup-To
2518 header is controlled by the followup-to configuration variable.
2520 More precisely, Mutt-ng maintains lists of patterns for the addresses of
2521 known and subscribed mailing lists. Every subscribed mailing list is
2522 known. To mark a mailing list as known, use the ``lists'' command. To mark
2523 it as subscribed, use ``subscribe''.
2525 You can use regular expressions with both commands. To mark all messages
2526 sent to a specific bug report's address on mutt's bug tracking system as
2527 list mail, for instance, you could say ``subscribe [0-9]*@bugs.guug.de''.
2528 Often, it's sufficient to just give a portion of the list's e-mail
2531 Specify as much of the address as you need to to remove ambiguity. For
2532 example, if you've subscribed to the Mutt-ng mailing list, you will
2533 receive mail addressed to mutt-users@mutt.org. So, to tell Mutt-ng that
2534 this is a mailing list, you could add ``lists mutt-users'' to your
2535 initialization file. To tell mutt that you are subscribed to it, add
2536 ``subscribe mutt-users'' to your initialization file instead. If you also
2537 happen to get mail from someone whose address is mutt-users@example.com,
2538 you could use ``lists mutt-users@mutt\\.org'' or ``subscribe
2539 mutt-users@mutt\\.org'' to match only mail from the actual list.
2541 The ``unlists'' command is used to remove a token from the list of known
2542 and subscribed mailing-lists. Use ``unlists *'' to remove all tokens.
2544 To remove a mailing list from the list of subscribed mailing lists, but
2545 keep it on the list of known mailing lists, use ``unsubscribe''.
2547 14. Using Multiple spool mailboxes
2549 Usage: mbox-hook [!]pattern mailbox
2551 This command is used to move read messages from a specified mailbox to
2552 adifferent mailbox automatically when you quit or change folders. pattern
2553 is a regular expression specifying the mailbox to treat as a ``spool''
2554 mailbox and mailbox specifies where mail should be saved when read.
2556 Unlike some of the other hook commands, only the first matching pattern is
2557 used (it is not possible to save read mail in more than a single mailbox).
2559 15. Defining mailboxes which receive mail
2561 Usage: [un]mailboxes [!]filename [ filename ... ]
2563 This command specifies folders which can receive mail and which will be
2564 checked for new messages. By default, the main menu status bar displays
2565 how many of these folders have new messages.
2567 When changing folders, pressing space will cycle through folders with new
2570 Pressing TAB in the directory browser will bring up a menu showing the
2571 files specified by the mailboxes command, and indicate which contain new
2572 messages. Mutt-ng will automatically enter this mode when invoked from the
2573 command line with the -y option.
2575 The ``unmailboxes'' command is used to remove a token from the list of
2576 folders which receive mail. Use ``unmailboxes *'' to remove all tokens.
2578 Note: new mail is detected by comparing the last modification time to the
2579 last access time. Utilities like biff or frm or any other program which
2580 accesses the mailbox might cause Mutt-ng to never detect new mail for that
2581 mailbox if they do not properly reset the access time. Backup tools are
2582 another common reason for updated access times.
2584 Note: the filenames in the mailboxes command are resolved when the command
2585 is executed, so if these names contain shortcuts (such as ``='' and
2586 ``!''), any variable definition that affect these characters (like folder
2587 and spoolfile) should be executed before the mailboxes command.
2589 16. User defined headers
2591 Usage: my_hdr string unmy_hdr field [ field ... ]
2593 The ``my_hdr'' command allows you to create your own header fields which
2594 will be added to every message you send.
2596 For example, if you would like to add an ``Organization:'' header field to
2597 all of your outgoing messages, you can put the command
2599 my_hdr Organization: A Really Big Company, Anytown, USA
2603 Note: space characters are not allowed between the keyword and the colon
2604 (``:''). The standard for electronic mail (RFC822) says that space is
2605 illegal there, so Mutt-ng enforces the rule.
2607 If you would like to add a header field to a single message, you should
2608 either set the edit-headers variable, or use the edit-headers function
2609 (default: ``E'') in the send-menu so that you can edit the header of your
2610 message along with the body.
2612 To remove user defined header fields, use the ``unmy_hdr'' command. You
2613 may specify an asterisk (``*'') to remove all header fields, or the fields
2614 to remove. For example, to remove all ``To'' and ``Cc'' header fields, you
2619 17. Defining the order of headers when viewing messages
2621 Usage: hdr_order header1 header2 header3
2623 With this command, you can specify an order in which mutt will attempt to
2624 present headers to you when viewing messages.
2626 ``unhdr_order *'' will clear all previous headers from the order list,
2627 thus removing the header order effects set by the system-wide startup
2630 hdr_order From Date: From: To: Cc: Subject:
2632 18. Specify default save filename
2634 Usage: save-hook [!]pattern filename
2636 This command is used to override the default filename used when saving
2637 messages. filename will be used as the default filename if the message is
2638 From: an address matching regexp or if you are the author and the message
2639 is addressed to: something matching regexp .
2641 See pattern-hook for information on the exact format of pattern.
2645 save-hook me@(turing\\.)?cs\\.hmc\\.edu$ +elkins
2646 save-hook aol\\.com$ +spam
2648 Also see the fcc-save-hook command.
2650 19. Specify default Fcc: mailbox when composing
2652 Usage: fcc-hook [!]pattern mailbox
2654 This command is used to save outgoing mail in a mailbox other than record.
2655 Mutt-ng searches the initial list of message recipients for the first
2656 matching regexp and uses mailbox as the default Fcc: mailbox. If no match
2657 is found the message will be saved to record mailbox.
2659 See pattern-hook for information on the exact format of pattern.
2661 Example: fcc-hook [@.]aol\\.com$ +spammers
2663 The above will save a copy of all messages going to the aol.com domain to
2664 the `+spammers' mailbox by default. Also see the fcc-save-hook command.
2666 20. Specify default save filename and default Fcc: mailbox at once
2668 Usage: fcc-save-hook [!]pattern mailbox
2670 This command is a shortcut, equivalent to doing both a fcc-hook and a
2671 save-hook with its arguments.
2673 21. Change settings based upon message recipients
2675 Usage: reply-hook [!]pattern command Usage: send-hook [!]pattern command
2676 Usage: send2-hook [!]pattern command
2678 These commands can be used to execute arbitrary configuration commands
2679 based upon recipients of the message. pattern is a regular expression
2680 matching the desired address. command is executed when regexp matches
2681 recipients of the message.
2683 reply-hook is matched against the message you are replying to, instead of
2684 the message you are sending .send-hook is matched against all messages,
2685 both new and replies .Note: reply-hooks are matched before the send-hook
2686 ,regardless of the order specified in the users's configuration file.
2688 send2-hook is matched every time a message is changed, either by editing
2689 it, or by using the compose menu to change its recipients or subject.
2690 send2-hook is executed after send-hook ,and can, e.g., be used to set
2691 parameters such as the sendmail variable depending on the message's sender
2694 For each type of send-hook or reply-hook, when multiple matches occur,
2695 commands are executed in the order they are specified in the muttrc (for
2698 See pattern-hook for information on the exact format of pattern.
2700 Example: send-hook mutt "set mime_forward signature=''"
2702 Another typical use for this command is to change the values of the
2703 attribution, signature and locale variables in order to change the
2704 language of the attributions and signatures based upon the recipients.
2706 Note: the send-hook's are only executed ONCE after getting the initial
2707 list of recipients. Adding a recipient after replying or editing the
2708 message will NOT cause any send-hook to be executed. Also note that my_hdr
2709 commands which modify recipient headers, or the message's subject, don't
2710 have any effect on the current message when executed from a send-hook.
2712 22. Change settings before formatting a message
2714 Usage: message-hook [!]pattern command
2716 This command can be used to execute arbitrary configuration commands
2717 before viewing or formatting a message based upon information about the
2718 message. command is executed if the pattern matches the message to be
2719 displayed. When multiple matches occur, commands are executed in the order
2720 they are specified in the muttrc.
2722 See pattern-hook for information on the exact format of pattern.
2726 message-hook ~A 'set pager=builtin'
2727 message-hook '~f freshmeat-news' 'set pager="less \"+/^ subject:.*\""'
2729 23. Choosing the cryptographic key of the recipient
2731 Usage: crypt-hook pattern keyid
2733 When encrypting messages with PGP or OpenSSL, you may want to associate a
2734 certain key with a given e-mail address automatically, either because the
2735 recipient's public key can't be deduced from the destination address, or
2736 because, for some reasons, you need to override the key Mutt-ng
2737 wouldnormally use. The crypt-hook command provides a method by which you
2738 can specify the ID of the public key to be used when encrypting messages
2739 to a certain recipient.
2741 The meaning of "key id" is to be taken broadly in this context: You can
2742 either put a numerical key ID here, an e-mail address, or even just a real
2745 24. Adding key sequences to the keyboard buffer
2749 This command adds the named string to the keyboard buffer. The string may
2750 contain control characters, key names and function names like the sequence
2751 string in the macro command. You may use it to automatically run a
2752 sequence of commands at startup, or when entering certain folders.
2754 25. Executing functions
2756 Usage: exec function [ function ... ]
2758 This command can be used to execute any function. Functions are listed in
2759 the functions. ``exec function'' is equivalent to ``push <function>''.
2763 Usage: score pattern value Usage: unscore pattern [ pattern ... ]
2765 In situations where you have to cope with a lot of emails, e.g. when you
2766 read many different mailing lists, and take part in discussions, it is
2767 always useful to have the important messages marked and the annoying
2768 messages or the ones that you aren't interested in deleted. For this
2769 purpose, mutt-ng features a mechanism called ``scoring''.
2771 When you use scoring, every message has a base score of 0. You can then
2772 use the score command to define patterns and a positive or negative value
2773 associated with it. When a pattern matches a message, the message's score
2774 will be raised or lowered by the amount of the value associated with the
2777 score "~f nion@muttng\.org" 50
2778 score "~f @sco\.com" -100
2780 If the pattern matches, it is also possible to set the score value of the
2781 current message to a certain value and then stop evaluation:
2783 score "~f santaclaus@northpole\.int" =666
2785 What is important to note is that negative score values will be rounded up
2788 To make scoring actually useful, the score must be applied in some way.
2789 That's what the score thresholds are for. Currently, there are three score
2792 o flag threshold: when a message has a score value equal or higher than
2793 the flag threshold, it will be flagged.
2795 o read threshold: when a message has a score value equal or lower than
2796 the read threshold, it will be marked as read.
2798 o delete threshold: when a message has a score value equal or lower than
2799 the delete threshold, it will be marked as deleted.
2801 These three thresholds can be set via the variables score-threshold-flag
2802 ,score-threshold-read, score-threshold-delete and. By default,
2803 score-threshold-read and score-threshold-delete are set to -1, which means
2804 that in the default threshold configuration no message will ever get
2805 marked as read or deleted.
2807 Scoring gets especially interesting when combined with the color command
2808 and the Ëœn pattern:
2810 color index black yellow "~n 10-"
2811 color index red yellow "~n 100-"
2813 The rules above mark all messages with a score between 10 and 99 with
2814 black and yellow, and messages with a score greater or equal 100 with red
2815 and yellow. This might be unusual to you if you're used to e.g. slrn's
2816 scoring mechanism, but it is more flexible, as it visually marks different
2821 Usage: spam pattern format Usage: nospam pattern
2823 Mutt-ng has generalized support for external spam-scoring filters. By
2824 defining your spam patterns with the spam and nospam commands, you can
2825 limit, search, and sort your mail based on its spam attributes, as
2826 determined by the external filter. You also can display the spam
2827 attributes in your index display using the %H selector in the index-format
2828 variable. (Tip: try %?H?[%H] ? to display spam tags only when they are
2829 defined for a given message.)
2831 Your first step is to define your external filter's spam patterns using
2832 the spam command. pattern should be a regular expression that matches a
2833 header in a mail message. If any message in the mailbox matches this
2834 regular expression, it will receive a ``spam tag'' or ``spam attribute''
2835 (unless it also matches a nospam pattern -- see below.) The appearance of
2836 this attribute is entirely up to you, and is governed by the format
2837 parameter. format can be any static text, but it also can include
2838 back-references from the pattern expression. (A regular expression
2839 ``back-reference'' refers to a sub-expression contained within
2840 parentheses.) %1 is replaced with the first back-reference in the regex,
2841 %2 with the second, etc.
2843 If you're using multiple spam filters, a message can have more than one
2844 spam-related header. You can define spam patterns for each filter you use.
2845 If a message matches two or more of these patterns, and the
2846 $spam_separator variable is set to a string, then the message's spam tag
2847 will consist of all the format strings joined together, with the value of
2848 $spam_separator separating them.
2850 For example, suppose I use DCC, SpamAssassin, and PureMessage. I might
2851 define these spam settings:
2853 spam "X-DCC-.*-Metrics:.*(....)=many" "90+/DCC-%1"
2854 spam "X-Spam-Status: Yes" "90+/SA"
2855 spam "X-PerlMX-Spam: .*Probability=([0-9]+)%" "%1/PM"
2856 set spam_separator=", "
2858 If I then received a message that DCC registered with ``many'' hits under
2859 the ``Fuz2'' checksum, and that PureMessage registered with a 97%
2860 probability of being spam, that message's spam tag would read90+/DCC-Fuz2,
2861 97/PM. (The four characters before ``=many'' in a DCC report indicate the
2862 checksum used -- in this case, ``Fuz2''.)
2864 If the $spam_separator variable is unset, then each spam pattern match
2865 supersedes the previous one. Instead of getting joined format strings,
2866 you'll get only the last one to match.
2868 The spam tag is what will be displayed in the index when you use %H in the
2869 $index_format variable. It's also the string that the ËœH pattern-matching
2870 expression matches against for search and limit functions. And it's what
2871 sorting by spam attribute will use as a sort key.
2873 That's a pretty complicated example, and most people's actual environments
2874 will have only one spam filter. The simpler your configuration, the more
2875 effective mutt can be, especially when it comes to sorting.
2877 Generally, when you sort by spam tag, mutt will sort lexically -- that is,
2878 by ordering strings alphnumerically. However, if a spam tag begins with a
2879 number, mutt will sort numerically first, and lexically only when two
2880 numbers are equal in value. (This is like UNIX's sort -n.) A message with
2881 no spam attributes at all -- that is, one that didn't match any of your
2882 spam patterns -- is sorted at lowest priority. Numbers are sorted next,
2883 beginning with 0 and ranging upward. Finally, non-numeric strings are
2884 sorted, with ``a'' taking lowerpriority than ``z''. Clearly, in general,
2885 sorting by spam tags is most effective when you can coerce your filter to
2886 give you a raw number. But in case you can't, mutt can still do something
2889 The nospam command can be used to write exceptions to spam patterns. If a
2890 header pattern matches something in a spam command, but you nonetheless do
2891 not want it to receive a spam tag, you can list amore precise pattern
2892 under a nospam command.
2894 If the pattern given to nospam is exactly the same as the pattern on an
2895 existing spam list entry, the effect will be to remove the entry from the
2896 spam list, instead of adding an exception. Likewise, if the pattern for a
2897 spam command matches an entry on the nospam list, that nospam entry will
2898 be removed. If the pattern for nospam is ``*'', all entries on both lists
2899 will be removed. This might be the default action if you use spam and
2900 nospam in conjunction with a folder-hook .
2902 You can have as many spam or nospam commands as you like. You can even do
2903 your own primitive spam detection within mutt -- for example, if you
2904 consider all mail from MAILER-DAEMON to be spam, you can use a spam
2907 spam "^From: .*MAILER-DAEMON" "999"
2909 28. Setting variables
2911 Usage: set [no|inv]variable [=value] [ variable ... ] Usage: toggle
2912 variable [variable ... ] Usage: unset variable [variable ... ] Usage:
2913 reset variable [variable ... ]
2915 This command is used to set (and unset) variables .There are four basic
2916 types of variables: boolean, number, string and quadoption. boolean
2917 variables can be set (true) or unset (false). number variables can be
2918 assigned a positive integer value.
2920 string variables consist of any number of printable characters. strings
2921 must be enclosed in quotes if they contain spaces or tabs. You may also
2922 use the ``C'' escape sequences \n and \t for newline and tab,
2925 quadoption variables are used to control whether or not to be prompted for
2926 certain actions, or to specify a default action. A value of yes will cause
2927 the action to be carried out automatically as if you had answered yes to
2928 the question. Similarly, a value of no will cause the the action to be
2929 carried out as if you had answered ``no.'' A value of ask-yes will cause a
2930 prompt with a default answer of ``yes'' and ask-no will provide a default
2933 Prefixing a variable with ``no'' will unset it. Example: set noaskbcc .
2935 For boolean variables, you may optionally prefix the variable name with
2936 inv to toggle the value (on or off). This is useful when writing macros.
2937 Example: set invsmart_wrap.
2939 The toggle command automatically prepends the inv prefix to all specified
2942 The unset command automatically prepends the no prefix to all specified
2945 Using the enter-command function in the index menu, you can query the
2946 value of a variable by prefixing the name of the variable with a question
2951 The question mark is actually only required for boolean and quadoption
2954 The reset command resets all given variables to the compile time defaults
2955 (hopefully mentioned in this manual). If you use the command set and
2956 prefix the variable with ``&'' this has the same behavior as the reset
2959 With the reset command there exists the special variable ``all'', which
2960 allows you to reset all variables to their system defaults.
2962 29. Reading initialization commands from another file
2964 Usage: source filename [ filename ... ]
2966 This command allows the inclusion of initialization commands from other
2967 files. For example, I place all of my aliases in ˜/.mail_aliases so that
2968 I can make my ˜/.muttrc readable and keep my aliases private.
2970 If the filename begins with a tilde (``˜''), it will be expanded to the
2971 path of your home directory.
2973 If the filename ends with a vertical bar (|), then filename is considered
2974 to be an executable program from which to read input (eg. source
2979 Usage: unhook [ * | hook-type ]
2981 This command permits you to flush hooks you have previously defined. You
2982 can either remove all hooks by giving the ``*'' character as an argument,
2983 or you can remove all hooks of a specific type by saying something like
2988 31.1. Character Sets
2990 As users may run mutt-ng on different systems, the configuration must be
2991 maintained because it's likely that people want to use the setup
2992 everywhere they use mutt-ng. And mutt-ng tries to help where it can.
2994 To not produce conflicts with different character sets, mutt-ng allows
2995 users to specify in which character set their configuration files are
2996 encoded. Please note that while reading the configuration files, this is
2997 only respected after the corresponding declaration appears. It's advised
2998 to put the following at the very beginning of a users muttngrc:
3000 set config_charset = "..."
3002 and replacing the dots with the actual character set. To avoid problems
3003 while maintaining the setup, vim user's may want to use modelines as show
3006 # vim:fileencoding=...:
3008 while, again, replacing the dots with the appropriate name. This tells vim
3009 as which character set to read and save the file.
3011 31.2. Modularization
3013 ``Modularization'' means to divide the setup into several files while
3014 sorting the options or commands by topic. Especially for longer setups
3015 (e.g. with many hooks), this helps maintaining it and solving trouble.
3017 When using separation, setups may be, as a whole or in fractions, shared
3018 over different systems.
3020 31.3. Conditional parts
3022 When using a configuration on different systems, the user may not always
3023 have influence on how mutt-ng is installed and which features it includes.
3025 To solve this, mutt-ng contain a feature based on the ``ifdef'' patch
3026 written for mutt. Its basic syntax is:
3028 ifdef <item> <command>
3029 ifndef <item> <command>
3031 ...whereby <item> can be one of:
3041 All available functions, variables and menus are documented elsewhere in
3042 this manual but ``features'' is specific to these two commands. To test
3043 for one, prefix one of the following keywords with feature_: ncurses,
3044 slang, iconv, idn, dotlock, standalone, pop, nntp, imap, ssl, gnutls,
3045 sasl, sasl2, libesmtp, compressed, color, classic_pgp, classic_smime,
3048 As an example, one can use the following in ˜/.muttngrc:
3050 ifdef feature_imap 'source ~/.mutt-ng/setup-imap'
3051 ifdef feature_pop 'source ~/.mutt-ng/setup-pop'
3052 ifdef feature_nntp 'source ~/.mutt-ng/setup-nntp'
3054 ...to only source ˜/.mutt-ng/setup-imap if IMAP support is built in, only
3055 source ˜/.mutt-ng/setup-pop if POP support is built in and only source
3056 ˜/.mutt-ng/setup-nntp if NNTP support is built in.
3058 An example for testing for variable names can be used if users use
3059 different revisions of mutt-ng whereby the older one may not have a
3060 certain variable. To test for the availability of imap-mail-check , use:
3062 ifdef imap_mail_check 'set imap_mail_check = 300'
3064 Provided for completeness is the test for menu names. To set
3065 pager-index-lines only if the pager menu is available, use:
3067 ifdef pager 'set pager_index_lines = 10'
3069 For completeness, too, the opposite of ifdef is provided: ifndef which
3070 only executes the command if the test fails. For example, the following
3071 two examples are equivalent:
3073 ifdef feature_ncurses 'source ~/.mutt-ng/setup-ncurses'
3074 ifndef feature_ncurses 'source ~/.mutt-ng/setup-slang'
3078 ifdef feature_slang 'source ~/.mutt-ng/setup-slang'
3079 ifndef feature_slang 'source ~/.mutt-ng/setup-ncurses'
3081 32. Obsolete Variables
3083 In the process of ensuring and creating more consistency, many variables
3084 have been renamed and some of the old names were already removed. Please
3085 see sect-obsolete for a complete list.
3087 Chapter 4. Advanced Usage
3091 1. Regular Expressions
3095 2.1. Complex Patterns
3097 2.2. Patterns and Dates
3103 3.2. Conditional Expansion
3105 3.3. Modifications and Padding
3111 5.1. Message Matching in Hooks
3113 6. Using the sidebar
3115 7. External Address Queries
3119 9. Mailbox Shortcuts
3121 10. Handling Mailing Lists
3125 11.1. Linking threads
3127 11.2. Breaking threads
3129 12. Delivery Status Notification (DSN) Support
3131 13. POP3 Support (OPTIONAL)
3133 14. IMAP Support (OPTIONAL)
3135 14.1. The Folder Browser
3137 14.2. Authentication
3139 15. NNTP Support (OPTIONAL)
3141 15.1. Again: Scoring
3143 16. SMTP Support (OPTIONAL)
3145 17. Managing multiple IMAP/POP/NNTP accounts (OPTIONAL)
3147 18. Start a WWW Browser on URLs (EXTERNAL)
3149 19. Compressed folders Support (OPTIONAL)
3151 19.1. Open a compressed mailbox for reading
3153 19.2. Write a compressed mailbox
3155 19.3. Append a message to a compressed mailbox
3157 19.4. Encrypted folders
3159 1. Regular Expressions
3161 All string patterns in Mutt-ng including those in more complex patterns
3162 must be specified using regular expressions (regexp) in the ``POSIX
3163 extended'' syntax (which is more or less the syntax used by egrep and GNU
3164 awk). For your convenience, we have included below a brief description of
3167 The search is case sensitive if the pattern contains at least one upper
3168 case letter, and case insensitive otherwise. Note that ``\'' must be
3169 quoted if used for a regular expression in an initialization command:
3172 A regular expression is a pattern that describes a set of strings. Regular
3173 expressions are constructed analogously to arithmetic expressions, by
3174 using various operators to combine smaller expressions.
3176 Note that the regular expression can be enclosed/delimited by either " or
3177 ' which is useful if the regular expression includes a white-space
3178 character. See muttrc-syntax for more information on " and ' delimiter
3179 processing. To match a literal " or ' you must preface it with \
3182 The fundamental building blocks are the regular expressions that match a
3183 single character. Most characters, including all letters and digits, are
3184 regular expressions that match themselves. Any metacharacter with special
3185 meaning may be quoted by preceding it with a backslash.
3187 The period ``.'' matches any single character. The caret ``^'' andthe
3188 dollar sign ``$'' are metacharacters that respectively match the empty
3189 string at the beginning and end of a line.
3191 A list of characters enclosed by ``['' and ``]'' matches any single
3192 character in that list; if the first character of the list is a caret
3193 ``^'' then it matches any character not in the list. For example, the
3194 regular expression [0123456789] matches any single digit. A range of ASCII
3195 characters may be specified by giving the first and last characters,
3196 separated by a hyphen ``-''. Most metacharacters lose their special
3197 meaning inside lists. To include a literal ``]'' place it first in the
3198 list. Similarly, to include a literal ``^'' place it anywhere but first.
3199 Finally, to include a literal hyphen ``-'' place it last.
3201 Certain named classes of characters are predefined. Character classes
3202 consist of ``[:'', a keyword denoting the class, and ``:]''. The following
3203 classes are defined by the POSIX standard:
3207 Alphanumeric characters.
3211 Alphabetic characters.
3215 Space or tab characters.
3227 Characters that are both printable and visible. (A space is
3228 printable, but not visible, while an ``a'' is both.)
3232 Lower-case alphabetic characters.
3236 Printable characters (characters that are not control characters.)
3240 Punctuation characters (characters that are not letter, digits,
3241 control characters, or space characters).
3245 Space characters (such as space, tab and formfeed, to name a few).
3249 Upper-case alphabetic characters.
3253 Characters that are hexadecimal digits.
3255 A character class is only valid in a regular expression inside the
3256 brackets of a character list. Note that the brackets in these class names
3257 are part of the symbolic names, and must be included in addition to the
3258 brackets delimiting the bracket list. For example, [[:digit:]] is
3259 equivalent to [0-9].
3261 Two additional special sequences can appear in character lists. These
3262 apply to non-ASCII character sets, which can have single symbols
3263 (calledcollating elements) that are represented with more than one
3264 character, as well as several characters that are equivalent for collating
3265 or sorting purposes:
3269 A collating symbol is a multi-character collating element enclosed
3270 in ``[.'' and ``.]''. For example, if ``ch'' is a collating
3271 element, then [[.ch.]] is a regexp that matches this collating
3272 element, while [ch] is a regexp that matches either ``c'' or
3277 An equivalence class is a locale-specific name for a list of
3278 characters that are equivalent. The name is enclosed in ``[='' and
3279 ``=]''. For example, the name ``e'' might be used to represent all
3280 of ``è'' ``é'' and ``e''. In this case, [[=e=]] is a regexp that
3281 matches any of ``è'', ``é'' and ``e''.
3283 A regular expression matching a single character may be followed by one of
3284 several repetition operators:
3288 The preceding item is optional and matched at most once.
3292 The preceding item will be matched zero or more times.
3296 The preceding item will be matched one or more times.
3300 The preceding item is matched exactly n times.
3304 The preceding item is matched n or more times.
3308 The preceding item is matched at most m times.
3312 The preceding item is matched at least n times, but no more than m
3315 Two regular expressions may be concatenated; the resulting regular
3316 expression matches any string formed by concatenating two substrings that
3317 respectively match the concatenated subexpressions.
3319 Two regular expressions may be joined by the infix operator ``|''; the
3320 resulting regular expression matches any string matching either
3323 Repetition takes precedence over concatenation, which in turn takes
3324 precedence over alternation. A whole subexpression may be enclosed in
3325 parentheses to override these precedence rules.
3327 Note: If you compile Mutt-ng with the GNU rx package, the following
3328 operators may also be used in regular expressions:
3332 Matches the empty string at either the beginning or the end of a
3337 Matches the empty string within a word.
3341 Matches the empty string at the beginning of a word.
3345 Matches the empty string at the end of a word.
3349 Matches any word-constituent character (letter, digit, or
3354 Matches any character that is not word-constituent.
3358 Matches the empty string at the beginning of a buffer (string).
3362 Matches the empty string at the end of a buffer.
3364 Please note however that these operators are not defined by POSIX, so they
3365 may or may not be available in stock libraries on various systems.
3369 Mutt-ng's pattern language provides a simple yet effective way to set up
3370 rules to match messages, e.g. for operations like tagging and scoring. A
3371 pattern consists of one or more sub-pattern, which can be logically
3372 grouped, ORed, and negated. For a complete listing of these patterns,
3373 please refer to table patterns in the Reference chapter.
3375 It must be noted that in this table, EXPR is a regular expression. For
3376 ranges, the forms <[MAX], >>[MIN], [MIN]- and -[MAX] are also possible.
3378 2.1. Complex Patterns
3380 It is possible to combine several sub-patterns to a more complex pattern.
3381 The most simple possibility is to logically AND several patterns by
3382 stringing them together:
3386 The pattern above matches all messages that contain ``SPAM'' in the
3387 subject and are unread.
3389 To logical OR patterns, simply use the | operator. This one especially
3390 useful when using local groups:
3392 ~f ("nion@muttng\.org"|"ak@muttng\.org"|"pdmef@muttng\.org")
3393 (~b mutt-ng|~s Mutt-ng)
3396 The first pattern matches all messages that were sent by one of the
3397 mutt-ng maintainers, while the seconds pattern matches all messages that
3398 contain ``mutt-ng'' in the message body or ``Mutt-ng'' in the subject. The
3399 third pattern matches all messages that do not contain ``@synflood\.at''
3400 in the References: header, i.e. messages that are not an (indirect) reply
3401 to one of my messages. A pattern can be logicall negated using the !
3404 2.2. Patterns and Dates
3406 When using dates in patterns, the dates must be specified in a special
3407 format, i.e. DD/MM/YYYY. If you don't specify month or year, they default
3408 to the current month or year. When using date ranges, and you specify only
3409 the minimum or the maximum, the specified date will be excluded, e.g.
3410 01/06/2005- matches against all messages after Juni 1st, 2005.
3412 It is also possible to use so-called ``error margins'' when specifying
3413 date ranges. You simply specify a date, and then the error margin. This
3414 margin needs to contain the information whether it goes ``forth'' or
3415 ``back'' in time, by using + and -. Then follows a number and a unit, i.e.
3416 y for years, m for months, w for weeks and d for days. If you use the
3417 special * sign, it means that the error margin goes to both``directions''
3424 The first pattern matches all dates between January 1st, 2005 and January
3425 1st 2006. The second pattern matches all dates between October 18th, 2004
3426 and October 4th 2004 (2 weeks before 18/10/2004), while the third pattern
3427 matches all dates 1 day around December 28th, 2004 (i.e. Dec 27th, 28th
3430 Relative dates are also very important, as they make it possible to
3431 specify date ranges between a fixed number of units and the current date.
3432 How this works can be seen in the following example:
3434 ~d >2w # messages older than two weeks
3435 ~d <3d # messages newer than 3 days
3436 ~d =1m # messages that are exactly one month old
3442 The so called Format Strings offer great flexibility when configuring
3443 mutt-ng. In short, they describe what items to print out how in menus and
3446 Basically, they work as this: for different menus and bars, there's a
3447 variable specifying the layout. For every item available, there is a so
3450 For example, when running mutt-ng on different machines or different
3451 versions for testing purposes, it may be interesting to have the following
3452 information always printed on screen when one is in the index:
3454 o the current hostname
3456 o the current mutt-ng version number
3458 The setting for the status bar of the index is controlled via the
3459 status-format variable. For the hostname and version string, there's an
3460 expando for $status_format: %h expands to the hostname and %v to the
3461 version string. When just configuring:
3463 set status_format = "%v on %h: ..."
3465 mutt-ng will replace the sequence %v with the version string and %h with
3466 the host's name. When you are, for example, running mutt-ng version 1.5.9i
3467 on host mailhost, you'll see the following when you're in the index:
3469 Mutt-ng 1.5.9i on mailhost: ...
3471 In the index, there're more useful information one could want to see:
3473 o which mailbox is open
3475 o how man new, flagged or postponed messages
3479 To include the mailbox' name is as easy as:
3481 set status_format = "%v on %h: %B: ...
3483 When the currently opened mailbox is Inbox, this will be expanded to:
3485 Mutt-ng 1.5.9i on mailhost: Inbox: ...
3487 For the number of certain types of messages, one more feature of the
3488 format strings is extremely useful. If there aren't messages of a certain
3489 type, it may not be desired to print just that there aren't any but
3490 instead only print something if there are any.
3492 3.2. Conditional Expansion
3494 To only print the number of messages if there are new messages in the
3495 current mailbox, further extend $status_format to:
3497 set status_format = "%v on %h: %B %?n?%n new? ...
3499 This feature is called nonzero-printing and works as this: some expandos
3500 may be optionally printed nonzero, i.e. a portion of the format string is
3501 only evaluated if the value of the expando is different from zero. The
3504 %?<item>?<string if nonzero>?
3506 which tells mutt-ng to only look at <string if nonzero> if the value of
3507 the %<item%gt; expando is different from zero. In our example, we used n
3508 as the expando to check for and %n new as the optional nonzero string.
3510 But this is not all: this feature only offers one alternative: ``print
3511 something if not zero.'' Mutt-ng does, as you might guess, also provide a
3512 logically complete version: ``if zero, print something and else print
3513 something else.'' This is achieved by the following syntax for those
3514 expandos which may be printed nonzero:
3516 %?<item>?<string if nonzero>&<string if zero>?
3518 Using this we can make mutt-ng to do the following:
3520 o make it print ``n new messages'' whereby n is the count but only if
3523 o and make it print ``no new messages'' if there aren't any
3525 The corresponding configuration is:
3527 set status_format = "%v on %h: %B: %?n?%n new messages&no new messages? ...
3529 This doubles the use of the ``new messages'' string because it'll get
3530 always printed. Thus, it can be shortened to:
3532 set status_format = "%v on %h: %B: %?n?%n&no? new messages ...
3534 As you might see from this rather simple example, one can create very
3535 complex but fancy status messages. Please see the reference chapter for
3536 expandos and those which may be printed nonzero.
3538 3.3. Modifications and Padding
3540 Besides the information given so far, there're even more features of
3543 o When specifying %_<item> instead of just %<item>, mutt-ng will convert
3544 all characters in the expansion of <item> to lowercase.
3546 o When specifying %:<item> instead of just %<item>, mutt-ng will convert
3547 all dots in the expansion of <item> to underscores (_).
3549 Also, there's a feature called Padding supplied by the following two
3550 expandos: %|X and %>X .
3554 When this occurs, mutt-ng will fill the rest of the line with the
3555 character X. In our example, filling the rest of the line with
3556 dashes is done by setting:
3558 set status_format = "%v on %h: %B: %?n?%n&no? new messages %|-"
3562 Since the previous expando stops at the end of line, there must be
3563 a way to fill the gap between two items via the %>X expando: it
3564 puts as many characters X in between two items so that the rest of
3565 the line will be right-justified. For example, to not put the
3566 version string and hostname of our example on the left but on the
3567 right and fill the gap with spaces, one might use (note the space
3570 set status_format = "%B: %?n?%n&no? new messages %> (%v on %h)"
3574 Sometimes it is desirable to perform an operation on a group of messages
3575 all at once rather than one at a time. An example might be to save
3576 messages to a mailing list to a separate folder, or to delete all messages
3577 with a given subject. To tag all messages matching a pattern, use the
3578 tag-pattern function, which is bound to ``shift-T'' by default. Or you can
3579 select individual messages by hand using the ``tag-message'' function,
3580 which is bound to ``t'' by default. See patterns for Mutt-ng's pattern
3583 Once you have tagged the desired messages, you can use the ``tag-prefix''
3584 operator, which is the ``;'' (semicolon) key by default. When the
3585 ``tag-prefix'' operator is used, the next operation will be applied to all
3586 tagged messages if that operation can be used in that manner. If the
3587 auto-tag variable is set, the next operation applies to the tagged