Quispiam

power computing

If you are like me you barely notice your mailservers are having issues, until you see somthing like this in the logs;

LibClamAV Warning: ***********************************************************
LibClamAV Warning: ***  This version of the ClamAV engine is outdated.     ***
LibClamAV Warning: *** DON'T PANIC! Read http://www.clamav.net/support/faq ***
LibClamAV Warning: ***********************************************************

I have in the past updated ClamAV for Zimbra, but didn’t write it down or even remember how I did it. I performed a google on update clamav zimbra and found a wiki entry, a quick history revealed to me that I did previously do something similar to the wiki entry.

...
97  CC=/usr/bin/gcc-3.4 ./configure --prefix=/opt/zimbra/clamav-0.96 
       --with-user=zimbra --with-group=zimbra 
98  make
99  ln -s /usr/lib/libstdc++.so.6.0.7 /usr/lib/libstdc++.so
100  ldconfig
101  make
102  make check
103  make install
104  cd /opt/zimbra/clamav-0.93.1/etc/
105  diff clamd.conf ../../clamav-0.96/etc/clamd.conf
106  cd ..
107  cd ..
108  cd clamav-0.96/
109  mv clamd.conf clamd.conf.org
110  cd etc
111  mv clamd.conf clamd.conf.org
112  mv freshclam.conf freshclam.conf.org
113  cd /opt/zimbra/conf
114  cp clamd.conf /opt/zimbra/clamav-0.96/etc/
115  cp freshclam.conf /opt/zimbra/clamav-0.96/etc/
116  zmcontrol stop
117  su zimbra
118  cd /opt/zimbra/
119  rm -rf clamav
120  ln -s clamav-0.96/ clamav
121  chown -R zimbra.zimbra clamav-0.96/
122  mkdir /opt/zimbra/clamav/db
123  chown -R zimbra.zimbra clamav-0.96/
...

Beautiful, no need to think or read, just decipher my gunk from a year or so ago.

So, these details below are more of a reminder for me, but if the intertubes can get a hit of goodness from them AOK.

Download the latest and greatest clamav

wget http://downloads.sourceforge.net/clamav/clamav-{new version}.tar.gz

Unpack the archive and change into the newly created directory

tar xvzf clamav-{new version}.tgz
cd clamav-{new version}

You need to pass some pretty specific parameters to configure in order to get clam to install properly on a Zimbra unit, so try the following

 ./configure --prefix=/opt/zimbra/clamav-{new version} 
    --with-user=zimbra --with-group=zimbra

Now, I am super lazy and am running an older version of Ubuntu and I get the following error at the end of configure

checking for gcc bug PR27603... ok, bug not present
checking for gcc bug PR26763-2... ok, bug not present
checking for valid code generation of CLI_ISCONTAINED... ok, bug not present
checking for gcc bug PR28045... configure: error: your compiler has gcc PR28045 
    bug, use a different compiler, 
see http://gcc.gnu.org/bugzilla/show_bug.cgi?id=28045

Eeeek ! A little searching of the intertubes leads me to believe I will need an earlier version of gcc.

apt-get install gcc-3.4

Now I can get on with life as before, except now I need to tell the shell and by association, configure, what compiler I will be using.

CC=/usr/bin/gcc-3.4 ./configure --prefix=/opt/zimbra/clamav-{version} 
--with-user=zimbra --with-group=zimbra

Now that thats is all cool I can get on with the make and install process

make
make check
make install

The next few things are basically backing up and copying my old configs to the new clamav directories, and symlinking /opt/zimbra/clamav to the correct directory

cd /opt/zimbra/clamav-{old version}/etc
mv clamd.conf clamd.conf.org
mv freshclam.conf freshclam.conf.org
cd /opt/zimbra/conf
cp clamd.conf /opt/zimbra/clamav-{new version}/etc/
cp freshclam.conf /opt/zimbra/clamav-{new version}/etc/
cd /opt/zimbra/
rm -rf clamav
ln -s clamav-{new version}/ clamav
chown -R zimbra.zimbra clamav-{new version}/

Now I needed to start and stop zimbra

su zimbra
zmcontrol stop
zmcontrol start

Not that hard really, and not that complicated, mayhaps the running theme for my posts should be “How to make really old mailservers still deliver mail”

Thanks go to

history
http://wiki.zimbra.com/wiki/ClamAV_-_Updating_Version

Matt

Share