/*
 * -----------------------------------------------------------
 *
 *   Dr.Web(R) Mail Filter for QMail
 *
 * -----------------------------------------------------------
 */

1. Requirements
2. Installation
    2.1 Replacing the original qmail-queue 
    2.2 Setting up the filter
3. Contacts


        1. Requirements

- Started Dr.Web Daemon (drwebd) version 4.33 or higher
- QMail-1.03


        2. Installation

You should stop the qmail system before installation of the filter
otherwise a losing of corresponse is possible.

    2.1 Replacing the original qmail-queue

The first thing to do is to save the original qmail-queue, because the
principle of operating QMail filter is based on replacing (or, it would
be more correct to say, proxying) this component. That means that the
filter receives the message through the interface specified for
qmail-queue, checks it and, if it's "clean" transmits it forward to the
original qmail-queue. This principle leads to the first restriction: the
filter configuration file is located on the set paths (you can get to
know them by running qmail-queue with the --help parameter). Memorize
the name (and the path) where you stored the original qmail-queue - we
will need it in the paragraph 2.2.

Now copy qmail-queue from the package to the qmail/bin directory. Then
don't forget to specify the correct rights and user name both for the
new qmail-queue (drweb filter) and for mail-queue.original you have
copied. The most approriative configuration is when the daemon and the
filter work with drweb pseudo-account privileges. You should set up
following rights for qmail-queue files in qmail/bin for such
configuration:

-rws--x--x    X drweb    qmail       SIZE DATE qmail-queue
-rws--x--x    X qmailq   qmail       SIZE DATE qmail-queue.original

You can use the following commands for this:

$ chown drweb:qmail qmail-queue
$ chmod 4711 qmail-queue

$ chown qmailq:qmail qmail-queue.original
$ chmod 4711 qmail-queue.original

Also you should add drweb user to nofiles group (name of the group could
be changed by a maintainer of the qmail package so please see qmail
package documentaion for details):

$ cat /etc/group | grep nofiles
nofiles:x:NN:drweb

You should modify the User parameter in drweb32.ini to run the daemon as
drweb:

$ cat /etc/drweb/drweb32.ini | grep User
User = drweb
;UserID =

Now, you should set up the rights for the spool and the infected
directories:

$ ls -l /var | grep drweb
drwxr-xr-x   X drweb    drweb        SIZE DATE  drweb

$ ls -l /var/drweb
drwxr--r--   X drweb    drweb        SIZE DATE  bases
drwxrwx---   X drweb    nofiles      SIZE DATE  infected
drwxr--r--   X drweb    drweb        SIZE DATE  log
drwxr--r--   X drweb    drweb        SIZE DATE  run
drwxrwx---   X drweb    nofiles      SIZE DATE  spool


    2.2 Setting up the filter

The filter parameters are set up in the configuration file. As it is
impossible to set the filter parameters at start, it tries to find the
configuration file in standard (for the filter) directories, which you
can easily find out by running the filter from the console.

$ qmail-queue --help

For the description of the filter configuration file, notification
templates and trusted users list see conf_file.txt, notify.txt and
users_list.txt correspondingly.

To get the filter version you can run filter:

$ qmail-queue --version

To test correctness of the filter configuration file you can run filter:

$ qmail-queue --check_only 

The filter will start, read configuration file and test options. The
filter will report on actions made into a standard output stream (stdout).

    
        3. Contacts

Dr.Web program gets constantly developed, for fresh updating
information and news please visit our site:
  http://www.drweb.com

Marketing dept.: 
  http://buy.drweb.com
  E-Mail: sales@drweb.com
  
Support:
  http://support.drweb.com
  E-Mail: support@drweb.com

Please include following information in your problem report: 

- full name and version of your unix distribution
- Dr.Web version that is logged during program start
- versions of applications and filters which use Dr.Web Daemon.
- configuration files: daemon's (drweb32.ini), drweb_qmail.conf
- logs: daemon and mail (usually maillog)
