Disable ClamAV

Disable ClamAV#

There are scenarios in which an Administrator wants to or needs to disable Carbonio CE’s internal anti-virus engine, ClamAV, for example when using an external, company-wide anti-virus engine or for troubleshooting some MTA’s issue in a test environment. To disable ClamAV, first disable amavis (which is invoked by ClamAV to check e-mails). Both tasks must be executed from the CLI.

Disable amavis

Execute the following commands as the zextras user to disable amavis from the CLI

zextras$ carbonio prov mcf carbonioAmavisDisableVirusCheck TRUE

Restart the service to make sure the new value is picked up by the system

zextras$ zmamavisdctl restart

You can check at any time the status of the variable and of the service with

zextras$ carbonio prov gcf carbonioAmavisDisableVirusCheck

Note

If you never modified the value of the variable, this command may return no output, meaning that amavis is running.

Disable ClamAV

To disable ClamAV, execute the following commands as the root user to mask the service

# systemctl disable carbonio-clamav-sidecar.service

Since the systemd unit is masked, it will not be restarted during future upgrades. You need to explicitly unmask it before enabling it again.

Restart the following services to let systemd pick up the changes

  • Carbonio Mesh

    # systemctl restart service-discover
    
  • The services on the MTA Node

    zextras$ zmcontrol restart
    
    zextras$ zmcontrol restart
    
    zextras$ zmcontrol restart
    
    # systemctl start/stop/restart carbonio-mta.target
    

Finally, as the zextras user, let Carbonio CE make sure that the antivirus service is disabled.

zextras$ carbonio prov ms $(zmhostname) \
-zimbraServiceEnabled amavis

Additionally, you can also disable the other related services.

zextras$ carbonio prov ms $(zmhostname) \
-zimbraServiceEnabled amavis \
-zimbraServiceEnabled antivirus \
-zimbraServiceEnabled antispam \
-zimbraServiceEnabled opendkim \
carbonioAmavisDisableVirusCheck TRUE

As final task, you need to remove the ClamAV definition file for service-discover.

Note

This file will be restored during future upgrades of ClamAV or Carbonio CE, so make sure to remove it each time you upgrade.

# rm /etc/zextras/service-discover/carbonio-clamav.hcl

Remove Signatures Updater#

In order to remove completely the automatic download of ClamAV’s signatures databases, you can uninstall the package carbonio-avdb-updater.

# apt purge carbonio-avdb-updater