Linux System Administrator's Survival Guide lsg37.htm

Previous Page TOC Next Page



Cahapter 37


Configuring Elm and Pine


Now that you've gone to all the trouble of setting up either sendmail+IDA or smail, it's time to send and receive mail. That's where the user agents come in, otherwise known as mail readers. The mail reader displays your mail, enables you to manage your mailbox, and sends out new mail to others. Dozens of mail readers are available for UNIX and Linux, but the most popular of them all is Elm.

Elm and Pine are included with practically every distribution of Linux, although Elm is the most widely used at the moment so it's the mail reader this chapter examines first. If you decide to use another reader, check the documentation that accompanies the reader for configuration details. If you want to get going quickly with a very good reader, configure Elm or Pine on your system based on this chapter. You can have as many mail readers configured at a time as you want, so start with Elm or Pine and move on if it doesn't meet your needs.

Configuring Elm


Elm (ELectronic Mail) is a full-screen user interface to the Linux mail system, as shown in Figure 37.1. It is quite powerful and offers a very good help system for times when you get stuck. Elm will run on most systems without any special configuration, as long as the mail system is working properly. A few options help the system run better, though.

Figure 37.1.
Elm offers a full-screen interface to mail that is very easy to configure and use.

Elm's configuration information is stored in a file called /usr/lib/elm/elm.rc (sometimes just /usr/lib/elm.rc) and in each user's home directory in a file called .elm/elm.rc, both of which are created automatically by Elm the first time it is started. The file in each user's home directory is not editable by users, but it is modified when a user issues a save configuration command.

The primary changes to be made to the /usr/lib/elm/elm.rc file have to do with your machine's name and domain. You need to fill in a set of entries in the /usr/lib/elm/elm.rc file. Edit the file and update the hostname and domain name options so that they look like this:


# Local hostname

hostname = merlin

#

# Domain name

hostdomain = .tpci.com

#

# fully qualified domain name

hostfullname = merlin.tpci.com

Each setting has the keyword, a space, an equal sign, a space, then the value. Note that the domain name needs a preceding period to allow it to be tacked on to machine names properly. Elm doesn't use these settings much, but they are occasionally useful.

If you need to change the default character set used by the system (the normal character set is called ISO-8859-1), you will need to make changes in Elm's configuration file, too. This change affects only the way Elm shows information, and it should correspond to the character set used by Linux on your system. By default, Elm uses an ASCII character set unless it recognizes some codes it can't handle with that set, in which case it switches to an alternate system called metamail to display the codes.

