[Dovecot] Convert MBOX
To all,
I am using dovecot --version 1.0.10 and trying to convert MBOXes to MailDir's with the end goal of creating one folder filled with users old MBOXes that when they log in for the first time will be converted to Mail Dir format.
I tried this and it did not work and gave me this output; <snip> default_mail_env = maildir:%h/mail/ #convert_mail = mbox:%h/mail:INBOX=/usr/local/src/tmpmail/%u convert_mail = mbox:%h/mail/:INBOX=/usr/local/src/tmpmail/%u
Jan 30 17:17:04 pop01.unix dovecot: [ID 107833 mail.info] pop3-login:
Login: user=<x4500>, method=PLAIN, rip=192.168.30.192, lip=172.20.12.8
Jan 30 17:17:04 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
Loading modules from directory: /usr/local/lib/dovecot/pop3
Jan 30 17:17:04 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
Module loaded: /usr/local/lib/dovecot/pop3/lib20_convert_plugin.so
Jan 30 17:17:04 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
Effective uid=3000, gid=3000
Jan 30 17:17:04 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
mbox:
data=/export/x4500/mail/jp/n/e/jorgen/x4500/mail/:INBOX=/usr/local/src/tmpmail/x4500
Jan 30 17:17:04 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
mbox: root=/export/x4500/mail/jp/n/e/jorgen/x4500/mail,
index=/export/x4500/mail/jp/n/e/jorgen/x4500/mail,
inbox=/usr/local/src/tmpmail/x4500
Jan 30 17:17:06 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
mbox:
data=/export/x4500/mail/jp/n/e/jorgen/x4500/mail/:INBOX=/usr/local/src/tmpmail/x4500
Jan 30 17:17:06 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
mbox: root=/export/x4500/mail/jp/n/e/jorgen/x4500/mail,
index=/export/x4500/mail/jp/n/e/jorgen/x4500/mail,
inbox=/usr/local/src/tmpmail/x4500
Jan 30 17:17:06 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
maildir: data=/export/x4500/mail/jp/n/e/jorgen/x4500/mail/
Jan 30 17:17:06 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
maildir: root=/export/x4500/mail/jp/n/e/jorgen/x4500/mail,
index=/export/x4500/mail/jp/n/e/jorgen/x4500/mail, control=, inbox=
Jan 30 17:17:07 pop01.unix dovecot: [ID 107833 mail.error] POP3(x4500):
Mailbox conversion: Couldn't copy mailbox dovecot.index.log: BUG:
Unknown internal error
Jan 30 17:17:07 pop01.unix dovecot: [ID 107833 mail.error] POP3(x4500):
Mailbox conversion: Couldn't copy mailbox dovecot.index: BUG: Unknown
internal error
Jan 30 17:17:08 pop01.unix dovecot: [ID 107833 mail.error] POP3(x4500):
Mailbox conversion: Couldn't copy mailbox dovecot.index.cache: BUG:
Unknown internal error
Jan 30 17:17:11 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
maildir: data=/export/x4500/mail/jp/n/e/jorgen/x4500/mail/
Jan 30 17:17:11 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500):
maildir: root=/export/x4500/mail/jp/n/e/jorgen/x4500/mail,
index=/export/x4500/mail/jp/n/e/jorgen/x4500/mail, control=, inbox=
</snip> This actually created the x4500-convert directory but did not populate it
Then I tried this trying to get the mail dir created and populated.
<snip> #convert_mail = mbox:%h/mail:INBOX=/usr/local/src/tmpmail/%u convert_mail = mbox:/usr/local/src/tmpmail/%u:INBOX=/var/mail/%u
Jan 30 17:22:45 pop01.unix dovecot: [ID 673593 mail.info] Dovecot v1.0.10 starting up Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] pop3-login: Login: user=<x4500>, method=PLAIN, rip=192.168.30.192, lip=172.20.12.8 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): Loading modules from directory: /usr/local/lib/dovecot/pop3 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): Module loaded: /usr/local/lib/dovecot/pop3/lib20_convert_plugin.so Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): Effective uid=3000, gid=3000 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): mbox: data=/usr/local/src/tmpmail/x4500:INBOX=/var/mail/x4500 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): mbox: root=/usr/local/src/tmpmail/x4500, index=/usr/local/src/tmpmail/x4500, inbox=/var/mail/x4500 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): mbox: data=/usr/local/src/tmpmail/x4500:INBOX=/var/mail/x4500 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): mbox: root=/usr/local/src/tmpmail/x4500, index=/usr/local/src/tmpmail/x4500, inbox=/var/mail/x4500 Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): maildir: data=/export/x4500/mail/jp/n/e/jorgen/x4500/mail/ Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.info] POP3(x4500): maildir: root=/export/x4500/mail/jp/n/e/jorgen/x4500/mail, index=/export/x4500/mail/jp/n/e/jorgen/x4500/mail, control=, inbox= Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.error] POP3(x4500): mkdir_parents(/usr/local/src/tmpmail/x4500/.imap/INBOX) failed: Not a directory Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.error] POP3(x4500): open() failed with subscription file /usr/local/src/tmpmail/x4500/.subscriptions: Not a directory Jan 30 17:22:59 pop01.unix dovecot: [ID 107833 mail.error] POP3(x4500): Sending log messages too fast, throttling.. Jan 30 17:22:59 pop01.unix dovecot: [ID 961074 mail.error] child 23071 (pop3) returned error 89 </snip>
I am a little confused because when I read the syntax http://wiki.dovecot.org/Plugins/Convert?highlight=%28convert%29
It looks like it should say
"convert_mail= mbox:/users/home/dir/mail/:INBOX=/location/of/old/MBOX/file"
I have tried a number of different combinations but am still failing to get the mail/{cur,new,tmp} created in the correct user directory with actual mail in them.
Can some one please help w/this?
Additionally is there a way to run mail_convert on the command line to
try to sort out the arguments? I noticed the converts are .so and .a in
/usr/local/lib/dovecot/ so I doubt it but it can not hurt to ask.
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
to avoid such problems i simple create a new user with userdb_mail=maildir and using thunderbird i just copied the emails from one account to other :)
I had to wait a little but in the end everything was pretty damn ok. But i only had to change one account ...
Erin D. Hughes wrote:
To all,
I am using dovecot --version 1.0.10 and trying to convert MBOXes to MailDir's with the end goal of creating one folder filled with users old MBOXes that when they log in for the first time will be converted to Mail Dir format.
Evaggelos Balaskas - http://ebalaskas.gr Unix System Engineer Informatics Engineer Technological Education -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.6 (GNU/Linux) Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org
iD8DBQFHoHpPWIK+Pe9twhoRAt7GAJ4uT4yWl3fmPcc2gOM42h11kdUwCACfTTEC XFpTm/t0i/QxzSYnI5mh37U= =XJ83 -----END PGP SIGNATURE-----
Evaggelos Balaskas wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
to avoid such problems i simple create a new user with userdb_mail=maildir and using thunderbird i just copied the emails from one account to other :)
Thanks Evaggelos for your reply unfortunately I need to convert about 17,000 mboxes to maildirs. Re-reading my last mail I see that maybe I was not so clear.
I have a old system using mbox format (sendmail/pop3d). I am moving them to a new system using maildir format (postfix/dovecot).
I would like to rsync all of the old mail boxes to one directory on my new system. Then tell dovecot that this is the location of old mbox file, when the user logs in for the first time convert/copy their old mbox to their existing mail dir on the new. Finally copy the old mbox file to some thing like mbox-convert so it is not converted again.
I understand that the convert plugin is capable of doing this. I am havening trouble with the syntax though.
I read http://wiki.dovecot.org/Plugins/Convert?highlight=%28convert%29
The wiki and it seems to say.
"convert_mail= mbox:/users/home/dir/mail/:INBOX=/location/of/old/MBOX/file"
I have tried a number of different combinations but am still failing to get the mail/{cur,new,tmp} created in the correct user directory with actual mail in them.
Can some one please help w/this?
Additionally is there a way to run mail_convert on the command line to
try to sort out the arguments? I noticed the converts are .so and .a in
/usr/local/lib/dovecot/ so I doubt it, but it can not hurt to ask.
Regards,
Erin
On Thu, 31 Jan 2008, Erin D. Hughes wrote:
Evaggelos Balaskas wrote:
to avoid such problems i simple create a new user with userdb_mail=maildir and using thunderbird i just copied the emails from one account to other :)
Thanks Evaggelos for your reply unfortunately I need to convert about 17,000 mboxes to maildirs. Re-reading my last mail I see that maybe I was not so clear.
I have used mb2md to good success, albeit not on so many.
-- Asheesh.
-- Because I don't need to worry about finances I can ignore Microsoft and take over the (computing) world from the grassroots. -- Linus Torvalds
Asheesh Laroia wrote:
On Thu, 31 Jan 2008, Erin D. Hughes wrote:
Evaggelos Balaskas wrote:
to avoid such problems i simple create a new user with userdb_mail=maildir and using thunderbird i just copied the emails from one account to other :)
Thanks Evaggelos for your reply unfortunately I need to convert about 17,000 mboxes to maildirs. Re-reading my last mail I see that maybe I was not so clear.
I have used mb2md to good success, albeit not on so many.
-- Asheesh.
When I was switching over a bunch of mboxes from Thunderbird mb2md
did not work out. I forget what went wrong though. I had problems because Thunderbird stores its mail in a non-standard mbox way. I ended up deleting some things and using dovecots convert-tool. The convert tool is not in debian etch so I had to use one of my home computers with a newer dovecot. Then I just ran "convert-tool user /home/gokee2 mbox:/mnt/files/email/nochange/ maildir:/mnt/files/email/dovecot/a/" to change the mboxs over to maildir.
Good luck!
Gokee2
Erin D. Hughes wrote:
I would like to rsync all of the old mail boxes to one directory on my new system. Then tell dovecot that this is the location of old mbox file, when the user logs in for the first time convert/copy their old mbox to their existing mail dir on the new. Finally copy the old mbox file to some thing like mbox-convert so it is not converted again.
I have tried a number of different combinations but am still failing to get the mail/{cur,new,tmp} created in the correct user directory with actual mail in them.
Have you tried using a different path for the mail_location (aka default_mail_env)? I'd think that trying to convert from mbox:%h/mail/ to maildir:%h/mail/ would cause major problems, including the the 3 errors you received ("Mailbox conversion: Couldn't copy mailbox dovecot.index: BUG: Unknown internal error"). Also, the convert plugin should automatically rename the old mbox folder to "~/mail-converted" after it is done.
Try using these settings: mail_location = maildir:~/Maildir convert_mail = mbox:%h/mail/:INBOX=/usr/local/src/tmpmail/%u
Scott Alter
participants (5)
-
adsarebad@gmail.com
-
Asheesh Laroia
-
Erin D. Hughes
-
Evaggelos Balaskas
-
Scott Alter