Problem: Dovecot Warns about "Inotify instance limit for user 120 (UID dovemail) exceeded"

Problem

In dovecot.warn you will see lines as follows:
Nov 12 15:33:51 mail01 dovecot: imap(t.bush@schule.ucs): Warning: Inotify instance limit for user 120 (UID dovemail) exceeded, disabling. Increase /proc/sys/fs/inotify/max_user_instances

Environment

Inotify is a mechanism to watch changes on a file or directory. Thus, the process does not need to ask (“poll”) every now and then if a file has changed. Instead it can pause and will get notified by the kernel if the file in question changes. Especially for Email servers you should consider to increase this value (default for UCS servers: 512).

Solution

Increase the value until the warning message disappears:

root@mail:~# ucr set kernel/fs/inotify/max_user_instances=4096
Setting kernel/fs/inotify/max_user_instances
File: /etc/sysctl.d/local.conf
root@mail:~# sysctl -p /etc/sysctl.d/local.conf
root@mail:~# systemctl restart dovecot
Mastodon