General-Purpose Mail Package
|Official GNU Software|
Commands have the following syntax:
command [msglist] [argument ...]
A command is terminated by a newline character. Empty command (i.e. a newline character alone) is equivalent to ‘next’ (see next).
In the syntax above, command is the command verb. Each command has long and short (abbreviated) form. Each of them can be used to invoke the command.
Many mail commands take a list of messages (msglist) to operate upon, which defaults to current message.
The list of messages in its simplest form is one of:
|.||Selects current message. It is equivalent to empty message list.|
|*||Selects all messages in the mailbox.|
|^||Selects first non-deleted message.|
|$||Selects last non-deleted message.|
In its complex form, the message list is a comma or whitespace-separated list of message specifiers. A message specifier is one of
(integer number) This specifier addresses the message with the given ordinal number in the mailbox.
All messages with ordinal numbers between n and m, inclusive.
All messages of type t, where t can be any of:
Old messages (any message not in state ‘read’ or ‘new’).
Messages in state ‘read’.
Messages in state ‘unread’.
Selects all tagged messages.
Selects all untagged messages.
Selects all messages in state ‘saved’.
Selects all messages that contain header field header matching
given string. If the variable
regex is set, the
string is assumed to be a POSIX regexp. (All comparison is
case-insensitive in either case).
If header: part is omitted, it is assumed to be ‘Subject:’.
Message body match.
Selects all messages with body matching the string. The matching rules are the same as described above.
A message specifier can be followed by message part specifier, enclosed in a pair of brackets. A message part specifier controls which part of a message should be operated upon. It is meaningful only for multipart messages. A message part specifier is a comma or whitespace-separated list of part numbers or ranges. Each part number can in turn be message part specifier, thus allowing for operating upon multiply-encoded messages.
The following are the examples of valid message lists:
Messages from 1 through 4 and message 10.
All messages starting from message 4.
All messages with the word ‘watch’ in the subject.
All messages with the word ‘watch’ in the subject or body.
Same as above plus the last message in the mailbox.
Part 2 of the multipart message 10.
This document was generated on January 2, 2022 using makeinfo.Verbatim copying and distribution of this entire article is permitted in any medium, provided this notice is preserved.