We must get the perl libraries from CPAN/ports, to make things easier this should be as simple as copy/paste, if only. The shell you are using may not be able to handle a whole lot in one go, so you could make a short script to run it all. pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/p5-Digest-SHA1-2.10.tgz pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/p5-Digest-HMAC-1.01.tgz pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/p5-Net-DNS-0.47.tgz pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/p5-HTML-Tagset-3.04.tgz pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/p5-HTML-Parser-3.45.tgz pkg_add ftp://ftp.openbsd.org/pub/OpenBSD/3.7/packages/i386/p5-Mail-SpamAssassin-3.0.2.tgz cd /downloads wget http://search.cpan.org/CPAN/authors/id/D/DS/DSCHWEI/Parse-Syslog-1.03.tar.gz tar zxvf Parse-Syslog-1.03.tar.gz cd Parse-Syslog-1.03 perl Makefile.PL ; make test install cd /downloads wget http://search.cpan.org/CPAN/authors/id/M/MI/MIKEK/Statistics-Distributions-1.02.tar.gz tar zxvf Statistics-Distributions-1.02.tar.gz cd Statistics-Distributions-1.02 perl Makefile.PL make test install Now we can make clam But first create users that we require. groupadd clamav groupadd qscand mkdir /var/spool/qmailscan useradd -c "Qmail-Scanner Account" -g qscand -d /var/spool/qmailscan -s /bin/false qscand useradd -d /var/empty -s /sbin/nologin spamc useradd -d /tmp -s /sbin/nologin clamav groupadd vchkpw cd /downloads/qmailrocks tar zxvf clamav-0.80.tar.gz cd clamav-0.80 These variables need to be exported so that configure knows how to build the makefile export LDFLAGS="-L/usr/local/lib -lpthread" export CFLAGS="-I/usr/local/include" ./configure --disable-clamav \ --enable-dependency-tracking \ --disable-clamuko \ --enable-bigstack \ --sysconfdir=/etc \ --with-user=clamav \ --with-group=clamav \ --disable-cr make make check make install make clean Now that is all done we must change the config, vi /etc/clamd.conf Change Example to #Example Make sure LogFile is LogFile /var/log/clamav/clamd.log And that LogSyslog is not commented Also make sure User is qscand DatabaseDirectory should be DatabaseDirectory /usr/local/lib/clamav And finally ScanMail should not be commented, now save and exit vi. We need an rc control file for clam, if you copy and paste this: OUTP="#!/bin/sh\n" OUTP=$OUTP"FOO_BIN=/usr/local/sbin/clamd\n" OUTP=$OUTP"test -x \$FOO_BIN || exit 5\n" OUTP=$OUTP"case \"\$1\" in\n" OUTP=$OUTP"start)\n" OUTP=$OUTP"echo \"Starting \`\$FOO_BIN -V\`\"\n" OUTP=$OUTP"\$FOO_BIN\n" OUTP=$OUTP";;\n" OUTP=$OUTP"stop)\n" OUTP=$OUTP"echo \"Shutting down \`\$FOO_BIN -V\`\"\n" OUTP=$OUTP"killall \$FOO_BIN\n" OUTP=$OUTP";;\n" OUTP=$OUTP"restart)\n" OUTP=$OUTP"\$0 stop\n" OUTP=$OUTP"\$0 start\n" OUTP=$OUTP";;\n" OUTP=$OUTP"*)\n" OUTP=$OUTP"echo \"Usage: \$0 {start|stop|restart}\"\n" OUTP=$OUTP"exit 1\n" OUTP=$OUTP";;\n" OUTP=$OUTP"esac\n" echo $OUTP > /usr/local/etc/rc.d/clamd.sh We need to make some changes to the freshclam conf file, so vi /etc/freshclam.conf Make sure Example is commented, LogSyslog should also be uncommented DatabaseDirectory should be DatabaseDirectory /usr/local/lib/clamav We must make a couple of directories for clamav mkdir -p /var/log/clamav mkdir -p /usr/local/lib/clamav Give ownership to clamav chown -R clamav.clamav /var/log/clamav /usr/local/lib/clamav Now update the definitions: /usr/local/bin/freshclam Lets put a couple of values in /etc/mail/spamassassin/local.cf echo "rewrite_subject 1" >> /etc/mail/spamassassin/local.cf echo "required_hits 5" >> /etc/mail/spamassassin/local.cf Now lets get spamd and greylisting enabled in /etc/rc.conf, change spamd_flags=NO and spamd_grey=NO to spamd_flags=YES and spamd_grey=YES Make sure that spamd/clamd start at system boot by adding the following lines to /etc/rc.local: csh -cf '/usr/local/bin/spamd -L -x -u spamc &' csh -cf '/usr/local/sbin/clamd &'