Bug 88271 - View Source: Headers incorrectly detected in message body (bold)
Summary: View Source: Headers incorrectly detected in message body (bold)
Status: RESOLVED FIXED
Alias: None
Product: kmail
Classification: Applications
Component: messageviewer (show other bugs)
Version: 1.10.90
Platform: Debian testing Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords: triaged
: 113586 117451 127469 128251 160575 (view as bug list)
Depends on:
Blocks:
 
Reported: 2004-08-28 01:45 UTC by David Förster
Modified: 2009-04-30 16:02 UTC (History)
5 users (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description David Förster 2004-08-28 01:45:28 UTC
Version:            (using KDE KDE 3.3.0)
Installed from:    Debian testing/unstable Packages

When viewing the source of a message, strings in the text ending with a colon at the beginning of a line are displayed bold like the headers.
Example:

To: noreply@sourceforge.net
From: "SourceForge.net" <noreply@sourceforge.net>


Read and respond to this message at: 
https://sourceforge.net/forum/message.php?msg_id=2722727
By: openface ...

The word "By" is displayed bold.

I think this should only happen in the header section.
Comment 1 Ismail Onur Filiz 2006-05-29 21:19:19 UTC
*** Bug 113586 has been marked as a duplicate of this bug. ***
Comment 2 Ismail Onur Filiz 2006-05-29 21:20:01 UTC
*** Bug 117451 has been marked as a duplicate of this bug. ***
Comment 3 Ismail Onur Filiz 2006-05-29 21:20:58 UTC
*** Bug 128251 has been marked as a duplicate of this bug. ***
Comment 4 Magnus Holmgren 2006-05-31 09:18:56 UTC
It's no wonder considering that the highlighting code is effectively five lines and only looks at one message line at a time.

It is fairly simple to look for the first blank line that marks the end of the top level message header. That, however, would destroy the formatting of headers in multipart/* body parts and attached messages.

The correct way would probably be to traverse the DwMessage structure, to the extent that it is possible to get the original raw text back, which I doubt even if public Preamble() and Epilogue() methods were added to DwBody. But if it can be done, bug 97665 can be fixed in the process.

As a heuristic approach, we could assume that any line that could be a MIME boundary is one. We then start parsing headers until the next blank line, except if a Content-Type: message/* field was found, in which case parsing continues.
Comment 5 Tom Albers 2006-10-28 13:27:17 UTC
*** Bug 127469 has been marked as a duplicate of this bug. ***
Comment 6 Thomas McGuire 2007-11-22 17:36:11 UTC
See also bug 152707.
Comment 7 Thomas McGuire 2008-04-14 00:39:41 UTC
*** Bug 160575 has been marked as a duplicate of this bug. ***
Comment 8 George Kiagiadakis 2008-09-14 22:49:56 UTC
Still reproducable with kmail 1.10.90 (svn r860337).
Comment 9 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 10 Thomas McGuire 2009-04-30 16:02:22 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