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