2

I'm building a .NET Core WEB API that serves as an automation layer over Outlook messages and calendars using the Microsoft Graph SDK. One of the requirements is to identify which messages have been replied to or have been forwarded.

It's not yet clear to me how I can determine whether an email message has been forwarded or replied to when using the results of Graph Explorer "My Mail" sample request.

This answer states that the ConversationId property remains the same (which is indeed the case) and that the only indication is either "FW:" or "RE:" prefixed to the subject. Also in the Message documentation I can't seem to find a proper, reliable way of identifying those.

Can anyone tell me how this can be done?

2 Answers 2

4

If your looking at mail in the Inbox and you want to know if they have been acted on by a Mail client (eg Oultook or OWA) then you could use PidTagLastVerbExecuted https://learn.microsoft.com/en-us/office/client-developer/outlook/mapi/pidtaglastverbexecuted-canonical-property (this is how outlook determines it) eg

https://graph.microsoft.com/v1.0/me/messages?$expand=SingleValueExtendedProperties($filter=(Id%20eq%20'Integer%200x1081'))

If a Message had been replied to you would see a result like

            "singleValueExtendedProperties": [
            {
                "id": "Integer 0x1081",
                "value": "102"
            }
           ]

This still isn't 100% reliable so if your doing this for Auditing the only way is using the Tracking Logs (MessageTrace in Office365)

Sign up to request clarification or add additional context in comments.

2 Comments

Thank you Glen! It won't be used for auditing, just need to pass a true/false value from my API to give the frontend an indicator whether or not to show a forwarded / replied arrow icon. So this will do nicely :) The only thing that looks a bit strange here, is that 102 is used for replies and 104 for forwarded messages. While the docs link respectively states 105 and 106.
I think the documentation is wrong, last time I used this I used github.com/stephenegriffin/MAPIStubLibrary/blob/master/include/… to get the verb enums.
1

Email, in general, has very weak support for message threading. That said, you might be able to pull this from the internetMessageHeaders collection.

Per RFC5322:

The In-Reply-To: and References: fields are used when creating a reply to a message. They hold the message identifier of the original message and the message identifiers of other messages (for example, in the case of a reply to a message that was itself a reply). The In-Reply-To: field may be used to identify the message (or messages) to which the new message is a reply, while the References: field may be used to identify a "thread" of conversation.

Note that In-Reply-To is an optional field so it may not always be populated.

1 Comment

Thanks for the reply Marc, I've checked this out and it provided me with some useful tracking and auditing information. But sadly the In-Reply-To and References fields were not there. So I assume Outlook does not populate them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.