How to import emails in a separate database?

Apple Mail on Sequoia 15.5, local store of iCloud IMAP (full download), ~1,500 e-mails (~4MB) in the latest “problem” mailbox, which hadn’t completed after about 18 hours (about ⅚ of the way through by the time I decided to Force Quit).

I’ve figure it out since typing the above message (was working on figuring out a workaround when I saw your reply) – these are my archive e-mails from the late 90’s early 00’s, and DEVONthink is choking on those with the header

Content-Type: text/enriched;

That encoding type is supposed to do some basic formatting via plain text tags/source (some keywords are the same as HTML).

As soon as it hits one of those messages, DEVONthink goes into a tailspin, has a couple of hundred “hangs” according to Activity Monitor, and after about 20 minutes goes on to the next message.

The first time you click on one of these imported messages in DEVONthink, it shows the following in the body display area (after about 20 minutes and many hangs as shown in the Activity Monitor):

image

Double-clicking the text.enriched “file” just makes DEVONthink beep.

An imperfect way to find them in DEVONthink is to search for e-mails with 0 word count (imperfect as it finds truly empty e-mails). I can’t search for "text/enriched” or “” in the contents or for “text.enriched” attachments of the messages in Mail or DEVONthink as no results are returned.

Searching in the ~/Library/Mail/V10 folder returns no results.

I can do a successful Finder-level search for those strings if I drag the e-mails out of Mail – I can edit that header out of the raw .eml file, the message imports fine, but I wouldn’t want to drag out the 150k+ archive e-mails I have, or try and identify the messages first somehow.

While experimenting when drafting this message, I see I can select all the messages I want to export, choose “Save As…” and make sure “Raw Message Source” is the Format, and it will do a combined .eml file, which I could then search and replace to get rid of the header and the “ formatting terminator, then import into DEVONthink – I think this is what I’ll do for now.

Given how much of an edge case it is, it’s a bit much to ask for a full “text/enriched” interpreter in DEVONthink’s import routines, but maybe DEVONthink could be made to recognise that e-mail header on import and just handle it as plain text as the simplest case for decoding?

Anyway, it’s been an unexpected troubleshooting and documentation session, I’m going to try the above and see if I can feel smug about myself :slight_smile:

Sean

1 Like