Note 1:
=======
The following setup has so far been successfully tested with

Linux version: Red Hat Enterprise Linux 3, Fedora Core 3, Fedora Core 4
Shell version: Bash
Java version : Sun Java runtimes engine (JRE) 1.4.2_07, 1.4.2_09, 1.4.2_11

ZT has not yet been tested under Sun Java 5.

Note 2:
=======
There are multiple ways of installing Java under Linux, depending on 
distribution and/or version. I. e. under Fedora Core 4/5 it is NOT recommended 
to simply install the RPM from the Sun download site, as it would interfere 
with the included (non-proprietary) gcj-compat. http://www.fedorafaq.org has 
more information on this topic.

Consultion of the relevant websites and/or an internet search is strongly 
recommended!

Note 3:
=======
Due to note 2, all scripts contain the fully qualified path to ZeroToaster and 
Java directories. An alternative might be to work with symbolic links, but I 
haven't tried that so far (the first way worked nicely ;-). The paths are 
defined as local variables, thus it will be necessary to adopt those paths at 
the beginning of _each_ script.

---------------

Required files:		Location (sample, see remark below)
zt_mta.jar		/opt/zerotoaster
201_util.jar		/opt/zerotoaster
dns.jar			/opt/zerotoaster
filestorage.ini		/opt/zerotoaster
sendmail		/opt/zerotoaster
zt_start		/opt/zerotoaster
zerotoaster		/etc/init.d		(only if start as a system service is desired)
avscan_(program)	/opt/zerotoaster	(needs to be customized for each supported antivirus program)

After copying the files and prior to any subsequent steps, I recommend checking with "ls -l" that the access permissions are set in the correct way. Missing/forgotten execution permissions (x) gave me a lot of headache.

File locations:
The program directory has been named "zerotoaster", but any other name is possible.

To comply with common Linux conventions, the program/configuration/... files should go into /usr/zerotoaster or /opt/zerotoaster. In this description, /opt/zerotoaster will be used.
The message files are not supposed to go into the program directory or subdirectory. Instead, they should be placed into /var/spool/mails. This is configured in filestorage.ini.
In order to set the desired location, all occurences of the the (sub)string "./mails" should be changed to "/var/spool/mails" (omit quotation marks).
ZeroToaster will create subsequently all required subdirectories.
Sample from filestorage.ini:
# configuration for the class net.zerotoaster.storage.file.FileStorage
domaindir=./domains/
userdir=./users/
maildir=/var/spool/mails/
tempmaildir=/var/spool/mails/temp/
outmaildir=/var/spool/mails/outbound/
accdir=./accounting/
mailinglistdir=./mailinglists/
backupmaildir=/var/spool/mails/temp/
backupmailkeep=14

Sendmail:
ZeroToaster emulates sendmail functionality; this is done by script "sendmail" in /opt/zerotoaster.
In order to enable sendmail functionality, the original Linux sendmail needs to be moved out of the way. Afterwards a symbolic link is created in the same loaction, pointing to the sendmail emulation script in the ZT directory. This can be achived by these two bash commands:
mv /usr/sbin/sendmail /usr/sbin/sendmail_linux
ln -s /opt/zerotoaster/sendmail /usr/sbin/sendmail

Main configuration:
zt_mta.ini is the central configuration file and needs to be adapted prior to any program start attempt.
Refer to general documentation.

---------------

Create a system service (mainly aimed at Linux beginners):
It is advisable to start ZeroToaster as a system service. Only this approach assures that ZT will be able to run without a user being logged on. Otherwise the process will be terminated when the user logs off.
The included service definition file assumes that the service should be started when booting Linux in graphical (mode 5) as well as text mode (mode 3). It is essential that in the chosen mode(s) no mail-related service like postfix is also enabled - this will usually prevent ZeroToaster from working properly.

To create the service, copy the "zerotoaster" file to directory /etc/init.d.
Check paths in the script.
Add the subsystem definition by typing "chkconfig --add zerotoaster" (without quotation marks) in a shell/terminal window.

The service can be started later by typing "service zerotoaster start" in a terminal window. However, if you do that in a shell for testing, be aware that the ZeroToaster will not return control to the calling shell. The described service has been designed to call ZeroToaster during the boot sequence in a backgrounded process (where this behaviour will not be a problem)!

The function to stop the service "zerotoaster" is still a stub.

---------------

Starting ZeroToaster under Linux:
The main start script is "zt_start". Copy it into the ZeroToaster program directory.
If you decide to rename it, do not forget to rename it also in the "zerotoaster" subservice definition file (see below).
Reboot or start the service.

Note:
The line "exec >>/var/log/zerotoaster.log 2>&1" creates separate zerotoaster.log in /var/log. I find this useful for debugging purposes.
However, it becomes VERY large over an extended running time. Hence this should be deleted on a regular base (with the zerotoaster service being shut down/killed) or the line should be be removed for normal operation.

---------------

Virus protection:
If included in the ZeroToaster license, every processed e-mail can be automatically scanned for viruses.
It is working on the base of a command line which is called for every processed message. Hence usage of several scanners is possible if ZeroToaster is aware of their parameters. Sometimes programs do not support all commandline parameter on all platforms (NVC being one sample), consultation with 20/1 is advised.
ZeroToaster versions prior to 2.62 used a separate avscan.ini to set the command line und support only integration of one scanner engine.

From version 2.62 on, a section of zt_mta.ini contains the relevant information and multiple engines can be integrated.
Sample from /opt/zerotoaster/zt_mta.ini:
[AVSCAN]
# The scanner class(es) to use.
# Syntax: exec=classname, scanner execute line
exec=net.zerotoaster.mta.mailfilters.avscan.NormanAV, /opt/zerotoaster/avscan_norman

For each configured antivirus program, a shell command defines a script to be executed. This script in turn contains all relevant parameters for the scanner executable.

Sample from /opt/zerotoaster/avscan_norman (for Norman Virus Control):
#!/bin/bash
ZTDIR=/opt/zerotoaster
NVCDIR=/opt/norman/nvc/bin
cd $ZTDIR
$NVCDIR/nvcc -c:1 -lg:1 -l:1 -u -lf:"$2" "$1"
