Last Comment Bug 298596 - Detaching attachment from complex MIME message rewrites message incorrectly
: Detaching attachment from complex MIME message rewrites message incorrectly
Status: RESOLVED FIXED
: fixed1.8
Product: MailNews Core
Classification: Components
Component: Attachments (show other bugs)
: Trunk
: All All
: -- normal with 2 votes (vote)
: ---
Assigned To: David :Bienvenu
:
Mentors:
Depends on:
Blocks:
  Show dependency treegraph
 
Reported: 2005-06-23 09:20 PDT by Mike Cowperthwaite
Modified: 2008-07-31 01:21 PDT (History)
2 users (show)
asa: blocking1.8b5+
See Also:
Crash Signature:
(edit)
QA Whiteboard:
Iteration: ---
Points: ---


Attachments
proposed fix (945 bytes, patch)
2005-09-26 12:59 PDT, David :Bienvenu
mscott: superreview+
mscott: approval1.8b5+
Details | Diff | Review

Description Mike Cowperthwaite 2005-06-23 09:20:41 PDT
Spun off from bug 286446.

Given a complex message, such as:
  multipart/related
   multipart/alternative
    text/plain
    text/html
   application/msword

After detaching the attachment, the resulting message includes two copies of
the text/html body, one of which is hidden between MIME boundaries (without 
headers of its own):

   multipart/related; boundary=XXX
     --XXX
     multipart/alternative; boundary=YYY
       --YYY
       text/plain
         OK OK OK OK
       --YYY
       text/html
         <html>OK OK OK OK</html>
       --YYY--
       <html>COPY, DOESN'T BELONG HERE</html>
     --XXX
     text/x-moz-deleted
       blah blah blah
     --XXX--

Steps to reproduce:
1) integrate attachment 177627 [details] into your mail system
2) View the message; delete and/or detach the Joe.doc att't.
3) View the resulting message's source

Actual results:
3) Bogus MIME structure observed

Expected results:
3) Correct MIME structure
Comment 1 Benoît 2005-07-07 15:10:14 PDT
This bug is holding back my mail archiving. I would like to save attachments
without having my mail format butched.
Comment 2 Mattias 2005-08-02 12:42:34 PDT
This is a scary one, if it happens to you (it happened to me)
Comment 3 Benoît 2005-09-24 13:09:42 PDT
I think this should block SeaMonkey's release because it's a major functionality
that is broken and causing bloat.
Comment 4 Andrew Schultz 2005-09-24 14:23:42 PDT
If you want this bug fixed in 1.0b, you should nominate it for 1.8b5.  The
relevant code is shared and 1.0b will be released off of 1.8b5, whatever that is.
Comment 5 Benoît 2005-09-25 03:04:07 PDT
See my previous comment for the reason.
Comment 6 Scott MacGregor 2005-09-26 08:43:46 PDT
David, I'll let you decide what to do with this bug. 
Comment 7 David :Bienvenu 2005-09-26 09:49:37 PDT
I'll try to fix it. Changing this code is risky, however.
Comment 8 David :Bienvenu 2005-09-26 12:59:58 PDT
Created attachment 197455 [details] [diff] [review]
proposed fix

don't display cached part when stripping attachments.
Comment 9 Mike Cowperthwaite 2005-09-26 15:28:21 PDT
(In reply to comment #8)
> don't display cached part when stripping attachments.

??  Does that fix really belong to this bug?
Comment 10 David :Bienvenu 2005-09-26 15:46:49 PDT
Comment on attachment 197455 [details] [diff] [review]
proposed fix

I'll let this bake on the trunk for a little bit, but if everything is ok, I'd
like to check it into the branch as well.
Comment 11 David :Bienvenu 2005-09-26 15:48:38 PDT
>> ??  Does that fix really belong to this bug?

yes, it does - it was the call to display the cached part (the multipart
alternative that we've cached for display) that was causing us to write out the
extra copy of the body.
Comment 12 Scott MacGregor 2005-09-26 17:47:47 PDT
Please re-ping me when you feel this has baked enough and I'll approve the fix.
Comment 13 Tilmann Reh 2005-09-27 03:24:26 PDT
When this bug is worked on, perhaps two more attachment-deletion related errors
can be also fixed?

1. When an attachment is deleted from a message where the sender had requested a
receipt notification ("Return-receipt-to:" header, probably the same with
"Disposion-Notification-to:"), a popup window appears again, asking if the
notification shall be sent. This should not happen.

2. After having deleted an attachment, the junk status of the message is set to
"unknown". The junk status should not change upon attachment deletion.

(Or should a new bug be opened for these?)
Comment 14 Mike Cowperthwaite 2005-09-28 14:17:52 PDT
I've just tried TB 1.6a1+0928, and this patch appears to have fixed the reported 
problem.  Thanks, David!
Comment 15 David :Bienvenu 2005-09-28 14:19:42 PDT
great, thx, Mike - pinging mscott for a=, per his request.

Note You need to log in before you can comment on or make changes to this bug.