Closed Bug 43455 Opened 24 years ago Closed 24 years ago

Quoted empty lines in flowed mails aten

Categories

(MailNews Core :: MIME, defect, P3)

defect

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: BenB, Assigned: BenB)

Details

(Whiteboard: r=rhp, a=waterson)

Attachments

(3 files)

Reproduce:
1. Read the attached mail

Actual result:
No empty lines in the quote shown

Expected result:
Some empty lines in the quote shown
Attached patch FixSplinter Review
Attached patch.

<quote>
// Look if the last character (after stripping ending end
// of lines) is a SPACE. If itg is, we are looking at a
// flowed line.
</quote>
This is not true for empty lines in quotes, which may look like ">> ". So, I
moved this part down the quote handling code, which determined this quoting
stuff, and then exclude the quoting stuff. (I just noticed, that I forgot to
correct the comment. The code should be OK, however.)

Patch also contains some code cosmetic.

Daniel, can you do a code review (since you cannot compile currently), please?
Status: NEW → ASSIGNED
Whiteboard: Fixed. Waiting for review, approval, checkin.
> empty lines in quotes, which may look like ">> ".

No they may not. 
Quote from RFC 2646 4.2:
"If the line ends in one or more spaces, the line is flowed"

The only exception is in 4.3, Usenet signatures "-- ". 
> No they may not.

Then, nsHTMLToTXTConv is broken, because this is what it produces for empty
lines in quotes.

> The only exception is in 4.3, Usenet signatures "-- ".

I disagree. While RFC2646 doesn't explicitly say something about this situation,
I would interpret
<quote src="ftp://venera.isi.edu/in-notes/rfc2646.txt">
4.4.   Space-Stuffing
[...]
   On reception, if the
   first character of a line is a space, it is logically deleted.  This
   occurs after the test for a quoted line, and before the test for a
   flowed line.
   [...]
   Other lines MAY be space-stuffed as desired.
[...]
4.5.  Quoting
[...]
   Note that because of space-stuffing, the lines
       >> Exit, Stage Left
   and
       >>Exit, Stage Left
   are semantically identical; both have a quote-depth of two, and a
   content of "Exit, Stage Left".
</quote>
in the way that ">> " is a space-stuffed, quoted and empty line and thus not
flowed.
Hmm. I think you're right, and now I understands your patch. There were too many 
whitespace changes for me to see what you had done at first. You moved the space 
stuff removal so that it is done before the check if the line is flowed or not. 
That must be right.

I see now that RFC2646 explicitly says that you may space stuff any line and if 
someone wants to space stuff the empty line, we should be prepared for that. 

I think I will crawl back into my little hole. :-)
> There were too many whitespace changes for me to see what you had done
> at first.

I know, sorry.

> I think I will crawl back into my little hole. :-)

Please don't. I appreciate your reviews :).
Keywords: patch
Summary: Quoted empty linens in flowed mails aten → Quoted empty lines in flowed mails aten
Target Milestone: --- → M17
Attached patch fix, version 2Splinter Review
Fix now also prevents a memleak in a failure situation, thanks to daniel.
Whiteboard: Fixed. Waiting for review, approval, checkin. → Fixed. Waiting for approval, checkin.
Keywords: approval
Whiteboard: Fixed. Waiting for approval, checkin. → Fixed. Waiting for bug 40862's approval
Fix checked in.
Status: ASSIGNED → RESOLVED
Closed: 24 years ago
Resolution: --- → FIXED
Whiteboard: Fixed. Waiting for bug 40862's approval
Whiteboard: r=rhp, a=waterson
Verified in 9/29 build.
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: