This is a slightly off topic shot in the dark as it is more about Mail than any DevonX product but…
A quick question for the DevonThink software coders - In all your work with MacOS Mail and the unique ID numbering system of messages that is also used when mail is archived in DevonThink - have you ever come across a way to link to a thread instead of a message only?
I link first to messages in Mail during active work on projects and eventually change those links to DevonThink links with a simple search and replace when I archive the projects and all the mail messages. This is a pretty powerful workflow for me.
The one problem is that in MacOS Mail the link is always to just one message. One message that opens up without revealing its source folder or any other related messages. Which then means I have to copy/paste the thread title into the search window and search again to get all messages of the thread.
Wondering if anyone who’s been in the bowels of the software knows of a way to link to MacOS message threads instead of one message?
At least in DevonThink I could eventually find the link to the enclosing group which would represent the thread but even that would be a little difficult to do en-masse.
A mail message that is part of a thread contains special headers with the message Ids of the previous message(s). That’s how your mail client can group messages into threads.
I have seen it with web apps integrated with web email.
For example the legal client portal app MyCase has terrific Outlook Web integration that catches email in an ongoing thread and automatically ties it to a specific legal case.
I have not seen that with a local web client such as Mac Mail however.
If you mean Apple’s Mail program – that is an IMAP/SMTP (perhaps even still a POP3?) client. And technically, it would be possible to build a thread even with that software, starting from a single message. A crude approach would be to retrieve all messages with the same Subject header and order them by date, which gives you a flat thread:
That takes the first of the currently selected messages and builds a list of messages with the same subject in the same mailbox, sorted by ascending date.
OTOH, some IMAP servers can build a thread from a single message. And with Gmail, there are other possibilities:
It’s possible but Office 365 mail stores can be 100Gb so it may be hard to be performant.
Moreover a thread can change its subject during its course. Plus message can have the same subject but be unrelated. So the designation as a thread needs to rely on other metadata within the email headers.
The script is written for Apple’s Mail app. I don’t know about Office 365, nor their scripting dictionary.
A crude approach, as I said. A more sophisticated one would be to look at the headers In-Reply-To and References. So, you take the selected message, get those headers, store the relevant message IDs in an array, and then for each element of the array, get the corresponding message and its headers, weed out the duplicates and store the rest in the array …
Doing that on a client is probably time-consuming. Asking the IMAP server about the corresponding threat is a better solution, but that’s not easily scriptable.