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.

Ripmime

cd /downloads/
tar zxvf ripmime-1.4.0.10.tar.gz
cd /downloads/ripmime-1.4.0.10/

make && make install

Simscan

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 \
--enable-sigtool-path=/usr/bin/sigtool

make
make install

cat > /var/qmail/control/simcontrol << __EOF__
:clam=yes,spam=yes,spam_hits=8.5,attach=.vbs:.lnk:.scr:.wsh:.hta:.pif
__EOF__

# update simcontrol.cdb
/var/qmail/bin/simscanmk
/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 https://qmail.jms1.net/simscan/troubleshooting.shtml.

Test Qmail


Users comments