Skip to content
Module 5 · Lesson 10 of 25

Tuning IMAP for big folders

Part of Dovecot: IMAP/POP3 at Production Scale, in the IMAP, POP3, ManageSieve & Submission module.

Author

IMAP performance dies on huge folders (>50k messages). Dovecot's index files keep it sane.

Index location (10-mail.conf):

mail_location = mdbox:/var/mail/vhosts/%d/%n:INDEX=/var/indexes/%d/%n

Putting indexes on fast local SSD while mailboxes live on slower bulk storage is the single best IMAP tuning trick.

Useful per-protocol limits:

service imap-login {
  service_count = 1
  process_min_avail = 4
  vsz_limit = 256M
}
service imap {
  vsz_limit = 1G
  process_limit = 1024
}
  • process_min_avail = 4 keeps 4 idle pre-auth workers ready so login latency is consistent.
  • vsz_limit caps memory per process to protect against pathological clients.

Enable IMAP IDLE forever: imap_idle_notify_interval = 2 mins. Most clients (iOS Mail, Thunderbird) rely on IDLE for push.

Sign in to keep track of what you have read.

Pulse · email sending

Sending infrastructure that is yours alone.

Every domain gets its own MX host, IP, DKIM selector and certificate. Take it managed, and we run it for you, or buy a licence and run it on your own servers.

# on a fresh Ubuntu server
$ cd pulse && sudo ./install.sh
→ docker compose up · kumomta · stalwart · caddy
→ dashboard ready on https://pulse.yourdomain.com
$

Also from us:Beat: monitoring that tells you the fixConsulting: $65/hr, no retainer