Leading whitespace in plaintext messages is stripped when smaller-than sign "<" is first character

UNCONFIRMED
Unassigned

Status

Thunderbird
Message Compose Window
UNCONFIRMED
6 years ago
2 years ago

People

(Reporter: Abel Braaksma, Unassigned)

Tracking

9 Branch
x86_64
Windows 7

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

6 years ago
User Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:9.0.1) Gecko/20100101 Firefox/9.0.1
Build ID: 20111220165912

Steps to reproduce:

Trying to write a plaintext message with space-indented XML-style code, like so:

<root>
    <child /
</root>


Actual results:

Any spaces before "<" and at the beginning of a line are removed _after_ sending, thus the code snippet will look as follows:

<root>
<child />
</root>

This happens only when sending in plaintext (regardless whether the composer is in HTML mode or plaintext mode) and mailnews.send_plaintext_flowed is set to the default "true". When set to "false", the indentation remains (but long lines are truncated).

- message in Draft is still indented
- message in Sent has whitespace removed
- any recipient (regardless the client) sees whitespace removed
- message source (Ctrl-U) has whitespace removed


Expected results:

The leading whitespace should remain in place. Note that leading whitespace not followed by a "<" will remain as it should. It's only stripped when the first character is a "<". 

Reproducible? Always.
Confirmed by three independent users.
(Reporter)

Comment 1

6 years ago
I don't seem to be able to edit the original bug-report. The missing ">" after the first "<child /" was a typo.

Comment 2

6 years ago
(In reply to Abel Braaksma from comment #1)
I copied your text and sent it but didn't see this issue:
User Agent: Mozilla/5.0 (X11; Linux i686; rv:9.0) Gecko/20111222 Thunderbird/9.0.1
Application Build ID: 20111222141531

Email sent was:
Content-Type: text/plain; charset=ISO-8859-1; format=flowed
Content-Transfer-Encoding: 7bit
(Reporter)

Comment 3

6 years ago
(In reply to Hashem Masoud from comment #2)
> (In reply to Abel Braaksma from comment #1)
> I copied your text and sent it but didn't see this issue:

Hi Hashem. It seems to depend how you create the message. I.e., if you do this:

0. Only works with plain text, make sure to send any test message as plain text
1. mailnews.send_plaintext_flowed = false
2. Send message, indentation works
3. set mailnews.send_plaintext_flowed = true
4. right-click "Edit as new" on the sent message
5. Send message, indentation still works

But: if in step (4) you type the message by hand again, the indentation is gone, both in the Sent folder and with the recipient (doesn't matter whether you send it to yourself or not).

Note: just tested whether it must be somewhat proper XML/HTML, but it doesn't need to be. The following example text also fails:

Test message
    < this is
    < indented

Is received as:

Test message
< this is
< indented

Comment 4

6 years ago
Given that it happens with format=flowed messages only and involves '<' (and probably '>' as well) characters following white spaces, this looks like yet another fall-out from bug 215068 (also see bug 448198, which is about replies though rather than the original plain-text editing).
You need to log in before you can comment on or make changes to this bug.