Clamav anti-virus software installation
1.Download the latest Clamav anti-virus software tar-ball from
www.clamav.org2.Optionally: Binary ftp the tar-ball to the mailserver.
3.Store the Clamav anti-virus tar-ball in the /tmp filesystem
4.Login to the mailserver as user root.
5.Change directory to /tmp with: cd /tmp
6.Extract the tar-ball with (e.g.): tar -zxvf clamav-0.93.3.tar.gz
7.Change directory to the extraction directory: cd clamav-0.93.3
8.Create a unix-group with: groupadd clamav
9.Create a unix-user with: useradd -g clamav -s /bin/false -c "Clam AntiVirus" clamav
10.Configure the Clamav software with: ./configure --sysconfdir=/etc
11.Compile the Clamav software with: make
12.Install the Clamav software with: su -c "make install"
13.Edit the file: /etc/clamd.conf
Remark: c=comment line, s=set value.
c: Example
s: LogFile /var/log/clamd.log
s: LogTime yes
s: LogSyslog yes
s: LogFacility LOG_MAIL
s: LogVerbose yes
s: PidFile /var/run/clamd/clamd.pid
s: DatabaseDirectory /var/lib/clamav
s: LocalSocket /var/run/clamd/clamd.sock
s: FixStaleSocket yes
s: User clamav
s: AllowSupplementaryGroups yes
s: ScanOLE2 yes
s: ScanMail yes
s: PhishingSignatures yes
s: PhishingScanURLs yes
s: ScanHTML yes
s: ScanArchive yes
14.Create the database directory /var/lib/clamav with: mkdir /var/lib/clamav
15.Change ownership of the directory with: chown clamav:clamav /var/lib/clamav
16.Change permission on the directory with: chmod 755 /var/lib/clamav
17.Create the socket directory /var/run/clamd with: mkdir /var/run/clamd
18.Change ownership of the directory with: chown clamav:clamav /var/run/clamd
19.Change permission on the directory with: chmod 700 /var/run/clamd
20.Edit the file: /etc/freshclam.conf
Remark: c=comment line, s=set value, v=verify value.
c: Example
s: DatabaseDirectory /var/lib/clamav
s: UpdateLogFile /var/log/freshclam.log
s: LogTime yes
s: LogVerbose yes
s: LogSyslog yes
s: LogFacility LOG_MAIL
s: DatabaseOwner clamav
s (first entry): DatabaseMirror db.NL.clamav.net
v (second entry): DatabaseMirror database.clamav.net
s: ScriptedUpdates yes
21.Create the freshclam logfile with: touch /var/log/clamd.log
22.Change ownership of the freshclam logfile with: chown clamav /var/log/clamd.log
23.Change permissions on the freshclam logfile: chmod 600 /var/log/clamd.log
24.Create the freshclam logfile with: touch /var/log/freshclam.log
25.Change ownership of the freshclam logfile with: chown clamav /var/log/freshclam.log
26.Change permissions on the freshclam logfile: chmod 600 /var/log/freshclam.log
27.Test the Clamav anti-virus software with: clamscan -r -l scan.txt /tmp/clamav-0.93.3
It should find some files in /tmp/clamav-0.93.3/test
28.Edit the crontab with: crontab -e
29.Add the following line to the crontab: 17 * * * * /usr/local/bin/freshclam –quiet
30.Create the file /etc/rc.d/init.d/clamd:
.......
1.chmod 755 clamd
2.chkconfig --add clamd
3.chkconfig --levels 345 clamd on
4.Modify the file /etc/group bij adding the clamav user to the scalix group using:
usermod -G scalix clamav
5.service clamd start
Scalix – Clamav anti-virus integration configuration
1.Create an anti-virus rule-file in /var/opt/scalix/ml/s/rules (where ml is the instance-name) with with name ALL-ROUTES.VIR and content:
VIRUS-UNCLEANED=1 ACTION=REJECT NDN-INFO=!ndninfo.txt
VIRUS-UNCLEANED=0 VIRUS-FOUND=1 ACTION=ALLOW NOTIFY="A virus was found in your message. It was successfully cleaned and sent to the recipient. We recommend that you install or update your virus protection software and scan your computer for viruses."
2.Create a non-delivery-notification file in /var/opt/scalix/ml/s/rules (where ml is the instance-name) with with name ndninfo.txt and content:
Text = A virus was detected in your message and could not be cleaned, therefore it was not delivered. We highly recommend that you install or update your virus protection software.
3.Create a scan-file which provides the necessary information for the anti-virus software to scan all messages sent to Scalix users with (where ml is the instance-name), and make sure the file-permissons are set properly:
cp /opt/scalix/examples/general/omvscan.map /var/opt/scalix/ml/s/rules
cd /var/opt/scalix/ml/s/rules
chown root omvscan.map
chmod 555 omvscan.map
4.Modify the file /var/opt/scalix/ml/s/sys/omvscan.cfg (where ml is the instance-name):
CLAMAV_ENGINE=/usr/local/bin/clamdscan