Bug 344099 - KMail composer changes HTML format when replying to HTML mail
Summary: KMail composer changes HTML format when replying to HTML mail
Status: REPORTED
Alias: None
Product: kmail2
Classification: Applications
Component: composereditor-ng (show other bugs)
Version: 4.14.1
Platform: Ubuntu Linux
: NOR normal
Target Milestone: ---
Assignee: Laurent Montel
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-02-12 23:28 UTC by Quantum Five
Modified: 2023-12-07 09:08 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments
screenshot of html email (831.34 KB, image/png)
2023-08-18 19:14 UTC, Robert Riemann
Details
screenshot of draft email when replying to html email (top part) (214.25 KB, image/png)
2023-08-18 19:14 UTC, Robert Riemann
Details
screenshot of draft email when replying to html email (middle part) (319.65 KB, image/png)
2023-08-18 19:14 UTC, Robert Riemann
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Quantum Five 2015-02-12 23:28:40 UTC
I have created an email in Yahoo Mail and sent it to another account I am using KMail to read messages from (via IMAP). Here is what is received - KMail displays it properly:


------=_Part_4011896_1481964145.1423780407369
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 7bit

Long line:
Symptom: You intend moving on to reading your mail from an IMAP server, and wonder how filtering and spam handling will occur?

Solution: The machine that already has your mail can become your imap server. You will need to configure a server application. Dovecot is one such, and the guidance on the project web pages make it easy to set up. That still leaves you with the problem of filtering, as it makes sense to do it on the server (when you point kmail at the server you will see the folders that you have created on the server). Again there are options, but one of the best known is procmail. Again there is plenty of information on the Internet on how to set this up. You give it a set of "recipes" - here's an example:
Symptom: You are using KMail under KDE 4.2 or later on a netbook, and find that the new Aggregation display leaves you little screen space

Solution: In 4.2 you have a new set of icons next to the quick search bar. You can use these to choose a different theme and a different aggregation. If you want to change the look so that a mail uses a single row instead of two rows, go to Preferences-desktop-theme.png - the tooltip says Select View Appearance (Theme) - and change the theme to Classic. If you want to disable grouping by date, change the aggregation View-process-tree.png to Standard Mailing List. Now your KMail will look exactly like it did in earlier versions.

***END***

------=_Part_4011896_1481964145.1423780407369
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<html><body><div style=3D"color:#000; background-color:#fff; font-family:ve=
rdana, helvetica, sans-serif;font-size:16px"><div dir=3D"ltr" id=3D"yui_3_1=
6_0_1_1423765738316_16566">Long line:</div><div id=3D"yui_3_16_0_1_14237657=
38316_16592" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_1_1423765738316_16=
593" dir=3D"ltr">Symptom: You intend moving on to reading your mail from an=
 IMAP server, and wonder how filtering and spam handling will occur?<br sty=
le=3D"" class=3D""><br style=3D"" class=3D"">Solution: The machine that alr=
eady has your mail can become your imap server. You will need to configure =
a server application. Dovecot is one such, and the guidance on the project =
web pages make it easy to set up. That still leaves you with the problem of=
 filtering, as it makes sense to do it on the server (when you point kmail =
at the server you will see the folders that you have created on the server)=
. Again there are options, but one of the best known is procmail. Again the=
re is plenty of information on the Internet on how to set this up. You give=
 it a set of "recipes" - here's an example:</div><div id=3D"yui_3_16_0_1_14=
23765738316_16629" dir=3D"ltr"><br></div><div id=3D"yui_3_16_0_1_1423765738=
316_16630" dir=3D"ltr">Symptom: You are using KMail under KDE 4.2 or later =
on a netbook, and find that the new Aggregation display leaves you little s=
creen space<br style=3D"" class=3D""><br style=3D"" class=3D"">Solution: In=
 4.2 you have a new set of icons next to the quick search bar. You can use =
these to choose a different theme and a different aggregation. If you want =
to change the look so that a mail uses a single row instead of two rows, go=
 to Preferences-desktop-theme.png - the tooltip says Select View Appearance=
 (Theme) - and change the theme to Classic. If you want to disable grouping=
 by date, change the aggregation View-process-tree.png to Standard Mailing =
List. Now your KMail will look exactly like it did in earlier versions.<br>=
</div><div dir=3D"ltr"><br></div><div dir=3D"ltr">***END***</div><div dir=
=3D"ltr"><br></div></div></body></html>
------=_Part_4011896_1481964145.1423780407369--

*****************************************
*****************************************

Now here is what happens to that text after I click reply in KMail. The receiver shows it all text displayed as Times New Roman (tried with various email clients). Also, not sure why are there so many line brakes in the text/plain version of the email ?

*****************************************
*****************************************

--nextPart1906880.apNsLI2fOD
Content-Transfer-Encoding: 7Bit
Content-Type: text/plain; charset="UTF-8"



Long line:


Symptom: You intend moving on to reading your mail from an IMAP server, and wonder how filtering and spam handling will occur?



Symptom: You are using KMail under KDE 4.2 or later on a netbook, and find that the new Aggregation display leaves you little screen space



***END***





--nextPart1906880.apNsLI2fOD
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html; charset="UTF-8"

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0//EN" "http://www.w3.org/TR/=
REC-html40/strict.dtd">
<html><head><meta name=3D"qrichtext" content=3D"1" /><style type=3D"tex=
t/css">
p, li { white-space: pre-wrap; }
</style></head><body style=3D" font-family:'Tahoma'; font-size:11pt; fo=
nt-weight:400; font-style:normal;">
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br=
 /><br />---- Original Message ----<br /><br /></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0; back=
