General-Purpose Mail Package
|Official GNU Software|
MBOX environment variable. Any other mailboxes are called
When called without arguments,
Notice that this argument is not an argument to the --file (-f) option itself, but rather the first non-optional argument on the command line. This means that any number of additional options are allowed between the --file option and the mailbox file name. For example, the following three invocations are equivalent:
$ mail -fin mymbox $ mail -f mymbox -in $ mail --file -in mymbox $ mail --file -i mymbox -n
Additionally, for conformance to the GNU standards, the following form is also accepted:
$ mail --file=mymbox -i -n
The --user (-u) option allows the system administrator to assume another user identity for operating on this user’s mailboxes. Obviously, it is available only to system administrators. For example:
reads mail from the system mailbox of the user ‘tom’, and
mail --user=tom --file
reads mail from the personal mailbox of this user.
Unless you have started mail with --norc command line option,
it will read the contents of the system-wide configuration file.
Then it will read the contents of user configuration file, if it exists.
For detailed description of these files, see Mail Configuration Files.
After this initial setup,
Each message in the mailbox has a state that affects how it is retained or deleted upon closing the mailbox when terminating the program (see the quit command) or when switching to another mailbox (see the file command). The state is reflected in the header listing and can be changed during the session. The states are:
The message is present in the system mailbox and has not been read
by the user or moved to any other state. When
The message has been present in the system mailbox for more than one
The message has been read by the user, i.e. processed by one of the
undelete, or any of the
following escapes (in message compose mode):
(see Mail Variables). If it is not set (the default), the
messages are moved to the user’s mbox. If
hold is set,
the messages are held in the system mailbox instead.
The ‘read’ messages in any other mailbox will be retained in their current location.
The message has been processed by one of the following commands: ‘delete’, ‘dp’, ‘dt’. Messages in this state are ignored by any command, excepting ‘undelete’, which changes their state back to ‘read’. When closing the mailbox, deleted messages are permanently removed from the mailbox.
The message has been processed by the
command. When closing the mailbox, such messages are retained in
The message has been processed by one of the following commands:
is set, they are preserved using the same rules as for ‘read’
messages (see above).
Saved messages in non-system mailboxes are retained in their current location.
Unless the mailbox is empty, exactly one of its messages will be marked as current message. Upon startup, current message is set to the first new message, if there is any, or the first unread message if there is any, or to the first message in the mailbox. In the header listing, current message is marked with the ‘>’ sign at the beginning of the line. Current message is changed by any of the following commands: ‘dp’, ‘prev’, ‘next’.
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.