Attachments renamed

From MozillaZine Knowledge Base
Jump to navigationJump to search
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
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 1.5.0.12. 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;
name="=?ISO-8859-2?Q?Nov=FD_objekt_-_Dokument_aplikace_Microsoft_Wo?==?ISO-8859-2?Q?rd=2Edoc?="
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename="=?ISO-8859-2?Q?Nov=FD_objekt_-_Dokument_aplikace_Microsoft_Wo?==?ISO-8859-2?Q?rd=2Edoc?="

Thunderbird 1.5: (has the problem)
Content-Type: application/msword;
name*0*=ISO-8859-2Nov%FD%20objekt%20-%20Dokument%20aplikace%20Microsoft
name*1*=%20Word.doc
Content-Transfer-Encoding: base64
Content-Disposition: inline;
filename*0*=ISO-8859-2Nov%FD%20objekt%20-%20Dokument%20aplikace%20Micros
filename*1*=oft%20Word.doc

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 2.0.0.6.

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