Skip to main content

Notifications

Announcements

No record found.

Server-Side Synchronization Series Part 4: In-Reply-To Correlation and Forwarding Emails

This part of our blog series will cover the most common correlation method used for automatic promotion for user mailboxes: In-Reply-To correlation.

How does in-reply-to correlation work?

From our previous entry, we have an email sent from Dynamics that has the following Message-ID:

<142408F2977449AE9A3EB234870D156A1D6809716A2B@CODIN.OBFUSCATED.ONMICROSOFT.COM>


Exchange handles replies and forwards a bit differently than sending brand new emails. Let's reply to this email from my inbox and see what the reply's message headers look like:

From: Cody Dinwiddie <codin@microsoft.com>
To: Cody Dinwiddie <codin@OBFUSCATED.onmicrosoft.com>
Subject: Re: Test Email
Thread-Topic: Test Email
Thread-Index: AQscuKgXz0bUld+ni9oW2WvWgJcWopbHxZqC
Date: Tue, 1 Sep 2020 20:07:11 +0000
Message-ID:
<CH2PR21MB1463D383FECE14183B853DF7AE2E0@CH2PR21MB1463.namprd21.prod.outlook.com>
References:
<142408F2977449AE9A3EB234870D156A1D6809716A2B@CODIN.OBFUSCATED.ONMICROSOFT.COM>
In-Reply-To:
<142408F2977449AE9A3EB234870D156A1D6809716A2B@CODIN.OBFUSCATED.ONMICROSOFT.COM>
Accept-Language: en-US


This message has some additional fields than what we saw on a brand new email: "References" and "In-Reply-To". Notice how the MessageID is unique, but the In-Reply-To value is identical to the message id of our original email (the one we replied to). When Server-Side Sync reaches out to Exchange and pulls all of the emails since they last spoke, the following happens (simplified overview): 

  • Evaluate each email one by one to determine if any values meet promotion criteria
  • If an email matches in-reply-to to an existing messageid, evaluate the message to ensure other fields are valid
    • Are the email addresses for the sender and the recipients in a valid format? (x@y.z)
      • If not, reject as invalid email format
    • Does one of the email addresses in the recipient list match a system user or queue?
      • If not, reject as NoRecipientMatch
    • Is the sender of the email tied to a system user or queue?
      • If so, check the setting "Track Emails Sent between Dynamics 365 users as two activities"
        • If unchecked, reject the message with InternalEmailReject
      • (this is tied to "Track Emails Sent between Dynamics 365 users as two activities", which we will go over later in this series)
  • If the check conditions all pass, we promote the item to Dynamics and attempt the creation of an Email record.


Since we have a match, We will create the record in Dynamics.

What about forwarded emails?

Remember when I said that Exchange also applies "In-Reply-To" values to forwards as well? Let's take a look at the headers of a forward of the same forwarded mail:

From: Cody Dinwiddie <codin@microsoft.com>
To: John Doe <jodoe@OBFUSCATED.onmicrosoft.com>
Subject: Fw: Test Email
Thread-Topic: Test Email
Thread-Index: AQscuKgXz0bUld+ni9oW2WvWgJcWopbHyrhB
Date: Tue, 1 Sep 2020 20:25:32 +0000
Message-ID:
<CH2PR21MB1463E1A0575C6B54502AADC3AE2E0@CH2PR21MB1463.namprd21.prod.outlook.com>
References:
<142408F2977449AE9A3EB234870D156A1D6809716A2B@CODIN.OBFUSCATED.ONMICROSOFT.COM>
In-Reply-To:
<142408F2977449AE9A3EB234870D156A1D6809716A2B@CODIN.OBFUSCATED.ONMICROSOFT.COM>
Accept-Language: en-US

All users are setup to promote in-reply-to matches by default. In the above scenario, if John Doe is a Dynamics user setup to have incoming email evaluated through Server-Side Sync, John will see the above email and automatically promote it to Dynamics, thinking it is a direct reply. This scenario is not very common, but can still occur, so it's really important to understand the properties we evaluate for automatic promotion into Dynamics.

Updated 4/5/2021:

Due to this behavior not being ideal, I created a design change request to provide a mechanism to modify the way promotions work in this scenario. This has been added to Dynamics as a new OrgDbOrg setting- "DoNotCorrelateForwardedEmailsAsReplies". Set this value to true and when we evaluate forwards, we will not pull them into Dynamics as replies. More information on OrgDbOrg Settings and how to configure them can be found here.

In our next series, we will dive into Incoming Email promotion and how Email format fields work.

Part 1Part 2Part 3, Part 5, Part 6

Comments

*This post is locked for comments

  • RJ@ Profile Picture RJ@ 55
    Posted at
    Can you tell me how authentication happens in SSS and its a basic or modern authentication
  • rbaryolo Profile Picture rbaryolo 20
    Posted at
    Heading to read about details of activities synchronization. This is a really good series.