I have a huge IMAP email account that contains a lot of subfolders and a lot of messages (dating back to 2005). Is there a simple way to back up these folders and messages so I can delete them from the server?

I would like to retain the ability to browse and manage these archived messages, reply, or add addresses from these messages to my contacts - all preferably within Apple Mail.

If Apple Mail can't do it, what other options do I have?

  • Would you like to propose how you would access those archives? Would you re-inject them into Apple Mail or would some offline search / browse capability be acceptable? – bmike Feb 18 '14 at 15:55

You can do it with offlineimap. I'm using it for my GMail and Fastmail accounts.

Install Homebrew (you must also install Xcode). With Homebrew, brew install offline-imap.

Create ~/.offlineimaprc config file:

ui = ttyui
accounts = fastmail
maxsyncaccounts = 4
socktimeout = 60

[Account fastmail]
localrepository = fastmail-local
remoterepository = fastmail-remote

[Repository fastmail-local]
type = Maildir
localfolders = ~/Mail/Fastmail

[Repository fastmail-remote]
type = IMAP
remotehost = mail.messagingengine.com
remoteuser = username
remotepass = password

expunge = no

A big advantage of offlineimap is that it creates the folders you have on your IMAP server.

I'm reading my backup with mutt.

  • This is awesome. As Mail gets more and more layers of databases, I am sorely tempted to go back to the days when a rock-solid, reliable, text only presentation of text was how I consumed email. – bmike Feb 18 '14 at 15:51
  • A note: since fastmail now only allows ssl connections, I had to add remoteport=993 and ssl=yes to make it work. See the config file (e.g. at github.com/OfflineIMAP/offlineimap/blob/master/offlineimap.conf) for all options – Rabarberski Aug 6 '15 at 20:58

In the lefthand sidebox you can just drag mailboxes from the imap location to the On My Mac location.

Otherwise See Mail's help for Archiving mailboxes

Archive the mailbox which puts it on your computer then import the mailbox

I am not certain if the directories are kept,

  • It is ON MY MAC Location and just drag a mailbox into it. – Mark Nov 12 '11 at 12:21
  • If you talk about this one, it is just not there in my apple mail. Once I create one using Mailbox->Create New... it appears, but I still can not drag other mailboxes to it, only individual mails. – bitbonk Nov 13 '11 at 6:42

Just to Second, you can drag a folder from your inbox to On My Mac, however expect this process to take a long time if you have a large Mailbox, folder or sub folder, try with one small folder first and have a look at how it progresses the copy, you can do this by clicking on Window>Activity in Mail.


If you can or are willing to make the backup under Windows, IMAPSize enjoyed a very favorable reputation, back when I lived on Windows and frequented a couple of email fora.


You could create a Google mail account, add it to your mail client and drag the folders across. Then you could use gmail to browse all your mail.

  • I don't see storing all mail in Gmail as a backup / archive solution. Is there some export function that this would allow? Please expand on how this would allow deletion from the server. – bmike Feb 18 '14 at 15:52

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .