In this post, we are addressing a common issue that arises when an inbox contains hundreds of thousands of emails. The problem manifests itself as Dovecot encounters difficulties due to insufficient RAM allocated for indexing. This post aims to provide a solution to this problem and optimize Dovecot's performance by granting it additional RAM for indexing purposes.
Run:
Code: Select all
grep 'Cannot allocate memory' /var/log/dovecot.log
If output is something like:
Code: Select all
... Error: mmap failed with file ... dovecot.index.cache: Cannot allocate memory
Then, to fix this, in your SSH, as root, run:
Code: Select all
sed -i "1s|^|default_vsz_limit = 1024M\n|" /etc/dovecot/conf.d/10-master.conf
systemctl restart dovecot