Im changing hosts and i need to convert my maildir accounts on my old server to mbox on my new server.
Any ideas on the best way to do this?
I found this:
for i in new/* cur/*;do formail <”$i” >> ../mbox;done
But i dont really understand it. I have a basic knowledge of linux and I have root access to my server via ssh.
most of the Maildir folder have the following contents:
cur
new
tmp
dovecot.index.log
dovecot-uidlist
dovecot.index
dovecot.index.log.2
dovecot.index.cache
dovecot-keywords
subscriptions
Do i need all of that or can i ignore the dovecot files?
Any advice would be greatly appreciated.
C
If you have access to both servers via imap (or can temporarily arrange it), you might want to consider using an imapsync tool, eg:
http://freshmeat.net/projects/imapsync/
If that won't work, you should be able to ignore the dovecot files, but beware that you'll likely lose information like which messages are read and any flags set on the messages. (The imapsync method would preserve all those things.)
If one needs to convert a maildir account into a mailbox account without setting mailservers, one can use the mailbox library of python. If one has a single maildir folder to convert, one can use this small (10 lines+comments) python script found here. If one has subfolder, one needs to explore the subfolder structure, which is different between the two formats. This gives the following script :