The DigitalPimp
Ben Pfountz |
Note: blackhole is a spam control program, these directions show how to use it in a mode called qmail-queue mode, which means it checks all mail being relayed through the server.
Note: blackhole depends on many other ports.
install automake from ports: cd /usr/ports/devel/automake make install make clean
install autoconf from ports: cd /usr/ports/devel/autoconf make install make clean
install pcre from ports: cd /usr/ports/devel/pcre make install make clean
install clamav from ports: cd /usr/ports/security/clamav make install make clean
pw groupadd clamav
touch /var/log/freshclam.log
#!/bin/sh # # Startup / shutdown script for Clam Antivirus case "$1" in start) /usr/local/bin/freshclam -d -c 12 -l /var/log/freshclam.log echo -n ' freshclam' ;; stop) /usr/bin/killall freshclam > /dev/null 2>&1 \ && echo -n ' freshclam' ;; *)
echo ""
echo "Usage: `basename $0` { start | stop }"
echo ""
exit 64
;;
esac
Set the script permissions: chmod 744 /usr/local/etc/rc.d/clamav.sh
Set some extra permissions for freshclam: chown clamav /usr/local/share/clamav
Patch and Build blackhole: - Download or restore BlackHole.tar.gz - Unzip and cd into blackhold directory patch < /usr/home/bpfountz/projects/digitalpimp/patches/qmail_spam_ctl/blackhole.c.patch (note, this patch resolves a small bug I found in the 'Received: from' filter, email me if you want it) - Change /opt/blackhole/bin to /usr/local/bin/spamcheck in execute.h (note, I am using /usr/home/bpfountz/projects/digitalpimp/email_filter
instead, you can write your own) - You may also need to patch for the latest arguments to clamscan (--no-summary). Use grep to search: grep -r 'unzip=/usr/bin/unzip' * - After doing this, you will need to update 'every' makefile with the
correct path to automake: ./buildconf && ./Setup
answer questions like this: prefix: /usr/local - change to #define HAVE_LIBPCRE 1 in config.h.in spits out a config command, use this one in the following directions:
./configure --prefix=/usr/local --enable-qmailqueue --with-config1=.blackhole --enable-qmailqfilter --enable-one-box --with-log-type=syslog --enable-use-log --enable-virus-clean --enable-use-log --enable-ok-log --enable-log-score --enable-log-size --enable-log-iprelay --enable-log-sender --enable-log-score --with-rbl-dnssrv=127.0.0.1
- run the above configure command to generate Makefile - run gmake install - copy /var/qmail/bin/qmail-queue to /var/qmail/bin/qmail-queue-old - copy blackhole to /var/qmail/bin/qmail-queue-new - copy /var/qmail/bin/qmail-queue-new to /var/qmail/bin/qmail-queue
Configure blackhole: backup and restore /etc/blackhole.conf
Individual user configurations: these can be placed in: /var/spool/blackhole/conf/[fqhn]/[user]/.blackhole where [fqhn] is the fully qualified hostname the email is sent to and [user] is the username sent to
|
|