Thunderbird uses wrong attachment mime type on Windows Vista

3

2

Thunderbird running on Windows Vista has usually sent Microsoft Word documents as mime type application/msword, which as I understand is correct. However, now it has suddenly decided to send Word documents as mime type text/richtext, which creates a big problem as a recipient client may interpret the message as displayable inline - which in fact just creates garbage on the screen as it cannot handle direct display of Word documents. At least Thunderbird itself as a recipient does this, but I'd imagine other clients might as well.

As far as I can understand, Thunderbird picks up the mime type of the attachment from the operating system, instead of determining it by itself. This would suggest that something might be wrong with how Vista assigns mime types. However, I coudn't find a way to adjust on Vista how mime types are determined - only file type setting seems to be about which program opens them. However, this seems to be in order, since in registry HKEY_CLASSES_ROOT\.doc does contain the correct mime type - and in fact, the string text/richtext is nowhere to be found in registry.

It's also worth mentioning that other file types do still get their correct mime type.

How do I force Thunderbird to use the correct application/msword mime type for Microsoft Word document attachments (when sending email)?

Or: How do I determine what mime types are assigned to different file types on Windows Vista?

Or: How do I troubleshoot this issue further? (For example by determining if the problem is with Vista providing the wrong mime type for Thunderbird, or with Thunderbird not accepting what vista provides?)

Here's a sample of the failed attachment header:

Content-Type: text/richtext; name="Foo Bar.doc"    
Content-Description: Foo Bar.doc    
Content-Disposition: attachment;    
 filename="Foo Bar.doc"; size=85056;    
 creation-date="Thu, 17 Sep 2009 11:14:20 GMT";    
 modification-date="Thu, 17 Sep 2009 11:14:20 GMT"    
Content-Transfer-Encoding: base64

The problem now has a solution. The immediate cause of the problem turned out to be mimeTypes.rdf. The problem was caused by (and can be duplicated by adding) the following section in the file:

<RDF:Seq RDF:about="urn:mimetypes:root">
  <RDF:li RDF:resource="urn:mimetype:text/richtext"/>
</RDF:Seq>
<RDF:Description RDF:about="urn:mimetype:text/richtext"
                 NC:value="text/richtext"
                 NC:editable="true"
                 NC:fileExtensions="doc"
                 NC:description="Microsoft Office Word 97 - 2003">
  <NC:handlerProp RDF:resource="urn:mimetype:handler:text/richtext"/>
</RDF:Description>

Ilari Kajaste

Posted 2009-09-17T09:47:22.983

Reputation: 3 282

1

It's worth noting that Thunderbird/Firefox do use a sophisticated mime type related machinery independent from the operating system (OS). Consequently I would think that your issue is not caused by the OS (hence might not be specific to Vista, or even Windows), though the OS mime type settings might still influence initial handling of attachments once Thunderbird/Firefox encounter a mime type for the first time. See my answer too (http://superuser.com/questions/42545/thunderbird-uses-wrong-attachment-mime-type-on-windows-vista/46107#46107).

– Steffen Opel – 2009-09-24T09:21:26.760

Are things different when you send plain-text messages with Word attachments (compared to sending Rich Text/HTML messages, with the very same attachments)? (And if things are different: maybe you changed the way you compose messages?) – Arjan – 2009-09-24T10:05:40.117

@Arjan: Switching between HTML/plaintext modes and back did not affect the problem. – Ilari Kajaste – 2009-09-24T10:22:36.543

@Ilari: thanks much for the detailed follow ups to your question as well as my answer - highly appreciated by everyone encountering this problem! – Steffen Opel – 2009-09-24T13:26:15.100

Answers

4

Interesting issue. Upfront it's worth noting that text/richtext is an e-mail related mime type obsoleted by text/enriched and entirely unrelated to application/rtf, see Wikipedia about Enriched text:

Enriched text is a formatted text format for e-mail, defined by the IETF in RFC 1896 and associated with the text/enriched MIME type.
[...]
A predecessor of this text/enriched MIME type was called text/richtext in RFC 1341 and RFC 1521. Neither should be confused with Rich Text Format (MIME type text/rtf or application/rtf) which is an entirely different specification, devised by Microsoft.

The only clue I could find is targeting Horde/IMP via Firefox, but seems to address the same problem, see Word attachment file problem:

