-->
Previous Table of Contents Next


Some lines were displayed before the message itself began. This is the header information—and it can be useful. Typically, header information includes the following:

  The message number
  Who sent the message
  When it was sent
  The name of the system that received the message
  The date the message was received
  The “real name” of the sender, as well as his or her login ID
  The return path
  The message recipient(s)
  The subject

All this information is passed on with each e-mail message. The sender is always identified, making forgeries difficult. The real name that appears in the From line is taken from a field from the sender’s entry in the password file. The mail system uses the Return-Path or Reply-To information if you generate a reply (as discussed later in this chapter). The To line contains the address or list of addresses of the recipients of this message. (This sample message was a group message.) The sender filled in the Subject line.

Reading the Next Message

There are two ways to read the next message (the message following the current message in your mailbox). You can press <Return> or <n> to display the next message. It becomes the current message after you read it. You read the next message in the same way you read the current message. After you read the last message in the list, you see the message ‘At EOF’.

Reading Any Message

All the messages in your mailbox are numbered. You can read messages in any order by entering the message number when you see the ? prompt. For example, to read message number 2, type 2 and press <Return>. Message number 2 then becomes the current message.

Reading E-Mail from Other Files

When you start mail, you read messages kept in your system mailbox, which has the path /var/spool/mail/$LOGNAME. Recall from Chapter 18, “Understanding Linux Shells,” that LOGNAME is the shell variable that holds your login name. If you log in as bkorn, your mail is held in /var/spool/mail/bkorn. You can read mail from other files that hold complete e-mail messages—that is, messages with the headers and text of the messages. Naturally, you must have read permission for those files.

To read messages from a file, type the command to start the e-mail program followed by -f filename, and press <Return>. For example, to read the e-mail in the file mbox, enter this command:


mail -f mbox|

You can read the mail in that file in the same way you read e-mail from your system mailbox.


NOTE:  The mbox file is located in your home directory and automatically contains messages you’ve already read but haven’t deleted. These messages are saved to mbox when you exit mail.

Sending Mail While Reading

You can send e-mail while you’re using the mail program to read your messages. To do so, enter m address at the ? prompt. Follow these steps:

1.  Start the mail program (type mail and press <Return>).
2.  Read some messages or do other things, but at the ? prompt, enter the following to send e-mail to a user whose login name is ernie:

   m ernie

3.  At the prompt for a subject, type a subject heading:

   Subject: Game Time

4.  Type the message and end it with a period on the last line, as in the following example:

   Don’t forget we’re playing V-ball at 6:30

   .


The computer responds with the following lines:

   EOT

   ?

5.  Continue using mail.

Printing Mail Messages

By using mail, you can print the current message to a printer connected to your system. First, make the message you want to print the current message. Then enter | lpr at the ? prompt. You are, in effect, piping the current message to the lpr program.

To print a collection of messages, save them in a file and then print the file. See the section “Saving E-Mail to Files with mail,” later in this chapter, for information on effective ways to save messages.


Previous Table of Contents Next