[Dovecot] mbox to maildir conversion
Timo writes:
BTW. Nowadays Dovecot includes its own conversion tool also, which might work better than mb2md. Usage is something like:
src/plugin/convert-tool user /home/user mbox:/home/user/mail:INBOX=/var/mail/%u maildir:/home/user/Maildir
I would RTFM but searching wiki.dovecot.org turns up nothing. Give me more hints and I will add a new wiki page.
The feedback the command gives is
$ ./convert-tool Fatal: Usage: <username> <home dir> <source mail env> <dest mail env>
Why does the tool want a home directory? What does it look for there?
I know you say the syntax is the same for other tools but I don't know it for them yet either. :-) Guessing at the syntax for the source, it looks like the first thing is the format of the source (mbox:) followed by a directory containing mbox format files. The INBOX portion specifies the location of the mbox that the MDA puts incoming messages into.
I can see the variables defined in doc/variables.txt, got that already.
Is it intended to run both directions? That is, if I swap the last two args is will it convert maildirs into mboxes?
This comment from Stian seemed pertinent as well.
But there is at least one "bug" with this; you should convert .'s in mbox names to underscore or something, else it looks weird. Other than that, it seems to work fine :)
..but I am unsure what 'looks weird' means. Can you give an example?
Why is this tool under 'plugins' when it appears to be a separate utility? My guess is that it was easier to put there due to the build environment. Maybe it should install to a bin or sbin location?
Thanks for all you do,
Brian
After experimenting with convert-tool it appears to rename the mail/ directory to mail-converted/ and do nothing else.
Command I used:
convert-tool testtest mbox:/home/testtest:INBOX=/var/spool/mail/testtest
maildir:/var/mail/t/testtest/Maildir/
I have dovecot running already in a test config and I can see the account's folders correctly in squirrelmail. All the files and folders seem okay there.
A 'verbose' option for convert-tool would be highly useful...
Brian
I'm coming in late to this so sorry if this has already been suggested, but pine comes with a mailutil app if compiled with the maildir patch..
http://www.math.washington.edu/~chappa/pine/info/maildir.html
For example...
mailutil copy ~/mail/saved-messages #driver.md/Mdir/saved-messages
I used to transfer all my mail into maildir format (about 8 years worth - including sent mail) and it worked fine.
-philip
participants (2)
-
Brian Wilson
-
Philip Hallstrom