Attachments renamed

From MozillaZine Knowledge Base
Jump to navigationJump to search
This article was written for Thunderbird but also applies to Mozilla Suite / SeaMonkey (though some menu sequences may differ).

Sometimes attachments sent using Thunderbird 1.5 are renamed as .DAT or .BIN files when viewed using Eudora, Hotmail, Netscape webmail, Outlook or Outlook Express. They are displayed correctly in Thunderbird. The problem was fixed in Thunderbird 2 but the fix was not included in Its also possible it might break again.

This problem appears to occur only when the filename exceeds 64 bytes. This includes filenames that are less than 64 characters but are longer than 64 bytes due to Unicode or multibyte characters . For example, View ->Message Source shows the headers for a Microsoft Word attachment called "Nový objekt - Dokument aplikace Microsoft Word.doc" (in Czech) sent using two versions of Thunderbird:

Thunderbird 1.0.7 (no problem)
Content-Type: application/msword;
Content-Transfer-Encoding: base64
Content-Disposition: inline;

Thunderbird 1.5: (has the problem)
Content-Type: application/msword;
Content-Transfer-Encoding: base64
Content-Disposition: inline;

The problem is caused by "name" and "filename" being replaced by multiple parameters. This is due to Thunderbird switching from RFC2047 to RFC2231 (a newer standard) for attachment filename handling. Outlook supports RFC2047 (the older standard).

This problem can be worked around by setting the preference mail.strictly_mime.parm_folding to either 0 or 1 to use RFC2047 [1]. It defaults to 2 (RFC2231) in 1.5.x and 3 (RFC2231, but name param is encoded by RFC2047) with

You could either add the following to prefs.js in your profile folder

user_pref("mail.strictly_mime.parm_folding", 0);

or use Tools -> Options -> Advanced -> General -> Config Editor, type mail.strictly_mime.parm_folding in the Filter:, and then double click on the 2 and change it to 0.

Other reasons

The recipients firewall might have renamed the file extension. File Extension Details for .ZL5 describes how ZoneAlarm Mailsafe renames a .cmd file to use .zl5 for example.

This can also happen with Gmail IMAP accounts, if the file name contains non-ASCII characters. Gmail's IMAP server does not correctly encode the header values. See Gmail IMAP quirks for a workaround.

See also

External links