'\" t
.\" -*- nroff -*-
.\"
.\"     Copyright (C) 2015-2024 Richard Russon <rich@flatcap.org>
.\"
.\"     This program is free software; you can redistribute it and/or modify
.\"     it under the terms of the GNU General Public License as published by
.\"     the Free Software Foundation; either version 2 of the License, or
.\"     (at your option) any later version.
.\"
.\"     This program is distributed in the hope that it will be useful,
.\"     but WITHOUT ANY WARRANTY; without even the implied warranty of
.\"     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
.\"     GNU General Public License for more details.
.\"
.\"     You should have received a copy of the GNU General Public License
.\"     along with this program; if not, write to the Free Software
.\"     Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301, USA.
.\"
.de EX
.nf
.ft CW
..
.de EE
.ft
.fi
..
.TH neomuttrc 5 "@MAN_DATE@" Unix "User Manuals"
.\" --------------------------------------------------------------------
.SH NAME
.\" --------------------------------------------------------------------
neomuttrc \- Configuration file for the NeoMutt Mail User Agent (MUA)
.
.\" --------------------------------------------------------------------
.SH DESCRIPTION
.\" --------------------------------------------------------------------
.PP
A NeoMutt configuration file consists of a series of \(lqcommands\(rq. Each
line of the file may contain one or more commands. When multiple commands are
used, they must be separated by a semicolon (\(lq\fB;\fP\(rq).
.
.PP
The hash mark, or pound sign (\(lq\fB#\fP\(rq), is used as a \(lqcomment\(rq
character. You can use it to annotate your initialization file. All text after
the comment character to the end of the line is ignored.
.
.PP
Single quotes (\(lq\fB\(aq\fP\(rq) and double quotes (\(lq\fB\(dq\fP\(rq) can
be used to quote strings which contain spaces or other special characters. The
difference between the two types of quotes is similar to that of many popular
shell programs, namely that a single quote is used to specify a literal string
(one that is not interpreted for shell variables or quoting with a backslash
[see next paragraph]), while double quotes indicate a string which should be
evaluated. For example, backticks are evaluated inside of double quotes, but
not single quotes.
.
.PP
\(lq\fB\(rs\fP\(rq quotes the next character, just as in shells such as Bash
and Zsh. For example, if you want to put quotes (\(lq\fB\(dq\fP\(rq) inside of
a string, you can use \(lq\fB\(rs\fP\(rq to force the next character to be
a literal instead of interpreted character.
.
.PP
\(lq\fB\(rs\(rs\fP\(rq means to insert a literal \(lq\fB\(rs\fP\(rq into the
line. \(lq\fB\(rsn\fP\(rq and \(lq\fB\(rsr\fP\(rq have their usual C meanings
of line feed (LF) and carriage return (CR), respectively.
.
.PP
A \(lq\fB\(rs\fP\(rq at the end of a line can be used to split commands over
multiple lines, provided that the split points don't appear in the middle of
command names.
.
.PP
It is also possible to substitute the output of a Unix command in an
initialization file. This is accomplished by enclosing the command in backticks
(\fB\(ga\fP\fIcommand\fP\fB\(ga\fP).
.
.PP
Unix environment variables can be accessed like the way it is done in shells
like sh and Bash: Prepend the name of the variable by a dollar
(\(lq\fB\(Do\fP\(rq) sign.
.
.\" --------------------------------------------------------------------
.SH COMMANDS
.\" --------------------------------------------------------------------
.SS "\s-1Configuration Commands\s0"
.\" --------------------------------------------------------------------
.PP
The following are the commands understood by NeoMutt:
.
.PP
.nf
\fBaccount-hook\fP \fIregex\fP \fIcommand\fP
.fi
.IP
This hook is executed whenever you access a remote mailbox. Useful to adjust
configuration settings to different IMAP or POP servers.
.
.PP
.nf
\fBalias\fP [ \fB\-group\fP \fIname\fP ... ] \fIkey\fP \fIaddress\fP [\fB,\fP \fIaddress\fP ... ]
\fBunalias\fP [ \fB\-group\fP \fIname\fP ... ] { \fB*\fP | \fIkey\fP ... }
.fi
.IP
\fBalias\fP defines a surrogate \fIkey\fP for the given address(es). Each
\fIaddress\fP will be resolved into either an email address
(user@\:example.com) or a named email address (User Name <user@\:example.com>).
The address may be specified in either format, or in the format
\(lquser@\:example.com (User Name)\(rq.
.IP
\fBNote\fP: If you want to create an alias for more than one address, you
\fBmust\fP separate the addresses with a comma (\(lq\fB,\fP\(rq).
.IP
\fBunalias\fP removes the alias corresponding to the given \fIkey\fP or all
aliases when \(lq\fB*\fP\(rq is used as an argument.
.IP
The optional \fB\-group\fP flag causes the address(es) to be added to or
removed from the \fIname\fPd group.
.
.PP
.nf
\fBalternates\fP [ \fB\-group\fP \fIname\fP ... ] \fIregex\fP [ \fIregex\fP ... ]
\fBunalternates\fP [ \fB\-group\fP \fIname\fP ... ] { \fB*\fP | \fIregex\fP ... }
.fi
.IP
\fBalternates\fP is used to inform NeoMutt about alternate addresses where you
receive mail; you can use regular expressions (\fIregex\fP) to specify
alternate addresses. This affects NeoMutt's idea about messages from you, and
messages addressed to you.
.IP
\fBunalternates\fP can be used to write exceptions to alternates regular
expression. To remove a regular expression from the alternates list, use the
unalternates command with exactly the same \fIregex\fP or use \(lq\fB*\fP\(rq
to remove all entries.
.IP
The optional \fB\-group\fP flag causes all of the subsequent regular expressions
to be added to or removed from the \fIname\fPd group.
.
.PP
.nf
\fBalternative_order\fP \fImime-type\fP[/\fImime-subtype\fP] [ \fImime-type\fP[/\fImime-subtype\fP] ... ]
\fBunalternative_order\fP { \fB*\fP | \fImime-type\fP[/\fImime-subtype\fP] ... }
.fi
.IP
\fBalternative_order\fP command permits you to define an order of preference
that is used by NeoMutt to determine which part of
a \fBmultipart/\:alternative\fP body to display. A \fImime-subtype\fP of
\(lq\fB*\fP\(rq matches any \fBmultipart/\:alternative\fP subtype, as does an
empty \fImime-subtype\fP.
.IP
\fBunalternative_order\fP removes entries from the ordered list or deletes the
entire list when \(lq\fB*\fP\(rq is used as an argument.
.
.PP
.nf
\fBattachments\fP { \fB+\fP | \fB\-\fP }\fIdisposition\fP \fImime-type\fP [ \fImime-type\fP ... ]
\fBunattachments\fP { \fB+\fP | \fB\-\fP }\fIdisposition\fP \fImime-type\fP [ \fImime-type\fP ... ]
\fBattachments\fP \fB?\fP
\fBunattachments\fP \fB*\fP
.fi
.IP
You can make your message index display the number of qualifying attachments in
each message, or search for messages by attachment count. You also can
configure what kinds of attachments qualify for this feature with the
\fBattachments\fP and \fBunattachments\fP commands.
.IP
\fIdisposition\fP is the attachment's Content-Disposition type \(em either
\fBinline\fP or \fBattachment\fP. You can abbreviate this to \fBI\fP or
\fBA\fP.
.IP
Disposition is prefixed by either a \fB+\fP symbol or a \fB-\fP symbol. If it's
a \fB+\fP, you're saying that you want to allow this disposition and MIME type
to qualify. If it's a \fB-\fP, you're saying that this disposition and MIME
type is an exception to previous \fB+\fP rules.
.IP
\fImime-type\fP is the MIME type of the attachment you want the command to
affect. A MIME type is always of the format \fBmajor/minor\fP. The major part
of \fImime-type\fP must be literal text (or the special token \(lq\fB*\fP\(rq,
but the minor part may be a regular expression. Therefore, \(lq\fB*/.*\fP\(rq
matches any MIME type.
.IP
Note that the first MIME part is treated slightly differently: It is almost
always the message text.  Thus, it is not counted as an attachment if its
disposition is \fBinline\fP and it is not a \fBmultipart/*\fP or
\fBmessage/*\fP MIME-type.
.IP
Entering the command \(lq\fBattachments ?\fP\(rq as a command will list your
current settings in neomuttrc format, so that it can be pasted elsewhere.
.IP
Entering the command \(lq\fBunattachments *\fP\(rq as a command will Clear all
attachment settings.
.
.PP
.nf
\fBauto_view\fP \fImime-type\fP[\fB/\fP\fImime-subtype\fP] [ \fImime-type\fP[\fB/\fP\fImime-subtype\fP] ... ]
\fBunauto_view\fP { \fB*\fP | \fImime-type\fP[\fB/\fP\fImime-subtype\fP] ... }
.fi
.IP
This commands permits you to specify that NeoMutt should automatically convert
the given \fImime-type\fPs to text/plain when displaying messages. For this to work,
there must be a
.BR mailcap (5)
entry for the given \fImime-type\fP with the \fBcopiousoutput\fP option set.
A \fImime-subtype\fP of \(lq\fB*\fP\(rq matches any
\fBmultipart/\:alternative\fP subtype, as does an empty \fImime-subtype\fP.
.
.PP
.nf
\fBbind\fP \fImap\fP[\fB,\fP\fImap\fP ... ] \fIkey\fP \fIfunction\fP
\fBunbind\fP { \fB*\fP | \fImap\fP | [\fB,\fP\fImap\fP...]} [ \fIkey\fP ]
.fi
.IP
This command allows you to change the default or define additional key bindings
(operation invoked when pressing a key).
.IP
\fImap\fP specifies in which menu the binding belongs. Multiple \fImap\fPs may
be specified by separating them with commas (no additional whitespace is
allowed). The currently defined \fImap\fPs are:
.BR alias ", " attach ", " browser ", " compose ", " editor ", " generic ", "
.BR index ", " mix ", " pager ", " pgp ", " postpone ", " query " and " smime "."
.IP
\fIkey\fP is the key (or key sequence) you wish to bind, e.g.
\(lq\fB\(rsCa\fP\(rq for control-A. In addition, \fIkey\fP may be specified as
a three digit octal number prefixed with a \(lq\fB\(rs\fP\(rq or as a symbolic
name. The \fB<what-key>\fP function can be used to explore keycode and
symbolic names for the keys on your keyboard.
.IP
\fIfunction\fP specifies which action to take when key is pressed. Note that
the function name is to be specified without angle brackets.
.IP
Missing key sequence in \fBunbind\fP command means unbind all bindings in menus given in \fImap\fP .
.IP
For more information on keys and functions, please consult the NeoMutt manual.
.
.PP
.nf
\fBcharset-hook\fP \fIalias\fP \fIcharset\fP
\fBiconv-hook\fP \fIcharset\fP \fIlocal-charset\fP
.fi
.IP
\fBcharset-hook\fP defines an \fIalias\fP for a character set. This is useful to
properly display messages which are tagged with a character set name not known
to NeoMutt.
.IP
\fBiconv-hook\fP defines a system-specific name for a character set. This is
useful when your system's
.BR iconv (3)
implementation does not understand MIME character set names (such as
\fBiso-8859-1\fP), but instead insists on being fed with
implementation-specific character set names (such as \fB8859-1\fP). In this
specific case, you'd put \(lq\fBiconv-hook\fP\~iso-8859-1\~8859-1\(rq into your
configuration file.
.
.PP
.nf
\fBcolor\fP \fIobject\fP [ \fIattribute\fP ... ] \fIforeground\fP \fIbackground\fP
\fBcolor\fP { header | body } [ \fIattribute\fP ... ] \fIforeground\fP \fIbackground\fP \fIregex\fP
\fBcolor\fP status \fIforeground\fP \fIbackground\fP [\fIregex\fP [ \fInum\fP ]]
\fBcolor\fP index-object [ \fIattribute\fP ... ] \fIforeground\fP \fIbackground\fP \fIpattern\fP
\fBcolor\fP \fIcompose-object\fP \fIforeground\fP \fIbackground\fP
\fBcolor\fP \fIcompose-object\fP [ \fIattribute\fP ... ] \fIforeground\fP \fIbackground\fP
\fBuncolor\fP { index-object | header | body } { \fB*\fP | \fIpattern\fP ... }
.fi
.IP
If your terminal supports color, these commands can be used to assign
\fIforeground\fP/\:\fIbackground\fP combinations to certain \fIobject\fPs. The
currently defined \fIobject\fPs are:
.BR attach_\:headers ", "
.BR attachment ", "
.BR body ", "
.BR bold ", "
.BR error ", "
.BR hdrdefault ", "
.BR header ", "
.BR index ", "
.BR index_\:author ", "
.BR index_\:collapsed ", "
.BR index_\:date ", "
.BR index_\:flags ", "
.BR index_\:label ", "
.BR index_\:number ", "
.BR index_\:size ", "
.BR index_\:subject ", "
.BR index_\:tag ", "
.BR index_\:tags ", "
.BR indicator ", "
.BR markers ", "
.BR message ", "
.BR normal ", "
.BR progress ", "
.BR prompt ", "
.BR quoted ", "
.BR quoted\fIN\fP ", "
.BR search ", "
.BR signature ", "
.BR status ", "
.BR stripe_even ", "
.BR stripe_odd ","
.BR tilde ", "
.BR tree ", "
.BR underline "."
.IP
If the sidebar is enabled the following \fIobject\fPs are also valid:
.BR sidebar_\:background ", "
.BR sidebar_\:divider ", "
.BR sidebar_\:flagged ", "
.BR sidebar_\:highlight ", "
.BR sidebar_\:indicator ", "
.BR sidebar_\:new ", "
.BR sidebar_\:ordinary ", "
.BR sidebar_\:spool_file "."
.IP
The \fBbody\fP and \fBheader\fP objects allow you to restrict the colorization
to a regular expression. The \fBindex-object\fP permits you to select colored
messages by pattern.
.IP
The \fBheader\fP and \fBbody\fP match \fIregex\fP in the header/body of
a message, \fBindex-object\fP can match \fIpattern\fP in the message index.
Note that IMAP server-side searches (=b, =B, =h) are not supported for color
index patterns.
.IP
The \fBstatus\fP object optionally takes an regex and a match number.  If the
regex is given, only the matching parts are colored.  If additionally the match
number is given, only that sub-match of the regex is colored.
.IP
Valid compose-objects include
.BR compose_header ", " compose_security_encrypt ", " compose_security_sign ", "
.BR compose_security_both ", " compose_security_none .
.IP
Valid colors include:
.BR default ", "
.BR black ", "
.BR red ", "
.BR green ", "
.BR yellow ", "
.BR blue ", "
.BR magenta ", "
.BR cyan ", "
.BR white ", "
.BR #\fIRRGGBB\fP ", "
.BR color\fIN\fP "."
.IP
Valid attributes include:
.BR none ", " bold ", " underline ", "
.BR reverse ", and " standout .
.IP
The \fBuncolor\fP command can be applied to the index, header and body objects
only. It removes entries from the list. You must specify the same \fIpattern\fP
specified in the \fBcolor\fP command for it to be removed. The pattern
\(lq\fB*\fP\(rq is a special token which means to clear the color list of all
entries.
.IP
For further information on colorization, please consult the NeoMutt manual.
.
.PP
.nf
\fBcrypt-hook\fP \fIregex\fP \fIkeyid\fP
.fi
.IP
The crypt-hook command provides a method by which you can specify the ID of the
public key to be used when encrypting messages to a certain recipient. The
meaning of \fIkeyid\fP is to be taken broadly: This can be a different email
address, a numerical \fIkeyid\fP, or even just an arbitrary search string. You
may use multiple \fBcrypt-hook\fPs with the same \fIregex\fP; multiple matching
\fBcrypt-hook\fPs result in the use of multiple \fIkeyid\fPs for a recipient.
.TP
\fBindex-format-hook\fP \fIname\fP [\fB!\fP]\fIpattern\fP \fIformat-string\fP
This command is used to inject format strings dynamically into
$index_format based on pattern matching against the current message.
.IP
The $index_format expando \fI%@name@\fP specifies a placeholder for
the injection. Index-format-hooks with the same \fIname\fP are matched
using \fIpattern\fP against the current message. Matching is done in
the order specified in the .neomuttrc, with the first match being
used. The hook's \fIformat-string\fP is then substituted and evaluated.
.
.PP
.nf
\fBexec\fP \fIfunction\fP [ \fIfunction\fP ... ]
.fi
.IP
This command can be used to execute any \fIfunction\fP. Functions are listed in
the function reference. \(lq\fBexec\fP \fIfunction\fP\(rq is equivalent to
\(lq\fBpush\fP <\fIfunction\fP>\(rq.
.
.PP
.nf
\fBfcc-save-hook\fP \fIpattern\fP \fImailbox\fP
\fBfcc-hook\fP \fIpattern\fP \fImailbox\fP
\fBsave-hook\fP \fIpattern\fP \fImailbox\fP
.fi
.IP
\fBfcc-save-hook\fP is a shortcut, equivalent to doing both a \fBfcc-hook\fP
and a \fBsave-hook\fP with its arguments, including %-expansion on
\fImailbox\fP according to $index_format.
.IP
\fBfcc-hook\fP is used to save outgoing mail in a mailbox other than $record.
NeoMutt searches the initial list of message recipients for the first matching
\fIpattern\fP and uses \fImailbox\fP as the default \(lqFcc:\(rq mailbox. If no
match is found the message will be saved to $record mailbox.
.IP
\fBsave-hook\fP is used to override the default mailbox used when saving
messages. \fImailbox\fP will be used as the default if the message matches
\fIpattern\fP.
.IP
To provide more flexibility and good defaults, NeoMutt applies the expandos of
$index_format to \fImailbox\fP after it was expanded. See \fIPATTERNS\fP
section below or consult section \(lq\fBMessage Matching in Hooks\fP\(rq in
NeoMutt manual for information on the exact format of \fIpattern\fP.
.
.PP
.nf
\fBfolder-hook\fP [\fI-noregex\fP] \fIregex\fP \fIcommand\fP
.fi
.IP
When NeoMutt enters a folder which matches \fIregex\fP (or, when \fIregex\fP is
preceded by an exclamation mark, does not match \fIregex\fP), the given
\fIcommand\fP is executed. The \fI-noregex\fP switch controls whether \fIregex\fP
is matches as simple string equality or full regex match.
.IP
When several \fBfolder-hook\fPs match a given mail folder, they are executed in
the order given in the configuration file.
.
.PP
.nf
\fBgroup\fP [ \fB\-group\fP \fIname\fP ... ] { \fB\-rx\fP \fIregex\fP ... | \fB\-addr\fP \fIaddress\fP ... }
\fBungroup\fP [ \fB\-group\fP \fIname\fP ... ] { \fB*\fP | \fB\-rx\fP \fIregex\fP ... | \fB\-addr\fP \fIaddress\fP ... }
.fi
.IP
\fBgroup\fP is used to directly add either addresses or regular expressions to
the specified group or groups. The different categories of arguments to the
\fBgroup\fP command can be in any order. The flags \fB\-rx\fP and \fB\-addr\fP
specify what the following strings (that cannot begin with a hyphen) should be
interpreted as: either a regular expression or an email address, respectively.
.IP
\fBungroup\fP is used to remove addresses or regular expressions from the
specified group or groups. The syntax is similar to the \fBgroup\fP command,
however the special character \(lq\fB*\fP\(rq can be used to empty a group of
all of its contents.
.IP
These address groups can also be created implicitly by the \fBalias\fP,
\fBlists\fP, \fBsubscribe\fP and \fBalternates\fP commands by specifying the
optional \fB\-group\fP option.
.IP
Once defined, these address groups can be used in patterns to search for and
limit the display to messages matching a group.
.
.PP
.nf
\fBhdr_order\fP \fIheader\fP [ \fIheader\fP ... ]
\fBunhdr_order\fP { \fB*\fP | \fIheader\fP ... }
.fi
.IP
With the \fBhdr_order\fP command you can specify an order in which NeoMutt will
attempt to present these headers to you when viewing messages.
.IP
\(lq\fBunhdr_order\~*\fP\(rq will clear all previous headers from the order
list, thus removing the header order effects set by the system-wide startup
file.
.
.PP
.nf
\fBifdef\fP \fIsymbol\fP "\fIconfig-command\fP [ \fIargs\fP ... ]"
\fBifndef\fP \fIsymbol\fP "\fIconfig-command\fP [ \fIargs\fP ... ]"
\fBfinish\fP
.fi
.IP
The \fBifdef\fP feature introduces three new commands to NeoMutt and allow you
to share one config file between versions of NeoMutt that may have different
features compiled in.
.IP
.
.TS
box;
lb|lb
l|l .
Example Symbol	Description
_
\fCsidebar_format\fP	Config variable
\fCstatus-color\fP, \fCimap\fP	Compiled-in feature
\fCpgp-menu\fP, \fCgroup-related\fP	Function
\fCindex-format-hook\fP, \fCtag-transforms\fP	Command
\fCmy_var\fP	My variable
\fClmdb\fP, \fCtokyocabinet\fP	Store (database)
\fCHOME\fP, \fCCOLUMNS\fP	Environment variable
.TE
.
.IP
A list of compile-time \fIsymbol\fPs can be seen in
the output of the command \(lq\fBneomutt\~\-v\fP\(rq (in the
\(lq\fBCompile options\fP\(rq section).
.IP
\fBfinish\fP is particularly useful when combined with \fBifndef\fP.
.
.PP
.nf
\fBignore\fP \fIstring\fP [ \fIstring\fP ... ]
\fBunignore\fP { \fB*\fP | \fIstring\fP ... }
.fi
.IP
The \fBignore\fP command allows you to specify header fields which you don't
normally want to see in the pager. You do not need to specify the full header
field name. For example, \(lq\fBignore\fP content-\(rq will ignore all header
fields that begin with the string \(lqcontent-\(rq, \(lq\fBignore\fP\~*\(rq
will ignore all headers.
.IP
To remove a previously added token from the list, use the \fBunignore\fP
command. For example, \(lq\fBunignore\fP\~*\(rq will remove all tokens from the
ignore list.
.
.PP
.nf
\fBlists\fP [ \fB\-group\fP \fIname\fP ... ] \fIregex\fP [ \fIregex\fP ... ]
\fBunlists\fP [ \fB\-group\fP \fIname\fP ... ] { \fB*\fP | \fIregex\fP ... }
\fBsubscribe\fP [ \fB\-group\fP \fIname\fP ... ] \fIregex\fP [ \fIregex\fP ... ]
\fBunsubscribe\fP [ \fB\-group\fP \fIname\fP ... ] { \fB*\fP | \fIregex\fP ... }
.fi
.IP
NeoMutt maintains two lists of mailing list address regular expressions, a list
of subscribed mailing lists, and a list of known mailing lists. All subscribed
mailing lists are known.
.IP
The \fBlists\fP command adds a mailing list address to the list of known
mailing lists. The \fBunlists\fP command removes a mailing list from the lists
of known and subscribed mailing lists.
.IP
The \fBsubscribe\fP command adds a mailing list to the lists of known and
subscribed mailing lists. The \fBunsubscribe\fP command removes it from the
list of subscribed mailing lists.
.IP
The \fB\-group\fP flag adds all of the subsequent regular expressions to the
\fIname\fPd group.
.
.PP
.nf
\fBmacro\fP \fImenu\fP[\fB,\fP\fImenu\fP ... ] \fIkey\fP \fIsequence\fP [ \fIdescription\fP ]
\fBunmacro\fP { \fB*\fP | \fImenu\fP | [\fB,\fP\fImenu\fP...]} [ \fIkey\fP ]
.fi
.IP
This command binds the given \fIsequence\fP of keys to the given \fIkey\fP in
the given \fImenu\fP or menus. For currently defined menus, see \fBbind\fP
command above. To specify multiple menus, put only a comma between the menus.
.IP
Optionally you can specify a descriptive text after \fIsequence\fP, which is
shown in the help screens if they contain a \fIdescription\fP.
.IP
Missing key sequence in \fBunmacro\fP command means unmacro all macros in menus given in \fImenu\fP.
.
.PP
.nf
\fBmailboxes\fP [[\fB-label\fP \fIlabel\fP] | \fB-nolabel\fP]
           [[\fB-notify\fP | \fB-nonotify\fP]
           [\fB-poll\fP | \fB-nopoll\fP]
           \fImailbox\fP] [ ... ]
\fBnamed-mailboxes\fP \fIlabel\fP \fImailbox\fP [\fIlabel\fP \fImailbox\fP ... ]
\fBunmailboxes\fP { \fB*\fP | \fImailbox\fP ... }
.fi
.IP
The \fBmailboxes\fP specifies folders which can receive mail and which will be
checked for new messages. When changing folders, pressing space will cycle
through folders with new mail.
.IP
The \fBnamed-mailboxes\fP is an alternative to \fBmailboxes\fP \fB-label\fP
\fIlabel\fP.  NeoMutt can be configured to display the label instead of the
mailbox path.
.IP
The \fBunmailboxes\fP command is used to remove a file name from the list of
folders which can receive mail. If \(lq\fB*\fP\(rq is specified as the file
name, the list is emptied.
.
.PP
.nf
\fBmailto_allow\fP { \fB*\fP | \fIheader-field\fP ... }
\fBunmailto_allow\fP { \fB*\fP | \fIheader-field\fP ... }
.fi
.IP
As a security measure, NeoMutt will only add user-approved \fIheader-field\fPs
from a \fImailto:\fP URL. This is necessary since NeoMutt will handle certain
\fIheader-field\fPs, such as \fBAttach\fP, in a special way. The
\fBmailto_allow\fP and \fBunmailto_allow\fP commands allow the user to modify
the list of approved headers.
.IP
NeoMutt initializes the default list to contain only the \fBSubject\fP and
\fBBody\fP \fIheader-field\fPs, which are the only requirement specified by the
\fImailto:\fP specification in RFC2368, and the \fBCc\fP, \fBIn-Reply-To\fP,
\fBReferences\fP headers to aid with replies to mailing lists.
.TP
\fBecho\fP \fImessage\fP
Prints \fImessage\fP to the message window. After printing the
message, echo will pause for the number of seconds specified by
$sleep_time.
.TP
\fBcd\fP \fIdirectory\fP
Changes the current working directory.
.
.PP
.nf
\fBmbox-hook\fP [\fI-noregex\fP] \fIregex\fP \fImailbox\fP
.fi
.IP
When NeoMutt changes to a mail folder which matches \fIregex\fP, \fImailbox\fP
will be used as the \(lqmbox\(rq folder, i.e. read messages will be moved to
that folder when the mail folder is left. The \fI-noregex\fP switch controls
whether \fIregex\fP is matches as simple string equality or full regex match.

.IP
Note that execution of \fBmbox-hook\fPs is dependent on the $move configuration
variable. If set to \(lqno\(rq (the default), \fBmbox-hook\fPs will not be
executed.
.IP
The first matching \fBmbox-hook\fP applies.
.
.PP
.nf
\fBmessage-hook\fP \fIpattern\fP \fIcommand\fP
.fi
.IP
Before NeoMutt displays (or formats for replying or forwarding) a message which
matches the given \fIpattern\fP (or, when it is preceded by an exclamation
mark, does not match the \fIpattern\fP), the given \fIcommand\fP is executed.
When multiple \fBmessage-hook\fPs match, they are executed in the order in
which they occur in the configuration file.
.
.PP
.nf
\fBmime_lookup\fP \fImime-type\fP[\fB/\fP\fImime-subtype\fP] [ \fImime-type\fP[\fB/\fP\fImime-subtype\fP] ... ]
\fBunmime_lookup\fP { \fB*\fP | \fImime-type\fP[\fB/\fP\fImime-subtype\fP] ... }
.fi
.IP
This command permits you to define a list of \(lqdata\(rq MIME content types
for which NeoMutt will try to determine the actual file type from the file
name, and not use a
.BR mailcap (5)
entry given for the original MIME type. For instance, you may add the
\fBapplication/\:octet-stream\fP MIME type to this list.
.IP
In addition, the \fBunmime_lookup\fP command may be used to disable this
feature for any particular MIME type if it had been set, for example in
a global \fIneomuttrc\fP.
.
.PP
.nf
\fBmono\fP \fIobject\fP \fIattribute\fP
\fBmono\fP { header | body } \fIattribute\fP \fIregex\fP
\fBmono\fP index-object \fIattribute\fP \fIpattern\fP
\fBunmono\fP { index-object | header | body } { \fB*\fP | \fIpattern\fP ... }
.fi
.IP
For terminals which don't support color, you can still assign
attributes to objects.
.
.PP
.nf
\fBmy_hdr\fP \fIstring\fP
\fBunmy_hdr\fP { \fB*\fP | \fIfield\fP ... }
.fi
.IP
Using \fBmy_hdr\fP, you can define headers which will be added to the messages
you compose. \fBunmy_hdr\fP will remove the given user-defined headers.
.
.PP
.nf
\fBopen-hook\fP \fIregex\fP "\fIshell-command\fP"
\fBclose-hook\fP \fIregex\fP "\fIshell-command\fP"
\fBappend-hook\fP \fIregex\fP "\fIshell-command\fP"
.fi
.IP
These commands provide a way to handle compressed folders. The given
\fIregex\fP specifies which folders are taken as compressed (e.g.
\(dq\fB\(rs.gz$\fP\(dq). The commands tell NeoMutt how to uncompress a folder
(\fBopen-hook\fP), compress a folder (\fBclose-hook\fP) or append a compressed
mail to a compressed folder (\fBappend-hook\fP). The \fIshell-command\fP is a
.BR printf (3)
like format string and must contain two placeholders for from (\fB%f\fP) and to
(\fB%t\fP) filenames which should be placed inside single-quotes to prevent
unintended shell expansions. Examples:
.RS
.IP
.EX
.BR append-hook " \(aq" "\(rs.gz$" "\(aq \(dqgzip \-\-stdout \(aq" "%t" "\(aq >> \(aq" "%f" "\(aq\(dq"
.BR close-hook " \(aq" "\(rs.gz$" "\(aq \(dqgzip \-\-stdout \(aq" "%t" "\(aq > \(aq" "%f" "\(aq\(dq"
.BR open-hook " \(aq" "\(rs.gz$" "\(aq \(dqgzip \-\-stdout \-\-decompress \(aq" "%f" "\(aq > \(aq" "%t" "\(aq\(dq"
.EE
.RE
.
.PP
.nf
\fBpush\fP \fIstring\fP
.fi
.IP
This command adds the named \fIstring\fP to the beginning of the keyboard
buffer. The string may contain control characters, key names and function names
like the sequence string in the \fBmacro\fP command. You may use it to
automatically run a sequence of commands at startup, or when entering certain
folders.
.IP
For using functions, it's important to use angle brackets (\(lq<\(rq and
\(lq>\(rq) to make NeoMutt recognize the input as a function name. Otherwise
it will simulate individual just keystrokes.
.
.
.PP
.nf
\fBreply-hook\fP \fIpattern\fP \fIcommand\fP
\fBsend-hook\fP \fIpattern\fP \fIcommand\fP
\fBsend2-hook\fP \fIpattern\fP \fIcommand\fP
.fi
.IP
These commands can be used to execute arbitrary configuration commands based
upon recipients of the message. \fIpattern\fP is used to match the message, see
section \(lq\fBMessage Matching in Hooks\fP\(rq in manual for details.
\fIcommand\fP is executed when \fIpattern\fP matches.
.IP
\fBreply-hook\fP is matched against the message you are replying to, instead of
the message you are sending. \fBsend-hook\fP is matched against all messages,
both new and replies. \fBNote\fP, \fBreply-hook\fPs are matched before the
\fBsend-hook\fP, regardless of the order specified in the user's configuration
file.
.IP
\fBsend2-hook\fP is matched every time a message is changed, either by editing
it, or by using the compose menu to change its recipients or subject.
\fBsend2-hook\fP is executed after \fBsend-hook\fP, and can, e.g., be used to
set parameters such as the $sendmail variable depending on the message's sender
address. \fBNote\fP, \fBsend-hook\fPs are only executed once after getting the
initial list of recipients.
.
.PP
.nf
\fBscore\fP \fIpattern\fP \fIvalue\fP
\fBunscore\fP { \fB*\fP | \fIpattern\fP ... }
.fi
.IP
The \fBscore\fP command adds \fIvalue\fP to a message's score if \fIpattern\fP
matches it. \fIpattern\fP is a string in the format described in the
\fIPATTERNS\fP section below. \fIvalue\fP is a positive or negative integer.
A message's final score is the sum total of all matching score entries.
.IP
The \fBunscore\fP command removes score entries from the list. You must specify
the same \fIpattern\fP specified in the \fBscore\fP command for it to be
removed. The pattern \(lq\fB*\fP\(rq is a special token which means to clear
the list of all score entries.
.
.PP
.nf
\fBset\fP { [ \fBno\fP | \fBinv\fP | \fB&\fP | \fB?\fP ]\fIvariable\fP } [ ... ]
\fBset\fP { \fIvariable\fP=\fIvalue\fP | \fIvariable+=increment\fP | \fIvariable-=decrement\fP } [ ... ]
\fBunset\fP \fIvariable\fP  [ \fIvariable\fP ... ]
\fBreset\fP \fIvariable\fP  [ \fIvariable\fP ... ]
\fBtoggle\fP \fIvariable\fP [ \fIvariable\fP ... ]
\fBset\fP \fIvariable\fP \fB?\fP
.fi
.IP
These commands are used to set and manipulate configuration \fIvariable\fPs.
.IP
NeoMutt knows four basic types of \fIvariable\fPs: boolean, number, string, string
list and quadoption. Boolean \fIvariable\fPs can be \fBset\fP (true), \fBunset\fP
(false), or \fBtoggle\fPd. Number \fIvariable\fPs can be assigned a positive
integer \fIvalue\fP. Value of number \fIvariable\fPs can be incremented "\fB+=\fP"
and decremented "\fB-=\fP". String list \fIvariable\fPs use "\fB+=\fP" for
appending increment to the string list and "\fB-=\fP" for removal decrement from
the string list.
.IP
String \fIvariable\fPs consist of any number of printable characters and must
be enclosed in quotes if they contain spaces or tabs. You may also use the
escape sequences \(lq\fB\(rsn\fP\(rq and \(lq\fB\(rst\fP\(rq for newline and
tab, respectively. Content of a string \fIvariable\fPs can be extended using
"\fB+=\fP"
.IP
Quadoption \fIvariable\fPs are used to control whether or not to be prompted
for certain actions, or to specify a default action. A \fIvalue\fP of \fByes\fP
will cause the action to be carried out automatically as if you had answered
\(lqyes\(rq to the question. Similarly, a \fIvalue\fP of \fBno\fP will cause
the action to be carried out as if you had answered \(lqno\(rq.  A \fIvalue\fP
of \fBask-yes\fP will cause a prompt with a default answer of \(lqyes\(rq and
\fBask-no\fP will provide a default answer of \(lqno\(rq.
.IP
The \fBtoggle\fP command automatically prepends the \(lq\fBinv\fP\(rq prefix to
all specified \fIvariable\fPs. The \fBunset\fP command automatically prepends
the \(lq\fBno\fP\(rq prefix to all specified \fIvariable\fPs. If you use the
command \fBset\fP and prefix the \fIvariable\fP with \(lq\fB&\fP\(rq this has
the same behavior as the \fBreset\fP command.
.IP
The \fBreset\fP command resets all given \fIvariable\fPs to the compile time
defaults. With the \fBreset\fP command there exists the special \fIvariable\fP
\fBall\fP, which allows you to reset all \fIvariable\fPs to their system
defaults.
.IP
Using the <\fBenter-command\fP> function, you can query the \fIvalue\fP of
a \fIvariable\fP by suffixing the name of the \fIvariable\fP with a question
mark: \(dq:\fBset\fP\~allow_8bit\fB?\fP\(dq.
The old prefix query syntax (\(dq:\fBset\fP\~\fB?\fPallow_8bit\(dq) is also
still supported.
.
.PP
.nf
\fBsetenv\fP { \fB?\fP\fIvariable\fP | \fIvariable\fP \fIvalue\fP }
\fBunsetenv\fP \fIvariable\fP
.fi
.IP
You can alter the environment that NeoMutt passes on to its child processes
using the \fBsetenv\fP and \fBunsetenv\fP operators.
.IP
You can also query current environment \fIvalue\fPs by prefixing a
\(lq\fB?\fP\(rq character.
.
.PP
.nf
\fBsidebar_pin\fP \fImailbox\fP [ \fImailbox\fP ...]
\fBsidebar_unpin\fP { \fB*\fP | \fImailbox\fP ... }
.fi
.IP
The \fBsidebar_pin\fP command specifies \fImailbox\fPes that will always
be displayed in the sidebar, even if $sidebar_new_mail_only is set and the
\fImailbox\fP does not contain new mail.
.IP
The \fBsidebar_unpin\fP command is used to remove a \fImailbox\fP from
the list of always displayed \fImailbox\fPes. Use
\(lq\fBsidebar_unpin\~*\fP\(rq to remove all \fImailbox\fPes.
.
.PP
.nf
\fBsource\fP \fIfilename\fP
.fi
.IP
This command allows the inclusion of initialization commands from other files.
If the \fIfilename\fP begins with a tilde (\(lq~\(rq), it will be expanded to
the path of your home directory.
.IP
If the \fIfilename\fP ends with a vertical bar (\(lq|\(rq), then \fIfilename\fP
is considered to be an executable program from which to read input, (e.g.
\(lq\fBsource\fP\~\fI~/\:bin/\:myscript\fP|\(rq).
.IP
If the filename is relative and the command \fBsource\fP is executed from the
context of a configuration file, then the filename is interpreted relative to
the directory of that configuration file.  If the command is executed outside
of a configuration file, e.g. from the prompt, then the filename is interpreted
relative to the current working directory (see \fBcd\fP on how to change the
current working directory at runtime).
.IP
Note: A hook remembers the configuration file it was defined in and sets the
context to that file when executing its commands.  As a result a \fBsource\fP command
inside a hook is executed in the context of the configuration file the hook was
defined in.  Thus relative filenames are interpreted relative to the
configuration file the hook is defined in.
.
.PP
.nf
\fBspam\fP \fIregex\fP \fIformat\fP
\fBnospam\fP { \fB*\fP | \fIregex\fP }
.fi
.IP
NeoMutt has generalized support for external spam-scoring filters. By defining
your spam \fIregex\fPs with the \fBspam\fP and \fBnospam\fP commands, you can
limit, search, and sort your mail based on its spam attributes, as determined
by the external filter. You also can display the spam attributes in your index
display using the %H selector in the $index_format variable. (Tip: try
\(dq%<H?[%H]\~>\(dq to display spam tags only when they are defined for a given
message).
.IP
For further information on spam-scoring filters, please consult the
section \(lq\fBSpam Detection\fP\(rq in the NeoMutt manual.
.
.PP
.nf
\fBsubjectrx\fP \fIregex\fP \fIreplacement\fP
\fBunsubjectrx\fP { \fB*\fP | \fIregex\fP }
.fi
.IP
The \fBsubjectrx\fP command specifies a regular expression which,
if detected in a message subject, causes the subject to be replaced with the
\fIreplacement\fP value. The \fIreplacement\fP is subject to substitutions in
the same way as for the \fBspam\fP command: %L for the text to the left of the
match, %R for text to the right of the match, and %1 for the first subgroup in
the match (etc). If you simply want to erase the match, set it to \(lq%L%R\(rq.
Any number of \fBsubjectrx\fP commands may coexist.
.IP
Note this well: the \fIreplacement\fP value replaces the entire subject, not
just the match!
.IP
\fBunsubjectrx\fP removes a given \fBsubjectrx\fP from the substitution list.
If \(lq\fB*\fP\(rq is used as the argument, all substitutions will be removed.
.
.PP
.nf
\fBsubscribe-to\fP \fIimap-folder-uri\fP
\fBunsubscribe-from\fP \fIimap-folder-uri\fP
.fi
.IP
Tell the IMAP server to subscribe to or unsubscribe from the folder
\fIimap-folder-uri\fP.  The argument must be an IMAP URI,
e.g. \(lq\fBsubscribe-to\fP imaps://mail.example.org/inbox\(rq.
.IP
Subscription is an IMAP protocol feature where the server manages a list of
subscribed folders.  This list can be queried by clients like NeoMutt.
.IP
NeoMutt uses that list in various situations, see $imap_list_subscribed and
$imap_check_subscribed.
.
.PP
.nf
\fBtimeout-hook\fP \fIcommand\fP
\fBstartup-hook\fP \fIcommand\fP
\fBshutdown-hook\fP \fIcommand\fP
.fi
.IP
The \fBGlobal Hooks\fP feature introduces these hooks to NeoMutt. They are
called when global events take place in NeoMutt. \fBstartup-hook\fP and
\fBshutdown-hook\fP are most likely to be useful to users of
.BR notmuch (1).
.IP
\fBtimeout-hook\fP runs a \fIcommand\fP periodically when NeoMutt checks for
new mail. This hook is called every $timeout seconds.
.IP
Before NeoMutt opens the first mailbox when first starting, NeoMutt will run
the \fBstartup-hook\fP for the given \fIcommand\fP.
.IP
Before NeoMutt is about to exit, and before the mailbox is closed, NeoMutt will
run the \fBshutdown-hook\fP for the given \fIcommand\fP.
.
.PP
.nf
\fBunhook\fP { \fB*\fP | \fIhook-type\fP }
.fi
.IP
This command permits you to flush hooks you have previously defined. You can
either remove all hooks by giving the \(lq\fB*\fP\(rq character as an argument,
or you can remove all hooks of a specific \fIhook-type\fP by saying something
like \(lq\fBunhook\fP\~\fIsend-hook\fP\(rq.
.
.\" --------------------------------------------------------------------
.SH PATTERNS
.\" --------------------------------------------------------------------
.SS "\s-1Pattern Modifier\s0"
.\" --------------------------------------------------------------------
.PP
Many of NeoMutt's commands allow you to specify a pattern to match messages
.RB ( limit ", " tag-pattern ", " delete-pattern ", the above mentioned " hook
commands etc.). The table \(lq\fBPattern modifiers\fP\(rq shows several ways to
select messages.
.
.na
.TS
box tab(|);
lb s | lb
l s | lx
.
\0Pattern|Description
_
\0~A|T{
all messages
T}
_
\0=B \fISTRING\fP|T{
messages which contain \fISTRING\fP in the whole message. If IMAP is enabled,
searches for \fISTRING\fP on the server, rather than downloading each message
and searching it locally.
T}
_
\0=b \fISTRING\fP|T{
messages which contain \fISTRING\fP in the message body. If IMAP is enabled,
searches for \fISTRING\fP on the server, rather than downloading each message
and searching it locally.
T}
_
\0~B \fIEXPR\fP|T{
messages which contain \fIEXPR\fP in the whole message
T}
_
\0~b \fIEXPR\fP|T{
messages which contain \fIEXPR\fP in the message body
T}
_
\0%C \fIGROUP\fP|T{
messages either \(lqTo:\(rq, \(lqCc:\(rq or \(lqBcc:\(rq to any member of \fIGROUP\fP
T}
_
\0%c \fIGROUP\fP|T{
messages carbon-copied to any member of \fIGROUP\fP
T}
_
\0~C \fIEXPR\fP|T{
messages either \(lqTo:\(rq, \(lqCc:\(rq or \(lqBcc:\(rq \fIEXPR\fP
T}
_
\0~c \fIEXPR\fP|T{
messages carbon-copied to \fIEXPR\fP
T}
_
\0~D|T{
deleted messages
T}
_
\0~d \fIMIN\fP-\fIMAX\fP|T{
messages with \(lqdate-sent\(rq in a date range
T}
_
\0%e \fIGROUP\fP|T{
messages which contain a member of \fIGROUP\fP in the \(lqSender:\(rq field
T}
_
\0~E|T{
expired messages
T}
_
\0~e \fIEXPR\fP|T{
messages which contain \fIEXPR\fP in the \(lqSender:\(rq field
T}
_
\0%f \fIGROUP\fP|T{
messages originating from any member of \fIGROUP\fP
T}
_
\0~F|T{
flagged messages
T}
_
\0~f \fIEXPR\fP|T{
messages originating from \fIEXPR\fP
T}
_
\0~G|T{
cryptographically encrypted messages
T}
_
\0~g|T{
cryptographically signed messages
T}
_
\0=h \fISTRING\fP|T{
messages which contain \fISTRING\fP in the message header. If IMAP is enabled,
searches for \fISTRING\fP on the server, rather than downloading each message
and searching it locally; \fISTRING\fP must be of the form \(lqHeader:
substring\(rq (see below).
T}
_
\0~H \fIEXPR\fP|T{
messages with spam attribute matching \fIEXPR\fP
T}
_
\0~h \fIEXPR\fP|T{
messages which contain \fIEXPR\fP in the message header
T}
_
\0~i \fIEXPR\fP|T{
messages which match \fIEXPR\fP in the \(lqMessage-ID:\(rq field
T}
_
\0~I \fIQUERY\fP|T{
messages whose \fIMessage-ID\fP field is included in the results returned from
an external search program, when the program is run with \fIQUERY\fP as its
argument. See $external_search_command
T}
_
\0~k|T{
messages containing PGP key material
T}
_
\0~K \fIEXPR\fP|T{
messages blind carbon-copied to \fIEXPR\fP
T}
_
\0%L \fIGROUP\fP|T{
messages either originated or received by any member of \fIGROUP\fP
T}
_
\0~L \fIEXPR\fP|T{
messages either originated or received by \fIEXPR\fP
T}
_
\0~l|T{
messages addressed to a known mailing list
T}
_
\0~M \fIEXPR\fP|T{
messages which contain a mime Content-Type matching \fIEXPR\fP
T}
_
\0~m <\fIMAX\fP|T{
messages with numbers less than \fIMAX\fP \fB*\fP)
T}
_
\0~m >\fIMIN\fP|T{
messages with numbers greater than \fIMIN\fP \fB*\fP)
T}
_
\0~m \fIMIN\fP,\fIMAX\fP|T{
messages with offsets (from selected message) in the range \fIMIN\fP to
\fIMAX\fP \fB*\fP)
T}
_
\0~m \fIMIN\fP-\fIMAX\fP|T{
message in the range \fIMIN\fP to \fIMAX\fP \fB*\fP)
T}
_
\0~m \fIN\fP|T{
just message number \fIN\fP \fB*\fP)
T}
_
\0~N|T{
new messages
T}
_
\0~n \fIMIN\fP-\fIMAX\fP|T{
messages with a score in the range \fIMIN\fP to \fIMAX\fP \fB**\fP)
T}
_
\0~O|T{
old messages
T}
_
\0~P|T{
messages from you (consults $from, \fBalternates\fP, and local account/hostname information)
T}
_
\0~p|T{
messages addressed to you (consults $from, \fBalternates\fP, and local account/hostname information)
T}
_
\0~Q|T{
messages which have been replied to
T}
_
\0~R|T{
read messages
T}
_
\0~r \fIMIN\fP-\fIMAX\fP|T{
messages with \(lqdate-received\(rq in a date range
T}
_
\0~S|T{
superseded messages
T}
_
\0~s \fIEXPR\fP|T{
messages having \fIEXPR\fP in the \(lqSubject:\(rq field
T}
_
\0~T|T{
tagged messages
T}
_
\0~t \fIEXPR\fP|T{
messages addressed to \fIEXPR\fP
T}
_
\0~U|T{
unread messages
T}
_
\0~u|T{
messages addressed to a subscribed mailing list
T}
_
\0~V|T{
cryptographically verified messages
T}
_
\0~v|T{
message is part of a collapsed thread.
T}
_
\0~w \fIEXPR\fP|T{
newsgroups matching \fIEXPR\fP
T}
_
\0~X \fIMIN\fP-\fIMAX\fP|T{
messages with \fIMIN\fP to \fIMAX\fP attachments \fB**\fP)
T}
_
\0~x \fIEXPR\fP|T{
messages which contain \fIEXPR\fP in the \(lqReferences:\(rq or
\(lqIn-Reply-To:\(rq field
T}
_
\0~y \fIEXPR\fP|T{
messages which contain \fIEXPR\fP in their keywords
T}
_
\0~Y \fIEXPR\fP|T{
messages whose tags match \fIEXPR\fP
T}
_
\0~z \fIMIN\fP-\fIMAX\fP|T{
messages with a size in the range \fIMIN\fP to \fIMAX\fP \fB**\fP) \fB***\fP)
T}
_
\0=/ \fISTRING\fP|T{
IMAP custom server-side search for \fISTRING\fP. Currently only defined for
Gmail. See section \(lq\fBGmail Patterns\fP\(rq in NeoMutt manual.
T}
_
\0~=|T{
duplicated messages (see $duplicate_threads)
T}
_
\0~#|T{
broken threads (see $strict_threads)
T}
_
\0~$|T{
unreferenced message (requires threaded view)
T}
_
\0~(\fIPATTERN\fP)|T{
messages in threads containing messages matching \fIPATTERN\fP, e.g. all
threads containing messages from you: ~(~P)
T}
_
\0~<(\fIPATTERN\fP)|T{
messages whose immediate parent matches \fIPATTERN\fP, e.g. replies to your
messages: ~<(~P)
T}
_
\0~>(\fIPATTERN\fP)|T{
messages having an immediate child matching \fIPATTERN\fP, e.g. messages you
replied to: ~>(~P)
T}
_
.T&
l s s .
T{
\0Where \fIEXPR\fP is a regular expression, and \fIGROUP\fP is an address group.
T}
.T&
l l s .
.PP
\0\fB*\fP)|T{
The message number ranges (introduced by \(lq\fB~m\fP\(rq) are even
more general and powerful than the other types of ranges. Read on and see
section \(lq\fBMessage Ranges\fP\(rq in manual.
T}
\0\fB**\fP)|T{
The forms \(lq<\fIMAX\fP\(rq, \(lq>\fIMIN\fP\(rq, \(lq\fIMIN\fP-\(rq and
\(lq-\fIMAX\fP\(rq are allowed, too.
T}
\0\fB***\fP)|T{
The suffixes \(lqK\(rq and \(lqM\(rq are allowed to specify
kilobyte and megabyte respectively.
T}
.TE
.PP
.ad
.
.PP
Special attention has to be paid when using regular expressions inside of
patterns. Specifically, NeoMutt's parser for these patterns will strip one
level of backslash (\(lq\fB\(rs\fP\(rq), which is normally used for quoting. If
it is your intention to use a backslash in the regular expression, you will
need to use two backslashes (\(lq\fB\(rs\(rs\fP\(rq) instead.
.
.PP
You can force NeoMutt to treat \fIEXPR\fP as a simple \fISTRING\fP instead of
a regular expression by using \(lq\fB=\fP\(rq instead of \(lq\fB~\fP\(rq in the
pattern name. For example, \(lq\fB=b\~*.*\fP\(rq will find all messages that
contain the literal \fISTRING\fP \(lq\fB*.*\fP\(rq. Simple substring matches
are less powerful than regular expressions but can be considerably faster. This
is especially true for IMAP folders, because substring matches can be performed
on the server instead of by fetching every message. IMAP treats
\(lq\fB=h\fP\(rq specially: it must be of the form
\(lqHeader:\~\fIsubstring\fP\(rq and will \fBnot\fP partially match header
names. The \fIsubstring\fP part may be omitted if you simply wish to find
messages containing a particular header without regard to its value.
.
.PP
Patterns matching lists of addresses (notably
.BR c ", " C ", " p ", " P " and " t )
match if there is at least one match in the whole list. If you want to make
sure that all elements of that list match, you need to prefix your pattern with
\(lq\fB^\fP\(rq.
.
.PP
This example matches all mails which only has recipients from Germany.
.IP
Matching all addresses in address lists:
.BI ^~C\~ \(rs.de$
.
.PP
You can restrict address pattern matching to aliases that you have defined with
the \(lq\fB@\fP\(rq modifier. This example matches messages whose recipients
are all from Germany \fBand\fP who are known to your alias list.
.
.IP
Matching restricted to aliases:
.BI ^@~C\~ \(rs.de$
.
.PP
To match any defined alias, use a regular expression that matches \fBany\fP
string. This example matches messages whose senders are known aliases.
.
.IP
Matching any defined alias:
.BI @~f\~ .
.
.SS "\s-1Nesting and Boolean Operators\s0"
.\" --------------------------------------------------------------------
.PP
Logical AND is performed by specifying more than one criterion.
.IP
For example:
.BI ~t\~ work " ~f\~" smith
.
.PP
would select messages which contain the word \(lqwork\(rq in the list of
recipients \fBand\fP that have the word \(lqsmith\(rq in the \(lqFrom:\(rq
header field.
.
.PP
NeoMutt also recognizes the following operators to create more complex
search patterns:
.
.RS
.TP 4
\(bu \(lq\fB!\fP\(rq \(em logical NOT operator
.TQ
\(bu \(lq\fB|\fP\(rq \(em logical OR operator
.TQ
\(bu \(lq\fB()\fP\(rq \(em logical grouping operator
.RE
.
.PP
Here is an example illustrating a complex search pattern. This pattern will
select all messages which do \fBnot\fP contain \(lqwork\(rq in the \(lqTo:\(rq
\fBor\fP \(lqCc:\(rq field \fBand\fP which are from \(lqsmith\(rq.
.
.IP
Using boolean operators in patterns:
.BI !(~t\~ work |~c\~ work ") ~f\~" smith
.
.PP
Here is an example using white space in the regular expression (note the
\(lq\fB\(aq\fP\(rq and \(lq\fB\(dq\fP\(rq delimiters). For this to match, the
mail's subject must match the \(lq^Junk +From +Me$\(rq \fBand\fP it must be
from either \(lqJim +Somebody\(rq \fBor\fP \(lqEd +SomeoneElse\(rq:
.
.IP
Quoting regex:
.na
.IB \(aq ~s\~ "\(dq^Junk +From +Me$\(dq"
.BI ~f\~( "\(dqJim +Somebody\(dq" | "\(dqEd +SomeoneElse\(dq" ) \(aq
.ad
.
.PP
\fBNote\fP: If a regular expression contains parenthesis, or a vertical bar
(\(lq\fB|\fP\(rq), you must enclose the expression in double or single quotes
since those characters are also used to separate different parts of NeoMutt's
pattern language.
.
.IP
For example:
.BI ~f \~\(dquser@ ( home\(rs.org | work\(rs.com ) \(dq
.
.PP
Without the quotes, the parenthesis wouldn't end. This would be separated to
two OR'd patterns:
.BI ~f \~user@(home\(rs.org
.RI "and " work\(rs.com) ". They are never what you want."
.
.SS "\s-1Searching by Date\s0"
.\" --------------------------------------------------------------------
.PP
NeoMutt supports two types of dates, \fBabsolute\fP and \fBrelative\fP for
the \(lq\fB~d\fP\(rq and \(lq\fB~r\fP\(rq pattern.
.
.PP
.nf
.B Absolute Dates
.fi
Dates must be in
.IR dd [/ mm [/[ CC ] YY ]]
format (day, month, century and year \(em all parts, with the exception of day,
are optional, defaulting to the current month and year). An example of a valid
range of dates is:
.
.IP
Limit to messages matching:
.IR \fB~d\fP\~20 / 1 / 95 - 31 / 10
.
.PP
Alternatively, you may use \fIYYYYMMDD\fP to specify a date.
.PP
When given a two-digit year, NeoMutt will interpret values less than \(lq70\(rq
as lying in the 21st century (i.e., \(lq38\(rq means 2038 and not 1938, and
\(lq00\(rq is interpreted as 2000), and values greater than or equal to
\(lq70\(rq as lying in the 20th century.
.
.PP
If you omit the \fIMIN\fPimum (first) date, and just specify
.RI - dd / mm / YY ,
all messages before the given date will be selected. If you omit the
\fIMAX\fPimum (second) date, and specify
.IR dd / mm / YY -,
all messages after the given date will be selected. If you specify a single
date with no dash (\(lq\fB-\fP\(rq), only messages sent/received on the given
date will be selected.
.
.PP
You can add error margins to absolute dates. An error margin is a sign
(\(lq\fB+\fP\(rq or \(lq\fB-\fP\(rq), followed by a digit, followed by one of
the units in table \(lq\fBDate units\fP\(rq below. As a special case, you can
replace the sign by a \(lq\fB*\fP\(rq character, which is equivalent to giving
identical plus and minus error margins.
.
.\".TS
.\"allbox tab(|);
.\"cb cb
.\"c l .
.\"\0Unit|Description
.\"\0d|Days
.\"\0w|Weeks
.\"\0m|Months
.\"\0y|Years
.\".TE
.\".PP
.\".
.TS
allbox center tab(|);
lb c c c c
lb l l l l .
\0Date Unit|d|w|m|y
\0Description|Days|Weeks|Months|Years
.TE
.
.TS
allbox center tab(|);
lb c c c
lb l l l .
\0Date Unit|S|M|H
\0Description|Seconds|Minutes|Hours
.TE
.PP
\fBExample\fP: To select any messages two weeks around January 15, 2001, you'd
use the following pattern:
.
.IP
Limit to messages matching:
.IR \fB~d\fP\~15 / 1 / 2001 \fB*\fP 2 \fBw\fP
.
.PP
It is possible to give multiple error margins:
.
.IP
which cumulate:
.IR \fB~d\fP\~1 / 1 / 2001 \fB-\fP 1 \fBw+\fP 2 \fBw*\fP 3 \fBd\fP
.
.PP
.nf
.B Relative Dates
.fi
This type of date is relative to the current date, and may be specified as:
.
.RS
.TP 4
\(bu \(lq\fB<\fP\fIoffset\fP\(rq for messages newer than \fIoffset\fP units
.TQ
\(bu \(lq\fB=\fP\fIoffset\fP\(rq for messages exactly \fIoffset\fP units old
.TQ
\(bu \(lq\fB>\fP\fIoffset\fP\(rq for messages older than \fIoffset\fP units
.RE
.
.PP
\fIoffset\fP is specified as a positive number with one of the units from table
\(lq\fBDate units\fP\(rq.
.
.PP
\fBExample\fP: To select messages less than 1 month old, you would use:
.
.IP
Limit to messages matching:
.BI ~d\~< 1 m
.
.PP
\fBNote\fP: All dates used when searching are relative to the \fBlocal\fP time
zone, so unless you change the setting of your $index_format to include
a \(lq\fB%[...]\fP\(rq format, these are \fBnot\fP the dates shown in the main
index.
.
.\" --------------------------------------------------------------------
.SH CONFIGURATION VARIABLES
.\" --------------------------------------------------------------------
