Closed Bug 221451 Opened 21 years ago Closed 21 years ago

Open With radio button frequently disabled when opening an attachment

Categories

(Thunderbird :: Mail Window Front End, defect)

x86
Windows XP
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED
Thunderbird0.4

People

(Reporter: mscott, Assigned: mscott)

References

Details

Attachments

(1 file)

With the new helper app dialog, thunderbird frequently gets in a state where the "Open With" radio button is both disabled and fails to show the appropriate application properly. I see this after installing OpenOffice on a machine that has never had MSWord on it. I then open a word document and I get this problem. BMS is also reporting this issue with PDF attachments.
Status: NEW → ASSIGNED
Target Milestone: --- → Thunderbird0.4
Blocks: bms
We detect that the attachment is of type octet/stream so we disable the open radio button and only enable the save button. In the octet/stream case we really need to look at the file extension. This is what we used to do with the old helper app dialog.
I've made this marginally better in 0.3 and in the trunk by taking the following fixes: Bug #143570 --> Allow assigning helper apps to mailnews attachments by extension and Bug #65827 --> File extension (.php) determined from Content-Type header (or url extension) overrides filename in Content-Disposition header. Now instead of showing application/octet in the helper app dialog when opening mail attachments, we show the correct mime type in the dialog (i.e. Microsoft Word Document). However the helper app dialog still uses an application/octet-stream mime info object and the security code in the dialog then disables the open radio button even though we have a valid helper app for the real mime type.
Blocks: 221542
Ok, I think I found the problem. It's with the new helper app dialog the birds use. initAppAndSaveToDiskValues does the following: // We don't let users open .exe files or random binary data directly // from the browser at the moment because of security concerns. var mimeType = this.mLauncher.MIMEInfo.MIMEType; if (mimeType == "application/octet-stream" || mimeType == "application/x-msdownload") { this.dialogElement("open").disabled = true; var openHandler = this.dialogElement("openHandler"); openHandler.disabled = true; openHandler.label = ""; modeGroup.selectedItem = this.dialogElement("save"); return; } We should never look directly at the content type when determining if we are going to block the open. We always need to look at the extension. This is how the old helper app dialog works. In fact the same code for disabling the open button is present in the new dialog too, it just has this extra blurb as well. I think the fix is to just remove these lines. We are already disabling the open with radio button in openWithDefaultOK which properly tests to see if the file is an executable.
Attached patch the fixSplinter Review
Attachment #132894 - Flags: superreview?(bugs)
Status: ASSIGNED → RESOLVED
Closed: 21 years ago
Resolution: --- → FIXED
Attachment #132894 - Flags: superreview?(bugs)
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: