Actions for attachment file types: Difference between revisions

From MozillaZine Knowledge Base
Jump to navigationJump to search
m (lightning issues (.ics attachments))
(added application/octet-stream secion)
 
Line 58: Line 58:
# Delete mimeTypes.rdf from your Thunderbird [[profile folder]].
# Delete mimeTypes.rdf from your Thunderbird [[profile folder]].
# Restart Thunderbird to see if the problem has been fixed.
# Restart Thunderbird to see if the problem has been fixed.
===application/octet-stream===
The Content-Type: header for the attachment specifies what type file it is. For example Content-Type: image/jpeg means its a jpeg image file. You may run into an attachment where it is set to application/octet-stream, which will probably cause problems because that means its generic 8bit binary data not associated with any application.
It is supposed to be set to that if the [https://en.wikipedia.org/wiki/MIME MIME] type (content type) is not recognized. This could occur as a side effect of the sender downloading the file using a browser that didn't properly recognize the MIME type. If that happened and they sent it as an attachment the senders email client would not automatically detect and fix the problem. If you run into this problem replacing the mimetypes.rdf file will not help as the problem is with the message you got. You could edit  the Content-Type header using an add-on such as [https://addons.mozilla.org/en-US/thunderbird/addon/header-tools-lite/ Header Tools Lite]. However, it might be simplest to configure Thunderbird to open any application/octet-stream attachment with a view utility that relies upon the file extension to decide what type of file it is.


===Hacking Thunderbird's settings===
===Hacking Thunderbird's settings===

Latest revision as of 22:29, 20 August 2017

When you double-click on an attachment listed in the Attachments pane in Thunderbird, a dialog will open asking "What should Thunderbird do with this file?" The choices will be:

  • Open with: default application for handling this file type, or some other application
  • Save to Disk
  • Do this automatically for files like this from now on. [optional, for one of the two above choices]

If you select the "Do this automatically for files like this from now on" checkbox, Thunderbird will remember the action you chose for the specified file type (such as JPG image files), so that the dialog will be bypassed for future attachments of this file type in the future.

The Microsoft web site has free viewers for most Office file types. If you can't find a utility to open an attachment with a specific file type on your favorite shareware/download site try OpenWith.org.

Changing the settings for attachment-handling actions

In "Tools -> Options -> Attachments", there are options panels for "Attachments Folder" and "Download Actions".

"Attachments Folder" settings

This simply allows you to set a default folder for saving attachments, so that you do not need to manually select a folder every time you save an attachment by double-clicking on it. It will not automatically save attachments in incoming messages to the specified folder without user intervention.

"Download Actions" settings

Despite what the labelling in this panel might suggest (it says "Thunderbird can automatically save or open attachments of certain types"), these settings simply allow you to change the save/open actions that will be performed when you double-click on an attachment of a specified file type. Changing these settings will not allow save/open actions to be performed automatically for attachments in incoming messages without user intervention. For instance, if you previously used the "Do this automatically for files like this from now on" checkbox to have Thunderbird always open ".doc" attachments with Word, you can undo that file-handling association by clicking on the "DOC" file type and clicking the "Remove Action" button.

To add a download action to this list, open an e-mail that has an attachment of the type you want to add, or write a new e-mail and attach a file of the type that you want to add. Open the attachment and choose how you want Thunderbird to open it. Check the box "Do this automatically for files like this from now on".

The MIME Edit extension adds a Tools -> MIME Edit -> Edit menu command that does everything (except for searching) that the download actions window does, plus it lets you create a entry. It can be very useful if you get a bad setting due to opening an attachment that has the wrong MIME type definition, acknowledged "do this from now on for all attachments of that type" and it replaced the good entry with a bad entry.

Troubleshooting

Unexpected handling of certain attachments

Some mail programs send attachments with the wrong content type. This can make Thunderbird handle an attachment in an unexpected way when you try to open it.

To check the content type of an attachment, select the e-mail in a folder but do not open the e-mail. From the menu bar choose View -> Message Source. Find the Content-Type header that names the attachment. Note that there might be many Content-Type headers in the message, so you must be careful to find the one that applies to the attachment you are investigating. A Content-Type header looks like:

Content-Type: application/pdf;
 name="test.pdf"

Thunderbird uses the content type to decide what to do with the file. If the content type is unhelpful, then Thunderbird uses the file name extension to decide what to do with the file. If the content type does not match the file name extension, then Thunderbird might not handle the file in the way you expect. You might have to save the file so that you can open it in the way you want.

"Do this automatically..." checkbox disabled

Some mail programs send attachments with a nonspecific content type: application/octet-stream or application/x-msdownload. These content types can apply to various different types of file. Therefore the box "Do this automatically for files like this from now on" is disabled.

To work around this, ensure that Thunderbird's attachment-handling action for the file name extension is not the system default application. Instead, change it to specify the actual application.

If that doesn't help, send yourself an e-mail to which you manually attached a file with this file name extension. (Do not forward an email whose attachment caused the box to be disabled.) Then open the attachment and choose how you want Thunderbird to open it. Check the box "Do this automatically for files like this from now on".

Note:  Another workaround is to set your operating system to handle these nonspecific content types using some application. This is not usually a good idea, because these nonspecific content types can apply to various different types of file.

Another way to get the checkbox enabled, if you know the correct content type, is doing following:

  • Save mail to disk
  • Open saved mail in text editor
  • Change "application/octet-stream" to the specific content type associated with the attachment's file extension.
  • Save changes and close text editor
  • Open saved mail in Thunderbird
  • "Do this automatically..." should now be enabled

"Open with" choice disabled

Thunderbird disables the "Open with" choice in the "What should Thunderbird do with this file?" dialog box if the attached file seems to be executable (a program). This is because an executable file in an e-mail might contain malicious code. If you are sure you want to run the program, save it and then run it.

Removing all the settings for attachment-handling actions

If Thunderbird doesn't seem to be performing attachment-handling actions as it should, or if certain options are grayed out (not selectable) when they shouldn't be, and you can't resolve the issue as described above, it could be due to a corrupted "mimeTypes.rdf" file. Thunderbird uses this file to store your file-handling preferences for specified file types. Deleting it sometimes cures the problem. To do so:

  1. Exit Thunderbird if it is running.
  2. Recommended: make a temporary backup of your Thunderbird profile (or at least of the mimeTypes.rdf file).
  3. Delete mimeTypes.rdf from your Thunderbird profile folder.
  4. Restart Thunderbird to see if the problem has been fixed.

application/octet-stream

The Content-Type: header for the attachment specifies what type file it is. For example Content-Type: image/jpeg means its a jpeg image file. You may run into an attachment where it is set to application/octet-stream, which will probably cause problems because that means its generic 8bit binary data not associated with any application.

It is supposed to be set to that if the MIME type (content type) is not recognized. This could occur as a side effect of the sender downloading the file using a browser that didn't properly recognize the MIME type. If that happened and they sent it as an attachment the senders email client would not automatically detect and fix the problem. If you run into this problem replacing the mimetypes.rdf file will not help as the problem is with the message you got. You could edit the Content-Type header using an add-on such as Header Tools Lite. However, it might be simplest to configure Thunderbird to open any application/octet-stream attachment with a view utility that relies upon the file extension to decide what type of file it is.

Hacking Thunderbird's settings

Advanced users may be able to resolve some issues by opening mimeTypes.rdf with a text editor such as Notepad and manually editing the file.

Lightning related issues

There is no support for configuring Thunderbird to open a .ics file by double clicking on it. It also doesn't generate an error message. This is a known bug. Try holding down the control key while dragging the attachment to the events pane. [1]

Mac-related issues

Apple Mac computers send attachments in a special format (described in RFC 1740). Thunderbird can normally decode these Mac-encoded attachments.

If you do not use a Mac, and you receive attachments from a Mac user, then you might see extra attachments that you cannot open. You can ignore these extra attachments, because they contain data that is only useful on a Mac.

If you use an Intel Mac, then there are known bugs in the handling of Mac-encoded attachments—see, for example: bug 361401 and related bugs.

If a Mac user sends a file without a file extension as an attachment, Apple Mail doesn't use its knowledge of the file to create a Content-Type for it, it just sends Content-Type: application/octet-stream. As described above, when Thunderbird receives attachments without a file extension or a content-type, it doesn't know what to do with the attachment and has to prompt you.

Alternative approach

Thunderbird normally calls the appropriate viewer based on the MIME type in the Content-Type header, regardless of the attachments file extension. The Download Actions table displays the MIME type as a file type. A MIME type of application/pdf is displayed as PDF document for example. The OpenAttachmentByExtension extension provides an alternative approach. Its meant for users who frequently receive messages whose attachments either have the wrong MIME type, or no MIME type. The extension ignores the MIME type and selects the viewer based on the file extension (including no file extension). It also provides the option to specify additional command line arguments when launching the viewer.

The extension doesn't provide a GUI to specify what action should occur. You need to specify the actions by modifying Thunderbirds preferences . See the extension's readme.txt for more details. It is generally safer to use the MIME type (Thunderbird's default behavior) to select a viewer than the file extension.

See also

External links

  • The Attachment Extractor extension lets you extract the attachments for multiple messages in one step.
  • The Attachment Reminder extension reminds you if it finds certain words and no attachments.
  • The Attachments Viewer extension uses the Gloda (Global Search) database to add a tab to view attachments in your account.
  • The MIME Edit extension lets you add a new action, it is not limited to just editing and deleting existing actions. (removed)
  • List of registered MIME types at the Internet Assigned Numbers Authority (IANA)
  • The OrderAtt extension lets you reorder an attachment list.
  • The ViewSourceWith extension adds a "open with" command to let you view attachments or the message source using other applications.
  • Bug report requesting support for copying and pasting attachments