dbox
====

dbox is Dovecot's own high-performance mailbox format. The original version was
introduced in v1.0 alpha4, but since then it has been completely redesigned in
v1.1 series.

dbox can be used in two ways:

 1. One message per file, similar to <Maildir> [MailboxFormat.Maildir.txt].
 2. Multiple messages per file, but unlike <mbox> [MailboxFormat.mbox.txt]
    multiple files per mailbox. (This isn't currently fully working.)

One of the main reasons for dbox's high performance is that it uses Dovecot's
index files as the primary storage for message flags and keywords. They're
still backed up to the dbox files once in a while though. Using index files as
the primary storage also means that the indexes don't have to be
"synchronized". Dovecot trusts that they're always up-to-date (unless it sees
that something is clearly broken).

Unlike Maildir the message file names don't change. This makes it possible to
support storing files in multiple directories or mount points. dbox supports
looking up files from "altpath" if they're not found from the primary path.
This means that it's possible to move older mails that are rarely accessed to
cheaper (slower) storage.

dbox supports a quick migration from Maildir format. It basically works by
renaming Maildir/cur/ directory as the dbox's mail directory and then moving
files from Maildir/new/ directory and Dovecot's control and index files there
as well. The maildir files are sometimes later then converted to actual dbox
files when their message flag changes are decided to be backed up (if there are
no changes, they're never converted currently).

dbox storage is extensible, so in future there will be other extensions. Some
things that are planned:

 * Single instance attachment storage. If multiple mailboxes/users have the
   same attachment, it's stored only once in disk.
 * Multiple mailboxes in one dbox storage. This makes copying messages from one
   mailbox to another a simple metadata update.

Multiple messages per file mode isn't currently fully functional, so it can't
be enabled without modifying sources.

(This file was created from the wiki on 2009-01-07 04:42)
