How to export all emails from a mailbox in Apple Mail

I'm trying to export all emails from an account I have setup and mapped to Apple mail on my computer. There are 1200 emails. The account is no longer active so i'm trying to export all the emails in the mailbox in apple mail to an .mbox file that I can import somewhere else.

The problem is when I do an export of the mailbox and then import it somewhere, there are only 88 emails when there should be 1200+.

Why is this only exporting some of the emails and how can I make it so it exports all of them?


I couldn't get my export working even with a mailbox rebuild. However, my goal was simply to archive my old mail, and not necessarily to do so in the mbox format, so copying the raw mailbox via Terminal with cp was adequate for my purposes.

After some trial and error, I found the path was ~/Library/Mail/V3/IMAP-<account-name>/. Sharing it here in case anyone anyone else is in the same boat.


Solving the annoying Some messages could not be imported - Error in Mail.app.

I figured out a pretty easy way to copy all E-Mails from my old MacBook to my new machine with Mail.app.

(MacOS Mojave 10.14.2; Mail 12.2)

Don't export your mailboxes as .mbox (Mail.app > Mailbox > Export Mailbox...)

I pretty much always got the following error when I imported the previously exported .mbox files to my new Macbook:

Some messages could not be imported. The partially imported mailboxes are located in the mailbox named “Import” in the mailboxes list.

The odd thing is that Mail.app doesn't tell you which E-Mails have not been copied. This uncertainty is very frustrating especially when you want to move thousands of E-Mails.

There is a simple workaround using EMLs instead of .mbox:

  1. In Finder create a folder for every mailbox you want to copy. In any case you should create a minimum of 2 folders. You’ll see why soon.
  2. In Mail.app select one mailbox at a time. Select all mails inside and drag & drop them into the corresponding folder in the finder. The mails are copied into the folder as EML. Note that it might take a very long time before the .eml files appear, but you can check in Activity Monitor if Mail is doing something, it'll be using a significant percent of processor (10%-90% of a core in my case). As a reference, for 10 000 emails, it took over 2 hours until the .eml were exported.
  3. On the new machine open Mail.app. File > Import Mailboxes… > Import data from Apple Mail
  4. Important! Select at least 2 folders to import. If you only select one folder, Mail.app imports every EML file in its own mailbox! (This would work but it takes long to delete the empty mailboxes after you’ve moved all the mails into one mailbox.)

Done! With this technique I've copied thousands of E-Mails from one Mail.app to another Mail.app without any errors.