Skip to content

Commit fd944a7

Browse files
authored
Add option to have ClamAV clamd use less memory on startup (#64)
1 parent 26c8ab6 commit fd944a7

2 files changed

Lines changed: 11 additions & 2 deletions

File tree

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,7 @@ Thank you very much.
4343

4444
- [mailserver2/mailserver](#mailserver2mailserver)
4545
- [Fork](#fork)
46-
- [Chat & questions](#chat--questions)
46+
- [Chat \& questions](#chat--questions)
4747
- [Build](#build)
4848
- [Docker image](#docker-image)
4949
- [Summary](#summary)
@@ -86,6 +86,7 @@ Thank you very much.
8686
- [IPv6 support](#ipv6-support)
8787
- [Persistent files and folders in /mnt/docker/mail Docker volume](#persistent-files-and-folders-in-mntdockermail-docker-volume)
8888
- [Override postfix configuration](#override-postfix-configuration)
89+
- [Whitelist Hosts/IP Addresses In Postfix](#whitelist-hostsip-addresses-in-postfix)
8990
- [Custom configuration for Dovecot](#custom-configuration-for-dovecot)
9091
- [Postfix blacklist](#postfix-blacklist)
9192
- [Email client settings](#email-client-settings)
@@ -114,6 +115,9 @@ Please check, if your system meets the following minimum requirements:
114115
| CPU | 1 GHz | 1 GHz |
115116
| RAM | 512 MiB | 1 GiB |
116117

118+
**NOTE**: If you are having problems with clamd using too much memory on startup, set `CLAMD_MEMORY_FIX` to `true`.
119+
See [the ClamAV documentation](https://docs.clamav.net/manual/Installing/Docker.html#what-can-i-do-to-minimize-ram-usage) for details.
120+
117121
<p align="right"><a href="#summary">Back to table of contents :arrow_up_small:</a></p>
118122

119123
### Prerequisites
@@ -331,6 +335,7 @@ If you use Ansible, I recommend you to go to see [@ksylvan](https://github.com/k
331335
| **WHITELIST_SPAM_ADDRESSES** | List of whitelisted email addresses separated by commas | *optional* | null |
332336
| **DISABLE_RSPAMD_MODULE** | List of disabled modules separated by commas | *optional* | null |
333337
| **DISABLE_CLAMAV** | Disable virus scanning | *optional* | false |
338+
| **CLAMD_MEMORY_FIX** | Will add `ConcurrentDatabaseReload no` in clamd.conf | *optional* | false |
334339
| **DISABLE_SIEVE** | Disable ManageSieve protocol | *optional* | false |
335340
| **DISABLE_SIGNING** | Disable DKIM/ARC signing | *optional* | false |
336341
| **DISABLE_GREYLISTING** | Disable greylisting policy | *optional* | false |
@@ -1123,7 +1128,7 @@ NOQUEUE: reject: 554 5.7.1 <john.doe@domain.tld>: Sender address rejected: Acces
11231128
- Dovecot 2.2.27
11241129
- Rspamd 1.9.4
11251130
- Fetchmail 6.3.26
1126-
- ClamAV 0.100.3
1131+
- ClamAV 1.0.3
11271132
- Clamav Unofficial Sigs 5.6.2
11281133
- Zeyple 1.2.2
11291134
- Unbound 1.6.0

rootfs/usr/local/bin/setup.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -733,6 +733,10 @@ sed -i -e 's/^Foreground .*$/Foreground true/g' \
733733
-e 's/^LogFacility .*$/LogFacility LOG_MAIL/g' \
734734
/etc/clamav/clamd.conf
735735

736+
if [ "$CLAMD_MEMORY_FIX" = true ]; then
737+
echo "ConcurrentDatabaseReload no" >> /etc/clamav/clamd.conf
738+
fi
739+
736740
# FRESHCLAM
737741
# ---------------------------------------------------------------------------------------------
738742

0 commit comments

Comments
 (0)