BSD Inn - SB02

BSDInn Home     Page 1     Page 2     Page 3     Page 4     Page 5     Page 6    

2. ClamSMTPd and ClamAV install

cd /usr/ports/security/clamsmtp
make install clean


(it will install clamav as well)

Add to /etc/rc.conf

clamsmtpd_enable="YES"
clamav_clamd_enable="YES"


(Thanks to Ken Hathaway for pointing out a typo in this)



2.1 Configure clamsmtpd and clamav

cd /usr/local/etc
cp clamsmtpd.conf-sample clamsmtpd.conf

nano clamsmtpd.conf


Change these :

OutAddress: 10026
Quarantine: on
ClamAddress: /var/run/clamav/clamd
TempDirectory: /tmp
User: clamav
VirusAction: /usr/local/bin/vaction.sh


save and exit

nano clamd.conf


Make sure the following are uncommented and set as:
LogFile /var/log/clamav/clamd.log
TemporaryDirectory /tmp
LocalSocket /var/run/clamav/clamd
FixStaleSocket



2.2 Setup vaction.sh script

WARNING: Read the warning in the downloaded script


cd /usr/local/bin

wget http://memberwebs.com/nielsen/software/clamsmtp/scripts/virus_action_sample.sh

mv virus_action_sample.sh vaction.sh

chown clamav:clamav vaction.sh

chmod 700 vaction.sh


2.3 Set up quarantine directory and log file

nano vaction.sh

file="/var/log/virus.log"
dir="/var/lib/quarantine/"

if [ -n "$EMAIL" ]; then
mv "$EMAIL" "$dir"
fi


create log file and dir

touch /var/log/virus.log

chown clamav:clamav /var/log/virus.log

mkdir -p /var/lib/quarantine

chown clamav:clamav /var/lib/quarantine/



Prev Page: SB01 Next Page: SB03



Last Updated on... 2006-03-22 09:14 | Locked Page | Home | Recent Changes |