mbox to maildir conversion

netrix37

Member
Jul 13, 2006
14
0
151
Does CPanel provide any scripts to convert individual accounts from mbox to maildir? (They are moving from another host) It looks like /scripts/convert2maildir is only system wide. I've played with mb2md-3.20.pl available at http://batleth.sapienti-sat.org/projects/mb2md/ abd while this works it requires a lot of manual intervention. Taking into consideration the number of email accounts I'm trying to convert mb2md would not be optimal.
 

Stefaans

Well-Known Member
Mar 5, 2002
461
4
318
Vancouver, Canada
I think the reason why the /scripts/convert2maildir is system wide, is that it not only converts the mailboxes, but also changes the POP3 server from the old cppop, to Courier. I think this is a (convert) all or nothing situation.
 

sparek-3

Well-Known Member
Aug 10, 2002
2,174
281
388
cPanel Access Level
Root Administrator
I think Stefaans is correct, except maybe more so on the MTA, exim. How is the MTA (thats the SMTP service, exim on cpanel) suppose to know what mail format a particular account is using? If an account is using maildir and the MTA is set up for mailbox, then it won't create new message files correctly. Likewise, if an account is using mailbox and the MTA is set up to use maildir, then it won't append to the mailbox file correctly.

This is probably also true for the POP3 service as well. I'm not sure if cppop will handle maildir or not. I believe Courier will handle mailbox and maildir, although cPanel may have it configured to only handle maildir.
 

netrix37

Member
Jul 13, 2006
14
0
151
Thanks guys but I'm not sure I explained thoroughly. All the accounts are already in maildir format. What I'm trying to do is take a website backup from another host altogether (that uses mbox) and convert it to use the maildir format so the users will not lose their email. The system wide conversion has already happened so I was hoping there was a method for converting individual accounts via a cpanel script. mb2md works it would just be a *huge* pain to make it work across all the email accounts that particular user has.
 

sparek-3

Well-Known Member
Aug 10, 2002
2,174
281
388
cPanel Access Level
Root Administrator
If an account is on a cpanel server with mbox, when it is transferred over to a different cpanel server with maildir, I believe the mail is automatically converted to maildir.
 

netrix37

Member
Jul 13, 2006
14
0
151
sparek-3 - Can you give me an example of what you mean by transfered over? Originally I used the full site backup (that only root can install) which seemed to do a really sloppy job of converting as some of the mail was available (usually the root inbox) but specifically folders were almost always broken in some form or another.

Stefaans - Can you elaborate a little?


My problem is more than likely going to be these folders which unfortunately have all sorts of hideous names like "Angel's Files" or "MyFolder (Secret)" which I'm sure is not going to make things any easier. The clients are using SquirrelMail which apparently every user created folder has to have a file telling SM that the folder has been "subscribed" to before they can even view the folder/email which is just one more step.
 

sparek-3

Well-Known Member
Aug 10, 2002
2,174
281
388
cPanel Access Level
Root Administrator
In my experience this has been done by the restorepkg process on the new server that converts everything over. If you use the Transfer Account feature in the WHM from the old (mbox) server and transfer to the new (maildir) server, the conversion process should go through.

If you copy a backup from cpanel's daily backup process from the old server to the new server, then restore the account, the conversion should take place.

If you have any cPanel backup (daily backup, cpmove file, user's backup file) and restore it on the new server, the conversion should take place.
 

Stefaans

Well-Known Member
Mar 5, 2002
461
4
318
Vancouver, Canada
Stefaans - Can you elaborate a little?
I would use fetchmail on the server where the mailboxes are being imported to. Fetchmail can then create a POP3 session with a mailbox on the remote server and deliver all messages to the new mailbox on the local server. I woudl then schedule fetchmail with cron so that it keeps on transferring messages for a few days until the domain transfer has propagated.

For more info on fetchmail:
* Wikipedia description: http://en.wikipedia.org/wiki/Fetchmail
* Manual: http://www.fetchmail.info/fetchmail-man.html

Good luck ;)
 

fcsnc

Well-Known Member
Mar 19, 2002
52
0
306
North Carolina
netrix,
I would be interested in knowing how this turned out. In particular, what kind(s) of MUA's (Outlook Express, Thunderbird, Outlook, Eudora, etc.) does the client use, and were the users able to figure out how to retrieve/store/find their email after the conversion?