This documentation is for Dovecot v1.x, see wiki2 for v2.x documentation.

Migration to Dovecot

Dovecot is one of the easiest IMAP servers to migrate to because of its very powerful configuration options. Dovecot can store email in both MBOX and MAILDIR formats, making it compatible with most other mail storage formats. Dovecot is also very flexible as to where it stores the email. It supports many methods for storing user data and password authentication. You can set it up to authenticate against multiple databases.

Migration involves several separate tasks. You either need to convert your data or make Dovecot read your existing data. Dovecot is very good at being compatible and configurable so that it is likely to read your existing mail folders and user and password configurations. Tasks for conversion include:

When migrating from another IMAP server, you should make sure that these are preserved:

  1. Message flags
    • Lost flags can be really annoying, you most likely want to avoid it.
  2. Message UIDs (and for IMAP, the UIDVALIDITY value)
    • If UIDs are lost, at the minimum clients' message cache gets cleaned and messages are re-downloaded as new.
    • Some IMAP clients store metadata by assigning it to specific UID, if UIDs are changed these will be lost.
  3. Mailbox subscription list
    • Users would be able to manually subscribe them again if you don't want to mess with it.

When migrating from another POP3 server, you should make sure that POP3 UIDLs are preserved, otherwise if client had kept mails in the server all the mails are downloaded again as new mails. pop3_uidl_format and pop3_reuse_xuidl will help you here. If your existing server used IMAP UIDs for the POP3 UIDL, you'll also need to make sure the IMAP UIDs stay the same.

Here are the more server-specific instructions:

Other POP3 servers (X-UIDL)

Some POP3 servers generate the X-UIDL header. To use this header when available and ease migration, use:

# Use X-UIDL header if available
pop3_reuse_xuidl = yes

Different POP3 servers generate UIDs differently. If you want to preserve them to avoid users downloading their mails twice, you'll need to figure out how the server generates the UID and patch Dovecot accordingly to do the same.

Here is a list of POP3 servers and how they generate their UIDs. Please update if you know more:

Anchor(convert)