Bug 152707

Summary: View Source: Some headers not correctly detected and not bold
Product: [Applications] kmail Reporter: hanno
Component: messageviewerAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED FIXED    
Severity: normal CC: ruchir.brahmbhatt
Priority: NOR Keywords: triaged
Version: 1.9.8   
Target Milestone: ---   
Platform: Gentoo Packages   
OS: Linux   
Latest Commit: Version Fixed In:
Attachments: screenshot of undetected header

Description hanno 2007-11-22 13:40:54 UTC
Version:            (using KDE KDE 3.5.8)
Installed from:    Gentoo Packages
Compiler:          gcc 4.2.2 
OS:                Linux

When I have an extra-header in a mail that contains a dot, something like:
X-foo.bar: test

kmail doesn't detect this as a header. According to RFC 822, Section 3.2:
     field-name  =  1*<any CHAR, excluding CTLs, SPACE, and ":">

So a dot should be a perfectly valid char in a header-field. I'll attach an image that shows the header view. It's grey, while field names of detected fields are black.
Comment 1 hanno 2007-11-22 13:41:18 UTC
Created attachment 22161 [details]
screenshot of undetected header
Comment 2 Thomas McGuire 2007-11-22 17:35:25 UTC
Very similar to bug 88271.
The header parsing code isn't very sophisticated there.
Comment 3 Ruchir Brahmbhatt 2009-04-24 19:30:42 UTC
Reproducible on trunk revision 958061.
Comment 4 Jaime Torres 2009-04-28 20:45:13 UTC
SVN commit 960620 by jtamate:

BUG: 88271
BUG: 152707

Use the right regular expresion to check for mail headers.
Also, use a mini ad-hoc state machine to not treat all that looks like headers as headers.
When a blank line is found, it is supposed to start a body part, until a header with Content- is found.

 M  +28 -5     mailsourceviewer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=960620
Comment 5 Thomas McGuire 2009-04-30 16:02:23 UTC
SVN commit 961651 by tmcguire:

Backport r960620 by jtamate from trunk to the 4.2 branch:

CCBUG: 88271
CCBUG: 152707

Use the right regular expresion to check for mail headers.
Also, use a mini ad-hoc state machine to not treat all that looks like headers as headers.
When a blank line is found, it is supposed to start a body part, until a header with Content- is found.


 M  +28 -5     mailsourceviewer.cpp  


WebSVN link: http://websvn.kde.org/?view=rev&revision=961651