Setup Incoming and Outgoing email synchronization for CRM in Exchange 2016
This article scopes on the CRM email router configuration in an on-premises CRM and Exchange Environment.
The CRM email router allows us to configure an interface between CRM deployment and Exchange server through POP3 for incoming email configuration.
The Microsoft Dynamics CRM 2016 Email Router is an interface between Microsoft Dynamics CRM 2016 and an email system.
By doing this, the CRM users will be receiving the emails and sending after this configuration is complete.
Basically this CRM 2016 Email Router requires two configurations in an email system (Exchange on-premises server in our case):
1) POP3 servers for incoming email – We need to use the Exchange POP3 configuration
https://exchangequery.files.wordpress.com/2017/09/untitled.png?w=600
https://exchangequery.files.wordpress.com/2017/09/untitled1.png?w=600
In our example we are using Other Specified.
**Other Specified: **By using this option we are configuring the email router in CRM to send emails on behalf of every CRM user through a specific CRM service account that has access to all the CRM users mailboxes which will be the preferred setting. Other advanced settings can be configured in the advanced section.
https://exchangequery.files.wordpress.com/2017/09/untitled3.png?w=600
2) SMTP or Exchange servers (EWS) for outgoing email:
The outgoing email configurations for CRM is used for users or queues to send Microsoft Dynamics CRM email messages.
For Exchange Online we need to use the below configuration.
We can use the same configuration for on-premises and use the EWS URL, if the EWS URL is resolving from the CRM email router configuration host.
https://exchangequery.files.wordpress.com/2017/09/untitled4.png?w=600
For SMTP configuration:
In the case below we can use an SMTP server (can be IIS SMTP or SMTP G/W) and the CRM email router host needs to have a connection to the SMTP host. The email router component can be installed on the SMTP server itself and configured.
https://exchangequery.files.wordpress.com/2017/09/untitled5.png?w=600
Exchange Permission for CRM account:
First we need to create a new Application Impersonation role assignment in the RBAC and assign to the CRM service account.
In order to do that, please run the below command:
New-ManagementRoleAssignment –Name:impersonationAssignmentName – Role:ApplicationImpersonation –User:[ServiceUser]
Run the below command on the CRM users Container:
Get-Mailbox -OrganizationalUnit CRMUsersCOntainerOU | ForEach-Object {Add-ADPermission -Identity $_.DistinguishedName -User User1 -ExtendedRights ms-Exch-EPI-May-Impersonate}
Get-Mailbox -OrganizationalUnit CRMUsersCOntainerOU | ForEach-Object {Add-ADPermission -Identity $_.DistinguishedName -User User1 -ExtendedRights ms-Exch-EPI-Impersonation}
This service user will have a forwarding mailbox in the CRM. All email sent to that address will have a forwarder and sends to the actual recipient.
After the above configuration is completed the CRM can send outgoing emails, receive incoming emails, and process for all users.