

mail                         Overview                        mail




Electronic mail system


The  COHERENT system  includes a  full-featured,  UNIX-style mail
system.  It  consists of a  number of commands  and files through
which you  can describe potential  recipients of mail,  either on
your  system  or other  systems,  and send  mail  to them  either
directly or  via UUCP.  This article describes  the design of the
COHERENT mail system,  and introduces the commands and files that
compose it.

***** Structure of the COHERENT Mail System *****

The  COHERENT mail  system has three  major components:  the _u_s_e_r
_a_g_e_n_t  (i.e., mmaaiill);  the _r_o_u_t_i_n_g _a_g_e_n_t  (the commands  ssmmaaiill and
rrmmaaiill); and the delivery agents (the commands llmmaaiill and uuuuxx).

The user agent collects messages from the user and reads messages
from  a  user's  mailbox.  It  hands  to  the  routing agent  for
delivery any messages it receives from the user.

The routing  agents decode addresses and decide  how to deliver a
message.  They  are the only  components of the  mail system that
must run sseettuuiidd to assume the privilege of the superuser rroooott.

The delivery agents move messages to their destination.

The  local delivery  agent,  llmmaaiill, places  messages into  users'
mailboxes.   To  discourage  mail  forging,  llmmaaiill does  not  use
sseettuuiidd. It  must be run by a privileged  user (generally rroooott) to
write into all mail boxes.  As a rule, llmmaaiill is invoked only by a
routing agent.

The UUCP delivery agent, uuuuxx, queues messages for transmission to
remote systems.   It uses sseettuuiidd  to assume the  identity of user
uuuuccpp in order to  write into the necessary spool directories.  It
has long  been trivial to  forge messages to  remote systems with
uuuuxx; keep this in mind if you plan to use electronic mail for any
kind of authorization system.

ssmmaaiill  looks up  each _u_s_e_r in  file /uussrr/lliibb/mmaaiill/aalliiaasseess.  If it
finds a match, it uses the matched name in place of _u_s_e_r. If _u_s_e_r
is of the form


        _s_y_s!_u_s_e_r


or







COHERENT Lexicon                                           Page 1




mail                         Overview                        mail



        _s_y_s! ... !_u_s_e_r


or


        _u_s_e_r@_s_y_s[._d_o_m_a_i_n]


it  is  treated  as a  remote  destination.   ssmmaaiill then  invokes
command uuuuxx  to pass the message to  _s_y_s, whose responsibility it
becomes to pass the message to _u_s_e_r.

If   ssmmaaiill   finds   no   match  in   /uussrr/lliibb/mmaaiill/aalliiaasseess,   or
$HHOOMMEE/.aalliiaasseess, however, it attempts to look up each _u_s_e_r in file
/eettcc/ppaasssswwdd, to see if this is a local user.  If it does not find
_u_s_e_r  in this  file, ssmmaaiill  mails  an error  message back  to the
sender.   If, however,  it  does find  _u_s_e_r in  this file,  ssmmaaiill
checks   file   $HHOOMMEE/.ffoorrwwaarrdd   for  any   possible   forwarding
instructions.  If  this file is absent,  ssmmaaiill passes the message
to   llmmaaiill.   llmmaaiill    writes   the   message   into   the   file
/uussrr/ssppooooll/mmaaiill/_u_s_e_r.    This   file   is   called   the   user's
``mailbox''.  Note  that _u_s_e_r owns  this file, and  can therefore
permit or deny access to her mail by other users.

***** Files *****

$HHOOMMEE/ddeeaadd.lleetttteerr -- Message that mmaaiill could not send
$HHOOMMEE/.aalliiaasseess -- Personal mail alias file for outgoing mail
$HHOOMMEE/.ffoorrwwaarrdd -- Forwarding instructions for inbound mail
/eettcc/ppaasssswwdd -- User identities
/ttmmpp/mmaaiill* -- Temporary and lock files
/uussrr/lliibb/mmaaiill/aalliiaasseess -- Aliases of users
/uussrr/lliibb/mmaaiill/ffuullllnnaammeess -- Short full name aliases of users
/uussrr/lliibb/mmaaiill/ppaatthhss -- Mail routing control file
/uussrr/ssppooooll/mmaaiill -- Mailbox directory, filed by user name

***** See Also *****

aalliiaasseess, ccoommmmaannddss, mmaaiill, mmkkffnnaammeess, mmssgg, nnppttxx, ppaatthhss, uuuuxx

***** Notes *****

To  mail a  file  to another  user, use  the shell's  redirection
operator `<'.  For example, the command


        mail stephen <bug.report


mails file bbuugg.rreeppoorrtt to  user sstteepphheenn. The file will be prefixed
with  your address,  and suffixed  with your  mail ``signature'',
should you have one.




COHERENT Lexicon                                           Page 2


