How to stop Office 365 sending those pesky winmail.dat attachments

Are your attachments breaking?
Are your attachments breaking?

If you have used Outlook for any length of time, you’ve probably heard of winmail.dat – you may not have seen it but someone you have sent a message to may have complained about not being able to open an attachment you sent.

Usually the people complaining are using something like Thunderbird, some weird webmail or the (god awful) Mac mail client.

In the words of Microsoft:

Do some of your users report that e-mail recipients in external domains can’t open their messages that contain a Winmail.dat attachment? If so, the recipients in the external domain are probably using an e-mail client that doesn’t support the Transport Neutral Encapsulation Format (TNEF). Microsoft Outlook is one of the few e-mail clients that support TNEF-encoded messages, although some third-party utilities can help convert Winmail.dat attachments.

They make it sound like Outlook supporting TNEF is a good thing, don’t they? When actually it’s a really bad thing that Exchange does!

If you use the Gmail web client you won’t notice these problems – Gmail automatically converts winmail.dat attachments. Clever Gmail.

If you use Thunderbird, you could use the LookOut add-on – it appears to work well.

Time to be a good corporate citizen

However, lets assume you’re using Office 365, your recipients have complained about winmail.dat attachments and, rather than pass the buck back to them, you want to do the right thing. So how do you stop these attachments going out?

Nerd Alert!There isn’t an easy way to do this on the web client. Like many things, we have to go down the yucky PowerShell route. So, assuming you haven’t used PowerShell with Office 365, you will need the following:

1) Download and install the Microsoft Online Services Sign-In Assistant for IT Professionals

2) Download and install the Microsoft Online Services Module (step 2)

3) Fire up PowerShell on your PC using “Run As Administrator”

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.com
Set-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/)

Follow me

Jonathan Gwyer

Jonathan Gwyer first delved into geekery with a ZX81 in 1981 and has been working in IT since 1990.

A Microsoft Certified Professional with many years of large corporate experience and training, he now focuses on helping small businesses make the most of their IT.
Follow me

Latest posts by Jonathan Gwyer (see all)

Copyright © 2008-2018 Jonathan Gwyer
Web Design by fairly marvellous Kent

How to stop Office 365 sending those pesky winmail.dat attachments

by Jonathan Gwyer time to read: 2 min
18