ground-color:#ffffff;"><a name=3D"yui_3_16_0_1_1423765738316_16566"></a=
><span style=3D" font-family:'verdana,helvetica,sans-serif'; font-size:=
16px; color:#000000;">L</span><span style=3D" font-family:'verdana,helv=
etica,sans-serif'; font-size:16px; color:#000000;">ong line:</span></p>=

<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a =
name=3D"yui_3_16_0_1_1423765738316_16592"></a><span style=3D" font-fami=
ly:'verdana,helvetica,sans-serif'; font-size:16px; color:#000000;"><br =
/></span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a =
name=3D"yui_3_16_0_1_1423765738316_16593"></a><span style=3D" font-fami=
ly:'verdana,helvetica,sans-serif'; font-size:16px; color:#000000;">S</s=
pan><span style=3D" font-family:'verdana,helvetica,sans-serif'; font-si=
ze:16px; color:#000000;">ymptom: You intend moving on to reading your m=
ail from an IMAP server, and wonder how filtering and spam handling wil=
l occur?</span><span style=3D" font-family:'verdana,helvetica,sans-seri=
f'; font-size:16px; color:#000000;"><br /><br />Solution: The machine t=
hat already has your mail can become your imap server. You will need to=
 configure a server application. Dovecot is one such, and the guidance =
on the project web pages make it easy to set up. That still leaves you =
with the problem of filtering, as it makes sense to do it on the server=
 (when you point kmail at the server you will see the folders that you =
have created on the server). Again there are options, but one of the be=
st known is procmail. Again there is plenty of information on the Inter=
net on how to set this up. You give it a set of &quot;recipes&quot; - h=
ere's an example:</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a =
name=3D"yui_3_16_0_1_1423765738316_16629"></a><span style=3D" font-fami=
ly:'verdana,helvetica,sans-serif'; font-size:16px; color:#000000;"><br =
/></span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><a =
name=3D"yui_3_16_0_1_1423765738316_16630"></a><span style=3D" font-fami=
ly:'verdana,helvetica,sans-serif'; font-size:16px; color:#000000;">S</s=
pan><span style=3D" font-family:'verdana,helvetica,sans-serif'; font-si=
ze:16px; color:#000000;">ymptom: You are using KMail under KDE 4.2 or l=
ater on a netbook, and find that the new Aggregation display leaves you=
 little screen space</span><span style=3D" font-family:'verdana,helveti=
ca,sans-serif'; font-size:16px; color:#000000;"><br /><br />Solution: I=
n 4.2 you have a new set of icons next to the quick search bar. You can=
 use these to choose a different theme and a different aggregation. If =
you want to change the look so that a mail uses a single row instead of=
 two rows, go to Preferences-desktop-theme.png - the tooltip says Selec=
t View Appearance (Theme) - and change the theme to Classic. If you wan=
t to disable grouping by date, change the aggregation View-process-tree=
.png to Standard Mailing List. Now your KMail will look exactly like it=
 did in earlier versions.<br /></span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'verdana,helvetica,sans-serif'; font-size:16px=
; color:#000000;"><br /></span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'verdana,helvetica,sans-serif'; font-size:16px=
; color:#000000;">***END***</span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><sp=
an style=3D" font-family:'verdana,helvetica,sans-serif'; font-size:16px=
; color:#000000;"><br /></span></p>
<p style=3D" margin-top:0px; margin-bottom:0px; margin-left:0px; margin=
-right:0px; -qt-block-indent:0; text-indent:0px; -qt-user-state:0;"><br=
 /><br /></p></body></html>
--nextPart1906880.apNsLI2fOD--


Reproducible: Always

Steps to Reproduce:
1. Create en email in Gmail, Yahoo, Outlook, etc and send it to an email account which you use KMail to read emails from
2. Reply to the email received via KMail
3. At the destination notice that the original email format is messed up
Comment 1 David Faure 2017-04-09 12:33:23 UTC
"why are there so many line brakes in the text/plain version of the email" should finally be fixed with https://codereview.qt-project.org/191229
Comment 2 Thomas 2019-01-25 11:44:00 UTC
(In reply to David Faure from comment #1)
> "why are there so many line brakes in the text/plain version of the email"
> should finally be fixed with https://codereview.qt-project.org/191229

This will not solve it. All emails send from kmail have this style in the header of the email that causes this issues:

p, li { white-space: pre-wrap; }

This way kmail is not usable for me because even <spans> produce a line break and I need to define different font styles in the same row for our coorporations signature.
Comment 3 Robert Riemann 2023-08-18 19:13:34 UTC
Dear all,

I would love to see KMail used in the public sector, but from my experience better HTML email support would be necessary.

When I reply to an HTML email, then the layout of the email changes often drastically. Is this the most recent matching bug report for this? I will upload screenshots of the original email and of the reply email.

I use Kontact Version 5.23.3 (23.04.3), KDE Frameworks Version 5.108.0, Qt Version 5.15.10 (built against 5.15.10). I am using Wayland on Opensuse tumbleweed 64bit.
Comment 4 Robert Riemann 2023-08-18 19:14:05 UTC
Created attachment 161049 [details]
screenshot of html email
Comment 5 Robert Riemann 2023-08-18 19:14:43 UTC
Created attachment 161050 [details]
screenshot of draft email when replying to html email (top part)
Comment 6 Robert Riemann 2023-08-18 19:14:59 UTC
Created attachment 161051 [details]
screenshot of draft email when replying to html email (middle part)