This documentation is for Dovecot v2.x, see wiki1 for v1.x documentation.
Differences between revisions 1 and 40 (spanning 39 versions)
Revision 1 as of 2007-03-19 20:48:22
Size: 1967
Editor: TimoSirainen
Comment:
Revision 40 as of 2013-07-29 08:55:52
Size: 2977
Editor: TimoSirainen
Comment:
Deletions are marked like this. Additions are marked like this.
Line 1: Line 1:
= Courier, Courier-IMAP =
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 ["Namespaces"] how to set namespaces to be Courier-compatible.
= Courier IMAP/POP3 =
'''WARNING: Badly done migration will cause your IMAP and/or POP3 clients to re-download all mails. Read [[Migration]] page first carefully.'''
== Courier v0.43 and later to Dovecot v1.1+ ==
[[http://www.dovecot.org/tools/courier-dovecot-migrate.pl|courier-dovecot-migrate.pl]] does a perfect migration from Courier IMAP and POP3, preserving IMAP UIDs and POP3 UIDLs. It reads Courier's {{{courierimapuiddb}}} and {{{courierpop3dsizelist}}} files and produces {{{dovecot-uidlist}}} file from it.
Line 4: Line 6:
 * Courier's {{{courierimapsubscribed}}} is compatible with Dovecot's {{{subscriptions}}} file, just rename it and remove the "INBOX." prefixes. (NOTE: with 0.99.x it's {{{.subscriptions}}}, with 1.0 it's {{{subscriptions}}} without the dot)
 * Courier's {{{courierimapuiddb}}} is compatible with Dovecot's {{{dovecot-uidlist}}} file, just rename it.
 * Courier's message flags are compatible with Dovecot (as they are specified by the Maildir specification)
 * Courier's message keywords implementation isn't Dovecot compatible and there is currently no easy way to migrate them.
See also the [http://bendiken.net/scripts/ courier2dovecot] script by Arto Bendiken.

See also the [http://www.aucontraire.net/scripts/mail/courier2dovecot.py courier2dovecot.py] script by Michael Watkins.

Settings:
Before doing the actual conversion you can run the script and see if it complains about any errors and such, for example:
Line 15: Line 9:
# normal home directories # ./courier-dovecot-migrate.pl --to-dovecot --recursive /home
Finding maildirs under /home
/home/user/Maildir/dovecot-uidlist already exists, not overwritten
/home/user/Maildir2: No imap/pop3 uidlist files
Total: 69 mailboxes / 6 users
       0 errors
No actual conversion done, use --convert parameter
}}}
The actual conversion can be done for all users at once by running the script with {{{--convert --recursive}}} parameters. Make sure the conversion worked by checking that {{{dovecot-uidlist}}} files were created to all maildirs (including to subfolders).

The {{{--recursive}}} option goes through only one level down in directory hierarchies. This means that if you have some kind of a directory hashing scheme (or even domain/username/), it won't convert all of the files.

You can also convert each user as they log in for the first time, using PostLoginScripting with a script something like:

{{{#!plain
#!/bin/sh
# WARNING: Be sure to use mail_drop_priv_before_exec=yes,
# otherwise the files are created as root!

courier-dovecot-migrate.pl --quiet --to-dovecot --convert Maildir
# This is for imap, create a similar script for pop3 too
exec /usr/local/libexec/dovecot/imap
}}}

FIXME: The script should rename also folder names that aren't valid mUTF-7. Dovecot can't otherwise access such folders.

== Dovecot configuration ==
Courier by default uses "INBOX." as the IMAP namespace for private mailboxes. If you want a transparent migration, you'll need to configure Dovecot to use a namespace with "INBOX." prefix as well.

{{{
Line 17: Line 40:
# for virtual users
mail_location = maildir:~/}}}
For POP3 UIDL compatibility with Courier, the Dovecot configuration depends on the Courier version used:
Line 21: Line 41:
 Courier version 0:: {{{
# Courier version 0 (using maildir filenames)
pop3_uidl_format = %f}}}
 Courier version 1:: {{{
# Courier version 1 (UID)
pop3_uidl_format = %u}}}
 Courier version 2 and early Courier version 3:: {{{
# Courier version 2 (UIDVALIDITY and UID - you most likely want this)
pop3_uidl_format = %v-%u}}}
 Courier version 3 (younger versions):: Here everything has changed: Courier's UID data are now stored in{{{courierpop3dsizelist}}}and in a completely new format. But it's still possible to convert it to the format dovecot needs (link to perlscript and further configuration details will follow later).
namespace {
  prefix = INBOX.
  separator = .
  inbox = yes
}
}}}
== Manual conversion ==
 * Courier's {{{courierimapsubscribed}}} file is compatible with Dovecot's {{{subscriptions}}} file, but you need to remove the "INBOX." prefixes from the mailboxes. ''This is true even if you set namespace prefix to "INBOX." as described above.''
 * Courier's {{{courierimapuiddb}}} file is compatible with Dovecot's {{{dovecot-uidlist}}} file, just rename it.
 * Courier's message flags are compatible with Dovecot (as they are specified by the Maildir specification)
 * Courier's message keywords implementation isn't Dovecot compatible. There doesn't exist a simple way to convert the keywords manually.

