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:
- Where and how to store the email
- User configuration - home directory structure - UID/GID - password storage
- Authentication of users
When migrating from another IMAP server, you should make sure that these are preserved:
- Message flags
- Lost flags can be really annoying, you most likely want to avoid it.
- 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.
- 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:
[:Migration/UW:UW-IMAP / UW-POP3]
[:Migration/Linuxconf:Linuxconf / VIMAP]
[:Migration/Courier:Courier IMAP and POP3]
[:Migration/Cyrus:Cyrus IMAP and POP3]
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:
[http://www.openwall.com/popa3d/ popa3d] Generates MD5 sum from a couple of headers. Dovecot uses compatible MD5 sums internally but converts them into strings in a bit different way.
[http://www.ex-parrot.com/~chris/tpop3d/ tpop3d] When used with maildir, tpop3d UIDL is a hexadecimal representation of first 16 2-byte words of md5 sum of the message filename. When used with mailbox, tpop3d UIDL is a hexadecimal representation of first 16 2-byte words of md5 sum of first 512 bytes of message (or full messsage if it less then 512 bytes).