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.
In /var/log/dovecot.log you will find:
Code: Select all
... Error: mmap failed with file ... dovecot.index.cache: Cannot allocate memory
In order 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