Relation between a mail and it's reply

I’d like to archive my mail from Apple Mail and Outlook, but keeping the link between the original message and its replies. In Outlook for instance, each answered mail have a specific icon that once clicked act as a link to the answer.
So far I did not found a way to do it with DEVONthink, did I miss something? Is there at least a way to display an icon or add a tag to specify that a message was answered?

Thanks!

Welcome @Nick

Is there at least a way to display an icon or add a tag to specify that a message was answered?

Being answered isn’t a property of an email message. That would be a convenience method in an email application itself, not something that’s part of the message.

Thanks for the fast answer @BLUEFROG !
I do realize that it’s not part of the message, but it could be stored somewhere, just like tags for instance. EagleFiler for instance keep tracks of this and display an icon in front of each answered mail, although there is no direct link to the actual answer.

I use a group structure; it’s a manual process assisted with an Applescript

Thanks for the tip @DTLow. That sounds a bit tedious, how do you automate with the script?

There’s a mail header for that:

Though it is not used (aka set!) by all e-mail clients, it can be employed to group e-mail conversations. And that’s exactly what good e-mail clients do. I’m always a bit irritated when I see requests for functionality that are already available in a dedicated program to be replicated in DT.

Anyway, I thought that it might be possible to script that. But trying got me nowhere. For that to work, one would have to be able to get at the raw content of the mail. I tried so using the data property, but failed (in both AppleScript and JavaScript) since that only returned a hexadecimal representation of something (hopefully the e-mail).

Then I thought that maybe the metaData property contains headers. It does so, but only for some headers, not for In-Response-To. So scripting seems not possible here, unless @cgrunenberg or @pete31 come up with one of their usually brilliant ideas.

Edit Now, that is getting interesting. The URL of the imported e-mail contains this:
in-reply-to=%3C18C10D31-B7EF-47E2-BDB8-
which translates to in-reply-to=<18C10D31-B7EF-47E2-BDB8- and that looks like a message ID (or rather an in-reply-to header). Unfortunately, it is anything but. It’s in fact the truncated (!) message ID of this email. The correct in-reply-to would be something like
in-reply-to=%3CACFF067F-7A95-4B67-958B-20727BD3B57D@example.com%3E.

So, it seems that someone has thought about doing something to allow building an e-mail thread. But unfortunately, the result is not very helpful:

  • the URL parameter in-reply-to contains a truncated message ID
  • the original in-reply-to value is missing from the URL.

What has been tried here, apparently, is building a mailto: URL so that clicking on it would create a new e-mail as a reply to the current one. And clicking on that works as expected (at least with Apple’s mail program). But since the reply-to part of this URL is borken, the e-mail-thread would break if someone used this link to actually answer the e-mail.

I’d suggest modifying this so that the in-reply-to URL parameter contains the complete e-mail ID of the current e-mail. In addition, if this e-mail is already a reply to another one, the URL should contain some bogus parameter (i.e. one that can’t be an e-mail header field) giving the e-mail ID of this other e-mail. So, something like
in-reply-to=%3CACFF067F-7A95-4B67-958B-20727BD3B57D@example.com%3E&previous_message=%3CID OF MESSAGE THIS ONE IS A REPLY TO%3E

Many things to do just to replicate a function that any self-respecting mail client provides anyway. So what would be the point?

1 Like

The actual script command is move record theNote to theFilingGroup
and I have code to identify theFilingGroup including selecting from a list

1 Like

Hi Chrillek and thanks for your investigations!
Regarding the “replicate” point, I don’t know how do you use DevonThink but for me it’s mainly a way to archive my documents, including my mails. I have used several mail clients -and was perfectly happy with the way they handled the conversations- but what I want now is to concatenate all my mails coming from both Outlook and Apple Mail, and delete the originals (more than 20 years of emails). So everything will be in DevonThink and nowhere else, hence the usefulness of a “conversation” function, at least for me.

Since you asked: I only rarely import email into DT. Mostly I rely on my email client, and I don’t keep more than two, three years of e-mail.