9.2 Configuring User Mail Programs


As we've noted, there are a variety of mailer programs available for use as user agents. Some of the most popular are listed in Table 9-1. Some of them pine, the mh family, and Netscape can also be configured to function as direct mail submission agents; the others rely on the transport agent for this task.

Table 9-1. Mail programs provided by Unix systems
 

AIX

FreeBSD

HP-UX

Linux

Solaris

Tru64

System V mail

   

figs/check.gif

 

figs/check.gif

figs/check.gif

BSD mail

figs/check.gif

figs/check.gif

figs/check.gif

figs/check.gif

figs/check.gif[6]

figs/check.gif[6]

elm (ftp://ftp.virginia.edu/pub/elm/)

figs/squ.gif

figs/check.gif

figs/check.gif [6]

figs/check.gif

figs/squ.gif

figs/squ.gif

mutt (http://www.mutt.org)

figs/squ.gif

figs/check.gif

figs/squ.gif

figs/check.gif

figs/squ.gif

figs/squ.gif

pine (http://www.washington.edu/pine/)

figs/squ.gif

figs/check.gif

figs/squ.gif

figs/check.gif

figs/check.gif

figs/squ.gif

Netscape (http://www.netscape.com)

figs/check.gif

figs/check.gif

figs/squ.gif

figs/check.gif

figs/check.gif

figs/check.gif

mh and variants (http://www.mhost.com/nmh/)

figs/check.gif

figs/check.gif

figs/squ.gif

figs/check.gif

figs/check.gif

figs/check.gif

Emacs internal mailer rmail (http://www.gnu.org)

figs/squ.gif

figs/check.gif

squ;

figs/check.gif

figs/check.gif

figs/check.gif

[6] The corresponding command is mailx.

In Table 9-1, figs/check.gif indicates that the program is installed with the operating system or provided as an optional package within installation media. A program marked with figs/squ.gif is available by Internet download.

Selecting a mailer program is generally a matter of personal preference. As such, we won't discuss their ordinary features here. Instead, we will focus on system administrator configuration issues for three of the most popular mailers: BSD mail, mutt, and pine. However, there are two points with regard to other mailer agents that you should be aware of:

  • elm (by David Taylor) is still in wide use as a mailer program, but its functionality has been pretty well superceded by mutt. mutt's interface is almost identical to elm's, and it is a considerably more powerful program (especially compared to vanilla elm, without the many separately available modifications installed). Users who like elm might be encouraged to try mutt.

  • The mh family (mh, nmh, xmh, exmh) uses a mailbox format that is substantially different from the ones used by other user agents. The most widely used mailbox format on Unix systems is the mbox format, in which all messages are stored within a single file, separated by lines beginning with "From " (i.e., followed by a space and no colon). For this reason, this format is sometime referred to as the From_ format.

    In contrast, the mh mailbox is a directory in which individual mail messages are stored as separate files, with the message number as the filename. Deleted messages have names of the form ,n: the original name prepended with a comma. Some other mailer programs (e.g., mutt) can be configured to read mh mailboxes.

The one task user agents always require of system administrators is configuration of systemwide default settings. Additionally, users may require help to set up some of these programs' advanced features. In the remainder of this section, we will look at the configuration files for the BSD mail program, mutt, and pine. We will then consider how to set up the latter two programs to use PGP for encrypting email messages.

Table 9-2 lists the user-specific and systemwide configuration files associated with these three user agents. Note that systemwide configuration files are applied before the user's own file, so systemwide settings can be overridden by individual users. The table also lists the command form that can be used to bypass the system configuration file entirely. However, pine does have the capability of imposing systemwide settings on users (as we will see).

Table 9-2. Mailer configuration files and options

Mailer

System file

User file

Option to bypass system configuration file

BSD mail

/etc/mail.rc

~/.mailrc

mail -n

mutt

/etc/Muttrc

~/.muttrc

mutt -n

pine

/usr/lib/pine.conf and /usr/lib/pine.conf.fixed[7]

~/.pinerc

pine -P /dev/null

[7] These configuration files are sometimes stored in /usr/local/lib instead.

Here is a sample mail.rc configuration file for the mail program (annotated):

set append           Append messages to mailbox (versus prepend). set asksub askcc     Prompt for subject and CC list. set autoprint        Print next message after a delete command. set metoo            Don't remove sender from group lists. set nosave           Don't save cancelled messages to dead.letter. set Replyall         Make the r command = reply to sender only. ignore Received Message-Id Resent-Message-Id Status Mail-From Via

The first five entries set some useful mail options and are generally self-explanatory. The Replyall option causes mail's r reply command to default to replying only to the sender of the letter, rather than to the entire recipient list. In other words, it interchanges the functions of mail's r and R subcommands. Setting this will cut down on a lot of unnecessary mail traffic, and it may even prevent some embarrassment on the part of new mail users. However, you may need to inform experienced users of such a change if you make it on an existing system.

The remaining lines in the configuration file tell mail to ignore the listed mail header lines when determining to whom a reply should go.

Users sometime want to change the text editor used by the mail program's e command (used to edit a message). mail uses whatever editor is specified in the EDITOR environment variable in this context.

mutt (written by Michael Elkins and others) comes with an excellent template configuration file that lists and describes all the available options. Here is an annotated sample of a systemwide Muttrc file:

# System configuration file for Mutt # ignore certain headers when determining reply recipient ignore "from " received content- mime-version status sender ignore references return-path lines x-status message-id # set some options set abort_nosubject=ask-yes     Prompt to abort if  no subject (default=yes) . set askcc=yes                   Prompt for CC list. set askbcc=no                   Don't prompt for BCC list. set beep=no                     Turn off beeping! set beep_new=no                 Even on new message arrival. set confirmappend=no            Don't prompt for confirmation when appending  set confirmcreate=yes              to a mail folder, but do confirm folder creations.    set header=no                   Don't include headers in quoted messages. set mail_check=300              Check for new mail every 5 minutes. set mime_forward=no             Include replied-to message as text (rather                                     than  as a MIME attachment).

This file lists some useful options for mutt. Note that mutt also automatically uses the text editor specified in the EDITOR environment variable as the internal editor for creating new mail messages.

pine (written at theUniversity of Washington) supports two systemwide configuration files: pine.conf and pine.conf.fixed. The latter file contains mandatory settings that cannot be overridden by the user in any way (they are applied last, after all other configuration files and command-line options). The two files are otherwise indistinguishable in format and directory location.

Template configuration files can be created with the pine -conf command. The resulting template file, which includes all major settings with descriptions, is sent to standard output. You can also set configuration file options using the program's internal configuration facilities (choose s and then c from the main menu).

Here is an annotated pine configuration file:

# pine configuration file editor=/usr/bin/jove                      Specify editor for mail messages; the default                                           is pico (included in the pine package). # set some options     feature-list=enable-suspend,              Let pine sessions be suspended with ^Z. # start editor immediately when composing mail message   enable-alternate-editor-implicitly, # Make quoted messages in replies as short as possible   no-include-header-in-reply,             Strip off  headers.   no-include-attachments-in-reply,        Attachments too.   strip-from-sigdashes-on-reply,          And signatures.   enable-bounce-command,                  Allow message bounce (resend) command.   enable-full-headers-cmd,                Allow users to optionally view all headers.   enable-jump-shortcut,                   Entering a number jumps to that message.   enable-tab-completion,                  Tab key file completion turned on.   quell-status-message-beeping,           No beeping!   quit-without-confirm,                   Suppress confirmation at exit.   save-will-advance                       Go on to next message after message save. # show these fields when creating a new mail message default-composer-hdrs=To:,Subject:,Cc:

Unlike the other mailers we've considered, pine does not respect the setting of the EDITOR environment variable. Rather, users must use the program's own editor setting to specify an alternate message composition editor. The enable-alternate-editor-implicitly setting causes the specified editor to be invoked immediately when entering the body of a new message (rather than having to enter pine's ^_ command). The other entries in this configuration file are easy to understand.

9.2.1 Automated Email Message Encryption

The PGP facility may be used to encrypt and decrypt email messages as well as regular files; indeed, this is one of its most common uses. While users may perform these processes manually (as described in Chapter 7), most prefer that it be handled within their mailer program. Both mutt and pine can provide this functionality (PGP must be installed on the local system and be in the search path).

mutt must have been compiled with PGP support in order to use this feature. You can check the build options using the mutt -v command; check for the HAVE_PGP option.

Configuring mutt to incorporate PGP requires adding some entries to one of its configuration files. Fortunately, the package provides the exact entries that you need in some sample configuration files (named pgp*.rc). Here are a few lines from the file for PGP version 6, which illustrate the nature of the entire set of additional entries:

# -*-muttrc-*- # PGP command formats for PGP 6.    # decrypt a pgp/mime attachment set pgp_decrypt_command="PGPPASSFD=0; export PGPPASSFD; cat - %f |    pgp6 +compatible +verbose=0 +batchmode -f"    # create a pgp/mime signed attachment set pgp_sign_command="PGPPASSFD=0; export PGPPASSFD; cat - %f |    pgp6 +compatible +batchmode -abfst %?a? -u %a?" ...

As this listing indicates, mutt runs external processes to perform PGP operations on mail messages, and the actual commands to run are defined in entries like these.

To use PGP with mutt to sign or encrypt an outgoing message, you enter the p command before sending it. This invokes the PGP menu; its most important items are e (encrypt message), s (sign message), b (do both), and f (forget it cancel). Selecting items from this menu merely flags the desired PGP operations for the message. They are actually carried out when the send command (y) is given. At this point, you will be prompted for the key to use and the corresponding passphrase.

PGP decryption in mutt is even more automated. When an encrypted and/or signed message is opened, the relevant PGP operations are performed automatically once mutt has prompted for the PGP passphrase.

mutt creates encrypted mail messages as MIME attachments with content type "application/pgp-encrypted", not as inline text. It can also decrypt only messages in this format.

pine also supports PGP encryption and decryption, via add-on utilities. One of the most widely-used is pgp4pine (by Holger Lamm; http://pgp4pine.flatline.de). pine places the encrypted text within the main text of the email message, surrounded by header lines; it does not handle MIME attachments.

Once pgp4pine is installed, you must specify two configuration file settings to be able to call it from within pine:

# Programs that message text is piped into prior to display display-filters=_BEGINNING("-----BEGIN PGP")_ /usr/bin/pgp4pine -d -i TMPFILE # Programs that message text is piped into prior to sending sending-filters=/usr/bin/pgp4pine -e -i TMPFILE -r RECIPIENTS

The first entry defines a pattern to search for in incoming mail messages: in this case, the text " -- -- -BEGIN PGP", followed by the command with which to process it (to decrypt it, in this case). Once defined, mail messages containing PGP-encrypted text within their body are automatically decrypted (after the passphrase is entered).

The second entry is used to define a series of filters that can optionally be applied to outgoing mail messages. It defines a single filter that performs PGP encryption and/or signing.

To create an encrypted mail message, you must select a filter after issuing the pine send command; using this configuration, the key sequence Ctrl-X Ctrl-N initiates a send and selects the first filter, pgp4pine, resulting in the following menu:

You may: a) Sign and encrypt the message b) Sign the message c) Encrypt the message d) Send it unmodified q) Abort and Quit

If you select any of the first three options, you will be prompted for the passphrase. Note that a key corresponding to the recipient's email address must be present on your key ring (you cannot select a key if pine cannot determine which key to use).

If you want to use PGP as a matter of course for mail messages, add the compose-send-offers-first-filter to the feature-list in one of the pine configuration files.

The pgp4pine facility also has its own configuration file, ~/.pgp4pinerc. In general, the supplied file works well without modification. However, you will want to verify the settings specifying the name of the PGP main command for your version of PGP. For example, here is the setting that corresponds to PGP Version 6:

profile_pgp6_pgp6bin=pgp

This entry says that the pgp command is the one to use. Verify that all entries whose names begin with "profile_pgpn" are correct for the corresponding version of PGP.

One disadvantage of pgp4pine is that it uses a predictable name for its temporary file. Users should ensure that any such files lingering after crashes are deleted (although this happens only very rarely).



Essential System Administration
Essential System Administration, Third Edition
ISBN: 0596003439
EAN: 2147483647
Year: 2002
Pages: 162

Similar book on Amazon

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net