| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |
To read messages from a given mailbox, use one of the following ways of
invoking mail:
mail
mail --file
mail --file=path_to_mailbox
mail --user=user
Please note, that usual mailbox permissions won't allow you to use the last variant of invocation, unless you are a super-user. Similarly, the last but one variant is also greatly affected by the permissions the target mailbox has.
Unless you have started mail with `--norc' command line option,
it will read the contents of the system-wide configuration file.
Then it reads the contents of user configuration file, if any.
For detailed description of these files, see 3.4.7 Personal and System-wide Configuration Files.
After this initial setup, mail displays the first page of header
lines and enters interactive mode. In interactive mode, mail
displays its prompt (`?', if not set otherwise) and executes the
commands the user enters.
Following commands quit the program:
mail was operating upon user's system
mailbox, then all undeleted and unsaved messages that have been read and
are not marked with hold flag are saved to the user's mbox file
(`$HOME/mbox'). The messages, marked with delete are removed.
The program exits to the Shell, unless saving the mailbox fails, in
which case user can escape with the exit command.
Typing EOF (`C-D') alone is equivalent to `quit'.
Following commands can be used during the session to request online help:
$HOME is
assumed.
quit command has been issued.
If mailbox is omitted, the command prints the current mailbox
name followed by the summary information regarding it, e.g.:
& fold "/var/spool/mail/gray": 23 messages 22 unread |
To control which headers in the message should be displayed, mail
keeps two lists: a retained header list and an ignored
header list. If retained header list is not empty, only the
header fields listed in it are displayed when printing the message.
Otherwise, if ignored header list is not empty, only the headers
not listed in this list are displayed. The uppercase variants
of message-displaying commands can be used to print all the headers.
The following commands modify and display the contents of both lists.
headers
command. When arg is `.', it is generally equivalent to
headers. When arg is omitted or is `+', the next
pageful of headers is displayed. If arg is `-', the
previous pageful of headers is displayed. The latter two forms
of z command may also take a numerical argument meaning the
number of pages to skip before displaying the headers. For
example:
& z +2 |
folder variable.
& summary "/var/spool/mail/gray": 23 messages 22 unread |
crt
determines the minimum number of lines the body of the message must
contain in order to be piped through pager command specified
by environment variable PAGER. If crt is set to a numeric
value, this value is taken as the minimum number of lines. Otherwise,
if crt is set without a value then the height of the terminal
screen is used to compute the threshold. The number of lines on
screen is controlled by screen variable.
decode command decodes and prints
out specified message parts. E.g.
& decode 15[2] +--------------------------------------- | Message=15[2] | Type=message/delivery-status | encoding=7bit +--------------------------------------- Content-Type: message/delivery-status ... |
toplines and
defaults to five.
cmd is set,
the value of this variable is used as a command name.
& untag :t |
delete command.
quit command these
messages will be deleted from the mailbox. Until the end of current
session the deleted messages can be referred to in message lists using
:d notation.
delete command, unless the variable
keepsave is set.
save, but the file to append messages to is named after the
sender of the first message in msglist. For example:
& from 14 15 U 14 smith@noldor.org Fri Jun 30 18:11 14/358 The Save c U 15 gray@noldor.org Fri Jun 30 18:30 8/245 Re: The Sa & Save 14 15 "smith" 22/603 |
i.e., 22 lines (603 characters) have been appended to the file "smith". If the file does not exist, it is created.
save, except that only message body (without the
header) is saved.
Save, except that only message body (without the
header) is saved.
quit command. This is the default action for
all read messages, unless you have variable hold set.
save, except that saved messages are not marked for
deletion.
Save, except that saved messages are not marked for
deletion.
These command allow to edit messages in a mailbox. Please note,
that modified messages currently do not replace original ones. i.e.
you have to save them explicitly using your editor's save
command if you do not want the effects of your editing to be lost.
EDITOR environment variable.
VISUAL environment variable.
For each message in msglist, switches to compose mode and sends the composed message to the sender and all recipients of the message.
Like reply, except that the composed message is sent only to
originators of the specified messages.
Switches to compose mode. After composing, sends the message to the originators and recipients of all messages in msglist.
Similar to followup, but reply message is sent only to
originators of messages in msglist.
To determine the sender of the message mail uses the
list of sender fields (see section Controlling Sender Fields). The first field
from this list is looked up in message headers. If it is found
and contains a valid email address, this address is used as
the sender address. If not, the second field is searched and
so on. This process continues until a field is found in the
headers, or the sender field list is exhausted, whichever happens
first.
If the previous step did not determine the sender address, the address from SMTP envelope is used.
Let's illustrate this. Suppose your mailbox contains the following:
U 1 block@helsingor.org Fri Jun 30 18:30 8/245 Re: The Sa & Print 1 From: Antonius Block <block@helsingor.org> To: Smeden Plog <plog@helsingor.org> Date: Tue, 27 Apr 2004 13:23:41 +0300 Reply-To: <root@helsingor.org> Subject: News Hi |
Now, you issue the following commands:
& sender mail-followup-to reply-to from & reply To: <root@helsingor.org> Subject: Re: News |
As you see, the value of Reply-To field was taken as the
sender address.
Now, let's try the following command sequence:
# Clear the sender list & nosender # Set new sender list & sender From |
Now, the From address will be taken:
& reply To: Antonius Block <block@helsingor.org> Subject: Re: News |
Commands sender and nosender are used to manipulate
the contents of the sender field list.
If the command sender is used without arguments, it displays
the contents of the sender field list. If arguments are given,
each argument is appended to the sender field list. For example:
& sender Sender address is obtained from the envelope & sender mail-followup-to reply-to & sender mail-followup-to reply-to & sender from & sender mail-followup-to reply-to from |
Command nosender is used to remove items from the sender
field list:
& sender mail-followup-to reply-to from & nosender reply-to & sender mail-followup-to from |
When used without arguments, this command clears the list:
& nosender Sender address is obtained from the envelope |
The incorporate (inc) command incorporates newly arrived
messages to the displayed list of messages. This is done automatically
before returning to mail command prompt if the variable
autoinc is set.
To run arbitrary shell command from mail command prompt, use
shell (sh) command. If no arguments are specified, the
command starts the user login shell. Otherwise, it uses its first
argument as a file name to execute and all subsequent arguments are
passed as positional parameters to this command. The shell
command can also be spelled as !.
| [ < ] | [ > ] | [ << ] | [ Up ] | [ >> ] | [Top] | [Contents] | [Index] | [ ? ] |