Disabling ClamAV on Virtualmin GPL

Hi, I have a virtualmin GPL setup running several virtual hosts, with 2GB RAM. As emails arrive to the various users, sometimes several instances of clamscan start up simultaneously, each one using several hundred MB of RAM, causing other processes to crash due to no additional RAM available.

How can I either 1) force a single instance of clamav to stay running and share the antivirus definitions with all incoming email scans, or 2) disable clamav completely and bypass it for all incoming mail?

Thanks!

  1. I’m not sure that is possible. ClamAv is indeed resource intensive if you have a lot of email incoming. I think you have probably set it up to use CPU instead of Ram (initial Virtualmin Wizard Installation), so each time a mail comes in, it has to spin up a new process from scratch. That may be bad if you have regular email on your VPS as it has to spin up a process each time. In that case, you should run ClamAV and SpamAssasin in memory (but it will use RAM instead), 2 GB would probably be on the small side and I would rather turn it off and use an external filtering service. SpamAssasin and ClamAV alone can take a 1 GB alone.

See here:
https://www.virtualmin.com/documentation/email/spam-av

  1. Webmin > System > Bootup and Shutdown

Disable clamav from boot.

Another solution is to limit incoming emails (e.g. one by one) but you will need 3rd party plugin for Postfix to achieve that. In case your are receiving/sending large amounts of emails you should really look at 3rd party solution like Spamexperts. They will do everything you need, e.g. rate limit, spam and virus check… for incoming and outgoing emails. This isnt free but they are the best. Another solution could be to go with services like GoogleApps, Zoho email (same as G but cheaper) or many others.

Volk gave you great advice so take his post and mine and see what is best solution for you.