To read a message, type its number and press <Enter>. The message is then displayed. You see the message header (including ``To'', ``From'', and ``Subject'' lines) along with the message itself:
&Once you have read a message, it is automatically saved to your mbox file (by default).
1Message 1: From: susant Fri Mar 05 09:30:12 1993 From: email@example.com (Susan Tzarcha) To: perry Subject: Lunch? Date: Fri, 05 Mar 1993 09:29:21 (EST) Message-ID: <firstname.lastname@example.org> Status: RO
Hi, what are you doing for lunch today? Alison and Greg have suggested we try the new restaurant in the Plaza.
Depending on how mail is set up, long messages may scroll off the screen. If this happens, press <Ctrl>S to temporarily stop the scrolling, and <Ctrl>Q to start it again. A more practical solution is to set the number of lines the screen scrolls by when you read a message. To do this, type set crt=20 at the mail prompt. The screen will then pause every 20 lines. To make this setting permanent, add the line set crt=20 to the .mailrc file in your home directory.
For details on setting variables in the .mailrc file, see ``Setting environment variables''.
You can select the program that mail uses to view long messages by setting the PAGER variable to the pathname of a suitable command (such as /usr/bin/pg). You must also have set crt to a suitable value for this to work. (A paging program allows you to quit reading a message at any stage. Depending on your choice of program, it may also allow you to search for text strings and change your position in the message.)
You can redisplay the message headers using the command h (short for header). If you want to stop reading a long message to return to the headers, press <Del> then enter h to redisplay the headers. If you have more than one screen of headers, type h+ to move forward to the next screen, and h- to go back to the previous one. You can also specify the number of screens to move after both + and -.
To display the headers of messages on a particular subject, type h/subject at the mail prompt, where subject is all or part of the subject line you want to find.
To show only those messages from one user, type h login, where login is their login name. To display these messages, one after another, enter p login. For the example introduced earlier in this chapter, the command h peterp displays the headers of all messages received from peterp:
N 12 peterp Fri Mar 12 16:37 25/816 XTR work - can we hold meet U 11 peterp Fri Mar 12 16:27 99/2154 status and milestones 5 peterp Fri Mar 05 14:45 38/1121 URGENTYou can specify messages by their number in the list of headers. There are also three special characters available for specifying messages:
For example, to list all message headers from the current to the
last message, type:
A dash (-) is used to indicate a range of characters; a
list of message numbers separated by spaces indicates
individual messages. For example:
h ^ . $
displays the headers of the first, current, and last messages only. For the example used earlier in ``Setting environment variables'', the screen would show:
N 12 peterp Fri Mar 12 16:37 25/816 XTR work - can we hold meet > 1 susant Fri Mar 05 09:30 12/345 Lunch?Recall that the first message became the current message when you read it previously.
You can mix a range with individual message numbers:
h ^ 10-$
displays the first, the tenth, and all subsequent messages:
N 12 peterp Fri Mar 12 16:37 25/816 XTR work - can we hold meet U 11 peterp Fri Mar 12 16:27 99/2154 status and milestones 10 patsyk Thu Mar 11 12:03 11/305 CA conference news > 1 susant Fri Mar 05 09:30 12/345 Lunch?You can also create a message list by specifying the type of messages in which you are interested. Type a colon followed by one of the following letters:
For example, to see a list of headers of the messages you have
Use an asterisk () if you need to specify
all non-deleted messages. For example, to completely clean out your
mailbox, use the save command with an asterisk and a filename
to save all non-deleted messages to that file:
The file that the messages are saved to is termed a ``mail folder''. You can use mail folders to group together messages on different subjects.
You can display message headers with the most recent message at either the top or the bottom of the list.
To list message headers with the most recent message at the bottom (that is, in chronological order), type set chron at the mail prompt. To list message headers with most recent numbers at the top, type set mchron.
To make your setting apply for all your mail sessions, add the line set chron or set mchron to your .mailrc file. For details on setting variables in the .mailrc file, see ``Setting environment variables''.