I'm trying to clean up the code for Dovecot v2.0 and I just keep coming back to the same thought: Is having the super-fast maildir -> single-dbox migration really actually a good idea?
Some problems with it:
Makes the code more complex.. And I've already fixed many bugs related to that, maybe not all.
Having some mails in maildir format and others in dbox format isn't really good in long term. The super-fast migration was mainly meant to be used as a quick and easy way to start using dbox and then slowly convert maildir files to dbox files.
There's currently no way to actually convert the migrated maildir files to dbox format. And I'm not really sure how such a tool would even be used. "doveadm -u <username> dbox convert-old-maildir-files" run one user at a time?..
Maybe a better alternative would be to simply do a proper full migration to dbox format, a few users at a time so disk I/O wouldn't explode? dsync especially could be helpful here. convert plugin could be replaced with a dsync plugin and then a migration could be done with:
- Run a "pre-migration" dsync for n users (not absolutely required, but a good idea to avoid login delays).
- Enable dsync plugin for the users (or this could be enabled always).
- Switch users to dbox format.
- Run a "post-migration" dsync for the users. If any user logged in before the post-migration was finished, the dsync plugin would finish the migration for that user.
- Goto 1 with another set of users, repeat until finished with all users.