Courier IMAP/POP3

WARNING: Badly done migration will cause your IMAP and/or POP3 clients to re-download all mails. Read Migration page first carefully.

Courier v0.43 and later to Dovecot v1.1+

courier-dovecot-migrate.pl does a perfect migration from Courier IMAP and POP3, preserving IMAP UIDs and POP3 UIDLs. It reads Courier's courierimapuiddb and courierpop3dsizelist files and produces dovecot-uidlist file from it.

Before doing the actual conversion you can run the script and see if it complains about any errors and such, for example:

# ./courier-dovecot-migrate.pl --to-dovecot --recursive /home
Finding maildirs under /home
/home/user/Maildir/dovecot-uidlist already exists, not overwritten
/home/user/Maildir2: No imap/pop3 uidlist files
Total: 69 mailboxes / 6 users
       0 errors
No actual conversion done, use --convert parameter

The actual conversion can be done for all users at once by running the script with --convert --recursive parameters. Make sure the conversion worked by checking that dovecot-uidlist files were created to all maildirs (including to subfolders).

The --recursive option goes through only one level down in directory hierarchies. This means that if you have some kind of a directory hashing scheme (or even domain/username/), it won't convert all of the files.

You can also convert each user as they log in for the first time, using PostLoginScripting with a script something like:

#!/bin/sh
# WARNING: Be sure to use mail_drop_priv_before_exec=yes,
# otherwise the files are created as root!

courier-dovecot-migrate.pl --quiet --to-dovecot --convert Maildir
# This is for imap, create a similar script for pop3 too
exec /usr/local/libexec/dovecot/imap

FIXME: The script should rename also folder names that aren't valid mUTF-7. Dovecot can't otherwise access such folders.

Dovecot configuration

Courier by default uses "INBOX." as the IMAP namespace for private mailboxes. If you want a transparent migration, you'll need to configure Dovecot to use a namespace with "INBOX." prefix as well.

mail_location = maildir:~/Maildir

namespace {
  prefix = INBOX.
  separator = .
  inbox = yes
}

Manual conversion

  • Courier's courierimapsubscribed file is compatible with Dovecot's subscriptions file, but you need to remove the "INBOX." prefixes from the mailboxes. This is true even if you set namespace prefix to "INBOX." as described above.

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

  • Courier's message flags are compatible with Dovecot (as they are specified by the Maildir specification)
  • Courier's message keywords implementation isn't Dovecot compatible. There doesn't exist a simple way to convert the keywords manually.

None: Migration/Courier (last edited 2019-12-20 14:09:53 by 38)