When clam 0.80 is installed it is configured to use /etc/clamd.conf not /etc/clamav.conf.
The old folder location of /etc/e-smith/templates/etc/clamav.conf folder is setup instead of the new /etc/e-smith/templates/etc/clamd.conf folder that is required for this 0.80 build.
What is we need is for the clam rpms to be rebuilt to use clamav.conf or for the install script within the rpm to setup the new folder structure not the old one.
A workaround is to copy the /etc/e-smith/templates/etc/clamav.conf folder to /etc/e-smith/templates/etc/clamd.conf and then to expand the clamd.conf file:
/sbin/e-smith/expand-template /etc/clamd.conf
The default freshclam conf file has an Example directive in it which prevents freshclam from executing properly until it is removed; just expand this template as well:
/sbin/e-smith/expand-template /etc/freshclam.conf
then these commands should work and antivirus scanning will be available
freshclam -v
service clamd start
Test this out before going live but it should be OK as it just a collection of the stuff I did to make it work.
I have updated jespers script with these mods if anyone wants to test this for me (my test server is down at the moment) - I will post it in here and those that want can copy and paste; my changes are commented:
#!/bin/sh
#############################################################################
#
# This Antivirus installation script has been developed
# by Jesper Knudsen at
http://sme.swerts-knudsen.dk#
# It installs ClamAv and Amavis-ng and ensures that the virus database is
# kept updated on an hourly basis
#
# Revision History:
#
# Aug 29, 2004: Initial revision history.
#############################################################################
clear
echo "========================================================"
echo "= Antivirus Installation Script ="
echo "= ="
echo "= This script will install Antivirus on your system ="
echo "= provide you with a server-manager panel for ="
echo "= configuration. ="
echo "= ="
echo "= No express or implied warranties are provided and its="
echo "= usage is at your own risk. ="
echo "= ="
echo "= If you feel confortable with the above then press ="
echo "= enter if not pres Ctrl+C to abort the installation ="
echo "= script. ="
echo "= ="
echo "========================================================"
read x
clear
echo "Checking for existing installations.... Please wait!"
#prepare a download directory in /root
cd /root
mkdir antivirus_install
cd antivirus_install
rpm -qa > rpmlist
IS_SME60=pic rpmlist | grep -c SMEServer-6.0
if [ $IS_SME60 -eq 1 ]
then
echo "Installing ClamAntivirus on SME 6.0....."
else
echo "This installation only supports SME 6.0.x - Exiting..."
cd /root
rm -rf antivirus_install
exit
fi
# is this an update of an older installation?
IS_UPDATE=grep -c clamav- rpmlist
if [ $IS_UPDATE -ne 0 ]
then
clear
echo "========================================================"
echo "= Clam Antivirus Already Installed !! ="
echo "= ="
echo "= This script will now try upgrade from an older ="
echo "= installation. If you did not install from an older ="
echo "= version of a script from sme.swerts-knudsen.dk ="
echo "= this might break your installation!!! ="
echo "= ="
echo "= If you feel confortable with the above then press ="
echo "= enter if not pres Ctrl+C to abort the installation ="
echo "= script. ="
echo "= ="
echo "========================================================"
read x
clear
AV=cat rpmlist | grep e-smith-antivirus
if [ cat rpmlist | grep -c e-smith-antivirus -ne 0 ]
then
echo "Upgrade ClamAV failed - e-smith-antivirus from pagefault.org installed."
echo "uninstall e-smith-antivirus first by rpm -e $AV"
cd /root
rm -rf antivirus_install
exit
fi
if [ cat rpmlist | grep -c sme-antivirus -ne 0 ]
then
FILE=grep sme-antivirus rpmlist
echo "$FILE being uninstalled to prepare for upgrade...."
rpm -e $FILE
fi
# then remove the old ClamAV files
FILE=grep clamav- rpmlist
echo "$FILE being uninstalled to prepare for upgrade...."
service clamd stop
rpm -e $FILE
if [ rpm -qa | grep -c clamav- -ne 0 ]
then
echo "Unistall of ClamAV failed - You need to uninstall manually - sorry"
cd /root
rm -rf antivirus_install
exit
else
echo "Uninstall of ClamAV successful..."
fi
# remove the old log as its not compatible
rm /var/log/clamav/freshclam.log
fi #IS_UPDATE
# determine download server....
mkdir downloadtest
cd downloadtest
PRIMARY=http://mirror.contribs.org/smeserver/contribs/swerts-knudsen/AntiVirus
SECONDARY=http://sme.swerts-knudsen.dk/downloads/AntiVirus
wget -q --timeout=4 $PRIMARY
if [ -f index.html ]
then
# download from primary site OK
SITE=$PRIMARY
else
wget -q --timeout=4 $SECONDARY
if [ -f index.html ]
then
# download from mirror site
SITE=$SECONDARY
fi
fi
echo "Downloading RPMs from $SITE"
cd ..
rm -rf downloadtest
#First download the ClamAV
wget $SITE/clamav-es-libs-0.80-es01.i386.rpm
wget $SITE/clamav-es-0.80-es01.i386.rpm
#Then get all the perl modules if they are not already installed
if [ pic rpmlist | grep perl-DateManip | wc -l -eq 0 ]
then
wget $SITE/perl-DateManip-5.40-15.i386.rpm
fi
if [ pic rpmlist | grep perl-Archive-Tar-1.1 | wc -l -eq 0 ]
then
wget $SITE/perl-Archive-Tar-1.10-1.noarch.rpm
fi
if [ pic rpmlist | grep perl-Archive-Zip-1.1 | wc -l -eq 0 ]
then
wget $SITE/perl-Archive-Zip-1.12-1.noarch.rpm
fi
if [ pic rpmlist | grep perl-Compress-Zlib-1.3 | wc -l -eq 0 ]
then
wget $SITE/perl-Compress-Zlib-1.33-1.i386.rpm
fi
if [ pic rpmlist | grep perl-Config-IniFiles | wc -l -eq 0 ]
then
wget $SITE/perl-Config-IniFiles-2.38-1.i386.rpm
fi
if [ pic rpmlist | grep perl-Convert-TNEF | wc -l -eq 0 ]
then
wget $SITE/perl-Convert-TNEF-0.17-1.i386.rpm
fi
if [ pic rpmlist | grep perl-Convert-UUlib-1 | wc -l -eq 0 ]
then
wget $SITE/perl-Convert-UUlib-1.03-1.i386.rpm
fi
if [ pic rpmlist | grep perl-File-MMagic | wc -l -eq 0 ]
then
wget $SITE/perl-File-MMagic-1.22-1.i386.rpm
fi
if [ pic rpmlist | grep perl-IO-stringy | wc -l -eq 0 ]
then
wget $SITE/perl-IO-stringy-2.108-1.i386.rpm
fi
if [ pic rpmlist | grep perl-MIME-tools | wc -l -eq 0 ]
then
wget $SITE/perl-MIME-tools-5.411a-1.i386.rpm
fi
if [ pic rpmlist | grep perl-MailTools-1.61 | wc -l -eq 0 ]
then
wget $SITE/perl-MailTools-1.61-1.i386.rpm
fi
if [ pic rpmlist | grep perl-libnet | wc -l -eq 0 ]
then
wget $SITE/perl-libnet-1.13-1.i386.rpm
fi
if [ pic rpmlist | grep maildrop | wc -l -eq 0 ]
then
wget $SITE/maildrop-1.3.0-1.7.0.i386.rpm
fi
#Then Amavis-ng
if [ pic rpmlist | grep amavis-ng | wc -l -eq 0 ]
then
wget $SITE/amavis-ng-0.1.6.4-03dc.noarch.rpm
fi
# now the re-inserts module
if [ pic rpmlist | grep qmail-bsmtp-0 | wc -l -eq 0 ]
then
wget $SITE/qmail-bsmtp-0.1-1.noarch.rpm
fi
#Then all the packaging tools
if [ pic rpmlist | grep arc-5 | wc -l -eq 0 ]
then
wget $SITE/arc-5.21e-4.i386.rpm
fi
if [ pic rpmlist | grep lha | wc -l -eq 0 ]
then
wget $SITE/lha-1.14i-4.2rm.i386.rpm
fi
if [ pic rpmlist | grep unarj | wc -l -eq 0 ]
then
wget $SITE/unarj-2.43-6.1rm.i386.rpm
fi
if [ pic rpmlist | grep unrar | wc -l -eq 0 ]
then
wget $SITE/unrar-2.71-1.1rm.i386.rpm
fi
if [ pic rpmlist | grep zoo | wc -l -eq 0 ]
then
wget $SITE/zoo-2.10-4.1rm.i386.rpm
fi
# now get the AntiVirus panel
wget $SITE/sme-antivirus-1.0.1-1.noarch.rpm
# delete the old Clam Cron job
if [ -e /etc/cron.d/freshclam.cron ]
then
rm -f /etc/cron.d/freshclam.cron
fi
#Now when downloaded lets install
rpm -Uvh *.rpm
######################### Changed by smeghead ######################
cp -R /etc/e-smith/templates/etc/clamav.conf /etc/e-smith/templates/etc/clamd.conf
/sbin/e-smith/expand-template /etc/clamd.conf
/sbin/e-smith/expand-template /etc/freshclam.conf
####################### End changes by smeghead ####################
#if it was an upgrade then we need to restart
service clamd start
#update the virus database
echo "Updating the Clam Virus database - Please wait...."
/usr/bin/freshclam --quiet -l /var/log/clamav/freshclam.log
# ensure that the first log file has been created
#touch /var/log/amavis-ng/amavis-ng.log
chown qmailq:qmail /var/log/amavis-ng
#chown qmailq:qmail /var/log/amavis-ng/amavis-ng.log*
# Now notify Swerts-Knudsen that you have installed - only so that I can enhance
# the scripts that are most in use
ERR=wget -q -t 1 -T 2 --delete-after
http://sme.swerts-knudsen.dk/cgi-bin/egometer?Antivirus_Scriptcd /root
# rm -rf antivirus_install
if [ $IS_UPDATE -ne 0 ]
then
echo "Update of Antivirus has successfully completed."
else
echo "Installation of Antivirus has successfully completed."
fi