[Dovecot] Problems Converting Maildir to mdbox

Charles Marcus CMarcus at Media-Brokers.com
Sat Aug 28 17:30:08 EEST 2010


On 8/28/2010 5:35 AM, Christian Felsing wrote:
> I would like to convert all users mail from maildir to mdbox. My Dovecot
> version is 2.0.1, converted from 1.2.13 but config was rewritten from
> scratch.
> 
> http://wiki2.dovecot.org/Migration/MailFormat says following:
> maildir -> mdbox migration. Set mail_location=mdbox:~/mdbox
> and run
> doveadm convert -u username maildir:~/Maildir
> 
> but doveadm does not know a command like "convert". Is there a _working_
> way to convert maildir to mdbox ? How to do that with all Dovecot mail
> users (about 10000) ?

Hmmm. not sure why that page is still around, but I'm fairly sure the
proper way to convert is using dsync...

http://wiki2.dovecot.org/Tools/Dsync

Towards the bottom you find:

"Converting:

Assuming that the mail_location setting in
/etc/dovecot/conf.d/10-mail.conf is set to: mail_location =
mdbox:~/mdbox, a logged in system user may convert her/his mails from
its Maildir in her/his home directory to the mdbox mailbox format. The
user has to execute the command:

 dsync mirror maildir:~/Maildir

If you want to do this without any downtime, you can do the conversion
one user at a time. Initially:

 * Configuration uses mail_location = maildir:~/Maildir
 * Set up the possibility of doing per-user mail location using
   userdb extra fields.

Then for each user:

 1. Run dsync mirror once to do the initial conversion.
 2. Run dsync mirror again, because the initial conversion could
    have taken a while and new changes could have occurred during
    it. This second time only applies changes, so it should be fast.
 3. Update mail extra field in userdb to mdbox:~/mdbox. If you're
    using auth cache, you need to flush it.
 4. Wait for a few seconds and then kill the user's all existing
    imap and pop3 sessions (that are still using maildir).
 5. Run dsync mirror once more to apply final changes that were
    possibly done. After this there should be no changes to Maildir,
    because the user's mail location has been changed and all existing
    processes using it have been killed.

Once all users have been converted, you can set the default
mail_location to mdbox and remove the per-user mail locations from userdb."

-- 

Best regards,

Charles


More information about the dovecot mailing list