Bug 289382 - HTML mails with CSS loses CSS on rendering
Summary: HTML mails with CSS loses CSS on rendering
Status: RESOLVED FIXED
Alias: None
Product: kmail2
Classification: Applications
Component: general (show other bugs)
Version: 4.7
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-19 20:47 UTC by Nathan O'Brennan
Modified: 2012-08-16 06:52 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In: 4.9.1


Attachments
Exact code copied out of the email (3.73 KB, text/html)
2011-12-19 20:47 UTC, Nathan O'Brennan
Details
mbox file containing offending code (64.10 KB, application/mbox)
2011-12-20 19:30 UTC, Nathan O'Brennan
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Nathan O'Brennan 2011-12-19 20:47:14 UTC
Created attachment 66914 [details]
Exact code copied out of the email

Version:           4.7 (using KDE 4.7.3) 
OS:                Linux

I have multiple daily logwatch logs sent to my email address in html format. The html messages use css for table coloring, but the css is not recognized or used when viewing the messages in kmail.

I have viewed the source of the email message and saved all the html into a separate file called logwatch.html and viewed it in Konqueror and it renders properly.

Reproducible: Always

Steps to Reproduce:
All logwatch messages in html format will produce the incorrect output via kmail.


Expected Results:  
The table heading backgrounds should be colored as per the inline css.

The attachment here is the exact html code copied from the email. I have only stripped out the details pertaining to my servers, but the offending contents are there.
Comment 1 Torgny Nyblom 2011-12-20 14:22:39 UTC
Could you please either send the mail to me as an mbox attachment and/or attach it here as an mbox file?
In either case feel free to strip it of any personal information.
Comment 2 Nathan O'Brennan 2011-12-20 19:30:26 UTC
Created attachment 66949 [details]
mbox file containing offending code

I reran logwatch and this is the email in html form that created. I saved as an .mbox file. I only modified a couple spots in the code itself so it would not disrupt any of the html coding.
Comment 3 Torgny Nyblom 2011-12-21 14:41:28 UTC
Thanks,

I'll look deeper into this issue but my initial thought is that your formatting is lost due to the formatting that KMail adds for the header/crypt/... formatting.
Ie, the viewer is quite capable of using css for markup but we might need to adjust the internal css as to nit collide with common formatting.
Comment 4 Torgny Nyblom 2011-12-21 18:58:19 UTC
CSS is not present in the HTML used for viewing.
Comment 5 Thomas 2012-05-29 21:42:39 UTC
same is i.e. with newsletters from http://www.linux-magazin.de in HTML format. Interestingly if you forward same message the editor is now rendering the style and colors. Check also i.e. by viewing same mail using Thunderbird the rendering is completly different.
Comment 6 Laurent Montel 2012-08-15 21:48:47 UTC
I fixed it in 4.9.1
But add css in mail breaks header css...

I need to understand how work html+css to specify css for header and not break it with imported css...
Comment 7 Laurent Montel 2012-08-16 06:51:38 UTC
Git commit 0c2c1b86541fa1e373a823b442e8753c8703e035 by Montel Laurent.
Committed on 16/08/2012 at 08:47.
Pushed by mlaurent into branch 'KDE/4.9'.

Fix Bug 289382 - HTML mails with CSS loses CSS on rendering

css loading was done yesterday but it broke header style.
Now it's fixed so I can close this bug.

FIXED-IN: 4.9.1

M  +15   -2    messageviewer/csshelperbase.cpp

http://commits.kde.org/kdepim/0c2c1b86541fa1e373a823b442e8753c8703e035
Comment 8 Laurent Montel 2012-08-16 06:52:32 UTC
@Thomas: I don't have your ML I think it's fixed so send me an email about this ML or test with 4.9.1
Regards