[Dovecot] convert to mdbox
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
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-m...
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 23/07/2013 10:44, Robert Schetterer wrote:
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
I thought dsync can do natively, just I don't figure out how.
I use the latest 2.2.4 dovecot, so I hope there was no problem.
for avoid acl and quota problems
dsync -o plugin/acl= -o plugin/quota= -u ....
Thanks for the hint.
perhaps look at
http://sys4.de/de/blog/2013/07/20/fallstricke-mit-acl-und-quota-bei-backup-m...
be aware of, if use zlib plugin all backup mails get compressed too
Best Regards MfG Robert Schetterer
Thank you!!
Levi
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
participants (3)
-
Birta Levente
-
Jan-Frode Myklebust
-
Robert Schetterer