Closed Bug 153930 Opened 23 years ago Closed 16 years ago

Attachments without suffix are given MIME type application/x-java-vm

Categories

(MailNews Core :: MIME, defect)

defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: thomas.z.bauer, Unassigned)

References

(Depends on 1 open bug)

Details

(Keywords: fixedOEM)

Attachments

(1 obsolete file)

For java runtime environment plugin versions 1.3.1 as well as 1.4.1, mail attachments without suffix are given the wrong MIME type. E.g., if I send somebody a Makefile in an attachment of a mail, the Makefile gets MIME type application/x-java-vm. If the user double-clicks on such a file, mozilla crashes. I am, however, not sure wether this is a problem of mozilla, or of the JRE plugins themselves.
QA Contact: gayatri → trix
I just sent an mbox file to an abuse department (content was a virus). Due to the absurd content-type the did not want to open it;-) IOW: Yes, it is a bug and it sucks. If Mozilla cannot determine what a file is it should ask. pi
Status: UNCONFIRMED → NEW
Ever confirmed: true
See also bug 141826: mail attachment with mime application/x-java-vm crashes.
OS: Linux → All
Hardware: PC → All
Attached patch patch for review (obsolete) — Splinter Review
When add attatchment, Composer first determine its type by look at its extension. It call mime service GetTypeFromExtension(). The problem is that the function do not consider the case that the extension is "". Please refer to nsExternalHelperAppService.cpp, nsExternalHelperAppService::GetTypeFromExtension(). In GetTypeFromExtension(), it will search the plugin list, and check extension list of each type. Don't know why, the java plugin's mExtensionArray[] has a "", it will thus mistakenly think "" is a plugin type. Thus when no extension exist should not call the function. And the type of the attachment can be determined later, when reading the data of the attachment, in OnDataAvailable(), UnknownDecoder::DetermineContentType() be called. The patch has passed jst-review-simulacrum.
Keywords: review
I have tested it on solaris and windows. After the patch: Attach a binary file without extension, the mime type is application/octet-stream. Attach a text file without extension, the attachment will be regard as txt file.
I have tested it on solaris and windows. After the patch: Attach a binary file without extension, the mime type is application/octet-stream. Attach a text file without extension, the attachment will be regard as txt file.
Keywords: patch
Great job! Thanks for the patch.
Status: NEW → ASSIGNED
Whiteboard: Have fix
Target Milestone: --- → mozilla1.2alpha
Comment on attachment 95846 [details] [diff] [review] patch for review R=ducarroz
Attachment #95846 - Flags: review+
Comment on attachment 95846 [details] [diff] [review] patch for review sr=bienvenu
Attachment #95846 - Flags: superreview+
Fix checked in the trunk. Thanks Yuedong Du for providing the patch.
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Thanks to all, the bug is removed in nightly build 2002082122.
Whiteboard: Have fix → Have fix, branchOEM+
Blocks: 18687
martinl@netscape.com has checked this patch into OEM branch on 8/26. Mark 'fixedOEM'. martinl, if something wrong, correct me.
Whiteboard: Have fix, branchOEM+ → Have fix, branchOEM+, fixedOEM
The fix did not make it into 1.1 release. So it should go into 1.11 if this will be. pi
Fix works in Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.1b) Gecko/20020828. pi
This bug exists on the 1.0 branch as well. The fix here seems conservative and prevents a crash.
Keywords: reviewfixedOEM
Whiteboard: Have fix, branchOEM+, fixedOEM
changing qa contact to yulian
QA Contact: trix → yulian
*** Bug 178599 has been marked as a duplicate of this bug. ***
As a note, this code should just not use GetFromExtension and use GetFromURI instead, since it has a URI. Then the MIME service would properly handle all the issues like empty extension and such....
I reopen this bug to implement new suggestion...
Status: RESOLVED → REOPENED
Resolution: FIXED → ---
Target Milestone: mozilla1.2alpha → mozilla1.3alpha
Target Milestone: mozilla1.3alpha → Future
QA Contact: yulian → stephend
Product: MailNews → Core
Comment on attachment 95846 [details] [diff] [review] patch for review mozilla/mailnews/compose/src/nsMsgSend.cpp 1.313
Attachment #95846 - Attachment is obsolete: true
Assignee: ducarroz → nobody
Status: REOPENED → NEW
QA Contact: stephend → mime
Product: Core → MailNews Core
(In reply to comment #19) > (From update of attachment 95846 [details] [diff] [review]) > mozilla/mailnews/compose/src/nsMsgSend.cpp 1.313 > Timeless did your last comment meant the bug was fixed ?
Depends on: 483352
No, he meant that the original patch was in fact checked in a couple of years before that comment, probably adding that comment as part of some sweep looking for reviewed patches that hadn't ever been checked in. However, comment 17, for which this was then reopened, isn't so straightforward a decision, so I filed bug 483352 for deciding whether the simplicity is worth dropping the "rename changes the mime-type we send" feature.
Status: NEW → RESOLVED
Closed: 23 years ago16 years ago
Resolution: --- → FIXED
Target Milestone: Future → ---
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: