Pro-Exchange,Lync & Office 365
Belgian Microsoft Unified Communications Professionals
Microsoft Exchange Server, Microsoft Lync Server & Office 365
Having fun with Mime types in Exchange 2010

When you migrate from Exchange 2003 to Exchange 2010 you may have some problems with xml attachments. Al of a sudden xml attachments are send as application/xml mime type instead of text/xml. In our case the application was specifically looking for text/xml, and thus wouldn’t detect the attachment.

You could solve this problem by creating a transport rule as you can see below.

clip_image001

  1. Select the conditions “from users that are inside or outside the organization” and ‘when the message header contains specific words”.
  2. Select the action '”set header with value”.
  3. Create the new transport rule.

To verify if the transport rule is working, you have to enable pipeline tracking on the HUB transport server. Now you can send a new message with a xml attachment to see if the transport rule changes the Content-Type.

In Exchange 2003 there was interface for editing and sorting these associations:

image

If you want to view the file type associations in Exchange 2010, you can do this with Exchange PowerShell by the following command:

Get-OrganizationConfig |fl MimeTypes”

Changing the MimeTypes with EMS\EMC is not possible however. You have to do this with ADSI edit but the attribute is decoded.

clip_image002

You can decode it with the following PowerShell script:

clear
$file = "C:\local\export.txt"
$num1 = ""74 65 78 74 2F 68 74 6D 6C 3B 68…"
$array += $num1.Split() | ForEach{[Convert]::ToInt32($_,16)} | ForEach{[Convert]::ToChar($_)}
foreach ($char in $array)
{
if ($char -eq ';')
{
$out+="`r`n"
}
else
{
$out+=$char
}
}
$out
Add-Content $file $out

Or buy the developer a beer and ask him to change his code, what is what we did in the end.

Note 1: post co-authored by Frederiek Goemaere and Koen Vermoesen, with input from Danny De Haan and Emmanuel Cambier
Note 2: cross-posted on both Pro-exchange and Xylos blogs.


Posted 01-09-2012 11:28 by Koen Vermoesen
Filed under: