Skip to main content

Ubuntu 16.04 and ISPConfig 3.1 - stopping ClamAV

ClamAV requires quite a bit of resources to run in the background and this usually slows down the mail delivery. In the ISPConfig 3 (Under Perfect Server setup), clamAV is run within Amavis. Therefore, typical removal of clamAV commands will not remove it.

When RAM is really low, Linux kills amavis and this will cause mail not being delivered. Therefore, if we run amavis to manage anti-virus and spam, consider a minimum of 2G or 4G RAM VM/Cloud servers.

The steps to disable clamav and amavisd are:

(1) edit postfix conf - note amavis uses a special port 10024 and 10026. Therefore, if you are not using these ports, consider closing them in your firewall settings.

nano /etc/postfix/

# content_filter = amavis:[]:10024
# receive_override_options = no_address_mappings

(2) Under ISPConfig 3.1, comment additional 2 lines

nano /etc/postfix/
#/^/ FILTER amavis:[]:10024
nano /etc/postfix/
#/^/ FILTER amavis:[]:10026

Save changes and restart postfix

/etc/init.d/postfix restart

(3) stop and disable the services

/etc/init.d/clamav-daemon stop
/etc/init.d/clamav-freshclam stop
/etc/init.d/amavis stop

update-rc.d -f clamav-daemon remove
update-rc.d -f clamav-freshclam remove
update-rc.d -f amavis remove

To restore the changes, do:

update-rc.d clamav-daemon defaults
update-rc.d clamav-freshclam defaults
update-rc.d amavis defaults

The services shall start in the next reboot

(4) Under Ubuntu 16.04 and ISPConfig 3.1, also execute the following commands:

systemctl disable clamav-daemon.socket
systemctl disable clamav-daemon.service
systemctl disable clamav-freshclam.service

Note - The changes in postfix will get overwitten by an ispconfig software update when you select to "re-configure" services during update, so you should comment out the lines again after you install a ispconfig update.


Post a Comment

Popular posts from this blog

ISPConfig / Pure-FTP / SSL (TLS) setup

ISPConfig comes with LetsEncrypt integrated in its panel for web domains. However, it does not automatically use the SSL cert for FTP service (PureFTP). This post describes the steps to enable the support. 1. We need an FQDN so that Lets Encrypt (LE) will be able to generate SSL under ISPConfig panel. 2. PureFTP TLS support requires a cert in .pem format which can be generated by leveraging the LE cert generated: cat /etc/letsencrypt/live/ /etc/letsencrypt/live/ > /etc/ssl/private/pure-ftpd.pem 3. Restart PureFTP so that it will not use the new certificate 4. LE certificates need to be renewed regularly so it is necessary to create a cron job to keep the .pem file updated. Setup a crontab 0 6 * * * /etc/letsencrypt/certbot-auto -n renew --quiet --no-self-upgrade && cat /etc/letsencrypt/live/ /etc/letsencrypt/live/ > /etc/ssl/private/pure-ftpd.pem && se

ISPConfig 3 + RoundCube Mail 1.0 + Password Management

Most of the articles on the web are referring to older versions. Below are the steps to get it working. Assumptions: This works on a Ubuntu Server 12.04 LTS updated with the latest patches, setup by following "Perfect Server" tutorial, then installed with RoundCube 1.0 as the Webmail. (SqurrielMail installation was skipped). 1. Enable the password plugin of RoundCube - The 1.0 version comes with the plugin in the package, but not activated. Under config/ // ---------------------------------- // PLUGINS // ---------------------------------- // List of active plugins (in plugins/ directory) $config['plugins'] = array('password'); This tells you will activate the 'password' plugin which sits inside the plugins/ directory. 2. Then edit the plugins/password/ $config['password_db_dsn'] = 'mysql://ispconfig:password@localhost/dbispconfig'; "password" is stored in /usr/local/ispconfig/interf