You might have received some document which is in rich text format. You might have opened it using Microsoft word and this has resulted in adding a mime-type called 'text/richtext' with its supporting application as MS-word in your browser setting. Subsequently, when you attach any word document, the browser is identifying any attached word document as 'text/richtext' type instead of 'application/msword'.

Due to Firefox and Thunderbird sharing much code this might well apply to Thunderbird too.

How do I force Thunderbird to use the correct application/msword mime type for Microsoft Word document attachments (when sending email)?

Why this is happening has apparently not been finally resolved, however, the temporary solution offered by the poster should apply too, as Thunderbird is using mimeTypes.rdf also. However, before applying the drastic measure to simply delete this file from your Thunderbird user profile and restart Thunderbird (which will likely restore the default file), I'd try to investigate this further to avoid loosing deliberate changes to Download Actions:

  • First you should have a look into your Thunderbird settings:
    Under Tools->Options->Attachments->Download Actions you'll find the user configured mime type related actions per file extension as stored in mimeTypes.rdf (i.e. just those different from default settings I guess). In principle the changed setting regarding Word documents should manifest itself there (though given the circumstances it might as well be some implied specialty or even a bug).
  • In case this doesn't yield a result you could still peak into mimeTypes.rdf and try to figure out which particular setting is wrong, if any.

Whether avoiding the simple deletion of mimetypes.rdf like so is worth the trouble depends on your situation of course.

Steffen Opel

Posted 2009-09-17T09:47:22.983

Reputation: 2 755

Even more confusing: there's also text/rtf which according to Wikipedia is for Microsoft's RTF. However, http://www.fileformat.info/info/mimetype/text/rtf refers to something different than the RTF as mentioned in http://www.fileformat.info/info/mimetype/application/rtf

– Arjan – 2009-09-24T09:37:20.003

The culprit here was the mimeTypes.rdf. It contained a definition for text/richtext that associated with the file extension doc. Deleting the file (or poking around with it) fixed the problem! Of course, out of curiosity, I would love to know what exactly had happened to it, what was the cause here - but the main thing is that Thunderbird is again working as it should. – Ilari Kajaste – 2009-09-24T10:27:51.010

For the record, "Download Actions" was empty, and adding an association to DOC there did not affect the issue. – Ilari Kajaste – 2009-09-24T10:29:39.070

For the record, I'm not able to duplicate the sending problem by simply opening a doc attachment which I've intentionally sent with wrong header text/richtext. However if I tell Thunderbird to "always perform this action" when I open the file, this does cause Thunderbird to use the the same wrong mime type when sending doc files. However, this condition is fixable by simple removing the bad entry from Tools->Options->Attachments->Download Actions, as described - in my initial problem the list was empty. – Ilari Kajaste – 2009-09-24T11:36:47.157

@Arjan: thanks much for updating Wikipedia and my answer in turn - I stumbled myself at first read, your edits removed the possible confusion! – Steffen Opel – 2009-09-24T12:48:12.507

1

I think Thunderbird should just use the Windows MIME type associations. Is it possible some antisocial program has scribbled over the associations for .doc?

I'm not sure it's possible to see the MIME type associations in the UI in Vista, but the information should still be there in the registry. Check the key HKEY_CLASSES_ROOT\.doc in regedit and see what the ‘Content Type’ value on the right is.

bobince

Posted 2009-09-17T09:47:22.983

Reputation: 8 816

Ah, ok. regedit is UI enough. :) But no, .doc was set correctly to application/msword, as was even .rtf. And in fact the string text/richtext was not found anywhere on registry! So it's looking more like a Thunderbird problem, I guess... – Ilari Kajaste – 2009-09-17T10:37:49.557

1

Even Thunderbird 17.0.2 has a mimetypes.rdf-problem. As in my case it can't and won't start the proper application textmaker.exe for my *.tmd-attachments. A guy named hooks prompted a very well working workaround in a softmaker-forum.

This workaround runs perfectly on Windows 7 Ultimate and Vista Home.

The workaround comes with this addon.

Install it, configure it, work with it!

bert wiedmann

Posted 2009-09-17T09:47:22.983

Reputation: 11

1

I suppoert Ilari's view that this is not a Windows registry problem, as I encounter it on linux, too (Xubuntu 9.10; Thunderbird 2.0.0.23). Here, too, the line in mimeTypes.rdf that links .doc to text/richtext has to be deleted, then everything works fine.

user22616

Posted 2009-09-17T09:47:22.983

Reputation: