[Dovecot] convert to mdbox

Jan-Frode Myklebust janfrode at tanso.net
Mon Jul 29 11:16:22 EEST 2013


On Tue, Jul 23, 2013 at 10:08:57AM +0300, Birta Levente wrote:
> 
> How can I convert all virtual mailboxes from maildir to mdbox?
> Manually, one by one, working, but I have a lot ...

I've converted around 4-500.000 users from maildir to mdbox by the
following on a server configured for using MDBOX as default:

  1 - Search for all users with mailMessageStore attribute in LDAP
  2 - Convert user to mdbox:
	dsync -v -u "$username" mirror maildir:"$maildir" + check returncode
	dsync -v -u "$username" mirror maildir:"$maildir" + check returncode
  3 - Delete mailMessageStore attribute from LDAP and add "mailLocation: mdbox:~/mdbox"
  4 - pkill -HUP -u dovecot -f dovecot/auth -- to make sure auth cache is updated
  5 - doveadm kick "$username" -- on all servers, in case user was logged in..
  6 - Do final sync: dsync -v -u "$username" mirror maildir:"$maildir"
  7 - Delete maildir.


Only 26554 users left to convert..



  -jf


More information about the dovecot mailing list