
		    HOW TO BUILD AND INSTALL POSTOFFICE

1) Unpacking the distribution

The POSTOFFICE sources are distributed in tarballs.  After extracting from
the tarball, you should end up with all the source and build files in the
directory
		postoffice-(version)

2) Installing the distribution

POSTOFFICE uses configure.sh to set itself up for compilation.   To run
configure, just do ``./configure.sh'' and it will check your system for
build dependencies and build makefiles for you.   If configure.sh finishes
without complaint, you can then do a ``make'' to compile everything and a
``make install'' to install the binaries.

Configure.sh has a few options that can be set:

    --src=DIR		where the source lives (.)
    --prefix=DIR	where to install the final product (/usr/local)
    --execdir=DIR	where to put executables (prefix/bin)
    --libdir=DIR	where to put libraries (prefix/lib)
    --mandir=DIR	where to put manpages (prefix/man)
    --confdir=DIR	where to put configuration information (/etc)

    --with-av=SCRIPT	virus scanning script to run after receiving mail
    --with-tcpwrappers	use tcp wrappers
    --with-greylist	use the greylist code
    --with-queuedir	where to put queued mail (/var/spool/mqueue)
    --with-auth		enable smtp authentication (AUTH LOGIN)
    --use-peer-flag	enable -opeer (for debugging)
    --with-vhosts[=DIR]	enable vhosts (passwd files in DIR (/etc/virtual))
    --with-vspool=DIR	(vhost mail spool in DIR) (/var/spool/virtual)
    --with-vuser[=user]	(vhost mail files owned by) [mail]
    --with-gcc-patch	Patch the code to make it conform more closely to
			the FSF coding style.

Alternatively, if you're running a recent version of redhat Linux (or its
derivatives;  I've built the rpm package of postoffice 1.2.3 on Centos 4,
Centos 3, RHEL3, and Redhat 8.0), you can build postoffice as an rpm
package.   To do this, you need to copy the postoffice tarball into
/usr/src/redhat/SOURCES, then extract the file
postoffice-(version)/os/redhat/postoffice.spec and do a
"rpmbuild -ba postoffice.spec", then rpm -ivh the resulting package.


3) Cautions and features

    a) The greylist code wants to put a database (owned by root, and by
       default only readable by root) into /var/db/smtpauth.  You may
       manually chmod the database to allow other users read and/or write
       access to it, if you so desire.
    b) POSTOFFICE uses the queue directory /var/spool/mqueue to queue up
       mail messages.  If your previous MTA has left messages in this
       directory, POSTOFFICE should ignore them, but if it doesn't your
       first runq will have surprising results.
    c) By default, AUTH LOGIN only works with virtual domains.  If you
       wish to have AUTH LOGIN work for every domain on the machine,
       you need to configure POSTOFFICE with --with-auth=passwd.
       WARNING:  This means that actual passwords will be passed over
       the wire in plaintext, which is a whopping huge security hole.
    d) I have not done any exhaustive checks for vulnerabilities in this
       code.   It tries not to write anything as root (except for mail
       into the root mailbox, which you can and probably should override
       with a mail alias) but the evil hackers are cleverer than I am
       by definition, and if there are vulnerabilities they will find
       them.
    e) The AV script needs to accept the file to be scanned on its
       standard input.  I use --with-av="|/usr/local/bin/clamscan --mbox -i --disable-summary -"
       as my standard av scanner;  the leading | bar is not necessary
       for the av command (it will be stripped off during execution),
       but you can put it there to remind you how the AV script is
       supposed to work.
    f) POSTOFFICE is written in C, not GCC, so it contains perfectly
       legitimate code that will generate warnings when built with
       ``gcc -Wall''   If Configure.sh detects that you're trying
       to build with gcc, it attempts to get around some of this
       brokenness by defining macros for if() and while().  The
       spurious gcc warnings can be reduced a bit more by configuring
       POSTOFFICE with the --with-gcc-path option, which applies a
       patch to bowlderise the code.  This is not guaranteed to work
       in the future.

