Clam Antivirus Installation for Qmail

Home » Computer Articles » Linux » Clam Antivirus Installation for Qmail
May 23, 2008 Linux No Comments


Apply the following to all Email servers.

Needed application before installation.

Make sure you have bzip2-devel and gmp-devel installed
swup --install bzip2-devel or yum install bzip2-devel
swup --install gmp-devel or yum install gmp-devel

Download and install CURL

make install

Download ClamAV from this web site Clamav

Untar downloaded file

tar -xvzf clamav-0.92.1.tar.gz

Creat a user and group for Clamav

groupadd clamav
useradd clamav -g clamav -C "Clam Antivirus" -s /bin/false


./configure --disable-zlib-vcheck
make install

Updating Definitions files

touch /var/log/clam-update.log
chmod 600 /var/log/clam-update.log
chown clamav /var/log/clam-update.log

Setup a cronjob to update definitions

crontab -e
# Updating for Antivirus
0 4,8,12,16,20,23 * * * /usr/local/bin/freshclam --quiet --log-verbose --daemon-notify


Download QClam from this web site QClam


bunzip2 qclam-0.8.tar.bz2
tar -xvf qclam-0.8.tar.bz2

If your system is not compatible with shipped QClam binary.
make clean
make install

Make sure that clamd is loaded at run time.

Copy or cut and paste this file to your server Clamd init file

Make sure the permissions of the file are 700
chmod 700 /etc/init.d/clamd

Add to /var/qmail/control/defaultdelivery

|/usr/local/bin/qclam --clam /usr/local/bin/clamdscan
|dot-forward .forward

Share This:

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.