Saving email attachments from Mail to DevonThink and substituting with item link in email

Well, as you’re the main developer it’s difficult to argue with that. But I’ll give it try, anyway (sorry about my persistence here).

I might be completely off, but I think DT ‘renders’ the e-mail as most e-mail,clients do by simply taking the headers and body as text content and decode any (text) encoded attachments. AFAIK mbox files contain the attachment encoded inline of the text.

As DT can import mbox emails/archives, I would say it’s possible (in theory) to discern between the header, the body and an attachment. And that’s exactly what DT appears to do, as attachments are displayed separately from the body. Therefore when importing e.g. an mbox encoded e-mail including an attachment, it should (in theory) be possible to split the header/body from the attachment, decode both and subsequently provide a separate UUID for both. By adding (hidden) meta-data with a UUID of the encapsulating e-mail, it’s possible to keep them related like this:

  • header+body (regular UUID1) - meta-data with UUID0
  • attachment(s) (regular UUID2/n) - meta-data with UUID0

That way one can replicate or duplicate the message and attachment independently, but the e-mail engine of DT uses the (hidden) UUID0 as a reference to combine them.

I understand this would require a major overhaul of the e-mail engine, might you even consider doing that. And of course, whether that’s something you want to spend time on is up to you and the company.

3 Likes