Dovecot supports three storage formats. Pick once — migration is possible but painful.
| Format | Layout | Strengths | Weaknesses |
|---|---|---|---|
| Maildir | 1 file per message | Universal, easy to back up file-by-file, every tool understands it | Slow on huge folders (100k+ msgs), high inode count |
| mdbox | Many messages per file, sharded | Fast, low inode usage, single-instance attachments | Dovecot-specific, harder to inspect manually |
| sdbox | 1 message per file, Dovecot-native | Like Maildir but with built-in index | Less mature than mdbox |
Recommendation:
- <1000 mailboxes, normal usage: Maildir. Simplest backup story.
- High-volume hosting or huge folders: mdbox. Single-instance attachments alone saves 30–50% disk.
- New deployments without strong reason: mdbox.
Configure in /etc/dovecot/conf.d/10-mail.conf:
mail_location = maildir:/var/mail/vhosts/%d/%n
# or
mail_location = mdbox:/var/mail/vhosts/%d/%n
%d = domain, %n = user (left side of @).
Sign in to keep track of what you have read.