PDF file with mime-type application/octet-stream is opened inline in SeaMonkey 2.x

RESOLVED WORKSFORME

Status

SeaMonkey
MailNews: Message Display
RESOLVED WORKSFORME
7 years ago
3 years ago

People

(Reporter: michal.gust, Unassigned, NeedInfo)

Tracking

SeaMonkey 2.2 Branch

Firefox Tracking Flags

(Not tracked)

Details

Attachments

(1 attachment)

(Reporter)

Description

7 years ago
User-Agent:       Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110608 Firefox/4.0.1 SeaMonkey/2.1
Build Identifier: Mozilla/5.0 (Windows NT 5.1; rv:2.0.1) Gecko/20110608 Firefox/4.0.1 SeaMonkey/2.1

I recently upgraded from SeaMonkey 2.0.12 to 2.1. PDF attachments were displayed correctly always in 2.0.12 (file with PDF icon not opened inline) but are displayed with wrong icon and binary text is opened inline for application/octet-stream mime-type since upgrade. Attachment file is still displayed correctly for application/pdf mime-type. PDF content is displayed correctly if file is opened for both mime-types.

Reproducible: Always

Steps to Reproduce:
Open email with pdf file attachment that has application/octet-stream mime-type
in SM 2.1.

Actual Results:  
Attachment is displayed with wrong icon and PDF file is opened inline as binary text.

Expected Results:  
Attachment should be treated same way as for application/pdf mime-type - e.g. PDF icon displayed and not opened inline.

mimeTypes.rdf file contained just one (default/dummy?) definition in older versions. It contains many definitions in current 2.1 version. I suspect there is missing proper definition for pdf file extension if application/octet-stream mime-type is used.

I don't understand well structure of the file but I think similarly to mimetype:text/html definition 

  <RDF:Description RDF:about="urn:mimetype:application/octetstream"
                   NC:fileExtensions="avi"
                   NC:description="Videoklip"
                   NC:value="application/octetstream"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/octetstream"/>
  </RDF:Description>

probably should be modified this way

  <RDF:Description RDF:about="urn:mimetype:application/octetstream"
                   NC:fileExtensions="avi"
                   NC:fileExtensions="pdf"
                   NC:description=""
                   NC:value="application/octetstream"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/octetstream"/>
  </RDF:Description>
(Reporter)

Updated

7 years ago
Version: unspecified → SeaMonkey 2.1 Branch
(Reporter)

Comment 1

7 years ago
I verified behavior of SM 2.2 - attachment still displayed incorrectly with wrong icon and inline as binary text - just icon has changed from something unspecified in 2.1 to SeaMonkey icon in 2.2.
Summary: PDF file with mime-type application/octet-stream is opened inline in SM2.1 → PDF file with mime-type application/octet-stream is opened inline in SeaMonkey 2.x
(Reporter)

Comment 2

7 years ago
I've tried proposed modification of urn:mimetype:application/octetstream in mimeTypes.rdf file to

  <RDF:Description RDF:about="urn:mimetype:application/octetstream"
                   NC:fileExtensions="avi"
                   NC:fileExtensions="pdf"
                   NC:description=""
                   NC:value="application/octetstream"
                   NC:editable="true">
    <NC:handlerProp RDF:resource="urn:mimetype:handler:application/octetstream"/>
  </RDF:Description>

and it corrects displaying of PDF attachments to expected one.
(Reporter)

Updated

7 years ago
Version: SeaMonkey 2.1 Branch → SeaMonkey 2.2 Branch

Comment 3

6 years ago
<RattyAway>	bienvenu: does the proposed fix in SeaMonkey Bug 665869 make sense?
<bienvenu>	RattyAway - it makes sense that it would work, but it's a big hack
<RattyAway>	bienvenu: any ideas as to something more elegant?
<bienvenu>	RattyAway - we should be looking at the file extension
RattyAway, iirc, the issue was that we ended up with an association for octetstream in the first place
<bienvenu>	RattyAway - and I thought I made a fix in TB to ignore asocations like that
<RattyAway>	bienvenu: so we have to do the same in SM?
<bienvenu>	RattyAway - my recollection was that it was in common code. Plus the symptom was very different...
in TB, the attachment icon just disappeared
<RattyAway>	Hmm ok thanks bienvenu

Comment 4

6 years ago
Created attachment 545260 [details]
Sample message with PDF attachment

I can't reproduce this problem using either SM 2.1 or 2.2 (on Windows 7) - both show the Adobe Reader icon (I have Adobe Reader X installed) in the attachment pane, and double clicking the PDF attachment opens it in a browser window (using the Adobe PDF plug-in).

Using fresh profiles with both SM versions, I don't find "mimeTypes.rdf" created.  In my personal profile "mimeTypes.rdf" does not contain any "application/octet-stream" occurrences.

I've also tried marking the attachment as:

Content-Type: application/octetstream

(no dash in "octetstream") - this caused "Open with/Save File" dialog to appear trying to open the attachment, but the icon in the Attachments pane was still o.k. and the file opened fine with Adobe Reader (as external application).

Updated

6 years ago
Attachment #545260 - Attachment mime type: application/octet-stream → message/rfc822

Comment 5

6 years ago
michal, could you confirm whether the attached mail works for you? If not could you try it with a new profile. If it does work, could you attach a test message that does fail?

Updated

6 years ago
Duplicate of this bug: 687455

Updated

6 years ago
Status: UNCONFIRMED → NEW
Ever confirmed: true
OS: Windows XP → All
Hardware: x86 → All

Comment 7

6 years ago
Tested against self built SM2.4, SM2.5 and SM2.6 from latest repos, all of which work (on Linux) but SM2.4beta2 downloaded fails.

Comment 8

6 years ago
With a new profile using SM2.4beta2 it does work too, so was a profile issue for me.

Comment 9

3 years ago
@Reporter:
So we can close this one?
Flags: needinfo?(michal.gust)

Comment 10

3 years ago
Seems so!

@Reporter: Please feel free to reopen this Bug if you still can reproduce with a current SeaMonkey version and a current OS.
Status: NEW → RESOLVED
Last Resolved: 3 years ago
Resolution: --- → WORKSFORME
You need to log in before you can comment on or make changes to this bug.