Attachments converted to .dat files when sending from #Zarafa. Solved!

We recently investigated an odd issue whereby email attachments, sent using Zarafa Groupware, were being ‘mangled’ and received as .dat files.

It turned out that it’s not a bug in Zarafa Groupware, but a problem with old Outlook clients.

It’s known as the “RFC-2047 vs RFC-2231″ issue.

These RFC’s detail how filenames should be encoded in MIME format. The newer RFC-2231 ( ratified in 1997 !!) details how filenames should be encoded and long lines folded, and this is what Zarafa uses.

Exchange 2007 (and up) support RFC-2231, whereas Exchange 2003 (and below) is not able to understand the newer formatting. Dear knows why Microsoft haven’t patched the older versions 🙂

The new format kicks in if the attachment name exceeds 64 characters, which explains why some attachment filenames are OK and others are converted to ATTxxxx.dat. Because the old Outlook can’t understand the new formatting (when filename > 64 chars or international characters are used) it replaces the filename with the ATTxxx name.

To resolve this we have patched the MIME libraries to insert an old ( RFC-2047) encoded line as well as the correct RFC-2231 encoding.

There is one caveat however; some poorly engineered spam filters will strip out the old RFC encoded line! Inty’s Mail Defender does this. If you are sending to people who use this, then keep file names to less than 64 characters.


A properly encoded( RFC-2231) filename line:

name*0*=UTF-8”Updated%20-%20 Approaches %20to%20Major%20Markets%20-%20%20;name*1*=with%20some%20amends%2031st%20March%202014.docx

An old format ( RFC-2047) filename line would look like this:

name=”Updated – Approaches to Major Markets – with some amends 31st March 014.docx”

This entry was posted in Zarafa. Bookmark the permalink.

Leave a Reply