We were banging our head against the wall with the winmail.dat problem we have with an office 365 email account.
The solution is to hack the Office 365 server with regards to the Transport Neutral Encapsulation Format (TNEF) format.
This article describes how Microsoft Office 365 admins can change the message format so that messages that are sent from Office 365 users to external recipients don’t contain the Winmail.dat attachment.
By default, email messages that are sent from Exchange Online in Office 365 use the Transport Neutral Encapsulation Format (TNEF) format. Messaging systems that aren’t based on Microsoft Exchange may be unable to interpret messages that use this rich text format. If the recipient’s messaging system can’t process this format, a file attachment that’s called Winmail.dat is added to the message.
Office 365 admins can use Windows PowerShell to change the message format to prevent the Winmail.dat attachment from being sent to external recipients.
You will need to paste in the following commands:
$Session = New-PSSession -ConfigurationName Microsoft.Exchange -ConnectionUri https://outlook.office365.com/powershell/ -Credential $LiveCred -Authentication Basic –AllowRedirection Import-PSSession $Session Set-RemoteDomain Default -TNEFEnabled $false
The first line asks for your Office 365 (admin account, please!) username and password and connects you to the service.
Line 2 imports the commands you are going to need.
Line 3 prevents TNEF messages being sent outside of your domain.
Setting it to anywhere outside of your domain is a slightly broad brush-stroke, but it does reduce the overhead of having to keep going back and fix it for each domain you discover that cannot cope. But if you really wanted to only disable TNEF for specific domains, you can:
New-RemoteDomain -Name Awkward -DomainName awkward.comSet-RemoteDomain Awkward -TNEFEnabled $false
In the first line you define your awkward domain, in the second you prevent TNEF messages going to it.
Is there a bigger hammer?
Yes, but while it’s a big hammer it’s also nice and sharply targeted…
Set-MailContact <ExternalEmailAddress or GUID> -UseMapiRichTextFormat Never
…will set mail sent to ExternalEmailAddress to always be sent plain text – no formatting at all.
Like stepping back in time.
Some might say a happier time, when people cared about the amount of bandwidth they used, didn’t send huge attachments and didn’t expect everyone to be using Outlook.
Some might say that, not me of course! I’m just thinking it…
(Updated 2014 to change -ConnectionUri from https://ps.outlook.com/powershell/ to https://outlook.office365.com/powershell/)
Source with thanks : http://www.deargeek.co.uk/2013/11/how-to-stop-office-365-sending-those-pesky-winmail-dat-attachments
Other sources :https://support.microsoft.com/en-au/kb/2487954