old-www/LDP/nag2/x-087-2-mail.elm.html

440 lines
8.3 KiB
HTML

<HTML
><HEAD
><TITLE
>Configuring elm</TITLE
><META
NAME="GENERATOR"
CONTENT="Modular DocBook HTML Stylesheet Version 1.57"><LINK
REL="HOME"
TITLE="Linux Network Administrators Guide"
HREF="index.html"><LINK
REL="UP"
TITLE="Electronic Mail"
HREF="x-087-2-mail.html"><LINK
REL="PREVIOUS"
TITLE="How Does Mail Routing Work?"
HREF="x-087-2-mail.routing.html"><LINK
REL="NEXT"
TITLE="Sendmail"
HREF="x-087-2-sendmail.html"></HEAD
><BODY
CLASS="SECT1"
BGCOLOR="#FFFFFF"
TEXT="#000000"
LINK="#0000FF"
VLINK="#840084"
ALINK="#0000FF"
><DIV
CLASS="NAVHEADER"
><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TH
COLSPAN="3"
ALIGN="center"
>Linux Network Administrators Guide</TH
></TR
><TR
><TD
WIDTH="10%"
ALIGN="left"
VALIGN="bottom"
><A
HREF="x-087-2-mail.routing.html"
>Prev</A
></TD
><TD
WIDTH="80%"
ALIGN="center"
VALIGN="bottom"
>Chapter 17. Electronic Mail</TD
><TD
WIDTH="10%"
ALIGN="right"
VALIGN="bottom"
><A
HREF="x-087-2-sendmail.html"
>Next</A
></TD
></TR
></TABLE
><HR
ALIGN="LEFT"
WIDTH="100%"></DIV
><DIV
CLASS="SECT1"
><H1
CLASS="SECT1"
><A
NAME="X-087-2-MAIL.ELM"
>17.5. Configuring elm</A
></H1
><P
><B
CLASS="COMMAND"
>elm</B
> stands for &#8220;electronic mail&#8221; and is one
of the more reasonably named Unix tools. It provides a full-screen interface
with a good help feature. We won't discuss how to use <B
CLASS="COMMAND"
>elm</B
>
here, but only dwell on its configuration options.</P
><P
>Theoretically, you can run <B
CLASS="COMMAND"
>elm</B
> unconfigured, and everything
works well&#8212;if you are lucky. But there are a few options that must be
set, although they are required only on occasion.</P
><P
>When it starts, <B
CLASS="COMMAND"
>elm</B
> reads a set of configuration variables
from the <TT
CLASS="FILENAME"
>elm.rc</TT
> file in <TT
CLASS="FILENAME"
>/etc/elm</TT
>.
Then it attempts to read the file <TT
CLASS="FILENAME"
>.elm/elmrc</TT
> in your
home directory. You don't usually write this file yourself. It is created when
you choose &#8220;Save new options&#8221; from <B
CLASS="COMMAND"
>elm</B
>'s options
menu.</P
><P
>The set of options for the private <TT
CLASS="FILENAME"
>elmrc</TT
> file is also
available in the global <TT
CLASS="FILENAME"
>elm.rc</TT
> file. Most settings in
your private <TT
CLASS="FILENAME"
>elmrc</TT
> file override those of the global file.</P
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="X-087-2-MAIL.ELM.GLOBAL"
>17.5.1. Global elm Options</A
></H2
><P
>In the global <TT
CLASS="FILENAME"
>elm.rc</TT
> file, you must set the options
that pertain to your host's name. For example, at the Virtual Brewery, the file
for <SPAN
CLASS="SYSTEMITEM"
>vlager</SPAN
> contains the following:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>#
# The local hostname
hostname = vlager
#
# Domain name
hostdomain = .vbrew.com
#
# Fully qualified domain name
hostfullname = vlager.vbrew.com</PRE
></TD
></TR
></TABLE
></P
><P
>These options set <B
CLASS="COMMAND"
>elm</B
>'s idea of the local hostname.
Although this information is rarely used, you should set the options.
Note that these particular options only take effect when giving them in
the global configuration file; when found in your private
<TT
CLASS="FILENAME"
>elmrc</TT
>, they will be ignored.</P
></DIV
><DIV
CLASS="SECT2"
><H2
CLASS="SECT2"
><A
NAME="X-087-2-MAIL.ELM.CHARSETS"
>17.5.2. National Character Sets</A
></H2
><P
>A set of standards and RFCs have been developed that amend the RFC-822
standard to support various types of messages, such as plain text,
binary data, PostScript files, etc. These standards are commonly
referred to as MIME, or Multipurpose Internet Mail Extensions. Among
other things, MIME also lets the recipient know if a character set
other than standard ASCII has been used when writing the message, for
example, using French accents or German
umlauts. <B
CLASS="COMMAND"
>elm</B
> supports these characters to some
extent.</P
><P
>The character set used by Linux internally to represent characters is
usually referred to as ISO-8859-1, which is the name of the standard it
conforms to. It is also known as Latin-1. Any message using characters
from this character set should have the following line in its header:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>Content-Type: text/plain; charset=iso-8859-1</PRE
></TD
></TR
></TABLE
></P
><P
>The receiving system should recognize this field and take appropriate
measures when displaying the message. The default for
<SPAN
CLASS="SYSTEMITEM"
>text/plain</SPAN
> messages is a
<SPAN
CLASS="SYSTEMITEM"
>charset</SPAN
> value of
<SPAN
CLASS="SYSTEMITEM"
>us-ascii</SPAN
>.</P
><P
>To be able to display messages with character sets other than ASCII,
<B
CLASS="COMMAND"
>elm</B
> must know how to print these characters. By default,
when <B
CLASS="COMMAND"
>elm</B
> receives a message with a
<TT
CLASS="REPLACEABLE"
><I
>charset</I
></TT
> field other than
<SPAN
CLASS="SYSTEMITEM"
>us-ascii</SPAN
> (or a content type other than
<SPAN
CLASS="SYSTEMITEM"
>text/plain</SPAN
>, for that matter), it
tries to display the message using a command called
<B
CLASS="COMMAND"
>metamail</B
>. Messages that require <B
CLASS="COMMAND"
>metamail</B
>
to be displayed are shown with an <B
CLASS="COMMAND"
>M</B
> in the very first
column in the overview screen.</P
><P
>Since Linux's native character set is ISO-8859-1, calling
<B
CLASS="COMMAND"
>metamail</B
> is not necessary to display messages using
this character set. If <B
CLASS="COMMAND"
>elm</B
> is told that the display
understands ISO-8859-1, it will not use <B
CLASS="COMMAND"
>metamail</B
>,
but will display the message directly instead. This can be enabled by
setting the following option in the global
<TT
CLASS="FILENAME"
>elm.rc</TT
>:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>displaycharset = iso-8859-1</PRE
></TD
></TR
></TABLE
></P
><P
>Note that you should set this option even when you are never going to
send or receive any messages that actually contain characters other than
ASCII. This is because people who do send such messages usually
configure their mailer to put the proper <TT
CLASS="LITERAL"
>Content-Type:</TT
>
field into the mail header by default, whether or not they are sending
ASCII-only messages.</P
><P
>However, setting this option in <TT
CLASS="FILENAME"
>elm.rc</TT
> is not
enough. When displaying the message with its built-in pager,
<B
CLASS="COMMAND"
>elm</B
> calls a library function for each character to
determine whether it is printable. By default, this function will only
recognize ASCII characters as printable and display all other
characters as <TT
CLASS="LITERAL"
>^?</TT
>. You may overcome this function by setting
the environment variable <SPAN
CLASS="SYSTEMITEM"
>LC_CTYPE</SPAN
> to <SPAN
CLASS="SYSTEMITEM"
>ISO-8859-1</SPAN
>, which tells the library to
accept Latin-1 characters as printable. Support for this and other
features have been available since Version 4.5.8 of the Linux standard library.</P
><P
>When sending messages that contain special characters from ISO-8859-1,
you should make sure to set two more variables in the
<TT
CLASS="FILENAME"
>elm.rc</TT
> file:
<TABLE
BORDER="0"
BGCOLOR="#E0E0E0"
WIDTH="100%"
><TR
><TD
><PRE
CLASS="SCREEN"
>charset = iso-8859-1
textencoding = 8bit</PRE
></TD
></TR
></TABLE
></P
><P
>This makes <B
CLASS="COMMAND"
>elm</B
> report the character set as ISO-8859-1
in the mail header and send it as an 8-bit value (the default is to strip all
characters to 7-bit).</P
><P
>Of course, all character set options we've discussed here may also be
set in the private <TT
CLASS="FILENAME"
>elmrc</TT
> file instead of the global one
so individual users can have their own default settings if the global one
doesn't suit them.</P
></DIV
></DIV
><DIV
CLASS="NAVFOOTER"
><HR
ALIGN="LEFT"
WIDTH="100%"><TABLE
WIDTH="100%"
BORDER="0"
CELLPADDING="0"
CELLSPACING="0"
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
><A
HREF="x-087-2-mail.routing.html"
>Prev</A
></TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="index.html"
>Home</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
><A
HREF="x-087-2-sendmail.html"
>Next</A
></TD
></TR
><TR
><TD
WIDTH="33%"
ALIGN="left"
VALIGN="top"
>How Does Mail Routing Work?</TD
><TD
WIDTH="34%"
ALIGN="center"
VALIGN="top"
><A
HREF="x-087-2-mail.html"
>Up</A
></TD
><TD
WIDTH="33%"
ALIGN="right"
VALIGN="top"
>Sendmail</TD
></TR
></TABLE
></DIV
></BODY
></HTML
>