Mailbox Formats¶
Mailbox formats supported by Dovecot:
Name |
Tag |
Description |
|
---|---|---|---|
|
OX Dovecot Pro object storage mailbox format. (Pro only) |
||
|
Traditional UNIX mailbox format.
Users’ INBOX mailboxes are commonly
stored in |
||
|
One file contains one message. A
reliable choice since files are never
modified and all operations are
atomic. The top-level Maildir
directory contains the
|
||
|
single-dbox, one message per file. |
Dovecot’s own high performance mailbox format. Messages are stored in one or more files, each containing one or more messages. |
|
|
multi-dbox, multiple messages per file. |
||
|
Use remote IMAP server as mail storage. |
||
|
Use remote POP3 server as mail storage. |
The Tag column indicates the tag which is used at the beginning of a mailbox location specification.
Configuration¶
See Mail Location Settings for configuration information.
Physical Storage¶
The mailbox formats define how Dovecot stores mail data, but it does not address where that data will physically live - that is a decision for the administrator to make.
There are two general categories of storage: local and shared.
Local Storage¶
Filesystems¶
See Maildir Mailbox Format for Maildir-specific filesystem optimizations
Dovecot doesn’t rely on atime updates, so you can mount the filesystem with
noatime
Index Files¶
Keeping index files on a different disk than the mail spool gives you better performance. The indexes have a lot of write activity so it is recommended toi use RAID-10 instead of RAID-5 for them.
Fsyncing¶
By default, Dovecot calls fsync()
and fdatasync()
whenever it’s
useful to prevent potential data loss. The main reason for this is so that
Dovecot won’t lie that the message was saved to the disk, if in fact a power
failure a second later would lose the message. With IMAP clients this is
perhaps a less serious problem, because the lost message was most likely
either a mail in Draft mailbox or a message in “Sent Messages” mailbox; in
other words, a message that the user had already seen. However if
Dovecot LDA or LMTP Server loses a message, the user never even knew
that the message existed, unless the sender decides to resend it.
Since power failures and kernel panics are quite rare, many people are
tempted to disable fsyncing because it may increase the performance quite a
lot. Dovecot allows this by setting mail_fsync
to never
.
However, this is dangerous, especially with IMAP, LDA, and LMTP. If you do
want to set to never
, you should only explicitly do this for services
that you are comfortable with data loss. Example:
# Default
mail_fsync = optimized
protocol pop3 {
# Enable fsyncing for POP3
mail_fsync = never
}