Manual installation of AntiVir MailGate
---------------------------------------

Note! You have to have a running mail configuration.  
If you already have problems using this configuration, we
do not give any support that is not directly related to AntiVir MailGate.

1. Create the directory /usr/lib/AntiVir and copy the file antivir.vdf
   to this directory. Please note the case of the word "AntiVir". Change also user 
   and group to root:antivir :
        
	mkdir /usr/lib/AntiVir
        cp vdf/antivir.vdf /usr/lib/AntiVir
	chown root:antivir /usr/lib/AntiVir
        chown root:antivir /usr/lib/AntiVir/antivir.vdf

2. Copy the scan engine antivir to /usr/lib/AntiVir. Change the user and group
   to root:antivir :

        cp bin/<operating system>/antivir /usr/lib/AntiVir
	chown root:antivir /usr/lib/AntiVir/antivir  

3. Copy the files avmailgate.conf, avmailgate.acl and antivir.conf to /etc and 
   edit them after reading the manual and the comments.
   Normally, you only have to edit avmailgate.acl (see MANUAL).

	cp etc/avmailgate.conf /etc
	cp etc/avmailgate.acl /etc
	cp etc/antivir.conf /etc

4. Then copy avgated and avgatefwd to /usr/lib/AntiVir:

	cp bin/<operating system>/avgated /usr/lib/AntiVir
	cp bin/<operating system>/avgatefwd /usr/lib/AntiVir

5. Create the spool directory (default: /var/spool/avmailgate)
   This directory must be accessible only by uucp or the user you selected
   in /etc/avmailgate.conf.
	mkdir /var/spool/avmailgate
	chown uucp:antivir /var/spool/avmailgate
	chmod 700 /var/spool/avmailgate
	cd /var/spool/avmailgate
	mkdir incoming
	mkdir outgoing
	mkdir rejected
	chown uucp:antivir *
	chmod -R 700 *

6. Make sure the directory /var/run is readable and writeable by the
   user uucp (or the user you specified in /etc/avmailgate.conf.)
   On SuSE it's already owned by uucp, so there is nothing to do.
   On other distributions the directory /var/run may be owned by
   root:root. You can either
   - change the group of /var/run to uucp (this is what I would recommend)
	'chgrp uucp /var/run'
   - let avgated and avgatefwd run as root (hmmm, not so good)
   - change the PidDir entry in /etc/avmailgate.conf so that it 
     points to some other location where uucp has write access.
    
7. If you have a license for commercial or private use:
   You have received a licence file named "hbedv.key".
   Please copy this file to /usr/lib/AntiVir/avmgate.key:

	cp hbedv.key /usr/lib/AntiVir/avmgate.key
	chown root:antivir /usr/lib/AntiVir/avmgate.key
 
8. Read and follow the instructions given in the specified INSTALL file 
   for your MTA:
   
   INSTALL.sendmail
   INSTALL.postfix
   INSTALL.qmail
   INSTALL.exim

9. Run /usr/lib/AntiVir/avgated and /usr/lib/AntiVir/avgatefwd

	/usr/lib/AntiVir/avgated
	/usr/lib/AntiVir/avgatefwd

10. Edit the file /etc/crontab and add the following line if
    you would like to make an update every day on 0:25:
        25 0 * * * root /usr/lib/AntiVir/antivir --update -q

    If you use a proxy server please define the server and the port
    of the proxy in /etc/antivir.conf.
    Test the update settings by running /usr/lib/AntiVir/antivir --update


Have a look at your log files (/var/log/mail, /var/log/maillog
or /var/log/mail.log). There you should find a message from avgated
"...ready to accept connections on port ...".
Now you can test it by sending mails to yourself.

Note: We have been reported that on some systems procmail will refuse to
write to users mailboxes. It says that it would not have the permission 
to do that... This problem is not solved yet. A possible workaround is
to set the SUID bit of /usr/bin/procmail.

Note: If you change the user and group parameter in avmailgate.conf, be sure 
that following files have the same access rights:

	/usr/lib/AntiVir/antivir
	/usr/lib/AntiVir/antivir.vdf
	/usr/lib/AntiVir/avmgate.key 

Also the following directories must be accessible by this user and group:

	/usr/lib/AntiVir
	/var/spool/avmailgate
	/var/spool/avmailgate/incoming
	/var/spool/avmailgate/outgoing
	/var/spool/avmailgate/rejected
	/var/run (or the directory you specified for the pid files)


-- Starting and stopping avgate automatically --

If everything works as desired, you should copy the correspondig rc.avgate
script to /etc/init.d/avgate and create symbolic links in /etc/init.d/rc[235].d
(* the directory "init.d" depends on your distribution *)

>= SuSE 8.0:

   Here is an example for the SuSE distributions >= 8.0:

   	cp rc.avgate.SuSE8x /etc/init.d/avgate

	To add the script to the appropriate runlevels use insserv:

	insserv /etc/init.d/avgate

	To remove the script from the runlevels use insserv:

	insserv -r /etc/init.d/avgate

< SuSE 8.0:

   Here is an example for the SuSE distributions < 8.0:

	cp rc.avgate.SuSE /sbin/init.d/avgate
	cd /sbin/init.d
	ln -sf ../avgate rc2.d/S20avgate
	ln -sf ../avgate rc2.d/K20avgate
	ln -sf ../avgate rc3.d/S20avgate
	ln -sf ../avgate rc3.d/K20avgate
	ln -sf ../avgate rc5.d/S20avgate
	ln -sf ../avgate rc5.d/K20avgate

NOTE: If you use an older Version of SuSE Linux ( < 8.0),
      don't forget to choose the script rc.avgate.SuSE instead of rc.avgate.SuSE8x
      and to add the line START_AVMAILGATE=YES to /etc/rc.config.


That's it!

