463 lines
12 KiB
HTML
463 lines
12 KiB
HTML
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
|
<HTML
|
|
><HEAD
|
|
><TITLE
|
|
>Advanced topics</TITLE
|
|
><META
|
|
NAME="GENERATOR"
|
|
CONTENT="Modular DocBook HTML Stylesheet Version 1.7"><LINK
|
|
REL="HOME"
|
|
TITLE="The Linux Mail User HOWTO"
|
|
HREF="index.html"><LINK
|
|
REL="PREVIOUS"
|
|
TITLE="Mail User Agents"
|
|
HREF="mua.html"><LINK
|
|
REL="NEXT"
|
|
TITLE="Other sources of information"
|
|
HREF="resources.html"></HEAD
|
|
><BODY
|
|
CLASS="sect1"
|
|
BGCOLOR="#FFFFFF"
|
|
TEXT="#000000"
|
|
LINK="#0000FF"
|
|
VLINK="#840084"
|
|
ALINK="#0000FF"
|
|
><DIV
|
|
CLASS="NAVHEADER"
|
|
><TABLE
|
|
SUMMARY="Header navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TH
|
|
COLSPAN="3"
|
|
ALIGN="center"
|
|
>The Linux Mail User HOWTO</TH
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="left"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="mua.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="80%"
|
|
ALIGN="center"
|
|
VALIGN="bottom"
|
|
></TD
|
|
><TD
|
|
WIDTH="10%"
|
|
ALIGN="right"
|
|
VALIGN="bottom"
|
|
><A
|
|
HREF="resources.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"></DIV
|
|
><DIV
|
|
CLASS="sect1"
|
|
><H1
|
|
CLASS="sect1"
|
|
><A
|
|
NAME="advanced"
|
|
></A
|
|
>3. Advanced topics</H1
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="aliases"
|
|
></A
|
|
>3.1. Aliases</H2
|
|
><P
|
|
>An `alias' is a way to set up a pseudo-address that simply directs
|
|
mail to another (single) address. There are two kinds of aliases:
|
|
MUA aliases and MTA aliases.</P
|
|
><P
|
|
>An MUA alias is one you set up in your MUA as a kind of personal
|
|
shorthand. Other people will not be able to see or use this alias.
|
|
For example, you could write:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> alias esr Eric S. Raymond <esr@thyrsus.com>
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>in your mutt configuration file. This would tell mutt that when it
|
|
sees `esr' in an address line, it should behave as through you had
|
|
typed `esr@thyrsus.com', Or you can type `mutt esr' and the expanded
|
|
address will be automatically filled in on the `to' line.</P
|
|
><P
|
|
>An MTA alias is one your MTA expands; it will be usable by
|
|
everyone, both on your machine and remotely. To create MTA aliases
|
|
you must modify a system file, usually but not always
|
|
<TT
|
|
CLASS="filename"
|
|
>/etc/aliases</TT
|
|
> or
|
|
<TT
|
|
CLASS="filename"
|
|
>/etc/mail/aliases</TT
|
|
> (the location depends on your
|
|
MTA). It may be instructive for you to look at the the aliases on
|
|
your system; it should contain a number of standard aliases such as
|
|
`postmaster'.</P
|
|
><P
|
|
>Your MTA may also allow the target of an alias to be a filename, which
|
|
will be treated as a mailbox the mail is to be appended to (this is
|
|
useful for archiving mail). It may also allow the target of an alias
|
|
to be a program, in which case mail to that alias will be passed to
|
|
an instance of the program on its standard input.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="forwarding"
|
|
></A
|
|
>3.2. Forwarding</H2
|
|
><P
|
|
>MTA aliases usually require administrator privileges to set up. But
|
|
it is desirable for mail users to be able to set up forwarding of
|
|
their own mail without administrator intervention.</P
|
|
><P
|
|
>To support this, most MTAs follow sendmail's lead and look for a file
|
|
called
|
|
<TT
|
|
CLASS="filename"
|
|
>.forward</TT
|
|
>
|
|
in your home directory. The contents of this file is interpreted like the
|
|
target of an alias which should receive all your mail; it should be a
|
|
single address. The most common use for this facility is to redirect your
|
|
mail to an account on another machine.</P
|
|
><P
|
|
>To amplify: The existence of the .forward file, regardless of whats
|
|
in it, tells the system to treat the contents of the file as an alias
|
|
target for all your mail. If you create an empty .forward file, your mail
|
|
disappears. Most people use this to forward their mail to another machine,
|
|
so most often there is just one email address in the first line, and
|
|
nothing else. The MTA will honor whatever is on the first line of your
|
|
.forward file as the target of an alias. Everything else is ignored. If the
|
|
target is misformatted, just like any other alias, then the mail
|
|
disappears.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="autoreply"
|
|
></A
|
|
>3.3. Auto-replying</H2
|
|
><P
|
|
>Another common use for the <TT
|
|
CLASS="filename"
|
|
>.forward</TT
|
|
>
|
|
facility is to pass your mail to a `vacation' program. A vacation
|
|
program reads incoming mail and automatically generates a canned reply
|
|
to it; they are so called because the most common form of canned reply
|
|
is to inform the sender that you are on vacation and will not be
|
|
reachable until a given date.</P
|
|
><P
|
|
>There is no one standard vacation program that is in universal use.
|
|
There are two good reasons for this: one, that such a program is
|
|
very easy to write as a shellscript or filter rule (see below); and
|
|
two, that vacation programs interact badly with mailing lists.</P
|
|
><P
|
|
>You should temporarily unsubscribe from all mailing lists you are on
|
|
before setting up auto-answering; otherwise, all members of the
|
|
mailing lists mail find they are being flooded with canned messages
|
|
by your vacation program. This is considered very rude behavior
|
|
and will guarantee you quite a frosty reception on your return.</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="lists"
|
|
></A
|
|
>3.4. Mailing lists</H2
|
|
><P
|
|
>A mailing list is a pseudo-address that sends mail to more than
|
|
one user.</P
|
|
><P
|
|
>In its simplest form, mailing list is just an MTA alias with more than
|
|
one recipient. Some small mailing lists are maintained this way.
|
|
Sendmail assists by supporting a syntax in <TT
|
|
CLASS="filename"
|
|
>/etc/aliases</TT
|
|
>
|
|
that includes the contents of a given mailing list file in the target
|
|
side of an alias. It looks like this:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> admin-list: ":include:/usr/home/admin/admin-list"
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>with the advantage that the admin-list file can live in
|
|
unprivileged-user space somewhere (root is only needed to set
|
|
up the original inclusion). Some other MTAs have similar features.</P
|
|
><P
|
|
>These simple lists are commonly called `mail
|
|
reflectors'.
|
|
There are a couple of problems with mail reflectors. One is that
|
|
bounce messages from failed attempts to broadcast goes to all users.
|
|
Another is that all subscriptions and unsubscriptions have to be done
|
|
manually by the mailing list administrator.</P
|
|
><P
|
|
>A kind of software called a mailing list
|
|
manager
|
|
has evolved to address these problems and other related ones. Its
|
|
most important function is to permit mailing list users to subscribe
|
|
and unscubscribe without going through the list maintainer.</P
|
|
><P
|
|
>A mailing-list manager keeps its own user-list information and
|
|
hooks up to the MTA through a program alias in
|
|
<TT
|
|
CLASS="filename"
|
|
>/etc/aliases</TT
|
|
>. For example, if the admin-list
|
|
above were going through the mailing list manager called SmartList on
|
|
a sendmail system, a portion of <TT
|
|
CLASS="filename"
|
|
>/etc/aliases</TT
|
|
>
|
|
might look like this:</P
|
|
><TABLE
|
|
BORDER="0"
|
|
BGCOLOR="#E0E0E0"
|
|
WIDTH="100%"
|
|
><TR
|
|
><TD
|
|
><FONT
|
|
COLOR="#000000"
|
|
><PRE
|
|
CLASS="programlisting"
|
|
> admin-list: "|/usr/home/smartlist/bin/flist admin-list"
|
|
admin-list-request: "|/usr/home/smartlist/bin/flist admin-list-request"
|
|
</PRE
|
|
></FONT
|
|
></TD
|
|
></TR
|
|
></TABLE
|
|
><P
|
|
>Note that this is a pair of aliases. It is conventional for
|
|
real mailing lists to have a request
|
|
address to be
|
|
used for user subscription and unsubscription requests. It is
|
|
considered rude and ignorant to send subscription/unsubscription
|
|
requests to the main address of such a list -- don't do it.</P
|
|
><P
|
|
>The robot sitting behind the request address may offer other features
|
|
besides just subscription/unsubscription. It may respond to help
|
|
requests, allow you to query who is on the list, or give you automated
|
|
access to list archives. It may also allow list administrators to
|
|
restrict posting to known members, set the list to auto-subscribe
|
|
nonmembers when they first post, or set various security policy
|
|
options. Mailing-list managers differ primarily in the design and
|
|
range of these secondary features.</P
|
|
><P
|
|
>Unfortunately, the format for sending commands to mailing-list request
|
|
robots is not standard. Some expect commands in the subject line,
|
|
some ignore the subject line and expect commands in the message body.
|
|
You need to pay attention to the response mail you get when you first
|
|
subscribe; it's a good idea to save such mail to a subscriptions
|
|
mailbox for later reference.</P
|
|
><P
|
|
>The most important mailing-list managers to know about are majordomo,
|
|
listserv, listproc, and smartlist; majordomo is the most popular by a
|
|
considerable margin. Recently, <A
|
|
HREF="http://www.gnu.org/software/mailman/mailman.html"
|
|
TARGET="_top"
|
|
>mailman</A
|
|
>, a
|
|
list manager with a rather nice Web-based signon/signoff/administration
|
|
interface, has become very popular and may be in the pricess of obsolescing
|
|
the older programs. There is a rather comprehensive <A
|
|
HREF="http://www.catalog.com/vivian/mailing-list-software.html"
|
|
TARGET="_top"
|
|
>list</A
|
|
>
|
|
of such packages on the Web.</P
|
|
><P
|
|
>For more about mailing list managers, consult the resources at
|
|
the <A
|
|
HREF="http://www.greatcircle.com/list-managers/"
|
|
TARGET="_top"
|
|
>List-Managers Mailing
|
|
List</A
|
|
>, including the FAQ (note: this list is
|
|
<EM
|
|
>not</EM
|
|
> appropriate for how-to questions).</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="filters"
|
|
></A
|
|
>3.5. Mail filters</H2
|
|
><P
|
|
>A mail filter is a program that sits between your local
|
|
delivery agent and you, automatically dispatching or rejecting mail
|
|
before you see it.</P
|
|
><P
|
|
>Mail filters have a number of uses. The most important are spam
|
|
filtering, dispatching to multiple mailboxes by topic or sender, and
|
|
auto-answering mail.</P
|
|
><P
|
|
>Typically, you set up mail filtering by putting a program alias
|
|
for the filter program in your .forward file, and writing a file of
|
|
filtering rules. The format and location of the filter rules file
|
|
varies between filter programs.</P
|
|
><P
|
|
>There are good feature summaries of the three major mail filters
|
|
(procmail, mailagent, and deliver) in <A
|
|
HREF="http://www.faqs.org/faqs/mail/setup/unix/part3/index.html"
|
|
TARGET="_top"
|
|
>part
|
|
3</A
|
|
> of Chris Lewis's Email Software Survey. The most popular of
|
|
these is (despite its rather nasty rule syntax) procmail, which is
|
|
universally present on Linux systems (and, indeed, is generally used
|
|
as the system's local delivery agent).</P
|
|
></DIV
|
|
><DIV
|
|
CLASS="sect2"
|
|
><H2
|
|
CLASS="sect2"
|
|
><A
|
|
NAME="spam"
|
|
></A
|
|
>3.6. Coping with spam</H2
|
|
><P
|
|
>Spam is sometimes known as `UCE' (Unsolicited Commercial Email)
|
|
or `UBE' (Unsolicited Bulk Email). As these names imply, it is an
|
|
obnoxious form of advertising that stuffs your mailbox with form
|
|
letters. (The term `spam' comes from a Monty Python's Flying Circus
|
|
skit in which a choir of Vikings endlessly repeats the chant "Spam
|
|
spam spam spam...").</P
|
|
><P
|
|
>Most spam seems to consist of solicitations for pyramid schemes,
|
|
ads for pornography, or (annoyingly) attempts to sell spam-sending
|
|
programs. A few individual spams (like MAKE MONEY FAST or the Craig
|
|
Shergold postcard hoax) have been so persistent as to become
|
|
legendary. Spam tends to be both verbose and illiterate. It's a
|
|
waste of time and a huge waste of network bandwidth.</P
|
|
><P
|
|
>If you're being deluged with spam, get educated. Browse the <A
|
|
HREF="http://spam.abuse.net/"
|
|
TARGET="_top"
|
|
>Fight Spam on the Internet!</A
|
|
> page. The
|
|
<A
|
|
HREF="http://www.mindworkshop.com/alchemy/nospam.html"
|
|
TARGET="_top"
|
|
>Death To
|
|
Spam!</A
|
|
> page is particularly effective on methods for stopping or
|
|
backtracking spam.</P
|
|
></DIV
|
|
></DIV
|
|
><DIV
|
|
CLASS="NAVFOOTER"
|
|
><HR
|
|
ALIGN="LEFT"
|
|
WIDTH="100%"><TABLE
|
|
SUMMARY="Footer navigation table"
|
|
WIDTH="100%"
|
|
BORDER="0"
|
|
CELLPADDING="0"
|
|
CELLSPACING="0"
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="mua.html"
|
|
ACCESSKEY="P"
|
|
>Prev</A
|
|
></TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="index.html"
|
|
ACCESSKEY="H"
|
|
>Home</A
|
|
></TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
><A
|
|
HREF="resources.html"
|
|
ACCESSKEY="N"
|
|
>Next</A
|
|
></TD
|
|
></TR
|
|
><TR
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="left"
|
|
VALIGN="top"
|
|
>Mail User Agents</TD
|
|
><TD
|
|
WIDTH="34%"
|
|
ALIGN="center"
|
|
VALIGN="top"
|
|
> </TD
|
|
><TD
|
|
WIDTH="33%"
|
|
ALIGN="right"
|
|
VALIGN="top"
|
|
>Other sources of information</TD
|
|
></TR
|
|
></TABLE
|
|
></DIV
|
|
></BODY
|
|
></HTML
|
|
> |