[Dovecot] converting from maildir to mdbox ?

Timo Sirainen tss at iki.fi
Tue Feb 8 21:44:39 EET 2011


On Tue, 2011-02-08 at 20:32 +0100, Jan-Frode Myklebust wrote:

> user_attrs = mailMessageStore=mail=maildir:%$:INDEX=/indexes/%1u/%1.1u/%u,mailQuota=quota_rule=*:storage=%$
> 
> i.e. every user has a "mailMessageStore" attribute in LDAP that points
> to his INBOX. Any ideas for how we can migrate user by user to mdbox?
> Can we add a mailboxFormat attribute to LDAP, and somehow get that
> used in the user_attrs lookup ? Ideally have it default to maildir if
> not set, so that the current setup isn´t changed and only migrated
> users are affected. Or should we be keeping the mailboxFormat as a
> prefix in all mailMessageStore strings ?

Change user_attrs to:

user_attrs = mailMessageStore=home, mailLocation=mail, mailQuota=..etc..

And in dovecot.conf set:

mail_location = maildir:~/:INDEX=/indexes/%1u/%1.1u/%u

Then add a temporary mailLocation field, which for converted users
contains: mdbox:~/mdbox:INDEX=/indexes/%1u/%1.1u/%u/mdbox

Finally once everyone has been converted, get rid of the mailLocation
field and instead just set:

mail_location = mdbox:~/mdbox:INDEX=/indexes/%1u/%1.1u/%u/mdbox

As a bonus you then no longer have home=mail directory, which isn't very
good anyway, and possibly might make your mailbox migration slightly
more difficult than it needs to be.



More information about the dovecot mailing list