Open Bug 483352 Opened 16 years ago Updated 3 years ago

Consider using GetFromURI instead of GetFromExtension to get the mime-type of attachments in compose

Categories

(MailNews Core :: Composition, defect)

defect

Tracking

(Not tracked)

People

(Reporter: philor, Unassigned)

References

Details

In bug 153930 comment 17, bz said [[[ 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.... ]]] but sadly, we're never quite that simple. If you attach foo.quux, then right-click the attachment, and rename it to foo.baz, we're (intentionally) doing GetFromExtension("baz"). nsMsgComposeAndSend::AddCompFieldLocalAttachments is a couple hundred lines of pain and obscurity (the comment for the part where we use the extension off a rename is the Newspeak "//First try using the real file name" because after all the file has always been named AtWarWithEastasia.baz), so maybe dropping support for that is worth it. Personally, before I read the code I would have been more likely to rename an attachment based on what I thought the new name would do on the recipient's system than what changes I thought it would make to what I sent.
Removing myslef on all the bugs I'm cced on. Please NI me if you need something on MailNews Core bugs from me.
Severity: normal → S3
You need to log in before you can comment on or make changes to this bug.