Mac – Back up specific IMAP mailbox

backupemailimapmail.apptime-machine

macOS 12.13.5, Mail.app 11.4. with an IMAP email account, Time Machine

I'd like Time Machine to automatically and regularly back up a specific IMAP mailbox and its contents — even better would be the preservation of the mailbox's nested folders — so I have a local copy, independent of the IMAP server. The Mac's contents are now backed up using Time Machine, but neither this specific IMAP mailbox nor its contents appear in TM. I have some anxiety about an inadvertent deletion: without maintaining a local copy, the emails would be gone and things would be difficult.

These SE questions are close:

Mail.app in OS X — IMAP and Archive Mailbox subfolder creation

Can I backup or mirror an IMAP mailbox on Mac OS X?

How can I back up a complete IMAP account?

but aren't helpful, particularly as I'm not facile or very comfortable in the Terminal.

Can any of you offer a solution or pointer?

Best Answer

Here's my solution to my question:

  • First, I found that the contents of the IMAP mailbox I'm interested in are indeed stored on the Mac. Each email is an .emix file, and they are many many layers deep within ~/Library/Mail.

  • Second, I use ChronoSync to nightly create a bootable backup of the Mac's SSD boot drive. To handle this new email backup job, I created a Synch task in ChronoSync that nightly backs up this group of emails from within ~/Library/Mail to a new folder located on the drive which contains ChronoSync's bootable backup. Because the Mac runs SpamSieve for the IMAP email account, the Mac is always on and available to run this job in the middle of the night.

Of course, I see now that having discovered where the emails were backed up already, I could as easily (save for the annoyance of navigation) find those .emix files on the Time Machine backup, or on ChronoSync's bootable backup. So it was a lot of worry for little or no gain.