1、前戏
最近遇到一个问题,Exchange邮箱发送一个带附件的邮件给内部的另外一个非Exchange邮件系统邮箱的用户邮件,收件人收到邮件后不使用Outlook客户端打开邮件时显示为winmail.dat;如果收件人使用Outlook打开则可以正常查看邮件附件。
现场环境为WIndows Server 2012 R2+Exchange 2016。AD的域名为contoso.local,Exchange的接收域为:contoso.local(外部中继域)、contoso.com(权威域),域名contoso.local域名为内部一个coremail邮件系统使用的SMTP域名;为了能够让Exchange 2016的邮箱用户能够在OAB中检索到coremail的邮箱用户地址,使用脚本在Exchange上为创建了大量外部SMTP地址为@contoso.local的联系人。
换句话说,在Exchange内部的邮件格式是为TNEF,当Exchange将邮件发送到第三方邮件系统时,会将TNEF格式的邮件进行内容格式转换(例如:转换为HTML格式),这样第三方邮件系统接收到邮件后使用非Outlook客户端就能够正常查看邮件内容。
出现上述这种情况,有两种解决方法:1)、关闭远程接受域的TnefEnabled属性值。(而我的环境中contoso.local为AD域名,无法删除也无设置为远程域,所以此方法行不通)。2)、设置每个Mailuser或Mail contact的属性UseMapiRichTextFormat为Never。
由于我处理的环境只能使用方法2,下面我还是两种操作方法都说明一下:
1. 打开Exchange Powershell
2. 三方邮件系统所使用的domain(此处,假设您的Exchange smtp domain为contoso.com,三方邮件系统的smtp domain为4thcoffee.com)加入到Exchange的Remote Domain中:
New-RemoteDomain Name 4thCoffee.com -DomainName 4thCoffee.com
3. 运行下方命令检查您此时的Remote Domain配置:
Get-RemoteDomain | Where {$_.TNEFEnabled -ne $false} | Select Name,DomainName,TNEFEnabled
<a href="http://s3.51cto.com/wyfs02/M01/8A/D6/wKioL1g9PXzxliANAAC2eHGmwBQ627.jpg" target="_blank"></a>
4. 将4thCoffee.com的TNEFEnabled参数设置为False:
Set-RemoteDomain -Identity 4thCoffee.com -TNEFEnabled $false
关于TNEF参数的说明:
The TNEFEnabled parameter specifies whether Transport Neutral Encapsulation Format (TNEF) message encoding is used on messages sent to the remote domain.
参考链接:
Set-RemoteDomain
<a href="https://technet.microsoft.com/en-us/library/aa997857(v=exchg.150).aspx" target="_blank">https://technet.microsoft.com/en-us/library/aa997857(v=exchg.150).aspx</a>
TNEF conversion options
<a href="https://technet.microsoft.com/en-us/library/bb310786(v=exchg.150).aspx" target="_blank">https://technet.microsoft.com/en-us/library/bb310786(v=exchg.150).aspx</a>
操作单个用户,直接使用命令Set-mailuser –identity yangfanit –UseMapiRichTextFormat Never 即可完成设置。
<a href="http://s3.51cto.com/wyfs02/M02/8A/DA/wKiom1g9PX7gGtIvAAByUv1fZAQ771.png" target="_blank"></a>
问题描述:
============================================
Exchange 2016邮箱用户给contoso.local的coremail用户发送邮件后,coremail邮箱用户收到邮件后,使用非Outlook客户端查看邮件时显示为winmail.dat格式。
原因分析:
===============================================
解决方法:
操作方法如下:
1、 操作单个用户,直接使用命令Set-mailuser –identity test01 –UseMapiRichTextFormat Never 即可完成设置。
<a href="http://s3.51cto.com/wyfs02/M00/8A/DA/wKiom1g9PYDwSum_AAJCCGvLGsY875.png" target="_blank"></a>
2、 批量设置所有Mailuser的UseMapiRichTextFormat属性操作方法。使用如下脚本即可设置所有mailuser用户的属性UseMapiRichTextFormat值。
#输入Exchange 2016 Powershell连接URL
$ExchangeURI = 'http://CASFQDN.contoso.com/powershell/'
$s=New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri $ExchangeURI -Authentication Kerberos -Name 'ExchangeSession'
Import-PSSession $s
Get-MailUser -ResultSize unlimited | Set-MailUser -UseMapiRichTextFormat never
$error | Out-File "c:\scripts\error.txt" -Force -noclobber
Remove-PSSession $s
操作过程:
1)、服务器CAS01.cotoso.com的C盘ExchangeScripts上有一个脚本文件Set-mailuserUseMapiRichTextFormat。
<a href="http://s3.51cto.com/wyfs02/M01/8A/DA/wKiom1g9PYKi_5ASAAJjZ8xonnI383.png" target="_blank"></a>
2)、运行脚本Set-mailuserUseMapiRichTextFormat。
<a href="http://s3.51cto.com/wyfs02/M02/8A/DA/wKiom1g9PYXR-sH9AANjqEIyCno668.png" target="_blank"></a>
3)、脚本运行完成后,如果执行过程中有问题,那么会记录在error.txt文件中。
<a href="http://s3.51cto.com/wyfs02/M00/8A/DA/wKiom1g9PYzglOGTAAD2XXrwRGU555.png" target="_blank"></a>
本文转自 jialt 51CTO博客,原文链接:http://blog.51cto.com/jialt/1877795