Experience your
30 day trial
now!
GET STARTED
Hi. Many of you have wondered what the various settings in the email router configuration file ( a.k.a Microsoft.Crm.EmailAgent.xml) are. Some of them are pretty straight forward and some are not. In this blog I will try to describe them in detail.
Microsoft.Crm.Tools.EmailAgent.xml
This file contains the configuration settings for running email router. The file store two types configuration settings. System configuration settings and Provider configuration settings.
a) System settings: These settings are general settings for the core email router operation.
S#
Tag Name
Description
1
MaxThreads
This defines the internal thread pool size for running the email providers.
2
MaxThreadExecution
This defines the maximum time a thread can execute for.
3
SchedulingPeriod
Time interval used to scheduling different providers.
4
ConfigRefreshPeriod
Time interval after which the configuration values gets read from the file to the internal memory structure.
5
ConfigUpdatePeriod
Timer interval after which the email router will attempt to synchronize the crm user and queues email settings between CRM server and the configuration file.
6
LogLevel
Log level. 1 – Normal, 2 – Advance, 3 - Details.
Note: all time intervals in the configuration file are specified in milliseconds.
Example:
<SystemConfiguration> <MaxThreads>50</MaxThreads> <MaxThreadExecution>600000</MaxThreadExecution> <SchedulingPeriod>1000</SchedulingPeriod> <ConfigRefreshPeriod>5000</ConfigRefreshPeriod> <ConfigUpdatePeriod>300000</ConfigUpdatePeriod> <LogLevel>1</LogLevel> </SystemConfiguration>
<SystemConfiguration>
<MaxThreads>50</MaxThreads>
<MaxThreadExecution>600000</MaxThreadExecution>
<SchedulingPeriod>1000</SchedulingPeriod>
<ConfigRefreshPeriod>5000</ConfigRefreshPeriod>
<ConfigUpdatePeriod>300000</ConfigUpdatePeriod>
<LogLevel>1</LogLevel>
</SystemConfiguration>
b) Provider settings: These settings are for the individual providers that provide a particular service. There are two types of provider. Outbound providers and inbound providers. These provider have some common settings and other provider specific settings.
Common settings:
ProviderConfiguration
This is the top node defining a single email provider.
deploymentId
This is an internal CRM deployment id used in the email configuration wizard. For all ECW generated provider nodes its Guid. If a non GUID value is detected, router assumes this to a manual entry by the user and retains it in successive refresh of the config file.
ProviderAssembly
The assembly that contains the providers.
ProviderClass
The class that defines the provider behavior.
CrmServerUrl
The CRM server URL to which the provider will sync email to/from.
CrmAuthMode
Auth mode used to authenticate against the CRM server.
WindowsAuthentication, Passport and ClearText are allowed values.
7
CrmUser
CRM user account used to connect to CRM.
8
CrmPassword
CRM user password used when connecting to CRM.
9
EmailServer
Email server name.
10
EmailAuthMode
Authentication mode used to against the email sever.
11
Log level for the provider.
12
Target
This indicates the email target to interact with. For the outgoing email provider it’s the email server name and for incoming provider it’s the mailbox name.
13
Direction
This indicates if the provider is incoming or outgoing.
14
CacheCapacity
Internal cache capacity size.
15
ConnectionTimeout
Connection timeout for the action against the email server.
16
PollingPeriod
Time interval after which the provider should be rescheduled.
17
MaxMessageCount
Maximum messages to download in one polling period.
18
EmailPort
Email port to use when interacting with the email server.
a. Outbound providers: These provide a conduit though which email sent in CRM flow to the outside word. The only default outbound provider provided with the OOB email router service is the SmtpPollingSendEmailProvider. The SMTP outbound provider downloads emails in the pending send status for the users and queues specified and send them out via the local or specified SMTP stack.
UserId
CRM id of the user whose outgoing emails should be processed.
QueueId
CRM id of the queue whose outgoing emails should be processed.
EmailUseSsl
Should ssl be used when sending emails.
DeliveryMethod
Delivery method for sending email.
PendingStatusDelay
Pending status delay describes the period after the email sent action, the email should be picked up by the email router for sent.
SendingStatusDelay
Sendind status delay describes the period after which the email in crm, if stuck in sending status should be reprocessed.
CodePage
Codepage to be used when sending email.
MaximumDeliveryAttempts
Maximum attempts the email router will try to send the email out. If the threshold is reached the status if the email in CRM will be set to Failed.
BatchSize
Describes how many users and queues to batch together when making one BackgroundSend api call. The backgroudSend API call is made to download pending emails from CRM.
RequestBatchSize
Maximum number of emails to download in one request to BackgroundSend API.
<ProviderConfiguration deploymentId="fd880e79-6f1b-4e40-aa05-628b845653fb"> <ProviderAssembly>Microsoft.Crm.Tools.EmailProviders.dll</ProviderAssembly> <ProviderClass>Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider</ProviderClass> <CrmServerUrl>http://[ServerName]/[OrganizationName]</CrmServerUrl> <CrmAuthMode>WindowsAuthentication</CrmAuthMode> <CrmUser>[DomainName] \administrator</CrmUser> <CrmPassword>{2A48C4DB-F2BF-48DF-A8EF-20F531EA9BAA}:jEPrLEnKMdMI+jgjIAabJg==@0HlCR312abwYDupnkrAi8A==</CrmPassword> <EmailServer>[EmailServerName] </EmailServer> <EmailAuthMode>WindowsAuthentication</EmailAuthMode> <UserId>9e80ac64-c82d-dd11-8246-0013720ec2db</UserId> <UserId>17d87ab0-c62d-dd11-8726-0013720ec2db</UserId> <Target>[EmailServerName] </Target> <Direction>Outbound</Direction> <LogLevel>1</LogLevel> <CacheCapacity>1024</CacheCapacity> <ConnectionTimeout>300000</ConnectionTimeout> <PollingPeriod>60000</PollingPeriod> <MaxMessageCount>1000</MaxMessageCount> <EmailPort>25</EmailPort> <EmailUseSsl>false</EmailUseSsl> <DeliveryMethod>Network</DeliveryMethod> <PendingStatusDelay>30000</PendingStatusDelay> <SendingStatusDelay>60000</SendingStatusDelay> <CodePage>Utf-8</CodePage> <MaximumDeliveryAttempts>10</MaximumDeliveryAttempts> <BatchSize>5</BatchSize> <RequestBatchSize>5</RequestBatchSize> </ProviderConfiguration>
<ProviderConfiguration deploymentId="fd880e79-6f1b-4e40-aa05-628b845653fb">
<ProviderAssembly>Microsoft.Crm.Tools.EmailProviders.dll</ProviderAssembly>
<ProviderClass>Microsoft.Crm.Tools.Email.Providers.SmtpPollingSendEmailProvider</ProviderClass>
<CrmServerUrl>http://[ServerName]/[OrganizationName]</CrmServerUrl>
<CrmAuthMode>WindowsAuthentication</CrmAuthMode>
<CrmUser>[DomainName] \administrator</CrmUser>
<CrmPassword>{2A48C4DB-F2BF-48DF-A8EF-20F531EA9BAA}:jEPrLEnKMdMI+jgjIAabJg==@0HlCR312abwYDupnkrAi8A==</CrmPassword>
<EmailServer>[EmailServerName] </EmailServer>
<EmailAuthMode>WindowsAuthentication</EmailAuthMode>
<UserId>9e80ac64-c82d-dd11-8246-0013720ec2db</UserId>
<UserId>17d87ab0-c62d-dd11-8726-0013720ec2db</UserId>
<Target>[EmailServerName] </Target>
<Direction>Outbound</Direction>
<CacheCapacity>1024</CacheCapacity>
<ConnectionTimeout>300000</ConnectionTimeout>
<PollingPeriod>60000</PollingPeriod>
<MaxMessageCount>1000</MaxMessageCount>
<EmailPort>25</EmailPort>
<EmailUseSsl>false</EmailUseSsl>
<DeliveryMethod>Network</DeliveryMethod>
<PendingStatusDelay>30000</PendingStatusDelay>
<SendingStatusDelay>60000</SendingStatusDelay>
<CodePage>Utf-8</CodePage>
<MaximumDeliveryAttempts>10</MaximumDeliveryAttempts>
<BatchSize>5</BatchSize>
<RequestBatchSize>5</RequestBatchSize>
</ProviderConfiguration>
b) Incoming provider: These provide a conduit though which the email from the outside world flow into CRM. The crm 4.0 email router provides 2 different OOB inbound providers. These are based on the protocol used to connect to the mailbox.
a. Exchange b. POP3
a. Exchange
b. POP3
There is also a third inbound mail box provider that allows processing of email from a forward or sink mail box style mail box.
EmailUser
User name of the user whose mailbox is to be monitored.
EmailPassword
Password to be used to login to the users mailbox.
EmailAddress
Email address of the user whose mailbox is to be monitored.
IsForwardMailbox
Indicates if the mail box being monitored is a forward mailbox. When mail box is a sink mailbox then email router processes the email found in the attachment of the email rather than the email itself. The user mail boxes all forward their emails to this mailbox as attachments.
DeleteEmails
This indicates if the email should be deleted from the mailbox after processing. A good option if it’s an unmonitored mail box.
MessageExpiry
Threshold time after which a message in the mail box is considered old to be neglected in processing.
MoveEmails
Flag to indicate if the undeliverable email should be moved to a separate folder.
<ProviderConfiguration deploymentId="fd880e79-6f1b-4e40-aa05-628b845653fb"> <ProviderAssembly>Microsoft.Crm.Tools.EmailProviders.dll</ProviderAssembly> <ProviderClass>Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider</ProviderClass> <CrmServerUrl>http://[ServerName]/[OrganizationName]</CrmServerUrl > <CrmAuthMode>WindowsAuthentication</CrmAuthMode> <CrmUser>[DomainName]\Administrator </CrmUser> <CrmPassword>{2A48C4DB-F2BF-48DF-A8EF-20F531EA9BAA}:jEPrLEnKMdMI+jgjIAabJg==@0HlCR312abwYDupnkrAi8A==</CrmPassword> <EmailServer>http://[EmailServerName]</EmailServer> <EmailAuthMode>WindowsAuthentication</EmailAuthMode> <EmailUser>[DomainName]\administrator</EmailUser> <EmailPassword>{2A48C4DB-F2BF-48DF-A8EF-20F531EA9BAA}:edkflQCsqYuDjLgtvCezJg==@x3JEvQyWBlCakbJGzbgv6w==</EmailPassword> <EmailAddress>Administrator@extest.microsoft.com</EmailAddress> <Target>First name Last name</Target> <Direction>Inbound</Direction> <LogLevel>1</LogLevel> <CacheCapacity>1024</CacheCapacity> <IsForwardMailbox>false</IsForwardMailbox> <DeleteEmails>false</DeleteEmails> <ConnectionTimeout>300000</ConnectionTimeout> <PollingPeriod>60000</PollingPeriod> <MaxMessageCount>1000</MaxMessageCount> <MessageExpiry>86400000</MessageExpiry> <EmailPort>80</EmailPort> <MoveEmails>true</MoveEmails> </ProviderConfiguration>
<ProviderAssembly>Microsoft.Crm.Tools.EmailProviders.dll</ProviderAssembly> <ProviderClass>Microsoft.Crm.Tools.Email.Providers.ExchangePollingMailboxProvider</ProviderClass>
<CrmServerUrl>http://[ServerName]/[OrganizationName]</CrmServerUrl >
<CrmUser>[DomainName]\Administrator </CrmUser>
<EmailServer>http://[EmailServerName]</EmailServer>
<EmailUser>[DomainName]\administrator</EmailUser>
<EmailPassword>{2A48C4DB-F2BF-48DF-A8EF-20F531EA9BAA}:edkflQCsqYuDjLgtvCezJg==@x3JEvQyWBlCakbJGzbgv6w==</EmailPassword>
<EmailAddress>Administrator@extest.microsoft.com</EmailAddress>
<Target>First name Last name</Target>
<Direction>Inbound</Direction>
<IsForwardMailbox>false</IsForwardMailbox>
<DeleteEmails>false</DeleteEmails>
<MessageExpiry>86400000</MessageExpiry>
<EmailPort>80</EmailPort>
<MoveEmails>true</MoveEmails>
Cheers,
Shashi Ranjan
PingBack from http://blog.a-foton.ru/2008/07/email-router-configuration-xml-file-explained/
The information is useful. However the tag <EmailAddress> should get a better consideration. Currently, it always copy CRM user's primary email address once the CRM EMail Router service restart. And the service is only looking for this mailbox on Exchange mail server, this is not ideal for a hosted Exchange environment: the CRM Email Router service should also query the SAM account mailbox for the same user. I will report it to Microsoft and explain it on my blog.
Jim Wang
http://jianwang.blogspot.com
首先微软有一篇白皮书可以作为配置前的参考:MicrosoftDynamicsCRM:Howtoconfigurethe
On-premiseandOnlineE-mailRout...
Logger Tool, Explanations about XML File, etc...
http://blogs.msdn.com/benlec
Is there any work arond for Exchange 2007 self signed certificate
首先微软有一篇白皮书可以作为配置前的参考: Microsoft Dynamics CRM: How to configure the On-premise and Online E-mail Router
Routers have come a long time in the last few years it's amazing how much they've changed.
This information is outstanding, and tweaking the BatchSize and RequestBatchSize fixed our problem.
BUT....
Whenever the Service is restarted, both of these values get set back to the default 5 and 5.
How do you prevent the lose of these changes?
I believe you have to set the provideroveride fature under the providor settings. What was your original issue?