%& latex -*-LaTeX-*- RCS $Id: zend.tex,v 1.7 1993/02/02 21:00:00 gerben Exp $
\documentstyle[a4,english,verbatim,titlepage]{article}
\title{Zend}
\author{Gerben Wierda}
\begin{document}
\maketitle
\def\Zn{{\sl Zend\/}}

\section{Introduction}

\Zn\ is meant as a general sender/receiver of files over the network through
\mbox{e-mail}. Normally, when people send each other files through mail (and they are
not using some kind of multimedia mail like NeXTmail, or MIME based mail) they
have to handle \verb|tar|, \verb|compress|, \verb|uuencode| and \verb|split|,
by themselves. \Zn\ does this for them. It will \verb|tar| directories,
\verb|compress| files, split them in chunks that can be handled by mail
(something most multimedia mailers do not account for, with the result that
mail messages often become too big for the connection software --- mostly UUCP
--- to handle) and send them to the receiver.

For a receiver to be able to receive files/directories that were sent by \Zn,
they should have \Zn\ installed on their system. Since \Zn\ runs {\sl setuid
root\/} it will have to be installed by the system administrator.

\Zn\ is meant to be system-independent and it makes use of standard Unix
utilities only. If not, the utilities are distributed with \Zn.

\section{User guide}

If someone wants to send a file, he or she enters:
\begin{quote}
\tt zend \sl user@remotehost file \rm [ \sl user@remotehost file \rm \ldots ]
\end{quote} 
One can give a series of combinations of receiver and file.

If someone receives a file, it is written in a subdirectory \verb|Zend|
of their home
directory or in a subdirectory of a dedicated spool directory (depending on
how \Zn\ is installed) and they are
notified of its existence by e-mail. \Zn\ will not overwrite existing files or
directories.

Users can stop reading here. This is all they have to understand. For some
systems there may be GUI front-ends for \Zn. (I hope).

\pagebreak
\section{Installation guide}

\Zn\ is normally installed as executable in \verb|/usr/local/bin|. A spool
directory (normally \verb|/usr/spool/zend|) is dedicated to \Zn.
These are created by running \verb|make install|.  You should be \verb|root|
to do this.  Besides you should install ``zend'' as an alias in your
mail-receiving system, for example, with sendmail, you add a line
\begin{quote}
\verb'zend:   "|/usr/local/bin/zend-R"'
\end{quote}
to \verb|aliases| and run \verb|newaliases|. In order to make timeouts work,
you should add an invokation of \verb|zend-T| to your
\verb|crontab| or \verb|/usr/adm/daily| script. (\verb|zend-R| and
\verb|zend-T| are installed as links to \Zn\ and invoke its server modes;
alternatively---if you don't like links, for instance---you can use the
\verb|-R| and \verb|-T| flags to \Zn itself.)

\subsection{Configuration}

In the spool directory
there is a file called \verb|config| that holds various variables:
\begin{description}
\item[Z-SystemName:] The name by which this system is known to the outside
world and where all mail will be sent.  Use the wrong name here
and you might bother other systems with mail not meant for them (not much
though, since transfer only starts when both systems have agreed.)
\item[Z-Lines:] The number of lines we want other systems to use when making
chunks. Normally something like 1000, so we stay under most limits (like
100000 bytes for UUCP transfers).
\item[Z-SpoolDir:] Where to deliver arriving files.  If this is missing, the
files are delivered in a subdirectory \verb|Zend| in the user's home
directory.
\item[Z-ZendSize:] Maximum size of something we accept to send. This is after
\verb|compress| (and \verb|tar| for directories). Normally something like
500k.
\item[Z-ReceiveSize:] The same for receiving.
\item[Z-ZendTrueSize:] Maximum real size of something we accept. This is the
real size before applying \verb|compress| (or \verb|tar| for directories).
Normally something like 1000k.
\item[Z-ReceiveTrueSize:] The same for receiving.
\item[Z-UUCPMode:] TRUE when mail addresses should be created that look
like ``remotesystem!user'', FALSE when ``user@remotesystem'' is in effect.
Normally FALSE.
\item[Z-PacketTimeout:] The number of days to wait after the last received
packet before the receiver requests a rezend of not-yet-received packets.
If missing or zero, the receiver never requests a rezend.
\item[Z-JobTimeout:] The number of days to wait after the last zent or
received packet before the job is considered dead.  If missing, it defaults to
14 days.
\item[Z-AllowUsers:] A comma-separated list of users who are allowed to
receive files through \Zn.
\item[Z-ExcludeUsers:] A comma-separated list of users who are excluded from
receiving files through \Zn.
\item[Z-AllowSystems:] A comma-separated list of remote systems that are
allowed to zend files to your own system.
\item[Z-ExcludeSystems:] A comma-separated list of system names that are
not allowed to zend files to your own system.
\end{description}

There are several important things to know about these configurations:
\begin{itemize}
\item The order in which the entries are is not important.
\item Syntax is strict.  Upper and lowercase matter.  Lines that are not
understood are ignored.  Only a line with \verb|Z-ZEND-DELIMITER| will stop
parsing of a stream and thus stop the configuration process. Strings start
directly after the colon; whitespace is {\em not\/} ignored here.  On the other
hand, whitespace before numbers is ignored.
\item Missing items result in a nul-value. FALSE for booleans, 0 for numbers
and NIL for strings.\verb|Z-SpoolDir| may be NIL, but \verb|Z-SystemName| not.
\end{itemize}



\subsection{Security Issues}

In principle, this is as safe (or unsafe) as mail is. However there is a
slight difference (that can be modified in the configuration file). The only
difference between mail and \Zn\ is that normally, files are delivered in a
subdirectory of the home directory of the receiver. It is therefore possible
that the partition where the user directory is gets flooded by received files,
where otherwise only the partition used for mail would flood. By setting
\verb|Z-SpoolDir| to a directory that lies on the spool partition. Note that
by setting the spool directory to the parent directory of all user's home
directories one can enforce delivery in the home directory of the users
instead of a dedicated subdirectory. By default, \verb|Z-SpoolDir| has a
value: ``/usr/spool/zendpublic''.

\Zn\ could probably run {\sl setuid uucp\/} but then the receiving directory
for each user should be installed beforehand. Running as root gives a better
privacy for the files that are in the queue, since uucp programs won't be able
to read them.

Normally \Zn\ records what it is doing in \verb|/usr/spool/zend/LOGFILE|.
This file grows without bounds, so it should be cleaned up periodically.
Alternatively you can delete it altogether, since \Zn\ only writes
log records if the logfile exists.

\section{Bugs}

Since \Zn\ uses the \verb|mktemp()| call to make unique file names or
directories there is a race condition where the creation of these unique
filenames is concerned.

The same goes for the time there is between the testing if a file exists and
its creation by \Zn. But since the users are owner of the special directory
where these files are created, they can take care of the removal of files
after they have been received.
\end{document}

%======================================================================
% $Log: zend.tex,v $
% Revision 1.7  1993/02/02  21:00:00  gerben
% *** empty log message ***
%
% Revision 1.6  1992/12/10  05:27:34  tom
% RCS keywords added.
%
%======================================================================
