amavisd-new consists of the daemon, and optionally some helper programs,
which are only needed in setups with certain mail transport agents (MTA).

Obtaining the software:
=======================

Fetch the tarball and unpack it:
  wget http://www.ijs.si/software/amavisd/amavisd-new-<version>.tar.gz
  gzip -d -c amavisd-new-<version>.tar.gz | tar xvf -
  cd amavisd-new-<version>

Checking the web page for any required patches, fetch and apply them, e.g.:
  wget http://www.ijs.si/software/amavisd/amavisd-new-<version>-1.patch
  wget http://www.ijs.si/software/amavisd/amavisd-new-<version>-2.patch
  ...
  patch <amavisd-new-<version>-1.patch
  patch <amavisd-new-<version>-2.patch
  ...
This is it. The most important files you obtained (and patched
if necessary) are amavisd and amavisd.conf.
Start reading with AAAREADME.first, then RELEASE_NOTES and INSTALL.


Installing the daemon:
======================

- Perl version 5.005 or later is needed. At the moment Perl 5.6.1
  seems the most predictable. Tested also with Perl 5.8.0;

- unpack the source distribution, and cd to the created directory;

- copy file amavisd to wherever you want it to reside,
  such as /usr/local/sbin, and make sure its mode bits allow it
  to be executed. This is a Perl source, so it is readable by
  any text viewer. It is heavily commented, in case you would need
  more information;
    cp amavisd /usr/local/sbin/
    chown root /usr/local/sbin/amavisd
    chmod 755  /usr/local/sbin/amavisd

- copy file amavisd.conf to whereever you want it to reside,
  such as /etc/, and make sure it is not writable by common users;
    cp amavisd.conf /etc/
    chown root /etc/amavisd.conf
    chmod 644  /etc/amavisd.conf

- create (or choose) a Unix group dedicated to run amavisd daemon
  and possibly some virus scanners. This should not be one of the
  user or system groups, and not shared with your mailer. It is
  customary to name the group 'amavis' (or perhaps 'sweep');
    (edit /etc/group, or use system-specific tools, such as vigr)

- create (or choose) a Unix user (UID) dedicated to run amavisd daemon
  and possibly some virus scanners. This should not be one of the
  user or system groups, and not shared with your mailer. Most definitely
  this should not be root (UID 0). It is customary to name the user
  'amavis' or 'vscan';
    (vipw, or use system-specific tools to add user)

- create a directory (e.g. /var/amavis) to be used by amavisd-new as a
  working directory. Set the ownership and protection of the directory
  to be readable and writable by the chosen UID, and not writable
  by other nonprivileged users;
    mkdir /var/amavis
    chown amavis:amavis /var/amavis
    chmod 750 /var/amavis

- create a directory (e.g. /var/virusmails) to be used by amavisd-new
  as a quarantine area (if you want a virus or spam quarantine).
  Set the ownership and protection of the directory to be readable
  and writable by the chosen UID, and not writable by other nonprivileged
  users;
    mkdir /var/virusmails
    chown amavis:amavis /var/virusmails
    chmod 750 /var/virusmails

- edit file /etc/amavisd.conf and adjust variables $daemon_group
  and $daemon_user to match the chosen group and user name,
  adjust variables $TEMPBASE and $QUARANTINEDIR to match the directories
  just created, then check/adjust other variables, especially those
  in 'Section I';

- install virus scanners (if you will be using them), and Perl module
  SpamAssassin (if you want it), and adjust variables in /etc/amavisd.conf,
  especially in the last section 'Section VII'; There are several other
  Perl modules needed by amavisd daemon - if you don't already have
  them installed you will get a list of missing modules when amavisd
  is started;

- start the program 'amavisd' as root. It should start up and change
  its GID/UID to the value you provided. It is wise to start it up
  for the first time with a 'debug' option:
    /usr/local/sbin/amavisd debug

- later when everything has been tested and works, you may use the shell
  script amavisd_init.sh to be invoked at system startup/shutdown time;

- you may find the utility program 'amavisdconf' useful, especially
  if you are accustomed to the Postfix utility 'postconf'.

- depending on the mailer you use, read the appropriate README.* file
  and follow instructions there. With some mailers (Postfix, Exim V4
  or a dual-MTA setup with any SMTP-capable mailers) you don't need
  anything else (no helper programs).

  With some other mailers (sendmail milter, or classical sendmail invoking
  content filter via local delivery agent) you need additional helper
  programs: amavisd-milter.c, or amavis.c respectively. They are available
  from the helper-progs subdirectory.


Testing the daemon:
===================

First checkout is described in MTA-specific README.* file,
please follow the instructions there.

When you think you have a working installation, go to a subdirectory
test-messages, which contains a couple of sample mail messages,
and follow the instructions in README there.
