Email Messages Sent From Dynamics 365 Through Server-Side Synchronization Will Now Save to Exchange “Sent Items” Folder
Introduction
As part of Microsoft’s continued efforts to improve Dynamics 365 and Server-Side Synchronization, the behavior of how outgoing email messages sent through Server-Side Synchronization via Dynamics 365 interact with Exchange folder structures has been modified. This change will affect the sizes of Exchange mailboxes tied to Dynamics and can lead to mailboxes being unable to send email if Exchange limitations are reached.
Background on how emails sent through Server-Side Synchronization via EWS works in a nutshell
When Server-Side Synchronization is configured using default settings, pressing “Send” on a fully composed new Email Message will cause the following to occur:
- The Email Message entity record is saved to the ActivityPointerBase SQL table (among others) in the “Pending Send” status
- The User or Queue tied to the “From” field on the Dynamics 365 Email Message record has an associated Dynamics 365 Mailbox entity record. The outgoing polling period will elapse for this Mailbox, triggering a call to check for messages in a “Pending Send” status under the User or Queue context.
- Messages in a “Pending Send” status are evaluated to ensure able to be provided to Exchange.
- Messages are then provided to Exchange through EWS calls as part of the Dynamics 365 Server-Side Synchronization integration.
- Exchange responds that it accepts the EWS request and will send the Email Message provided.
- Dynamics 365 updates the Email Message record to a “Sent” status.
- Exchange will save this email to the “Drafts” folder
- Exchange will provide the email to the outbound connector, which sends the message.
- Once sent, the email message is deleted from the Drafts folder.
This flow is markedly different than what a user would expect to see if they send an Email through Outlook, namely that messages sent through Server-Side Synchronization are not saved in the “Sent Items” folder. This ensures that mailboxes don’t increase in size and that Email Messages aren’t saved in two places (both Dynamics 365 SQL tables and Exchange folders).
Changes made to how Exchange handles Emails sent via Server-Side Synchronization
As a result of customer feedback, Email Messages sent through Dynamics 365 via Server-Side Synchronization now save a copy to the “Sent Items” folder in Exchange. This change allows Exchange administrators and legal discovery requests to easily identify messages that would otherwise require Dynamics 365 access to detect.
Effect of these changes on Exchange and Dynamics 365
Since messages sent through Server-Side Synchronization historically did not save a copy to “Sent Items” in Exchange, the Exchange mailbox never increased in size. As such, Dynamics and Exchange administrators might not be aware of this change, which will cause these mailboxes to increase in size over time unabated.
Due to this, the size of the mailbox or the number of items in the “Sent Items” folder (as examples) can reach a point where Exchange runs into limitations on the save of new items. These Exchange configuration values which prevent the save of new items are referred to as quota limitations.
In the event a quota limitation occurs when Dynamics 365 attempts to send a message through Server-Side Synchronization to Exchange, Exchange responds that it is unable to save the message and therefore cannot deliver it. This is provided to Dynamics in the form of an HTTP status code 403 response (forbidden), and the exception “Cannot submit message” due to “ErrorQuotaExceeded”. Dynamics will not change the status of the Email Message to “Sent” due to this exception.
How Exchange Quota Limitations can affect Users and Queues in Dynamics 365
In the event a quota limitation is encountered, the associated Dynamics 365 mailbox will cease to be able to send any outbound mail through Server-Side Synchronization. This can only be resolved by correcting the issue causing the limitation on the Exchange mailbox to occur. Quota limitations can be in many forms, such as the number of items allowed in a folder, overall size of the folder, overall size of the mailbox, etc.
For a Dynamics 365 User, this causes Dynamics 365 Email Message entity records to not be able to send if the User record is in the “From” field. Other users not running into quota limitations will be able to continue to successfully send email messages as normal. User mailboxes are typically monitored through Exchange clients (such as Outlook) by the users who own them, where the clients will normally point out mailbox size limits that are being approached. As such, user mailboxes are not typically affected by this change.
For a Dynamics 365 Queue, this causes Dynamics 365 Email Message entity records to not be able to send if the Queue record is in the “From” field. This can cause a much larger issue as Queues are typically used to send a much higher volume of emails, such as orders, customer service interactions, and marketing campaigns. When a queue that is successfully sending email messages suddenly runs into a quota limitation, it ceases to operate until the limitation is resolved.
How to prevent Exchange Quota Limitations from affecting Server-Side Synchronization
Dynamics 365 organizations that utilize queues for sending large quantities of email messages should verify through Exchange what policies are in use for the associated mailboxes. Exchange administrators can perform the following to ensure that quota limitations are not encountered:
- Change the values of the quota limitations mailbox-level to ensure they cannot be encountered
- Enable auto-archival on the “Sent Items” folder in a way that would prevent quota limitations from being encountered
- Manual observation of the folder structures and movement of associated items to prevent quota limitations from being encountered
On the Dynamics side, organizations that wish to change this behavior for Email Messages sent through Server-Side Synchronization must open a support ticket with Microsoft. This behavior can be modified by our support team at an organization-level to never save copies of the item to the “Sent Items” folder.
Due to customer feedback, Microsoft is working on the creation and testing of an OrgDBOrg setting that is toggle-able to change this behavior without needing to open a support ticket with Microsoft. More information on OrgDBOrg settings and how to configure them can be found here:
OrgDBOrg Settings and Documentation on How They Work
OrgDBOrg Solution Tool by Sean McNellis that easily allows modifications to these settings
I will update this blog when this OrgDBOrg setting is available.