| [c5c522c] | 1 | $Id: qmail.txt,v 1.1 2005/03/11 21:16:03 jonz Exp $ |
|---|
| 2 | |
|---|
| 3 | QMAIL and VPOPMAIL INTEGRATION |
|---|
| 4 | |
|---|
| 5 | qmail is designed with a modular system architecture, so there are a couple |
|---|
| 6 | of places to add dspam to such a system. VPopmail extends the base qmail |
|---|
| 7 | delivery process to handle virtual domains and users, which can reside in |
|---|
| 8 | several different user databases. Whether you want to add dspam at the |
|---|
| 9 | virtual domain level or user level largely determines the best way to add |
|---|
| 10 | it to your system. |
|---|
| 11 | |
|---|
| 12 | USER-LEVEL INTEGRATION |
|---|
| 13 | |
|---|
| 14 | If you are only configuring dspam for a small percentage of your users, |
|---|
| 15 | this is the best method. Configure dspam to use a standalone local delivery |
|---|
| 16 | agent like safecat (if you already use procmail or maildrop as an LDA, you |
|---|
| 17 | should call dspam from those tools directly). |
|---|
| 18 | |
|---|
| 19 | First, create a small script called maildir_mod in /usr/local/bin... |
|---|
| 20 | |
|---|
| 21 | #!/bin/sh |
|---|
| 22 | VPOPDOMAINS="/home/vpopmail/domains" |
|---|
| 23 | if [[ "$2" = "-d" ]]; then |
|---|
| 24 | user=`eval echo $3 | cut -f 1 -d "@"` |
|---|
| 25 | domain=`eval echo $3 | cut -f 2 -d "@"` |
|---|
| 26 | cd $VPOPDOMAINS/"$domain"/"$user" |
|---|
| 27 | fi |
|---|
| 28 | /usr/local/bin/safecat "$1"/tmp "$1"/new 1>/dev/null |
|---|
| 29 | |
|---|
| 30 | NOTE: Be sure to configure VPOPDOMAINS to point to the path for your virtual |
|---|
| 31 | domain directories |
|---|
| 32 | |
|---|
| 33 | Now configure DSPAM: |
|---|
| 34 | |
|---|
| 35 | ./configure \ |
|---|
| 36 | --with-dspam-owner=vpopmail \ |
|---|
| 37 | --with-dspam-group=vchkpw \ |
|---|
| 38 | --with-delivery-agent="/usr/local/bin/maildir_mod Maildir -d %u" \ |
|---|
| 39 | # Your arguments |
|---|
| 40 | |
|---|
| 41 | Next, create a .qmail file in the directory for the user with a line to |
|---|
| 42 | call dspam, like this: |
|---|
| 43 | |
|---|
| 44 | | /usr/local/bin/dspam --deliver=innocent --user $EXT@$USER |
|---|
| 45 | |
|---|
| 46 | The two environment variables $EXT and $USER are created by the qmail-local |
|---|
| 47 | program which begins the local delivery process. |
|---|
| 48 | |
|---|
| 49 | DOMAIN-LEVEL INTEGRATION |
|---|
| 50 | |
|---|
| 51 | If you're adding dspam for all users in a domain, you can add dspam |
|---|
| 52 | directly inline with the vpopmail LDA: vdelivermail. In this mode, you don't |
|---|
| 53 | need to configure dspam to use a custom LDA, nor do you need to add a .qmail |
|---|
| 54 | file for all users. Instead, you replace the existing line to the |
|---|
| 55 | .qmail-default file at the virtual domain level, like this: |
|---|
| 56 | |
|---|
| 57 | | /usr/local/bin/dspam --deliver=innocent --user $EXT@$USER --stdout | /home/vpopmail/bin/vdelivermail '' bounce-no-mailbox |
|---|
| 58 | |
|---|
| 59 | In essence, you just add the call to dspam (with the appropiate options |
|---|
| 60 | including --stdout) to the front of the existing line which vadddomain |
|---|
| 61 | creates when you add a domain. |
|---|