How to configure CRM Email Server Profile for unsecure connection

In Dynamics CRM 2013 Microsoft has added feature Server-Side Synchronization. You can now enable and configure synchronization of email, appointments, contacts, and tasks directly from the WEB UI.
The thing is that you can't configure insecure connection for email server profile by default. But you can achieve it with fine tuning of CRM deployment. Below are required steps.

You need to allow using non encrypted connection. You can use PowerShell commands or direct DB update.

Add-PSSnapin -Name Microsoft.Crm.PowerShell

$itemSetting = new-object 'System.Collections.Generic.KeyValuePair[String,Object]' ("ECAllowNonSSLEmail",1)
$configEntity= new-object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
$configEntity.LogicalName = "Deployment"
$configEntity.Attributes=new-object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
$configEntity.Attributes.Add($itemSetting)
Set-CrmAdvancedSetting -Entity $configEntity
UPDATE [MSCRM_CONFIG].[dbo].[DeploymentProperties]
SET BitColumn = 1
WHERE ColumnName = 'ECAllowNonSSLEmail'

This will allow you to set 'Use SSL for Outgoing Connection' to 'No'. Actually I stuck after that for a while, because mailbox was still failing tests. With 'Outgoing Authentication Protocol' set to 'Auto Detect' CRM will try to send email without any authentication (anonymously) via unsecured connection. To overcome this you need to set next setting.

Add-PSSnapin -Name Microsoft.Crm.PowerShell

$itemSetting = new-object 'System.Collections.Generic.KeyValuePair[String,Object]' ("AllowCredentialsEntryViaInsecureChannels",1)
$configEntity= new-object "Microsoft.Xrm.Sdk.Deployment.ConfigurationEntity"
$configEntity.LogicalName = "Deployment"
$configEntity.Attributes=new-object "Microsoft.Xrm.Sdk.Deployment.AttributeCollection"
$configEntity.Attributes.Add($itemSetting)
Set-CrmAdvancedSetting -Entity $configEntity
UPDATE [MSCRM_CONFIG].[dbo].[DeploymentProperties]
SET BitColumn = 1
WHERE ColumnName = 'AllowCredentialsEntryViaInsecureChannels'

[Update 25.01.2015] It turned out that you must also set ECAllowBasicAuthenticationOnNonSecureChannel parameter to 1 to make it work.

After that you can set 'Outgoing Authentication Protocol' to 'Basic' in email server profile. It will authenticate with credentials set in profile or in mailbox now.

Summary

To be able to send\receive emails via unsecured connection with authentication you must set deployment parameters ECAllowNonSSLEmail and AllowCredentialsEntryViaInsecureChannels to true. After that turn off SSL and set authentication protocol to basic in email server profile.
CRM 2013 Email Server Profile
P.S. Note that after changing deployment settings you must recycle CRMAppPool.

Show Comments