bsdzone BSDZone - FreeBSD help, how-to guides, and articles.

  [ Home ]   [ Current News ]   [ Howto Archive ]   [ Books ]   [ Search ]   [ Links ]   [ Contact ]  [ About ]  


simscan
Email - qmail - 27 Sep 05

How to install simscan into your qmail setup.

If you have used qmail for any serious applications you have most likely heard of qmailscanner.
I have used it for years to pipe all my mail through Spamassassin and ClamAV.

Then I found simscan

Where qmailscanner is written in perl ( Slow and a bit heavy ) and requires you to run suidperl, simscan is written in C.
From my personal experience, the latter usually runs faster and puts a lighter load on my box.
Plus I don’t like even installing that scary suidperl on my machine.

So you have qmail installed with the qmail queue patch, like every howto on the face of the earth tells you to.

Your life is simple. Just install simscan from the ports.
# cd /usr/ports/mail/simscan
# make install clean

If you are hosting more than one domain there is help for you too.
Just read the makefile and you will see the plethora of options available to you.
Then cross reference that with the simscan documentation to see what each configuration option does. It may take a few compiles to get it right.

I usually end up with a /var/db/ports/simcan/options file like….
WITH_CLAMAV=true
WITH_RIPMIME=true
WITH_SPAMD=true
WITHOUT_USER=true
WITH_DOMAIN=true
WITH_ATTACH=true
WITH_DROPMSG=true
WITHOUT_PASSTHRU=true
WITH_HEADERS=true

After it is installed you need to change your daemontools run file for qmail-smtpd to include
QMAILQUEUE=”/var/qmail/bin/simscan” export QMAILQUEUE

If you find things are not working like you thought they should, you can tell simscan to log debugging information by adding this to your daemontools run file for qmail-smtpd.
SIMSCAN_DEBUG=”2″ export SIMSCAN_DEBUG
This will cause logging to be added to the same log file as qmail-smtpd.

You then need to add your domains and the rules to /var/qmail/control/simcontrol file.

Mine looks like…
domain.com:clam=yes,spam=yes,spam_hits=5
domain2.com:clam=yes,spam=yes,spam_hits=10

Not really but you know what I mean.

Then you need to convert your text file into a cdb database with,
# /var/qmail/bin/simscanmk
# /var/qmail/bin/simscanmk -g ( The -g builds a version file which will report the versions of your scanners into the headers of the received email )

This will create the file simcontrol.cdb and simversion.cdb.

All that is left now is to restart qmail.


Leave a Reply