CRM 4.0 E-mail Router 配置常见错误和解决方法
首先微软有一篇白皮书可以作为配置前的参考:Microsoft Dynamics CRM: How to configure the On-premise and Online E-mail Router in different deployment scenarios
总结一下在配置CRM 4.0 E-mail Router 遇到的问题和解决方案,一般来讲问题都处在 Incoming(POP, Exchange)端。Outgoing(SMTP)只要权限没问题,Server允许Relay的情况下,不会有太多问题。
- Incoming(POP, Exchange)
##下面三种情况很可能是错误的Url,或者端口号
- Incoming Status: Failure - Unable to connect to the remote server No connection could be made because the target machine actively refused it
- Incoming Status: Failure - The operation has timed out
- Incoming Status: Failure - The remote server returned an error: (440) Login Timeout.
##下面的错误可能是因为错误的协议https,可以尝试http
- Incoming Status: Failure - The underlying connection was closed: Could not establish trust relationship for the SSL/TLS secure channel. The remote certificate is invalid according to the validation procedure.
微软的白皮书上给出了解释:
Type the HTTP-DAV location of the Microsoft Exchange server in the Server open text box.
Note: You should enter the url address
that has the HTTP-DAV enabled. Outlook Web Access (OWA) endpoints typically
have HTTP-DAV enabled. Typically this location will be entered as https://ExchangeServerName or https://ExchangeServerName.domain.com.
Note: If Exchange is not installed on the
default website and port, you must include the port number. For example https://ExchangeServerName:8080
我总结出的经验是:
(1) 确认协议[Protocol],地址[URL],端口[Port]都正确;
(2) 确认地址是邮件服务器的地址(Exchange Mailbox URL),这个地址不一定是OWA的地址;
(3) 不需要在地址后面添加 /exchange 或 /owa ,因为Email Router Service 在搜索的时候会自动添加(通过分析Exchange日志得到的结果);
(4) 有些时候你必要先发布[Publish]你的设定,然后重启 Email Router Service,然后再测试[Load/Test]。
- Outgoing(SMTP)
如果你发现配置没有问题,而当发送CRM E-mail时候,E-mail迟迟不被发送,显示:
- This message has not yet been submitted for delivery
可以尝试修改 ..\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.xml
<SchedulingPeriod>1000</SchedulingPeriod>
把这个值改小一点,比如100。关于EmailAgent.xml的更多解释参见这里。
然后重启 Microsoft CRM Email Router Service。
如果还不能解决问题(其实这是一个Email Router 的Bug,微软已经有了补丁 KB 952019 )你可以联系微软来获取这个hotfix。
- 关于E-Mail Router的日志
如果在Application Event 里的信息无法解决你的问题,可以尝试最大化日志设定,基本上要修改2个地方:
(1) 修改 HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\MSCRMEmail,把LogLevel从1改成3 。(1,2,3三个level)
(2) 修改 ..\Microsoft CRM Email\Service\Microsoft.Crm.Tools.EmailAgent.xml,也是把<LogLevel>从1改成3。
然后需要重启 Microsoft CRM Email Router Service,这时在eventvwr(日志查看器)里就会多出一项叫:MSCRMEmailLog (LogLevel改成2或3都会有这个项出现,而相关信息就不会出现在Application 程序 项里了 )
更多的CRM调试信息请参见 How to enable tracing in Microsoft Dynamics CRM
如果大家对Email Router有新发现,请留言。:)