Install ClamAV
What is ClamAV ?
Clam AntiVirus is an open source (GPL) anti-virus toolkit for UNIX, designed especially for e-mail scanning on mail gateways. It provides a number of utilities including a flexible and scalable multi-threaded daemon, a command line scanner and advanced tool for automatic database updates. The core of the package is an anti-virus engine available in a form of shared library.
Configure amavisd.conf
Install Clam AV
Still with Root access
cd /usr/ports/security/clamav
make config
make install clean
Make config clam av will automatically install any dependency such as
ARC, ARJ, LHA, UNZOO and UNRAR..
Configure Clamd.conf
cd /usr/local/etc/
pico clamd.conf
## uncomment or modify these line below :
LogSyslog yes
LogFacility LOG_MAIL
LogVerbose yes
DatabaseDirectory /var/db/clamav
LocalSocket /var/run/clamav/clamd.sock
FixStaleSocket yes
StreamMaxLength 20M
User vscan
AllowSupplementaryGroups yes
ScanELF yes
ScanPDF yes
ScanMail yes
PhishingSignatures yes
Configure Freshclam.conf
cd /usr/local/etc/
pico freshclam.conf
## add or modify these few line below :
DatabaseDirectory /var/db/clamav
DatabaseOwner vscan
AllowSupplementaryGroups yes
DatabaseMirror database.clamav.net
DatabaseMirror db.CN.clamav.net
NotifyClamd /usr/local/etc/clamd.conf
Change Directory permission to vscan
cd /var/db
chown -R vscan:vscan clamav
cd /var/run
chown -R vscan:vscan clamav
cd /var/log
chown -R vscan:vscan clamav
Setting a crontab for Freshclam
crontab -e
37 * * * * /usr/local/bin/freshclam