@c -*-tex-*-
@node Electronic Mail, FTP, Basics, Top
@chapter Electronic Mail
@cindex Electronic Mail
@menu
@end menu

@c old @footnote{@xref{ISDN} for more info on ISDN.})

The desire to communicate is the essence of networking.  People have
always wanted to correspond with each other in the fastest way
possible, short of normal conversation.  Electronic mail (or
@dfn{email}) is the most prevalent application of this in computer
networking.  It allows people to write back and forth without having
to spend much time worrying about how the message actually gets
delivered.  As technology grows closer and closer to being a common
part of daily life, the need to understand the many ways it can be
utilized and how it works, at least to some level, is vital.
@c part of daily life (as has been evidenced by the ISDN effort, the need
@c to understand the many ways it can be utilized and how it works, at
@c least to some level, is vital.

@node Addresses, Lists, Electronic Mail, Electronic Mail
@section Email Addresses
@menu
@end menu

Electronic mail is hinged around the concept of an @dfn{address}; the
section on Networking Basics made some reference to it while
introducing domains.  Your @dfn{email address} provides all of the
information required to get a message to you from anywhere in the
world.  An address doesn't necessarily have to go to a human being.
It could be an archive server,@footnote{@xref{Archive Servers}, for a
description.} a list of people, or even someone's pocket pager.  These
cases are the exception to the norm---mail to most addresses is read
by human beings.
@cindex address, email
@cindex archive servers
@cindex domains

@node Symbolic Cacophony
@subsection %@@!.: Symbolic Cacophony

Email addresses usually appear in one of two forms---using the
Internet format which contains @samp{@@}, an ``at''-sign, or using the
UUCP format which contains @samp{!}, an exclamation point, also called
a ``bang.''  The latter of the two, UUCP ``bang'' paths, is more
restrictive, yet more clearly dictates how the mail will travel.
@cindex bang path
@cindex UUCP

To reach Jim Morrison on the system @code{south.america.org}, one
would address the mail as @samp{jm@@south.america.org}.  But if Jim's
account was on a UUCP site named @code{brazil}, then his address
would be @samp{brazil!jm}.  If it's possible (and one exists), try to
use the Internet form of an address; bang paths can fail if an
intermediate site in the path happens to be down.  There is a growing
trend for UUCP sites to register Internet domain names, to help
alleviate the problem of path failures.
@cindex domains

Another symbol that enters the fray is @samp{%}---it acts as an extra
``routing'' method.  For example, if the UUCP site @code{dream} is
connected to @code{south.america.org}, but doesn't have an Internet
domain name of its own, a user @code{debbie} on @code{dream} can be
reached by writing to the address
@c not smallexample!
@example
debbie%dream@@south.america.org
@end example

@noindent
The form is significant.  This address says that the local system
should first send the mail to @code{south.america.org}.  There the
address @code{debbie%dream} will turn into @code{debbie@@dream}, which
will hopefully be a valid address.  Then @code{south.america.org} will
handle getting the mail to the host @code{dream}, where it will be
delivered locally to @code{debbie}.

All of the intricacies of email addressing methods are fully covered
in the book @cite{!%@@:: A Directory of Electronic Mail Addressing and
Networks} published by O'Reilly and Associates, as part of their
Nutshell Handbook series.  It is a must for any active email user.
Write to @var{nuts@@ora.com} for ordering information.
@cindex Nutshell Books

@node Sending and Receiving Mail
@subsection Sending and Receiving Mail

We'll make one quick diversion from being OS-neuter here, to show you
what it will look like to send and receive a mail message on a Unix
system.  Check with your system administrator for specific
instructions related to mail at your site.

A person sending the author mail would probably do something like this:
@smallexample
% mail brendan@@cs.widener.edu
Subject: print job's stuck

I typed `print babe.gif' and it didn't work! Why??
@end smallexample

@noindent
The next time the author checked his mail, he would see it listed in
his mailbox as:

@smallexample
% mail
"/usr/spool/mail/brendan": 1 messages 1 new 1 unread
 U  1 joeuser@@foo.widene Tue May  5 20:36   29/956   print job's stuck
?
@end smallexample

@noindent
which gives information on the sender of the email, when it was sent,
and the subject of the message.  He would probably use the
@samp{reply} command of Unix mail to send this response:

@smallexample
@group
? r
To: joeuser@@foo.widener.edu
Subject: Re: print job's stuck

You shouldn't print binary files like GIFs to a printer!

Brendan
@end group
@end smallexample

Try sending yourself mail a few times, to get used to your system's
mailer.  It'll save a lot of wasted aspirin for both you and your
system administrator.

@node Mail Header
@subsection Anatomy of a Mail Header
@cindex headers
@cindex RFC-822, email format

An electronic mail message has a specific structure to it that's
common across every type of computer system.@footnote{The standard is
written down in RFC-822.  @xref{RFCs} for more info on how to get copies
of the various RFCs.}  A sample would be:

@smallexample
From bush@@hq.mil Sat May 25 17:06:01 1991
Received: from hq.mil by house.gov with SMTP id AA21901
  (4.1/SMI for dan@@house.gov); Sat, 25 May 91 17:05:56 -0400
Date: Sat, 25 May 91 17:05:56 -0400
From: The President <bush@@hq.mil>
Message-Id: <9105252105.AA06631@@hq.mil>
To: dan@@senate.gov
Subject: Meeting

Hi Dan .. we have a meeting at 9:30 a.m. with the Joint Chiefs. Please
don't oversleep this time.
@end smallexample

@noindent
The first line, with @samp{From} and the two lines for
@samp{Received:} are usually not very interesting.  They give the
``real'' address that the mail is coming from (as opposed to the
address you should reply to, which may look much different), and what
places the mail went through to get to you.  Over the Internet, there
is always at least one @samp{Received:} header and usually no more
than four or five.  When a message is sent using UUCP, one
@samp{Received:} header is added for each system that the mail passes
through.  This can often result in more than a dozen @samp{Received:}
headers.  While they help with dissecting problems in mail delivery,
odds are the average user will never want to see them.  Most mail
programs will filter out this kind of ``cruft'' in a header.
@cindex UUCP

The @samp{Date:} header contains the date and time the message was
sent.  Likewise, the ``good'' address (as opposed to ``real'' address)
is laid out in the @samp{From:} header.  Sometimes it won't include
the full name of the person (in this case @samp{The President}), and
may look different, but it should always contain an email address of
some form.

The @samp{Message-ID:} of a message is intended mainly for tracing
mail routing, and is rarely of interest to normal users.  Every
@samp{Message-ID:} is guaranteed to be unique.

@samp{To:} lists the email address (or addresses) of the recipients of
the message.  There may be a @samp{Cc:} header, listing additional
addresses.  Finally, a brief subject for the message goes in the
@samp{Subject:} header.

The exact order of a message's headers may vary from system to system,
but it will always include these fundamental headers that are vital to
proper delivery.

@node Bounced Mail,  , Mail Header, Addresses
@subsection Bounced Mail
@cindex address, email
@cindex bounce, mail delivery

When an email address is incorrect in some way (the system's name is
wrong, the domain doesn't exist, whatever), the mail system will
@dfn{bounce} the message back to the sender, much the same way that
the Postal Service does when you send a letter to a bad street
address.  The message will include the reason for the bounce; a common
error is addressing mail to an account name that doesn't exist.  For
example, writing to Lisa Simpson at Widener University's Computer
Science department will fail, because she doesn't have an
account.@footnote{Though if she asked, we'd certainly give her one.}
@cindex domains

@smallexample
@group
From: Mail Delivery Subsystem <MAILER-DAEMON>
Date: Sat, 25 May 91 16:45:14 -0400
To: mg@@gracie.com
Cc: Postmaster@@cs.widener.edu
Subject: Returned mail: User unknown

   ----- Transcript of session follows -----
While talking to cs.widener.edu:
>>> RCPT To:<lsimpson@@cs.widener.edu>
<<< 550 <lsimpson@@cs.widener.edu>... User unknown
550 lsimpson... User unknown
@end group
@end smallexample

@noindent
As you can see, a carbon copy of the message (the @samp{Cc:} header
entry) was sent to the postmaster of Widener's CS department.  The
@dfn{Postmaster} is responsible for maintaining a reliable mail system
on his system.  Usually postmasters at sites will attempt to aid you
in getting your mail where it's supposed to go.  If a typing error was
made, then try re-sending the message.  If you're sure that the
address is correct, contact the postmaster of the site directly and
ask him how to properly address it.
@cindex postmaster

The message also includes the text of the mail, so you don't have to
retype everything you wrote.

@smallexample
   ----- Unsent message follows -----
Received: by cs.widener.edu id AA06528; Sat, 25 May 91 16:45:14 -0400
Date: Sat, 25 May 91 16:45:14 -0400
From: Matt Groening <mg@@gracie.com>
Message-Id: <9105252045.AA06528@@gracie.com>
To: lsimpson@@cs.widener.edu
Subject: Scripting your future episodes
Reply-To: writing-group@@gracie.com

@var{@dots{} verbiage @dots{}}
@end smallexample

@noindent
The full text of the message is returned intact, including any headers
that were added.  This can be cut out with an editor and fed right
back into the mail system with a proper address, making redelivery a
relatively painless process.

@node Lists
@section Mailing Lists
@cindex mailing list

People that share common interests are inclined to discuss their hobby
or interest at every available opportunity.  One modern way to aid in
this exchange of information is by using a @dfn{mailing
list}---usually an email address that redistributes all mail sent to
it back out to a list of addresses.  For example, the Sun Managers
mailing list (of interest to people that administer computers
manufactured by Sun) has the address
@samp{sun-managers@@eecs.nwu.edu}.  Any mail sent to that address will
``explode'' out to each person named in a file maintained on a
computer at Northwestern University.

@cindex administrivia
@cindex Sun Managers
Administrative tasks (sometimes referred to as @dfn{administrivia})
are often handled through other addresses, typically with the suffix
@samp{-request}.  To continue the above, a request to be added to or
deleted from the Sun Managers list should be sent to
@samp{sun-managers-request@@eecs.nwu.edu}.

When in doubt, try to write to the @samp{-request} version of a
mailing list address first; the other people on the list aren't
interested in your desire to be added or deleted, and can certainly do
nothing to expedite your request.  Often if the administrator of a
list is busy (remember, this is all peripheral to real jobs and real
work), many users find it necessary to ask again and again, often with
harsher and harsher language, to be removed from a list.  This does
nothing more than waste traffic and bother everyone else receiving the
messages.  If, after a reasonable amount of time, you still
haven't succeeded to be removed from a mailing list, write to the
postmaster at that site and see if they can help.
@cindex postmaster

Exercise caution when replying to a message sent by a mailing list.  If
you wish to respond to the author only, make @emph{sure} that the only
address you're replying to is that person, and not the entire list.
Often messages of the sort ``Yes, I agree with you completely!'' will
appear on a list, boring the daylights out of the other readers.  Likewise,
if you explicitly do want to send the message to the whole list,
you'll save yourself some time by checking to make sure it's indeed
headed to the whole list and not a single person.

@cindex FTPable Items
A list of the currently available mailing lists is available in at
least two places; the first is in a file on @code{ftp.nisc.sri.com}
called @file{interest-groups} under the @file{netinfo/} directory.
It's updated fairly regularly, but is large (presently around 700K),
so only get it every once in a while.  The other list is maintained by
Gene Spafford (@code{spaf@@cs.purdue.edu}), and is posted in parts to
the newsgroup @code{news.lists} semi-regularly. (@xref{Usenet News},
for info on how to read that and other newsgroups.)

@node Listservs
@subsection Listservs
@cindex listserv

On BITNET there's an automated system for maintaining discussion lists
called the @dfn{listserv}.  Rather than have an already harried and
overworked human take care of additions and removals from a list, a
program performs these and other tasks by responding to a set of
user-driven commands.

Areas of interest are wide and varied---ETHICS-L deals with ethics in
computing, while ADND-L has to do with a role-playing game.  A full
list of the available BITNET lists can be obtained by writing to
@samp{LISTSERV@@BITNIC.BITNET} with a body containing the command

@c not smallexample!
@example
list global
@end example

@noindent
However, be sparing in your use of this---see if it's already on your
system somewhere.  The reply is quite large.

The most fundamental command is @samp{subscribe}.  It will tell the
listserv to add the sender to a specific list.  The usage is

@c not smallexample!
@example
subscribe foo-l @var{Your Real Name}
@end example

@noindent
It will respond with a message either saying that you've been added to
the list, or that the request has been passed on to the system on
which the list is actually maintained.

The mate to @samp{subscribe} is, naturally, @samp{unsubscribe}.  It
will remove a given address from a BITNET list.  It, along with all
other listserv commands, can be abbreviated---@samp{subscribe} as
@samp{sub}, @samp{unsubscribe} as @samp{unsub}, etc.  For a full list
of the available listserv commands, write to
@samp{LISTSERV@@BITNIC.BITNET}, giving it the command @samp{help}.
@cindex help, with listservs
@cindex listserv

As an aside, there have been implementations of the listserv system
for non-BITNET hosts (more specifically, Unix systems).  One of the
most complete is available on @code{cs.bu.edu} in the
directory @file{pub/listserv}.
@cindex FTPable Items

@vskip 0pt plus 1filll
@flushright
``I made this letter longer than usual because
I lack the time to make it shorter.''
@b{Pascal}, @cite{Provincial Letters XVI}
@end flushright
