Module 5 · Lesson 10 of 25

Tuning IMAP for big folders

Part of Dovecot: IMAP/POP3 at Production Scale — IMAP, POP3, ManageSieve & Submission.

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 — protects 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 · self-hosted sending

Own the infrastructure your pipeline depends on.

One install script on your own server. Pulse sets up the MTA, mailboxes, certificates and dashboard; you add domains and start sending.

# 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