-->
Previous Table of Contents Next


Quitting and Saving Changes

To quit the mail program and save the changes that occur, press <q><Return> at the ? prompt. You see the shell prompt again. When you quit mail this way, messages you read but didn’t delete are saved in a file named mbox in your home directory.

Suppose that you use mail to read your mail. Your login name is bkorn, and your home directory is /home/bkorn. When you enter mail to start the mail program, you see the following screen of information:


mail     Type ? for help.

“/var/spool/mail/bkorn”: 5 messages 2 new 1 unread

     1 sarah Wed Jan  8 09:17  15/363

     2 top@kite.fish.com Thu Jan  9 10:18  26/657   Meeting on Friday

U    3 fred Fri Jan  10 08:09  32/900   New Order

> N  4 jones Fri Jan  10 13:22  35/1347  Draft Report

N    5 smith@somewhere.com Sat Jan  11 13:21  76/3103  Excerpt from book

?

Now suppose that you read the current message by pressing <Return>, and then you read message 1 by typing 1 and pressing <Return> at the ? prompt. If you then press <q><Return> to quit, you see the following information:


Saved 2 messages in /home/bkorn/mbox

Held 3 messages in /var/spool/mail/bkorn

The two messages you read are saved in the file mbox in your home directory; the other three messages are saved in your system mailbox, /var/spool/mail/bkorn.

If you save read messages like this often, mbox can become quite large. You may want to print that file occasionally and delete it. You can also read the mail from that file as though it were your system mailbox, as described later in this chapter.


NOTE:  You can read mail and indicate that the current message is to be kept in your system mailbox, /var/spool/mail/bkorn, and not in the file mbox. To do this after you read a message, enter pre (for preserve) at the ? prompt.

Quitting and Not Saving Changes

The other way to quit the mail program is to press <x><Return> at the ? prompt. When you do that, you exit the program with no changes to your system mailbox or any other file—as if you didn’t read your mail at all. You then see the shell prompt. You may want to exit the mail program in this way when you want to leave the program but save the mail in your system mailbox.

Using the elm Mailer

As stated earlier in this chapter, several different mail programs are available for Linux. Each has its own advantages and disadvantages.

One mail reader that comes with the Slackware and Red Hat distributions of Linux is the elm mailer. This mail program is a screen-oriented mailer rather than a line-oriented one. It provides a set of interactive menu prompts and is easy to use. Virtually everything that you can do with mail can be done under elm, and usually much more easily!

Because elm is easy to use, the following sections just touch on the highlights of using it. You can find more in-depth information by using elm’s online help or by reading its man page.

Starting elm

To start a mail session with elm, just type elm at the command prompt. If this is the first time you’ve used elm, it will prompt you for permission to set up a configuration directory in your account and create an mbox mail file if one doesn’t exist. Here’s what you see as you start elm for the first time:


$ elm

Notice:

This version of ELM requires the use of a .elm directory in your home

directory to store your elmrc and alias files. Shall I create the

directory .elm for you and set it up (y/n/q)? y

Great! I’ll do it now.



Notice:

ELM requires the use of a folders directory to store your mail folders in.

Shall I create the directory /home/gunter/Mail for you (y/n/q)? y

Great! I’ll do it now.

After elm creates its directory and mbox file, it runs the main mail program. This is a full-screen-oriented mailer. Your screen clears, and you see a display similar to the following:


Mailbox is ‘/var/spool/mail/gunter’ with 2 messages [ELM 2.4 PL25]

N  1   Nov 11 Jack Tackett    Linux book

N  2   Nov 11 Jack Tackett    more ideas



You can use any of the following commands

by pressing the first character;

d)elete or u)ndelete mail,  m)ail a message,

r)eply or f)orward mail,  q)uit

To read a message, press <return>. j = move down, k = move up, ? = help



Command:

At the top of the screen, elm tells you where your system mailbox is located, how many messages are in it, and what version of elm you’re running. elm then lists one line for each message in your mailbox. It places the letter N before each new message, just like the mail program. The summary line for each message tells you whether the message is new, the message date, the sender, and the subject. (As always, your display may vary slightly depending on your version of elm.) The current message is highlighted in the list (in the preceding listing, the current message is in boldface).


Previous Table of Contents Next