freebsdrocks.net was started originally as nospam.mine.nu.
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.
We will need to install ripmime and gcc as this is a requirement for simscan.
# cd /usr/ports/mail/ripmime
# make install clean
# cd /usr/ports/lang/gcc
# make install clean
# cd ~root
# tar zxvf qmail/simscan-1.4.0.tar.gz
# cd simscan-1.4.0
# patch < /root/qmail/simscan-1.4.0-clamav.3.patch
# ./configure --enable-user=qscand --enable-spamc-user=y --enable-clamav=y --enable-attach=y --enable-spam=y --enable-dropmsg=y --enable-custom-smtp-reject=y --enable-spam-hits=12 --enable-spam-passthru=y --enable-clamdscan=/usr/local/bin/clamdscan --enable-ripmime=/usr/local/bin/ripmime --enable-sigtool-path=/usr/bin/sigtool
./configure --enable-user=qscand --enable-spamc-user=n --enable-clamav=n --enable-attach=y --enable-spam=y --enable-dropmsg=y --enable-custom-smtp-reject=y --enable-spam-hits=12 --enable-spam-passthru=y --enable-ripmime=/usr/local/bin/ripmime --enable-sigtool-path=/usr/bin/sigtool
# make
# make install
# vi /var/qmail/control/simcontrol
:clam=yes,spam=yes,spam_hits=8.5,attach=.vbs:.lnk:.scr:.wsh:.hta:.pif
# /var/qmail/bin/simscanmk
# /var/qmail/bin/simscanmk -g
# vi /service/qmail-smtpd/run
QMAILQUEUE="$VQ/bin/simscan"
SIMSCAN_DEBUG=1
Now lets restart qmail:
# qmailctl restart
# cd /tmp
# echo "hi, testing." > /tmp/mailtest.txt
# env QMAILQUEUE=/var/qmail/bin/simscan SIMSCAN_DEBUG=3 /var/qmail/bin/qmail-inject you@yourdomain.com < /tmp/mailtest.txt
env QMAILQUEUE=/var/qmail/bin/simscan SIMSCAN_DEBUG=3 /var/qmail/bin/qmail-inject you@yourdomain.com < /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 you@yourdomain.com
simscan:[11974]:CLEAN (3.00/5.00):0.2596s::(null):root@mail-test.thibs.com:you@yourdomain.com
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.