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