Bug 284451

Summary: KMail adds linebreaks / newlines to long quoted lines
Product: [Applications] kmail2 Reporter: Stephan Diestelhorst <stephan.diestelhorst>
Component: composerAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED UNMAINTAINED    
Severity: normal CC: f.fainelli, pdgiddie+kde
Priority: NOR    
Version: 4.7   
Target Milestone: ---   
Platform: Ubuntu   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:

Description Stephan Diestelhorst 2011-10-19 11:38:52 UTC
Version:           4.7 (using KDE 4.7.2) 
OS:                Linux

When I reply to an email that contains long lines, these lines are quoted once (correct) and visually broken in the editor (correct, too) staying green across the several broken down lines.

However, when I send the message (e.g. to myself), the visual linebreaks from the window are coded into hard linebreaks in the message, which screws up the quoting, since now only the first line is quoted.

Example:

original line:

aaaaaaa...bbbbbbb....cccccccccc.... (very long)

view in editor when replying:

<green> > aaaaaaaaaaa... (window ends)
        bbbbbbb....     (window ends)
        ccccc..... </green>

sending this creates:

> aaaaaa....\n
bbbbbb.....\n
ccccc.......\n

Which when viewed again is (properly) rendered as:

<green> > aaaaaaaaaaa... </green>\n
<black> bbbbbbb.... \n
        ccccc..... </black>

So it seems that the visual linebreak / newline in the editor component sneaks into what is put on the wire.

Reproducible: Always

Steps to Reproduce:
* Receive an email with long lines
* Reply to that email (option "Intelligen Replies / Quotes" is on, but unrelated??)
* Adjust window size, so that the long lines break visually
* Observe, that they are still properly quoted (green)
* Send email (e.g. to self)
* Open sent email

Actual Results:  
* Visual linebreaks from the editing window size limit have translated into hard "\n" in the mail body
* This breaks (correctly) with the quoting logic, since the broken parts of the line are now not prefixed with a ">" anymore and hence are not seen as parts of the quote

Expected Results:  
* Visual linebreaks from the editing window size must not end up in the mail text being sent


This is likely similar to https://bugs.kde.org/show_bug.cgi?id=267052, but I think I provided the better report here ;-)
Comment 1 Denis Kurz 2016-09-24 17:59:42 UTC
This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.
Comment 2 Denis Kurz 2017-01-07 21:50:15 UTC
Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.