Guide updated on 29th of February 2016

Install Simscan & Ripmime

Simscan is a simple program that enables the qmail smtpd service to reject viruses, spam, and block attachments during the SMTP conversation so the processing load on the email system is kept to a minimum

You can find more information about Simscan here.

It needs Ripmime to extract attachments out of a MIME encoded email packages.


cd /downloads/
tar zxvf ripmime-
cd /downloads/ripmime-

make && make install


We will configure a patched version of Simscan. The combined patch of John M. Simpson's mainly fix some bugs and add debugging options.

cd /downloads/
tar zxvf simscan-1.4.0.tar.gz
cd /downloads/simscan-1.4.0

patch < /downloads/patches/simscan-1.4.0-combined.4.patch

./configure \
--enable-user=clamav \
--enable-spamc-user=y \
--enable-clamav=y \
--enable-attach=y \
--enable-spam=y \
--enable-dropmsg=y \
--enable-custom-smtp-reject=y \
--enable-spam-hits=8.5 \
--enable-spam-passthru=y \
--enable-clamdscan=/usr/bin/clamdscan \
--enable-ripmime=/usr/local/bin/ripmime \

make install

cat > /var/qmail/control/simcontrol << __EOF__

# update simcontrol.cdb
/var/qmail/bin/simscanmk -g

Test Simscan

systemctl restart clamav-daemon
systemctl restart clamav-freshclam

cd /tmp
echo "hi, testing." > /tmp/mailtest.txt
env QMAILQUEUE=/var/qmail/bin/simscan SIMSCAN_DEBUG=3 /var/qmail/bin/qmail-inject [email protected] < /tmp/mailtest.txt

You should have this kind of result:

env QMAILQUEUE=/var/qmail/bin/simscan SIMSCAN_DEBUG=3 /var/qmail/bin/qmail-inject [email protected] < /tmp/mailtest.txt
simscan: starting: work dir: /var/qmail/simscan/1407314229.189583.11975
simscan: calling clamdscan
simscan: clamdscan: /var/qmail/simscan/1407314229.189583.11975: OK
simscan: clamdscan:
simscan: clamdscan: ----------- SCAN SUMMARY -----------
simscan: clamdscan: Infected files: 0
simscan: clamdscan: Time: 0.008 sec (0 m 0 s)
simscan: normal clamdscan return code: 0
simscan: calling spamc
simscan: calling /usr/bin/spamc spamc -u [email protected]
simscan:[11974]:CLEAN (3.00/5.00):0.2596s::(null):[email protected]:[email protected]
simscan: done, execing qmail-queue
simscan: qmail-queue exited 0

If you have issues here, you can troubleshoot by following tips given on

Test Qmail

Users comments

Error connecting to Database!

Color Coded Qmail Installation Key
  Regular Black Text     Qmail installation notes and summaries by the author.
  Bold Black Text     Commands to be run by you, the installer.
  Bold/Regular Red Text    Vital and/or critical information.
  Regular Blue text     Denotes helpful tips and hints or hyperlinks.
  Regular Orange Text     Command line output.
  Bold/Regular green text     Denotes the contents of a file or script.