Closed Bug 81751 Opened 24 years ago Closed 24 years ago

when attaching multipart web pages to a piece of email only final part should be attached

Categories

(MailNews Core :: Composition, defect, P2)

x86
All
defect

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.2

People

(Reporter: blizzard, Assigned: bugzilla)

Details

(Whiteboard: [nsbeta1+])

Attachments

(3 files)

When you attach a multipart web page to an email message it's attached as the entire multipart message instead of just the final part. A good way to reproduce this is to attach a bugzilla query. Instead of the resulting html that is the bug list it attaches the entire query. This isn't what 4.x does. This is a spinoff of bug 81682.
Whiteboard: want for mozilla 0.9.1
Keywords: 4xp
yes, 4.x correctly attach the last part of the CGI response.
Status: NEW → ASSIGNED
What are the odds of seeing this in 0.9.1? It's been bugging the hell out of me for a while now.
where can I find specs about http multiparts? What the rules? I presume should be like mime! Does the separator is always the same?
When I fetch a URL, I receive a content type, so far we are doing nothing with it. For regular web page, the content type is text/html but in case of a bugzilla query, it's multipart/x-mixed-replace. I searched 4.x code and looks like I will need to add a converter to support the following content-type: multipart/x-mixed-replace multipart/x-byteranges multipart/byteranges multipart/mixed
good news, netwerk already provider all those converters. All I need to do, is to refuse to handle those content-type in nsIURLFetcher and then figure out which part I need to save. Should be not too complex for multipart/x-mixed- replace but I don't have a clue about the meaning of the other one and especially how to test them.
I have a fix (for multipart/x-mixed-replace) that I need to cleanup a littele bit before I can post the diff. Nominating nsbeta1.
Keywords: nsbeta1
Attached patch proposed fix, v1Splinter Review
Whiteboard: want for mozilla 0.9.1 → want for mozilla 0.9.1, Have fix
+#define MULTIPART_MIXED_REPLACE "multipart/x-mixed-replace" +#define MULTIPART_MIXED "multipart/mixed" +#define MULTIPART_BYTERANGES "multipart/byteranges" Aren't there defines for these elsewhere? kMimeMultiPart or something? If not shouldn't there be? + if (nsCRT::strcasecmp(aContentType, UNKNOWN_CONTENT_TYPE) == 0) + rv = InsertConverter(aContentType); + else + /* + if the content type is multipart/x-mixed-replace, we need to insert the + multipart converter. + */ + if (nsCRT::strcasecmp(aContentType, MULTIPART_MIXED_REPLACE) == 0) + rv = InsertConverter(aContentType); + else Can you move the else closer to the if please? It's confusing when there's a comment in the middle when looking at the code. + /* In case of multipart/x-mixed-replace, we need to truncate the file to the current part size */ + if (PL_strcasecmp(mConverterContentType, MULTIPART_MIXED_REPLACE) == 0) { - mContentType = contentType; + PRInt64 fileSize; + LL_I2L(fileSize, mTotalWritten); + mLocalFile->SetFileSize(fileSize); Does this truncate before the final write? I'm wondering if you're truncating with the final file size using the trailing marker in the multi part message or not.
>Aren't there defines for these elsewhere? kMimeMultiPart or something? If not >shouldn't there be? No, they are not defined yet (except mixed/multipart) but I can add then to the mime type file and fix the few place in the Mozilla code where the hardcoded string is used. >Can you move the else closer to the if please? It's confusing when there's a >comment in the middle when looking at the code. Sure, I'll... >Does this truncate before the final write? I'm wondering if you're truncating >with the final file size using the trailing marker in the multi part message or not. This append when we are done writing the final part and we have already close the file. I'll post soon a news patch that take care of those comments...
Putting in 0.9.1. It looks like this will prevent the crash in 81682 and it makes so you can actually read the page that was sent in the message.
Priority: -- → P2
Whiteboard: want for mozilla 0.9.1, Have fix → [nsbeta1+]want for mozilla 0.9.1, Have fix
Target Milestone: --- → mozilla0.9.1
It will only prevent the crash because people might not send out messages with it. Wallpaper.
If the crash gets fixed (which it sounds like it will), what's the worst thing that will happen by keeping this bug open until 0.9.2? My understanding is that in the 0.9.1 build the user should be able to open the attachment to see the message. Is that not correct?
I don't know if we will be able to display correctly the page if we fixe just the crash. This bug affect dynamically generated page that use multipart, that should not be too much.
I think we can wait until 0.9.2 for this and then get more time to play with this change at the beginning of a milestone.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
Putting back on 0.9.1 radar. It looks like it's going to be hard to fix the crash.
Target Milestone: mozilla0.9.2 → mozilla0.9.1
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix → [nsbeta1+]want for mozilla 0.9.1, Have fix, need r=,sr=
r=varada
The patch add support for multipart/x-mixed-replace and has been tested for it. But I have also added support for other type of multipart (mixed, byteranges) for which I don't have a test case and therefore cannot quaranty at 100% I am doing the right thing (that doesn't means it will crash but that maybe I am not generating the rigth output).
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix, need r=,sr= → [nsbeta1+]want for mozilla 0.9.1, Have fix, have r=, need sr=
hmmm this is a pretty hefty change in the way we do things for generating certain attachments. The code looks okay to me but we're going to have to test the heck out of this stuff once you check it in. I bet dougt may be able to help you find a website that uses multi-part/byte. I vaguely remember him checking in a fix to the multi-part converter recently to make it work with multi-part/byte pages. that would at least give us a test case for the byte part. sr=mscott
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix, have r=, need sr= → [nsbeta1+]want for mozilla 0.9.1, Have fix, have r= and sr=, need a=
Scott, are you concerned about attachment types besides x-mixed-replace and byteranges like all attachments in general? If you think there's a lot of testing needed perhaps we should have a bunch of people run with this for a few days or just wait until 0.9.2. I'm not sure how many pages there are out there like this but my guess is that it's not high enough to risk attachment sending. If I misinterpreted your concerns, let me know. dougt, do you have any examples of sites with multipart/byteranges?
the only example that I have of multipart byterange is via plugins. If you go to www.adobe.com, and view a pdf from there (or any http server that supports range requests), the plugin will request ranges from the http server. This content comes back from the server as multipart/byterange. Also, you can hack TestProtocols. Add a header that has two or more segmented ranges. Does this help?
a= asa@mozilla.org (on behalf of drivers)
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Have fix, have r= and sr=, need a= → [nsbeta1+]want for mozilla 0.9.1, Ready to be checked in
I know this got the approval, but I'd like to ask if this can get into 0.9.2 instead (I know I'm flipping back and forth). I think it would be good to have some more time to run with this.
Target Milestone: mozilla0.9.1 → mozilla0.9.2
a= asa@mozilla.org for checkin to the trunk. (on behalf of drivers)
Fixed and checked in (TRUNK ONLY)
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: [nsbeta1+]want for mozilla 0.9.1, Ready to be checked in → [nsbeta1+]
Using builds for win, mac and linux dated 06-27-01 and the original scenario, this is fixed. Verified. Note: we do not have tests for miltipart/x-mixed-replace & multipart/byteranges. Verified based on original scenario.
Status: RESOLVED → VERIFIED
Product: MailNews → Core
Product: Core → MailNews Core
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: