/*
 * -----------------------------------------------------------
 *
 *   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

- Dr.Web Daemon (v.4.32 or higher)
- QMail-1.03


        2. Installation

    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 into 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 the original qmail-queue.original you have
copied. The configuration is most approriative when daemon and filter works 
with drweb pseudo-account privileges. You should set up following rights
for files in qmail/bin for such configuartion:

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

You can use next commands to reach this result:

$ 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:
$ cat /etc/group | grep nofiles
nofiles:x:NN:drweb

You should modify parameter User in drweb32.ini to run daemon as drweb:
$ cat /etc/drweb/drweb32.ini | grep User
User = drweb
;UserID =

Now, you should set up rights for spool and 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

    Filter parameters are set up in the configuration file. Since it is
impossible to set filter parameters when starting it is trying to find the
configuration file in standard (for the filter) directories, which you can
easily find out by simply 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 filter version you can run filter:

$ qmail-queue --version

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

$ qmail-queue --check_only 

filter will starts, reads configuration file and test options. Filter will 
reports into standard output stream (stdout) about actions.

    
        3. Contacts

Doctor Web program gets constantly developed, for fresh updating information 
and news please visit our site:

http://www.drweb.com

Marketing dept.: 
  E-Mail: sales@drweb.com
Support:
  WWW: 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)
