mbox to maildir - questions

Kheldin

Member
Dec 5, 2007
12
0
51
Hello all!

I currently have a Fedora 6 server running Sendmail and Dovecot using the mbox format. I probably have about 300+ email accounts, totaling about 2GB (just the email). I am about to migrate to a CentOS + cPanel server using Exim and Courier.

I've already read through the forums here on how to convert from mbox to maildir, but it seems all the info suggests that I am doing this on the same server... that is simply converting an already setup cPanel install using mbox to a maildir. This isn't my case as you can see.

Basically, this is a fresh server setup with cPanel, and I need to migrate all the mail (mbox format) from my Fedora server over to this. My questions are..

Do I need to add all the email accounts FIRST in cPanel before uploading all the mbox mail files and attempting to convert them?

Which script would I use in this scenario.. the convert2maildir or the mb2md one? Does it matter?

Thanks in advance for any advice and help.

Cheers!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Hello all!

I currently have a Fedora 6 server running Sendmail and Dovecot using the mbox format. I probably have about 300+ email accounts, totaling about 2GB (just the email). I am about to migrate to a CentOS + cPanel server using Exim and Courier.

I've already read through the forums here on how to convert from mbox to maildir, but it seems all the info suggests that I am doing this on the same server... that is simply converting an already setup cPanel install using mbox to a maildir. This isn't my case as you can see.

Basically, this is a fresh server setup with cPanel, and I need to migrate all the mail (mbox format) from my Fedora server over to this. My questions are..

Do I need to add all the email accounts FIRST in cPanel before uploading all the mbox mail files and attempting to convert them?

Which script would I use in this scenario.. the convert2maildir or the mb2md one? Does it matter?

Thanks in advance for any advice and help.

Cheers!
The script /scripts/convert2maildir will use the mb2md script as part of the conversion process.

At this time, you don't need to convert prior to moving the mail over. However, you should convert shortly after the mail has been migrated.

Note that cPanel 11 still has support for mbox, though it is highly recommended you use maildir instead. However, you can migrate the mbox files to their appropriate locations on a cPanel server (mail is typically stored in ~/mail/ and ~/mail/[email protected]/). Then you can run /scripts/convert2maildir to convert things to maildir.

With 2GB of mail, the process can take a while. There's a few FAQs about the conversion process on these forums. However, the main thing to remember is that even if the process appears to be stuck/frozen, just let it do its thing. Do not terminate the script until it has finished processing everything, as this tends to be the cause of the vast majority of conversion issues.

Just a head's up about a few things during the process: mail will be queued rather than delivered while the conversion is in progress, users will be unable to access their email during the conversion process and after the conversion process, POP3 users will likely need to re-download all their email.
 

Kheldin

Member
Dec 5, 2007
12
0
51
Thanks for the respone!

Another quick question regarding this.

Do I need to set these email addresses up first on the new server running cPanel? Or can I simply copy all the old /var/spool/mail/username (from my Fedora server) files into the same directory on the new server running cPanel.. then run the conversion?

My Fedora setup is using system accounts for email addresses, so although everyone has a /home directory, there is no mail folder within them. The inbox is the raw /var/spool/mail file. I ask because it seems that cPanel creates email addresses within the domain owners home directory mail/ folder.

I'm sure the script is really slick, I just wonder how is it going to know that /var/spool/mail/joeblow needs to be converted and moved to /home/domainXowner/mail and not /home/domainYowner/mail ??

** Reading your reply again, are you saying that I have to move the mbox file from my old server, to the appropriate ~/mail folder on the new server first, then run the conversion? I assume this is what you mean which means I WILL have to create all the email accounts first, copy the mbox file for [email protected] into the mail/[email protected] directory, then run the conversion?

Sorry for all the questions and confusion. I just want to make sure I have all the bases covered before I attempt a mail conversion like this.

Thanks again!
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
...
** Reading your reply again, are you saying that I have to move the mbox file from my old server, to the appropriate ~/mail folder on the new server first, then run the conversion? I assume this is what you mean which means I WILL have to create all the email accounts first, copy the mbox file for [email protected] into the mail/[email protected] directory, then run the conversion?

Sorry for all the questions and confusion. I just want to make sure I have all the bases covered before I attempt a mail conversion like this.

Thanks again!
Correct, essentially you want it to be a cPanel system using mbox (as this is what /scripts/convert2maildir expects).
 

Kheldin

Member
Dec 5, 2007
12
0
51
Correct, essentially you want it to be a cPanel system using mbox (as this is what /scripts/convert2maildir expects).
OK.. One last question then.

I stuck the spool file in the mail/ directory, and after the conversion, it pretty much changed the mbox file to a directory with all the mail inside. Thats great, but instead of putting it in the mail/cur folder (the inbox) it just made a folder inside the mail/ one called .username with all the mail in there. It wasn't a big deal cuz I simply copied what was in that direcorty to the mail/cur one and viola, now it's all in my inbox.

But when I have over 300+ users, I really don't want to have to move all that mail. So my last question is, where exactely do I place this mbox file in the mail/ folder in order for it to put it in the inbox?

I guess since I've never ran a cPanel setup with mbox, I really don't know where the mbox inbox is located.. I tried putting the mbox file in the mail/cur folder, then converting, but it left it alone and didnt do anything to it.
 

cPanelDavidG

Technical Product Specialist
Nov 29, 2006
11,212
13
313
Houston, TX
cPanel Access Level
Root Administrator
Mbox was before my time (of helping people manage email formats), so I'm not sure on the precise naming scheme. Perhaps some of the more experienced individuals here may have some insight on that for you :).
 

Kheldin

Member
Dec 5, 2007
12
0
51
Is there anyone that has a cPanel setup using mbox that could tell me where the inbox (mbox) file resides?
 

koolcards

Well-Known Member
Oct 8, 2003
146
0
166
Tampa, Fl
Is there anyone that has a cPanel setup using mbox that could tell me where the inbox (mbox) file resides?

/home/<user name>/mail/inbox (default account)

/home/<user name>/mail/inbox/<domain name>/<2nd email account>/inbox

/home/<user name>/mail/inbox/<domain name>/<3rd email account>/inbox

/home/<user name>/mail/inbox/<2nd domain name>/<another email account>/inbox