Importing mbox issue

I'm using OSX El Capitan on a 27-inch late 2013 iMac. and have decided to start using the Mail app instead of Outlook 2011. I have a lot of archived folders that I'd like to migrate. The way to do this seems to be to drag and drop a folder from Outlook onto the desktop, then in Mail I'm going to File->Import Mailboxes, choosing "Files in mbox format", browsing to the .mbox file and pressing Choose.

Every time I've done this Mail crashes, when it reopens the imported mailbox is there but is completely empty.

Is there anything else I can do to transfer my Outlook folders to Mail?

iMac

Posted on Oct 14, 2015 9:08 AM

Reply
20 replies

Oct 2, 2017 1:16 PM in response to Wolf Wallis

If you go back to mlevitt's post he explains his fix to make a Windows mbox work on a Mac. If you create the mbox on the Mac there is nothing to fix.


Some background: The problem is that the output .mbox file has the wrong line endings and the mail import can't handle it. Windows normally ends lines with a carriage return and linefeed while a unix system (Mac is unix under the covers) uses only a linefeed.

Oct 2, 2017 12:32 PM in response to mlevitt

mlevitt,

Helpful, Professional, Easy to Follow, all the accolades.

I performed a transfer of files using your terminal commands and indeed reveled in the glory! That took care of the mailboxes/folders from my old xp days.

Today, tried to repeat the glory and finish the job with some Outlook for Mac 2016 folders I had set up. When I ran the terminal command however, the following is what I got. End result was that mac mail 9.3 crashed and no import occurred.

Can you possibly decipher this? I'm once again lost.


Unrecognized character \xC2; marked by <-- HERE after s|\r|\n|g<-- HERE near column 10 at -e line 1.

Oct 2, 2017 12:56 PM in response to dianeoforegon

Thxs diane. No problem creating the mbox files. When I import, mail crashes. Last night, when running the terminal command that mlevitt recommended, all mbox files imported successfully. today, running that same terminal command showed the following:


unrecognized character \xC2; marked by <-- HERE after s|\r|\n|g<-- HERE near column 10 at -e line 1.


Something in my mbox files must be different. They aren't large or at a glance any different from what I had success with last night. I can't decipher the line above to point me to a solution.

Jan 2, 2017 8:06 PM in response to mlevitt

Thank you so much for your solution!

For other users running into the same problem I would like to add that my preinstalled version of perl (v5.18.2) in Mac OS X 10.11.6 El Capitan had problems converting large .mbox files (around 1 GB worked, 2 GB not).

For that large files I got errors similar to "Substitution loop at -e line 1, <> line 1." and the original .mbox file had 0 KB afterwards. So the step 2 of your instruction is a really good advice.

I've found two possible solutions solving the problem by searching the web. The first one is to split big files into chunks and join them again after conversion. I went for the second solution. That is to install perl version 5.22 or later that doesn't show this bug anymore.


I've been using your command from step 4 in a slightly modified variation that should keep the original file with the prefix "orig_":

perl -pi'orig_*' -e 's|\r|\n|g' *.mbox

Nevertheless, I got mixed results when the mentioned error occurs and sometimes lost the original file, sometimes not. Your step 2, to backup the original file before, was a really helpful precaution again, even with that modified instruction.

Oct 2, 2017 1:09 PM in response to dianeoforegon

Life is good. Not sure how I had trouble importing mbox files yesterday until I did run the terminal command.

Today, terminal command not working.

Your explanation makes valid sense, however, and I am not savvy at all with terminal use.


However, just after my last post, I ran the command again and this time had no issues. I then imported the mbox files into mac mail like it was my birthday.


Problem is solved and perhaps I needed your calm guidance to make it happen.

This thread has been closed by the system or the community team. You may vote for any posts you find helpful, or search the Community for additional answers.

Importing mbox issue

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.