Hello again,

here is a short explanation, how my setup works:


qmailadmin 1.2.11 enables the users to enable/disable Spam checking. If the
user enables it, it puts a .qmail file in the user mailhome, that contains:

        | /var/qmail/bin/preline /usr/local/bin/dspam \
        --deliver=innocent,spam \
        --user [EMAIL PROTECTED]

This pipes the mail into dspam. Both, spam and ham get delivered by dspam
using maildrop. Maildrop puts innocent mails into ./Maildir/ and spam into
./IMAPdir/SPAM-inbox.

Now the user reads his inbox ./Maildir/ as usual. In order to read his
SPAM-inbox, he uses IMAP or webmail (which also uses IMAP). If there are
false positives or false negatives, he needs to train dspam.

There are different training approaches: Bouncing/forwarding the mails to
service addresses like [EMAIL PROTECTED] and [EMAIL PROTECTED] or using IMAP-
folders for training. This is what I prefer, because it is much easier for
the user to move a lot of messages than bouncing them.
With IMAP folders, the user moves false positives to SPAM-nospam/ and false
negatives to SPAM-spam/.
Now there is a cronjob that scans the users SPAM-spam/-nospam directories
every 5 minutes and trains dspam. After training, mails in SPAM-spam get
deleted and those in SPAM-nospam get moved to the inbox ./Maidir/.
The cronjob script also creates the IMAP folders, auto-subscribes them
and sends welcome messages to new dspam users telling them how to use it.

I also set up two other cronjobs:
a) the first scans all SPAM-inbox folders for incoming spam that is older
than 31 days and deletes it. This is neccessary, because some users
enable spam checking and do never ever look at the spam inbox. This is
also needed, because the vpopmail user quota does not count additional
IMAP folders. At least not in my setup here, where they are located side
by side to ./Maildir as ./IMAPdir and not as subdirectories of ./Maildir.
Three days before deletion it sends a warning email to the user.

b) The second cronjob sends an email with dspam_stats to every user.
I send the stats every monday morning.

If a user enables the filtering, then he needs to train its own dspam
database until it is mature. This may take some time. In the meantime,
he uses the database of "globaluser". That is defined in
/usr/local/var/dspam/group. The globaluser's database should be taken
from a well trained user. Read "man dspam-merge".


Things that could be done better/different:

- One could use the dspam daemon, which is faster for big sites. Since
I am running a small mail site, I went with the normal setup.

- You can also use procmail to sort mails. My example .qmail file:
        | /var/qmail/bin/preline /usr/local/bin/dspam \
        --deliver=innocent,spam --user [EMAIL PROTECTED] \
        --stdout | /usr/bin/procmail \
        /home/vpopmail/domains/example.com/claas/procmailrc

- It would be nice to have a CGI or php-script to let the user compile
his own procmailrc to do server side mail sorting.
I am using maildrop for all users except me. I'm using procmail, but
that has only historic reasons.

- One could also strip down the /etc/maildroprc and deliver all mails
to the ./Maildir/ and let the users mail client sort the mails according
to the header lines that dspam added.


I hope this is useful for some of you.

Many regards, Claas

Reply via email to