Vpopmail and Maildrop

Enabling maildrop in vpopmail

Evren Yurtesen < yurtesen at ispro.net.tr >

1.Install the maildrop package

#cd /usr/ports/mail/maildrop
#make install MAILDROP_SGID=vchkpw NO_MAILWRAPPER=true WITH_MAILDIRQUOTA=true
#make clean

Create the mailfilter file:
#ee /usr/local/etc/mailfilter

2. mailfilter text:

--------------------------------------------------------------------mailfilter---------------------------------

import EXT
import HOST

#VERBOSE=9
#logfile "/var/log/maildrop-filter-log"

SHELL="/bin/sh"
VHOME=`/usr/local/vpopmail/bin/vuserinfo -d $EXT@$HOST`
#VDOMHOME=`/usr/local/vpopmail/bin/vdominfo -d $HOST`
#VPOP=`cat $VDOMHOME/.qmail-default`
VPOP="$VHOME/Maildir/"

exception {
include $VHOME/Maildir/.mailfilter
}

exception {
to "$VPOP"
}

-----------------------------------------------------------mailfilter---------------------------------

NOTE: This file must be owned by vpopmail:vchkpw and permissions must be set to 600

#chown vpopmail:vchkpw /usr/local/etc/mailfilter
#chmod 600 /usr/local/etc/mailfilter

3. Building qmailadmin:

We must install the qmailadmin with spam enabled. Yet it is not supported in qmailadmin port so we should edit the Makefile in /usr/ports/mail/qmailadmin it should look like the text below, somewhere in Makefile

-------------------------------------------------------------------
CONFIGURE_ARGS+= \
--enable-htmldir=${PREFIX}/${WEBDATADIR}/${WEBDATASUBDIR} \
--enable-imagedir=${PREFIX}/${WEBDATADIR}/${WEBDATASUBDIR}/images \
--enable-imageurl=${WEBDATAURL}/${WEBDATASUBDIR}/images \
--with-htmllibdir=${DATADIR} \
--enable-cgibindir=${PREFIX}/${CGIBINDIR}/${CGIBINSUBDIR} \
--enable-cgipath=${CGIBINURL}/${CGIBINSUBDIR}/qmailadmin \
--enable-vpopmaildir=${LOCALBASE}/vpopmail \
--enable-autoresponder-bin=${LOCALBASE}/bin \
--enable-ezmlmdir=${LOCALBASE}/bin \
--enable-modify-spam=y \
--enable-spam-command='| /var/qmail/bin/preline /usr/local/bin/maildrop /usr/local/etc/mailfilter'

 

4. Sqwebmail and maildrop

If we want to use sqwebmail we should create the mailfilterconfig file containing the following in /usr/local/share/sqwebmail

maildirfilterconfig text...
-------------------------------------------------------------------
MAILDIRFILTER=.mailfilter
MAILDIR=$VHOME/Maildir
-------------------------------------------------------------------

Now your mailfilters would be working on per user bases as long as your users enable the spam detection in their qmailadmin preferences.

Please note that any other program creating .mailfilter files is incompatible with sqwebmail that sqwebmail would refuse. More importantly, squirrelmail saves the filters in user preferences and doesnt even read the file before erasing it, so it would just erase the sqwebmail's .maildir file and sqwebmail would complain that there is an incompatible .mailfilter file and you should contact with your system administrator. Although this is not a problem if you are using only one of these problems.
 

 

5. Enabling Spam Detection in SquirrelMail

Download the patched filters plugin of the patched filters plugin  of Sunil William Savkar. Thus double patched :)

Double Patched Filters Plugin


You should add the following line to include/validate.php in squirrelmail
define('SM_PATH','../'); I believe this is a bug in version 1.4.1 though, it might be fixed in
a newer version

Now untar the patched filters over your normal filters.

You might want to edit some settings in setup.php like your vpopmail home dir or if you changed something in your mailfilter files, so take your time to take a look around. But since filters are enabled per user bases there is nothing which should worry you about your emails being
trashed or something.

It should be all working

 

6.  Last Words

If you have any questions or problems please send email to Evren Yurtesen < yurtesen at ispro.net.tr >

www.enderunix.org Hosting Sponsor