-->

Previous | Table of Contents | Next

Page 176


# mail

Mail version 5.5-kw 5/30/95.  Type ? for help.

"/var/spool/mail/bball": 2 messages

>   1 mwc@savoynet.com      Tue Nov 18 10:43  38/2126  "Save on Inkjet /Laser"

    2 bball@staffnet.com    Tue Nov 18 11:27  24/701   "test"

&

The mail program will retrieve your mail from the /var/spool/mail directory, print its version, then list each message, and present the ampersand (&) as a prompt. Note that the current message is preceded by a right angle bracket (greater-than sign). The basic mail commands are

One handy way to send a long message quickly is to use the command-line redirection operator of your shell. For example, if you have composed a long message in your favorite text editor, you can send the message with


# mail -s "How is it going?" myfriend@somewhere.com < mymessage.txt

Using this approach, the mail program will create a message with a subject you specify with the -s option (note that you must enclose the text with quote marks), and then put the file mymessage.txt into the body of the message. Be careful, though, because the message will be sent right away without asking you if you really want to send it.

There are many more commands and different ways to use the mail program, and you may find it useful. See the mail manual page for more information. Although using mail can be quick and convenient, the next two mail programs are a lot more interactive, and offer features most people have become accustomed to when they send and receive mail.

Configuring and Using the pine Mail Program

The pine mail program, which you'll find under the /usr/bin directory, was developed by the University of Washington as an interactive mail and news reader. This means that not only can you use pine for sending or reading your mail, but you can also use it to read Usenet

Page 177

newsgroups. Usenet and different news readers are discussed later in this hour, but this section focuses on configuring and using pine for mail.

The pine program also comes with an extremely easy-to-use editor called pico, which might easily become your favorite Linux text editor, because it can be used with any other program, and not just pine. See Hour 14, "Text Processing," for more details about the pico editor.

The pine program is easy to set up and use. Most of the work is done for you automatically when you first start the program, for example:


# pine

Creating subdirectory "/home/bball/mail" where Pine will store

its mail folders.

The pine program starts up and creates a directory called mail, along with a .pinerc configuration file in your home directory. Before you start composing or sending mail, you should configure pine to recognize your username, your ISP's mail server, and, as you'll see later on, your ISP's news server. Although you can compose mail, and use pine's postpone feature to save your composed messages, you won't be able to send mail until you tell pine who you are, or the name of your ISP's mail server.

To do this, type an s, then a c to get to pine's configuration screen (see Figure 11.1).

Enter your personal name, the domain of your ISP, the name of your ISP's mail server, and if you know it, the name of your ISP's news server. Then type an e, and pine will ask if you want to save the changes. Your configuration will then be saved in the .pinerc file in

Figure 11.1
Specifying the personal
name, user domain,
SMTP server,and
NNTP server in the
pine mailer configu-
ration screen.


Page 178

your home directory. Although you can edit this file in your favorite text editor, using pine is a lot easier.

To compose a message, press the c key, and you'll be in pine's compose mode (see Fig-
ure 11.2).

You can specify multiple recipients to your message by typing a comma between names. You can also send file attachments by typing the name of the file (if it is in your home

Figure 11.2.
Composing a mail
message with file
attachments to multiple
recipients in the pine
compose mode.


directory), or the complete path of your file if it is somewhere else on your filesystem.

As you compose your message, you can use your cursor keys to move around the text, and a number of editing keys to write your text. You can also delete or undelete lines of text for cutting and pasting. For more details on editing, see the pico manual page.

When you're finished composing your message, you can send the message right away by using Ctrl+X, or postpone the message by using Ctrl+O. Using this approach, you can create or reply to messages while you're not connected to your ISP, and then send them later on.

When you retrieve your mail, pine will look in the /var/spool/mail directory, then extract the messages and put them into the default folder, INBOX, in the mail folder in your home directory (see Figure 11.3). You can also create other folders, and save and delete messages in different folders to organize your mail. Of course, you can also use the procmail approach discussed in the section "Configuring procmail and Writing Recipes to Fight Spam" to

Page 179

automate some of this process for you.

Figure 11.3.
You can select messages
through pine's
message list of a pine
mail folder.


The folder index of your messages is displayed in a list, and you can select messages by scrolling up and down with the cursor keys. From the main list of messages, you can delete, undelete, save, read, and export messages to your directory. To read a message, just hit the Enter key.

The pine program has a number of command-line options, and other features, such as built-in help, which you access with the question mark (?) from pine's main menu. Other pine functions, such as reading news, are discussed later in this hour.

Configuring and Using the elm Mail Program

The elm program, which is more than 10 years old, was originally developed by Dave Taylor, and has features of the mail and pine programs. You can, as in mail, send a message from the command line, using the mail command example you saw earlier, for example:


# elm -s "How is it going?" bball@staffnet.com < author.msg

Sending mail...

Mail sent!

When you first start elm, you'll be asked if you want to create elm's default mail folder, Mail.

# elm



Notice:

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

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

Previous | Table of Contents | Next