Slow mail import of large mailboxes from Apple Mail / GMail - or how do you do it?

Hi there

My GMail has almost 10GB of mails inside, because… why not if it’s free? :slight_smile:
I like keeping mail content inside DevonThink Pro Office and File -> Import -> Email -> Apple Mail -> Archive works fine except… it can take hours, sometimes longer than a night and whole DevonThink is blocked while import is ongoing.

Slow import isn’t that big problem on its own, but the fact that whole DevonThink UI is blocked meanwhile is a problem. Because of it, I tend to schedule mail archiving for weekend nights only and… forget about it once in a while.

  • How do you do it?
  • Is there some workaround to speed things up or to make UI non-blocked (e.g. maybe comewhow converting Apple Mail data to unix mailbox format could help things?)?
  • Or maybe there is a possibility for some script to archive just one-two folders at a time somehow?
  • Or do you just not archive large mailboxes at all and resort to standard mail search when looking for an old message?

There are at least two possibilities:

  1. Archive the complete mailbox once, then archive only new emails afterwards (via Email > Add to DEVONthink Pro Office in Apple Mail or by using rules in Apple Mail)

  2. Move all your emails into a local mailbox.

I am having a similar issue. Did you ever figure out a solution?
It seems also that when I go to the import page and look at apple mail sometimes it shows more mail boxes than I currently have active. Don’t know why. Just seems buggy?
Any suggestions greatly appreciated. It’s been very time consuming.

DEVONthink gets its information directly from Apple Mail when you access the Email section in the Import sidebar.

If you have issues with item counts, you can try doing a Mailbox > Rebuild in Apple Mail.

Emptying the trash of Mail and restarting the app might be sufficient too.

I think I’m running into the same issues. I’m trying to run an “Archive Mailbox” on my Gmail account with around 47,000 messages (Mail.app says there are nearly 76,000 messages, but I’m guessing that’s a difference in how they’re counting threads vs. individual messages.


ScreenShot 2021-01-28 at 09.54.04@2x

I clicked “Archive Mailbox” with my Gmail account selected and it’s been running just fine—no crashes or anything—but it’s been running for around 12 hours now, and it’s showing an increasingly higher time remaining, currently sitting at 19 hours.

Is this to be expected? I can be patient, I just wasn’t sure if that’s about what I should expect when importing large mailboxes like this one. Or should I try some of those steps above, and move things to my local machine first, then try again?

Moving them to the local machine is always a good idea as it bypasses having to talk to the email server to fetch the messages.

Okay cool, I’ll give that a shot, thanks!

Sorry, I’m an idiot – I’m not sure if I’m doing this properly. I’ve found ways to export a mailbox (.mbox format) to my hard drive, but I’m not sure if that’s actually what I want to do. Is there another way to just move mail to “On My Mac” so that DEVONthink can read it properly? Or should I just export the .mbox with Mail.app and then import that .mbox file manually into DEVONthink?

I also found @GordonMeyer’s writeup on how he does his yearly archives, and that made a lot of sense. (Thanks for sharing your workflow, Gordon!)

@BLUEFROG, would you recommend I do that for this first archive, then just use DEVONthink’s archive function moving forward as to not import duplicate messages?

What I did was using Google Takeout to save all my GMail emails as .mbox format. You can even choose which folders you want to include. Then use import unix mailbox under file in DT. My 6GB mailbox was imported in 20 minutes.

Welcome @mgymnop
Thanks for sharing your approach and experience!