Hi How can I convert all virtual mailboxes from maildir to mdbox? Manually, one by one, working, but I have a lot ... Virtual users and domains stored in sql database. Thats what I want: mail_location = maildir:/var/vmail/%d/%n/Maildir to mail_location = mdbox:/var/vmail/%d/%n/mdbox Thanks Levi -------------- next part -------------- A non-text attachment was scrubbed... Name: smime.p7s Type: application/pkcs7-signature Size: 3889 bytes Desc: S/MIME Cryptographic Signature URL: <http://dovecot.org/pipermail/dovecot/attachments/20130723/6984b461/attachment.bin>
Am 23.07.2013 09:08, schrieb Birta Levente:> Hi > > How can I convert all virtual mailboxes from maildir to mdbox? Manually, > one by one, working, but I have a lot ... > > Virtual users and domains stored in sql database. > > Thats what I want: > > mail_location = maildir:/var/vmail/%d/%n/Maildir > to > mail_location = mdbox:/var/vmail/%d/%n/mdbox > > Thanks > Levi >http://wiki2.dovecot.org/Tools/Dsync dsync should do it , but be aware from dsync bugs in some versions do heavy testing before doing something live, for many users do i.e with bash script export your users from sql to a file, or use live query for i in `cat user.lst` do dsync ..... done for avoid acl and quota problems dsync -o plugin/acl= -o plugin/quota= -u .... perhaps look at http://sys4.de/de/blog/2013/07/20/fallstricke-mit-acl-und-quota-bei-backup-mit-dsync-dovecot/ be aware of, if use zlib plugin all backup mails get compressed too Best Regards MfG Robert Schetterer -- [*] sys4 AG http://sys4.de, +49 (89) 30 90 46 64 Franziskanerstra?e 15, 81669 M?nchen Sitz der Gesellschaft: M?nchen, Amtsgericht M?nchen: HRB 199263 Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer Aufsichtsratsvorsitzender: Florian Kirstein
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