Results 1 to 10 of 10

Thread: [SOLVED] Howto: Update ClamAV

Threaded View

  1. #1
    Join Date
    Nov 2005
    Rep Power

    Post [SOLVED] Howto: Update ClamAV

    As others have noticed, the ClamAV released with M2 is out of date and it will complain in its log files to such.
    Note: This was done on Fedora Core 4 minimal install. Also, all the following can be done either as root or as the zimbra user. If you do it all as root make sure you change ownership for the resulting clamav-0.87.1 folder in /opt/zimbra to zimbra:zimbra.

    To update, follow the following:
    First go grab the latest ClamAV source from (Current Stable Version is 0.87.1)
    Extract it to where ever you please. All this can either be done as root or as the zimbra user. If you do it all as root make sure you change ownership for the resulting clamav folder in /opt/zimbra to zimbra:zimbra.

    Next run configure inside of the clamav extract as following:
    ./configure --prefix=/opt/zimbra/clamav-0.87.1 --with-user=501 --with-group=501
    This assumes zimbra is user and group id 501, change it accordingly to your system to match your zimbra user.

    Note: I had to install gmp-devel and bzip2-devel so the configure could find all its header files. Your mileage may very. If you get an error about GNU MP missing install gmp-devel. "yum install gmp-devel", and "yum install bzip2-devel" in Fedora and Red Hat.

    If your configure goes well, and make sure it does as you don't really want ClamAV installed without some of its available testing ability being compiled.

    Run: make
    Assume no errors,
    Run: make check, and then make install.
    Again assuming no errors, you now have the new version installed into /opt/zimbra/clamav-0.87.1

    You can do all the following without restart zimbra as a whole if you wish, or you can restart the whole suite.

    Stop Amavis from running, note mail service will be stopped and mail will be potentially lost if amavis isn't running and postfix gets mail.

    Run: zmamavisctl stop or zmcontrol stop to stop amavis.

    Delete the symbolic link /opt/zimbra/clamav

    Re-link it to the new install:
    ln -s /opt/zimbra/clamav-0.87.1 /opt/zimbra/clamav
    Now we need to edit clam and freshclam's conf files. I'm not entirely sure if this is actually necessary, but we didn't configure the default paths and options for a few things at build time so I think it is.

    Create directory /opt/zimbra/clamav/db

    In /opt/zimbra/clamav/etc/clamd.conf edit these settings:
    ## Example config file for the Clam AV daemon
    ## Please read the clamd.conf(5) manual before editing this file.
    # Comment or remove the line below.
    # Uncomment this option to enable logging.
    # LogFile must be writable for the user running daemon.
    # A full path is required.
    # Default: disabled
    LogFile /opt/zimbra/log/clamd.log
    # This option allows you to save a process identifier of the listening
    # daemon (main thread).
    # Default: disabled
    PidFile /opt/zimbra/log/
    # Path to the database directory.
    # Default: hardcoded (depends on installation options)
    DatabaseDirectory /opt/zimbra/clamav/db
    # TCP port address.
    # Default: disabled
    TCPSocket 3310
    # TCP address.
    # By default we bind to INADDR_ANY, probably not wise.
    # Enable the following to provide some degree of protection
    # from the outside world.
    # Default: disabled
    # Run as a selected user (clamd must be started by root).
    # Default: disabled
    User zimbra
    Note: These are just the settings I changed and are not continous, but are in order from top to bottom referencing the order of the actual clamd.conf file. There are many other parts to the file, but no other settings were changed.

    In /opt/zimbra/clamav/etc/freshclam.conf edit these settings:
    ## Example config file for freshclam
    ## Please read the freshclam.conf(5) manual before editing this file.
    ## This file may be optionally merged with clamd.conf.
    # Comment or remove the line below.
    # Path to the database directory.
    # WARNING: It must match clamd.conf's directive!
    # Default: hardcoded (depends on installation options)
    DatabaseDirectory /opt/zimbra/clamav/db
    # Path to the log file (make sure it has proper permissions)
    # Default: disabled
    UpdateLogFile /opt/zimbra/log/freshclam.log
    # This option allows you to save the process identifier of the daemon
    # Default: disabled
    PidFile /opt/zimbra/log/
    # By default when started freshclam drops privileges and switches to the
    # "clamav" user. This directive allows you to change the database owner.
    # Default: clamav (may depend on installation options)
    DatabaseOwner zimbra
    Note: Again this is just a few of the settings in the freshclam.conf file. They are the ones I changed. The rest are left at default.

    Now you should make sure zimbra owns all of clamav.
    chown -R zimbra:zimbra /opt/zimbra/clamav-0.87.1
    Next we need to update the virus database.
    Run: /opt/zimbra/clamav/bin/freshclam

    Need to start amavis back up.
    Either run: zmamavisdctl start, or zmcontrol start depending on how you stop before.
    Run zmcontrol status to make sure antivirus is running. If it is your good to go.

    You should check /opt/zimbra/log/clamd.log for errors, as well as freshclam in the same directory. Also /var/log/zimbra.log. To test out ClamAV I would suggest to send different variations of the EICAR test virus to one of your email addresses. Depending on if you have "Send notice ot recipient" check in Global Settings of the Admin Web UI, the user should receive around 20 email notifications of the emails being quarantined. Don't worry about the two that got through. Apparently ClamAV doesn't check for the techniques. There are although no virii included in those two emails, so it doesn't worry me. If anyone has any problems let me know.


    Edit: You can delete the previous install of clamav once you make sure everything is working. Delete the /opt/zimbra/clamav-0.85.1 directory and everythnig it contains. Again make sure you have the other version working well first.

    Last edited by unilogic; 12-03-2005 at 08:58 PM.

Similar Threads

  1. Howto update contacts using REST interface?
    By tigger in forum Administrators
    Replies: 0
    Last Post: 05-23-2007, 03:26 AM
  2. zimbra antivirus update clamav 0.90 failed
    By NIRMESH KUMAR in forum Administrators
    Replies: 3
    Last Post: 02-21-2007, 01:48 AM
  3. can clamav update the virus database automatically?
    By nxzwt in forum Administrators
    Replies: 1
    Last Post: 01-31-2007, 11:11 PM
  4. Replies: 2
    Last Post: 03-15-2006, 08:37 AM
  5. ClamAV update
    By johndevine in forum Administrators
    Replies: 3
    Last Post: 11-29-2005, 01:58 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts