Winmail.dat issues when using an SMTP Proxy
by Brian on Mar.17, 2014, under Computer Stuff, Windows Info
I’ve run into this a couple times recently after clients have been migrated to Office 365. Office 365 by default sends messages in the Transport Neutral Encapsulation Format (TNEF) format. This is a rich text format and some email servers aren’t able to interpret it, and will therefore replace attachments with winmail.dat files (very common with clients on Macs). The fix is to use PowerShell to change disable TNEF. There is a TechNet article that shows you how to disable TNEF for when sending to specific domains or email addresses, but in my opinion that’s not acceptable for a client because they will need to contact us to have it changed every single time they encounter someone who cannot receive attachments from them. The fix is to connect to Office 365 via PowerShell and then do one of the following…
Option 1: Disable for Specific Domain (example uses wyldehare.com as the domain you are sending to)
1. New-RemoteDomain -DomainName wyldehare.com -Name WyldeHare
2. Set-RemoteDomain -Identity WyldeHare -TNEFEnabled $false
3. Get-RemoteDomain -Identity WyldeHare| Select TNEFEnabled (This step just confirms that the change was accepted – should show you “false” for the output.)
Option 2: Disable for Specific Email Address
1. No point in doing this since the email server is usually what causes this.
Option 3: Disable Globally (recommended)
1. Set-RemoteDomain Default -TNEFEnabled $false
2. Get-RemoteDomain -Identity Default| Select TNEFEnabled (This step just confirms that the change was accepted – should show you “false” for the output.)
The change does not take immediately. I have not seen it documented anywhere, but I do know it doesn’t take place immediately. I had a client test this right after I made the change and it didn’t work, so I had them try again in the morning and it worked. I would guess at somewhere between 15 minutes and a few hours.
We’ve also run into some issues recently where users have been receiving winmail.dat attachments. This is usually caused in cases where the client has the SMTP proxy enabled on their WatchGuard. By default, the SMTP proxy strips some of the headers out of the email that identify it as a Rich Text Formatted email. If the email client does not have the header information needed to interpret the winmail.dat attachment, the email client cannot display the proper formatting of the email, and incorrectly displays the attachment as a winmail.dat file. To resolve, do the following…
- Start Policy Manager for your XTM device.
- Double-click the SMTP-Proxy used for inbound email.
Or, right-click the SMTP-proxy and select Modify Policy.
The New/Edit Policy dialog box appears with the Policy tab selected. - Adjacent to the Proxy action drop-down list, click View/Edit Proxy.
The SMTP Proxy Action Configuration dialog box appears. - From the Categories tree, select Headers.
- In the Pattern text box, type each of these patterns and click Add to add them to the Rules list.
- X-MS-Has-Attach:*
- X-MS-TNEF-Correlator:*
- X-MimeOLE:*
- From the If matched drop-down list, select Allow.
- From the Categories tree, select Content Types.
- In the Pattern text box, type application/ms-tnef and click Add.
The pattern appears in the Rules list. - From the If matched drop-down list, select Allow.
- From the Categories tree, select Filenames.
- In the Pattern text box, type winmail.dat and click Remove.
The winmail.dat pattern is removed from the Rules list. - From the None matched drop-down list, select Allow.
Now, having said that, we had a client *not* using the SMTP proxy have a similar issue. This client has Securence for SPAM filtering and there is a feature you can enable within Securence that attempts to extract the contents of Winmail.dat when necessary. To enable, go to Settings -> Filters -> Winmail.dat Extraction.