Submit Hint Search The Forums LinksStatsPollsHeadlinesRSS
14,000 hints and counting!

How to import an .imapmbox into Mail.app Apps
A lot of people have noted that there is no support built into Mail for importing a pre-existing IMAP mailbox (.imapmbox). In fact, the developers did build support for importing in, they just didn't know it. Mail.app will read the contents of an .imapmbox if it thinks that such a folder exists on an IMAP server somewhere. Once it believes that such a folder exists and it reads the file, you can copy the files out of this folder into the account you want. Here's the trick. Let's assume that you're trying to import "Foobar.imapmbox" into your account named "Personal."
  1. In Mail.app, create a dummy IMAP account. I call mine "converter." Enter all bogus information so that there isn't a chance it can contact the machine.
  2. Create a folder in the converter account having exactly the same name as the folder you want to import (in this case "Foobar").
  3. Create an empty folder in the Personal account having the name "Foobar" -- it will be empty for now.
  4. Close Mail.app.
  5. Now we're going to suddenly populate the "Foobar" folder in the converter account: Locate the local directory where the converter folders are cached. It's probably ~/Library/Mail/IMAP-d@converter or something. Copy your version of Foobar.imapmbox into this directory (it may overwrite an existing version, don't worry about this).
  6. Now open Mail.app up again. You should see the folder Foobar in the converter account populated with your mail. These messages can now be copied into the Foobar folder in Personal (or wherever else).
[robg adds: I haven't tested this one...]
    •    
  • Currently 2.00 / 5
  • 1
  • 2
  • 3
  • 4
  • 5
  (7 votes cast)
 
[25,142 views]  

How to import an .imapmbox into Mail.app | 11 comments | Create New Account
Click here to return to the 'How to import an .imapmbox into Mail.app' hint
The following comments are owned by whoever posted them. This site is not responsible for what they say.
What about in Tiger?!
Authored by: earthsaver on May 05, '05 11:09:36AM

Please tell me someone has figured out how to do this in Tiger. I have an Exchange account whose inbox I can't access from Mail (yet, I hope), however I've been sending mail from Mail.app through it's smtp server.

I'm frustrated that I haven't been able to import my sent mail from that account. I can manually open the message files that Mail now creates and file them in a mailbox folder, but if I rebuild the mailbox, Mail eliminates the list.

The messages are showing up in a .imapmbox folder. What gives?

---
- Ben Rosenthal
Q16 1.25 - Tiger



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: Murphy on May 05, '05 11:22:45AM

What exactly is the point of importing an imapmbox? Mail is usually stored on the server when using IMAP, so why not just recreate the IMAP-account?
Sorry if I overlooked something, but this hint doesn't make sense to me.



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: Gutta on May 05, '05 06:16:27PM

The point of this is to provide a way for those of us who mistakenly assumed that a readbale archive of an imap mailbox had been made by dragging it out onto the desktop. It wasn't readable - it doesn't behave the same as ordinary mailboxes. This way provides a path to retrieve those .imapmbox email archives.



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: Jwink3101 on May 05, '05 11:26:07AM
I do not know if it works in Tiger for a Tiger-made imapmbox but it used to work in Panther.

It DOES NOT work if you are taking a panther imapmbox and trying to put it into tiger. I had to boot Panther off of my backup to get mail i accidentally lost. If you look into the folders, they are set-up differently and therefor don't see each other. It's very sad

Of course, when i say tiger and panther, i mean tiger's mail and Panther's mail

[ Reply to This | # ]

Tiger imported my imap account when I upgraded
Authored by: mnb on May 05, '05 02:37:56PM

Tiger imported my imap account and mail with no problem, during the migration assistant copying your data from another mac/partition. When I launched mail, it imported and converted the data to the new format. I did have to change some imap acct settings, save, and change them back to get the signature prefs to become imap aware, but that's another story.

Of course, if it hadn't, I could just have set up the account and resync'd (which would take quite a while).

It still has issues with displaying new mail in non-inbox folders for imap accounts and it doesn't seem to check for mail on the regular cycle, but I cron'd a 5 min synch script a while back based on a hint I found here (I love this site!) and that takes care of the problem.



[ Reply to This | # ]
Just Awesome
Authored by: vertigo on May 05, '05 05:01:38PM

I have been trying in vain for the last 6 months to gain access to an old imapmbox folder for a non-functioning imap account. Tried every email program out there for Mac and Windows to try and import the folder, but nothing would recognize it.

This hint worked like a charm! I now have all my emails safely archived.

Kudos.

---
~vert



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: sosventures on Aug 23, '05 09:18:59AM

Not sure why the above didn't work for me (I am using Mail 2.0.3, Tiger 10.4.2).

However, I have an alternate solution that is super easy.

Somehow my .Mac IMAP account got blasted and I lost all my mail in my inbox and on my Inbox on my Apple Mail on my laptop.

Fortunately I had backed up 2 weeks prior, so I just lost 2 weeks of mail activity. Using Backup, I could see all the individual messages under my ~/Library/Mail/Mac-USERNAME/INBOX.imapmbox on my backup disk.

Struggled for hours trying to restore, discovered that mail doesn't want to import imapmbox files, as mentioned above.

But for some reason, with the current version of Mail, all you need to do is copy the imapmbox directory into the ~/Library/Mail/Mailboxes folder. It appears that the only thing you have to do is rename it with a .mbox extension.

That's about it. Quit mail, re-enter. Mail will refresh, your new mailbox will pop up, with ZERO messages. You then need to go to the Apple Mail/Mailbox/Rebuild menu option and a while later all the mail shows up.

This also apparently works on nested mailboxes, although I didn't test it sufficiently to verify. (Rename all the .imapmbox extensions to .mbox extensions... it may be necessary to futz... at first it wouldn't rebuild it for me, then I flattened my nested test by a layer (creating more branches at the /Mailbox level) and it worked.

Fabulous undocumented feature. (Of course, it would be better if you could just import the directory, but you can't).

Obviously, at your own risk. Hope it saves you hundreds of hours of lost work!
Good luck.
Sean

Steps summary:
1. Rename Imap mailbox directory to xyzzy.mbox, replacing all instances of .imapmbox with .mbox (and approving it when it tells you not to)
2. Move it to ~/Library/Mail/Mailboxes/
3. (Quit &) Start Mail
4. Select the xyzzy mail folder from the mailbox selections on the left frame
5. Select "REBUILD" option from the MAILBOX menu


---
Darkness cannot drive out darkness; only light can do that. Hate cannot drive out hate; only love can do that.
Martin Luther King, Jr.



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: grommond on Aug 31, '05 02:33:33PM

I seem to have the problem folks are saying isn't solved by this hint. I've got 10.3 IMAP mailbox caches on my local machine that I'd like to bring into 10.4 mail. I tried both of the suggestions above, both yielded zero message folders. Any ideas?



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: mcmillen on Sep 13, '05 11:53:47AM

A method that appears to work for backup purposes (ie. if you do it in advance, rather than being caught with only .imapmbox files as the result of an accident) is described at

http://www.macforumz.com/modules.php?name=Forums&file=viewtopic&t=134395&ex=-Subject-trouble-Mail-imapmbox-files-mbox-files-

It boils down to this: when you drag an IMAP mailbox into the "On My Mac" area in the Mail window, it automatically converts it to a local .mbox file, stored in ~/Mail/Mailboxes. (This may cause a lot of network access, as it needs to download all the contents of the IMAP folder to create the local copy. This seems to be happening, for me, even when I've recently synchronized the IMAP account.)

Anyway, once you have those folders created, they can be archived, and read back into Mail later, if you need them as backups. So for active and accessible IMAP accounts, this is an easy fix. For dead accounts, see the other comments, above. And pray.



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: deeraeya2 on Aug 03, '09 03:29:00PM

Just wanted to thank you for posting this tip. This had been annoying me for ages, anytime I wanted to archive IMAP mail, Mail.app was re-downloading everything. Since IMAP tends to get random disconnects etc when doing 10000+ emails that sucks, not to mention was very slow.

I can confirm that the re-name to *.mbox, copy and rebuild method in the parent works on Mail 3.6 in 10.5.7

Hazzah!



[ Reply to This | # ]
How to import an .imapmbox into Mail.app
Authored by: betsbillabong on Apr 05, '10 05:07:06PM

Hey all - I just thought I'd add what worked for me.

I had had duplicate mailboxes in my IMAP folder, and mistakenly deleted one. Big mistake! It deleted both of them. I was horrified (it was an important folder, let's call it DAD).

I did a spotlight search for some of the text in the missing emails and tracked the mailbox down. It was still in my ~user/library/mail folder, but I guessed that if I quit mail it would update (not sure here - I am not an expert at this stuff).

Anyhow, I found the imapmbox in the Imap server folder, and copied it over to the desktop. So basically I had DAD.imapmbox on my desktop. I thought I could just follow the instructions above, and rename it to DAD.mbox.

But no! I was not given 'sufficient access privileges'. I did 'get info' to change all user's permissions to 'read and write' but that didn't help. Not only could I not change the suffix, I could not change anything.

Finally, I created a new empty folder in Mail, called 'DADRESTORE'. I quit mail, cringing. I copied the files and folders from inside DAD.imapmbox into the 'DADRESTORE.mbox' folder which Mail had created ('info.plist, "attachments" and "messages"). And then I opened mail again and went to FILE -> Rebuild.

It worked! All of the emails were in the DADRESTORE folder. So if you are in a bind, try that.



[ Reply to This | # ]