Convert maildir to mbox

Status
Not open for further replies.

mattbates

Verified User
Joined
Oct 15, 2003
Messages
22
Hi,

I've just recently installed DA on FreeBSD 4.10 and it is generally working well, however I'm experiencing a few problems in transferring 'old' email across.

We were using the maildir format with Courier IMAP but as DA uses mbox, I'm looking for ways to convert it. I'm currently using formail to dump out to an mbox file but I'm not sure how to preserve folders in the mbox - e.g. sent items, drafts, etc - as it's all based in the one file.

Could anybody please help?

Thanks in advance.

Matt
 
mbox doesn't understand the contents of subdirectories.

If your users actually have any contents in the subdirectories that wouldn't be part of an mbox inbox, then they're using IMAP.

DA has implemented IMAP, and IMAP implements Maildir for all other directories besides the inbox,.

My understanding is that in order for IMAP to keep proper track of the emails you'll have to use an IMAP client (perhaps Squirrelmail) to create the directories and move the contents out of the single inbox into the proper directories (which are implemented as "folders" in IMAP).

There has been some discussion elsewhere on this forum about converting Maildir users to run on DA; I'm not sure if anyone came up with a foolproof scenario or not.

Jeff
 
jlasman said:
mbox doesn't understand the contents of subdirectories.

If your users actually have any contents in the subdirectories that wouldn't be part of an mbox inbox, then they're using IMAP.

DA has implemented IMAP, and IMAP implements Maildir for all other directories besides the inbox,.

Jeff

DA uses a modified UW IMAP server, and the UW server only does mbox. Maildir uses subdirectories as folders and individual files as emails. mbox uses individual files as folders and all the emails for each folder are contained in that file.

For DA, the non-INBOX folders are located in /home/${DOMAINUSER}/imap/${DOMAIN}/${MAILUSERNAME}/mail/
where ${DOMAINUSER} is the domain owner, ${DOMAIN} is the domain for the email user, and ${MAILUSERNAME} is the username for the email address. All IMAP folders ( Drafts, Sent, Trash,...) are contained in this directory as mbox files.

As Jeff said, folders should be maintained via an IMAP client.

I don't know of a script to convert Maildir to mbox, but it shouldn't be too hard to write a quick perl script to read all the files, format and concatenate them properly. I have gone the other way, mbox to Maildir on my home system, but not the other way.
 
Maybe you will come up with a way so that DA uses Maildir format and courrier imap.
 
rldev said:
Maybe you will come up with a way so that DA uses Maildir format and courrier imap.
I have some code on my home server that should do the trick. I just have not had time to test it yet, especially with customers mail.

Someone on this forum said they had it working, perhaps they are willing to share their modifications. I will, once I have time to make sure it works, but at the rate I am getting things done, it could be a little while.
 
I tried to get a couple of people working on it that said it could definitely be done. I offered to pay them, have not heard back from them. :(
 
Looks like I must have lost my changes, I recently upgraded my Solaris box where I keep all my source and it isn't there anymore. There is the possiblity that it is on my desktop in my Linux partition, but I can't seem to boot into that until my wife gets off the computer :)

I did a quick search, and it looks like someone with the username mktgarchitect says he got it to work. I will work on this again soon, I like courier so much better than UW.
 
I don't think you will get many arguments for using courrier if it can be done seamlessly.
 
The previous solution I posted works with two bugs....if you have spaces in any of your Maildir folder names, you need to edit the .mailboxlist file afterwards to fix it. And the conversion removed the "Read" flag on all the emails in all my folders.
 
Status
Not open for further replies.
Back
Top