Dbox Configuration

See dbox for a technical description of Dovecot’s dbox mailbox format.

NOTE: You must not lose the dbox index files, as they can’t be regenerated without data loss.

Mail Location

To use single-dbox, use the tag sdbox in the mail location:

# single-dbox
mail_location = sdbox:~/dbox

For backwards compatibility, dbox is an alias to sdbox in the mail location. (This usage is deprecated.)

To use multi-dbox, use the tag mdbox in the mail location:

# multi-dbox
mail_location = mdbox:~/mdbox

Default mail_location Keys

For dbox, the default Keys are:

Key

Default Value

MAILDIRBOX

mailboxes/

FULLDIRNAME

dbox-Mails/

Alternate Storage

See dbox alternate storage for further information.

To specify an alternate storage area, use the ALT parameter in the mail location. For example:

mail_location = mdbox:/var/vmail/%d/%n:ALT=/altstorage/vmail/%d/%n

will make Dovecot look for message data first under /var/vmail/%d/%n (“primary storage”), and if it is not found there it will look under /altstorage/vmail/%d/%n (“alternate storage”) instead. There’s no problem having the same (identical) file in both storages.

Keep the unmounted /altstorage directory permissions such that Dovecot mail processes can’t create directories under it (e.g. root:root 0755). This way if the alt storage isn’t mounted for some reason, Dovecot won’t think that all the messages in alt storage were deleted and lose their flags.

mdbox Configuration Settings

mdbox_preallocate_space

mdbox only: If enabled, preallocate space for newly created files.

In creation of new mdbox files, their size is immediately preallocated as mdbox_rotate_size.

This setting currently works only in Linux with certain filesystems (ext4 and xfs).

mdbox_rotate_interval
  • Default: 0

  • Values: Size

mdbox only: The maximum age the dbox file may reach before it’s rotated.

0 means there is no age-based rotation.

mdbox_rotate_size
  • Default: 10M

  • Values: Size

mdbox only: The maximum size the dbox file may reach before it is rotated.