This documentation is for Dovecot v1.x, see wiki2 for v2.x documentation.
Differences between revisions 22 and 23
Revision 22 as of 2005-08-21 15:31:10
Size: 6717
Editor: MarcPerkel
Revision 23 as of 2005-08-21 15:42:09
Size: 6718
Editor: MarcPerkel
Deletions are marked like this. Additions are marked like this.
Line 58: Line 58:
= VIMAP =  == VIMAP ==


Migration to Dovecot

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

  • Mailbox subscription list
    • User would be able to manually subscribe them again if you don't want to mess with it.
  • Message UIDs
    • If UIDs are lost, at the minimum clients' message cache gets cleaned
    • Some IMAP clients store metadata by assigning it to specific UID, if UIDs are changed these will be lost.
  • Message flags
    • Lost flags can be really annoying, you most likely want to avoid it.

Here's the more server-specific instructions:


By default UW-IMAP allows access to whole home directory, and many people have chosen to store their mails in mail/ directory. This usually means that IMAP clients have set "IMAP namespace" to "mail/", which doesn't work well with Dovecot, as Dovecot by default uses mail/ directory directly. So if IMAP namespace is kept as "mail/", Dovecot would try to access "~/mail/mail/" directory.

So, removing the prefix from IMAP clients would be the first step. Next problem is that subscribed mailboxes are listed as "mail/box" or "~/mail/box" or "~user/mail/box" in subscriptions file. You'd have to remove the mail/ directory part from all of these. The subscriptions file name is also different, UW-IMAP uses .mailboxlist while Dovecot uses .subscriptions.

Dovecot uses UW-IMAP compatible UID and message flag headers in mboxes, so that's not a problem.


default_mail_env = mbox:~/mail:INBOX=/var/mail/%u
# make sure mbox_locks are the same with all software that accesses your mboxes
mbox_locks = dotlock fcntl

If you want to make a transparent migration to Dovecot without having to change the configuration on hundreds of client systems, you will need a slightly different configuration.

  • If your clients have the server prefix set to something like "~/mail", this will not work unless you enable mail_full_filesystem_access in your Dovecot configuration. Dovecot will otherwise reject mailbox names or prefixes that start with "~". Alternative to this with 1.0-tests is to [wiki:Namespaces set up multiple hidden namespaces].
  • You can either rename your ".mailboxlist" file to ".subscriptions" for all you users, or change the definition of SUBSCRIPTION_FILE_NAME in src/lib-storage/subscription-file/subscription-file.c. In 1.0-test, this value is defined in src/lib-storage/subscription-fileindex/maildir/maildir-storage.h and src/lib-storage/subscription-fileindex/mbox/maildir-storage.h.

  • If ~/mbox file exists, UW-IMAP moves mails from /var/mail/user there. Currently Dovecot doesn't support this feature, so you'll have to either move everyone's mails to ~/mbox and reconfigure MTA/LDA to store mails there, or alternatively get the ~/mbox users to move their mails back to /var/mail/user. This feature may be implemented later, but it's not planned in near future.
  • You should read []. This document describes the migration process using scripts if you want to migrate from UW_IMAP with mbox to Dovecot using maildir (which will increase performance).


Only concerns Dovecot 0.99.x versions, 1.0-releases use them:

Every folder on a system using UW-IMAP has a system message in the top with the subject "DON'T DELETE THIS MESSAGE -- FOLDER INTERNAL DATA". This system message has information about the folder and its state. Dovecot 0.99.x does not use these system messages to anything so you can delete them without any problems - unless you have users using Pine together with an IMAP or POP3 mailclient.


By default Dovecot generates POP3 UIDs differently than UW-IMAP. If you want to preserve them, with 0.99.x you'll have to [ patch Dovecot]. With 1.0-tests you can use:

pop3_uidl_format = %08Xv%08Xu


VIMAP or [ Virtual Imap] was a patched version of WU-IMAP that was modified to work with [ Linuxconf's] virtual email configuration. The project doesn't seem to have much life and [ Patrick Hall] who wrote the patch is thrilled that Dovecot can now be configured to be fully compatible. Details of how to do this are described in the [wiki:VirtualUsers Virtual Users] section.


Courier by default uses "INBOX." as private IMAP namespace, so it has exactly the same problems as described with UW-IMAP above. Again, if you want the migration to be transparent for IMAP clients see [wiki:Namespaces Namespaces] how to get namespaces to be Courier-compatible.

  • Courier's courierimapsubscribed is compatible with Dovecot's .subscriptions file, just rename it and remove the "INBOX." prefixes.

  • Courier's courierimapuiddb is compatible with Dovecot's dovecot-uidlist file, just rename it.

  • Courier's message flags are compatible with Dovecot (as it's specified by Maildir specification)
  • Courier's message keywords implementation isn't Dovecot compatible and there's currently no easy way to migrate them.


# normal home directories
default_mail_env = maildir:~/Maildir
# for virtual users
default_mail_env = maildir:~/

For POP3 UIDL compatibility, use one of:

# Courier version 0 (using maildir filenames)
pop3_uidl_format = %f
# Courier version 1 (UID)
pop3_uidl_format = %u
# Courier version 2  (UIDVALIDITY and UID)
pop3_uidl_format = %v-%u


See [ cyrus2courier], it's Dovecot-compatible. Also mirrored at [].

For POP3 UIDL compatibility, use one of:

#  Cyrus (old format - up to v2.1.3)
pop3_uidl_format = %u
#  Cyrus (new format - v2.1.4 and above)
pop3_uidl_format = %v.%u

Other POP3 servers

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.

In future Dovecot will support reading the UID from X-UIDL header, and if it doesn't exist it will use it's own method. This feature is almost there, but not quite yet.

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

  • [ 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.

None: Migration (last edited 2010-11-02 22:24:58 by TimoSirainen)