This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 2 and 3
Revision 2 as of 2007-04-16 18:00:44
Size: 3374
Editor: troyengel
Comment: adding section about indexes
Revision 3 as of 2007-06-11 13:44:09
Size: 2928
Editor: TimoSirainen
Deletions are marked like this. Additions are marked like this.
Line 32: Line 32:
In some situations you may wish to not keep the index files in the user's home folder, for instance when {{{~/Maildir}}} is attached via NFS. You can specify this by adding {{{:INDEX=<path>}}} to {{{mail_location}}}, for example: See ["MailLocation#indexfiles"] for full explanation of how to change the index path. For example:
Line 35: Line 35:
mail_location = maildir:~/Maildir:INDEX=/var/spool/dovecot/%u mail_location = maildir:~/Maildir:INDEX=/var/indexes/%u
Line 37: Line 37:

The user's home folder will be created dynamically at runtime by Dovecot, as well as the folders necessary for each set of indexes in that user's mail tree.

'''NOTE''': ensure that the parent level folder, ''/var/spool/dovecot/'' e.g., has the proper writable permissions for your dovecot installation.

Maildir configuration

See ["MailboxFormat/Maildir"] for a complete description of how Dovecot has implemented Maildir support.

Mail location

Maildir exists almost always in ~/Maildir directory. The mail location is specified with:

mail_location = maildir:~/Maildir

Control files

Dovecot stores some Maildir metadata into two control files:

  • dovecot-uidlist file contains IMAP UID <-> Maildir filename mapping

  • dovecot-keywords file contains Maildir filename flag (a..z = 0..25) <-> keyword name mapping

Both of these files are described fully in ["MailboxFormat/Maildir"]. The important thing to remember about them however is that they shouldn't be treated the same way as index files. Index files can be deleted and rebuilt without any side effects, but if you delete control files you'll cause messages to get new UIDs and possibly lose keyword names.

If the messages get new UIDs, the IMAP clients will invalidate their local cache and download the messages all over again. If you do this for all the users, you could cause huge disk I/O bursts to your server.

Dovecot can't currently handle not being able to write the control files, so it will cause problems with [:Quota/FS:filesystem quota]. To avoid problems with this, you should place control files into a partition where quota isn't checked. You can specify this by adding :CONTROL=<path> to mail_location, for example:

mail_location = maildir:~/Maildir:CONTROL=/var/no-quota/%u

Index files

See ["MailLocation#indexfiles"] for full explanation of how to change the index path. For example:

mail_location = maildir:~/Maildir:INDEX=/var/indexes/%u


  • maildir_copy_with_hardlinks=yes (not default): When copying a message, do it with hard links whenever possible. This makes the performance much better, and it's unlikely to have any side effects. This will be default in some future version. The only downside is that copying to a shared mailbox may cause permission problems.

  • maildir_stat_dirs=no (default): Assume that all the files beginning with a dot in the maildir are maildirs. You shouldn't have any non-directory files beginning with a dot in the maildirs, but if you do you may need to set this to "yes", in which case Dovecot needs to stat() each directory entry, which degrades the performance. Some filesystems provide the directory/non-directory status for free without having to stat(). In those filesystems this setting is ignored.

  • maildir_copy_preserve_filename = yes (not default): When copying a message, try to preserve the base filename. This may allow you to optimize your backups. NOTE: This setting requires maildir_copy_with_hardlinks = yes to work.

Filesystem optimizations

See "Maildir and filesystems" section in ["MailboxFormat/Maildir"].

None: MailLocation/Maildir (last edited 2015-12-06 11:41:10 by TimoSirainen)