To make sure that Elm can process the standard character set used by Linux (and avoid calling the metamail system, which slows down mail reader processing), add this line to the /usr/lib/elm/elm.rc file (if it isn't already there):


displaycharset = iso-8859-1

There are some special characters in the ISO 8859-1 character set that Elm still can't quite handle properly, so you can add the following two lines to the file, as well:


charset = iso-8859-1

textencoding = 8bit

The latter command sets the system to 8 bits, instead of stripping off the last bit (the default action) to produce a 7-bit character.

Configuring Pine


Most mail readers will have a configuration file similar to Elm's that controls the access and behavior of the mail reader. The most commonly available is Pine (Pine Is No longer Elm), also a full-screen mail reader, as shown in Figure 37.2. Pine can use system variables to a large extent, but it can also be customized by users.

Figure 37.2.
Pine is an alternate to Elm, offering a different look and several different functions.

Pine stores its configuration file at .pinerc in the user's home directory. This is a large ASCII file, with lots of comments to explain what is going on. The areas that you need to examine to configure Pine involve the system names and user identification. At the top of the .pinerc file is the user information:


personal-name=

If you want to override the default setting gathered from the login name, you can enter a name here. For most users, you will want to leave it blank. (If a .pinerc file doesn't exist, run Pine and it will create the file automatically.)

The domain name and address has to be set with lines like these:


# Sets domain part of From: and local addresses in outgoing mail.

user-domain=

# List of SMTP servers for sending mail. If blank: Unix Pine uses sendmail.

smtp-server=

# NNTP server for posting news. Also sets news-collections for news reading.

nntp-server=

# Path of (local or remote) INBOX, e.g. ={mail.somewhere.edu}inbox

# Normal Unix default is the local INBOX (usually /usr/spool/mail/$USER).

inbox-path=

Again, blank entries are used to indicate that Pine should use the system default values. If you want to customize any of the entries, add the values after the equal sign. As you can see in the code, the comments are descriptive enough to let you figure out what each variable does.

A large chunk of the .pinerc file is devoted to providing information about the mailboxes used by Pine. Leave the defaults alone for most systems, unless you want to alter the behavior of the mail system. The variables that fall into this area are:


# List of incoming msg folders besides INBOX, e.g. ={host2}inbox, {host3}inbox

# Syntax: optnl-label {optnl-imap-host-name}folder-path

incoming-folders=

# List of directories where saved-message folders may be. First one is

# the default for Saves. Example: Main {host1}mail/[], Desktop mail\[]

# Syntax: optnl-label {optnl-imap-hostname}optnl-directory-path[]

folder-collections=

# List, only needed if nntp-server not set, or news is on a different host

# than used for NNTP posting. Examples: News *[] or News *{host3/nntp}[]

# Syntax: optnl-label *{news-host/protocol}[]

news-collections=

# Over-rides default path for sent-mail folder, e.g. =old-mail (using first

# folder collection dir) or ={host2}sent-mail or ="" (to suppress saving).

# Default: sent-mail (Unix) or SENTMAIL.MTX (PC) in default folder collection.

default-fcc=

# Over-rides default path for postponed messages folder, e.g. =pm (which uses

# first folder collection dir) or ={host4}pm (using home dir on host4).

# Default: postponed-mail (Unix) or POSTPONE.MTX (PC) in default fldr coltn.

postponed-folder=

# If set, specifies where already-read messages will be moved upon quitting.

read-message-folder=

# Over-rides default path for signature file. Default is ~/.signature

signature-file=

# List of file or path names for global/shared addressbook(s).

# Default: none

# Syntax: optnl-label path-name

global-address-book=

# List of file or path names for personal addressbook(s).

# Default: ~/.addressbook (Unix) or \PINE\ADDRBOOK (PC)

# Syntax: optnl-label path-name

address-book=

The final section of the .pinerc file that you may want to examine deals with personal preferences for the reader:


# List of features; see Pine's Setup/options menu for the current set.

# e.g. feature-list= select-without-confirm, signature-at-bottom

# Default condition for all of the features is no-.

feature-list=

# Pine executes these keys upon startup (e.g. to view msg 13: i,j,1,3,CR,v)

initial-keystroke-list=

# Only show these headers (by default) when composing messages

default-composer-hdrs=

# Add these customized headers (and possible default values) when composing

customized-hdrs=

# Determines default folder name for Saves...

# Choices: default-folder, by-sender, by-from, by-recipient, last-folder-used.

# Default: "default-folder", i.e. "saved-messages" (Unix) or "SAVEMAIL" (PC).

saved-msg-name-rule=

# Determines default name for Fcc...

# Choices: default-fcc, by-recipient, last-fcc-used.

# Default: "default-fcc" (see also "default-fcc=" variable.)

fcc-name-rule=

# Sets presentation order of messages in Index. Choices:

# subject, from, arrival, date, size. Default: "arrival".

sort-key=

# Sets presentation order of address book entries. Choices: dont-sort,

# fullname-with-lists-last, fullname, nickname-with-lists-last, nickname

# Default: "fullname-with-lists-last".

addrbook-sort-rule=

# Reflects capabilities of the display you have. Default: US-ASCII.

# Typical alternatives include ISO-8859-x, (x is a number between 1 and 9).

character-set=

# Specifies the program invoked by ^_ in the Composer,

# or the "enable-alternate-editor-implicitly" feature.

editor=

# Program to view images (e.g. GIF or TIFF attachments).

image-viewer=

# If "user-domain" not set, strips hostname in FROM address. (Unix only)

use-only-domain-name=

As with all the other sections of the .pinerc file, most of these entries can be left in their default blank state unless you specifically need to override an entry. The final section of the .pinerc file is updated by Pine itself, and it should not be modified by users (as all these settings are lost when Pine runs, so if users do make changes to this section they are not retained). This final section or /pinerc deals with printers and the version of Pine.

Summary


Setting up any of the mail readers is usually a matter of editing the configuration file for the reader. In almost all cases, the configuration files have a lot of comments to explain what is going on. You only need to read these files to understand the configuration steps you must take. In general, you don't need to do anything with most mail readers, assuming that you have a typical Linux system using sendmail.

Previous Page Page Top TOC Next Page