Bug 84896

Summary: kmail display emails as blank emails
Product: [Unmaintained] kmail Reporter: Zé <mmodem00>
Component: generalAssignee: kdepim bugs <kdepim-bugs>
Status: RESOLVED WORKSFORME    
Severity: normal CC: gschintgen, thiago
Priority: NOR    
Version: unspecified   
Target Milestone: ---   
Platform: Mandrake RPMs   
OS: Linux   
Latest Commit: Version Fixed In:
Sentry Crash Report:
Attachments: Email from forums.mozillazine.org that appears as blank email
the last email displayed as (almost) blank email in kmail
fotografia1.png
two blank e-mails and three that always turn blank
ill e-mails, as Evolution sees them
comment #23 just got blank
Log created with ethereal of Kmail retrieving a email from the server
Log created with ethereal of Evolution retrieving a email from the server
Log created with ethereal of Evolution retrieving a email from the server (update of the attach 7310)
Two log files created with ethereal of Evolution and Kmail retrieving same email from the server

Description 2004-07-11 04:54:37 UTC
Version:           kmail 1.6.2 (using KDE KDE 3.2.3)
Installed from:    Mandrake RPMs
Compiler:          gcc (GCC) 3.3.2 (Mandrake Linux 10.0 3.3.2-6mdk) 
OS:                Linux

So what happens is, that KMail display many emails (html and plain text) as 
blank emails, with unknown sender and date, and with no suject, from for 
example forums.mozillazine.org also from www.linuxquestions.org, display these 
emails as blank emails. only when i click to see the code, is that i can 
see something.
And these same emails retrieved from the server from Evolution are all well 
displayed.

I tried many things to see if i could put kmail displaying these emails
correctly, i chooseed using a maildir folder instead of an mbox, deleted
the .index files to rebuild again by kmail, deleted the ~/.Mail dir.

Downloaded kde-3.2.3 from cooker and compiled kdepim-3.2.3-2mdk.src.rpm without
the patch (Mandrake patch) that puts messages in the folder ~/.Mail, because
Mandrake uses the ~/.Mail instead of the folder ~/Mail.

I reinstalled Mandrake 10.0 in english, cause it would have something related
with the locale (language) settings, but no, nothing resolved.


The main problems:
- Messages are cut off, often before the beginning of the body, as can be seen
in the message sources of the relevant messages
- Problem appears with all messages, not just HTML messages as the OP would
have one believe
- Problem is with downloading AND/OR JUST storing messages
- /tmp is not a separate partition; / is not full (1 GiB left)
- no relevant filters are in effect
- problem still appears when logging in as another user
- deleting the .index files did not help
- maildir or mbox have no impact on the issue

Now, to dissipate all doubts to see if is a Mandrake or just a kde problem, i installed kde-3.2.3 with konstruct and Kmail haves exactly the same problem that the kmail that is installed with the Mandrake rpm.
So this is not only a Mandrake problem, but is a KDE bug.
Comment 1 Thiago Macieira 2004-07-12 04:39:07 UTC
Does this happen with hotpop only or with any POP3 server? Does it happen with IMAP?
Comment 2 2004-07-12 05:00:32 UTC
Happens with any POP3 server, there many other users with this same problem.
And to say that there arent only emails that come from forums.mozillazine.org but from a variety of sites, inclusive from kde-devel mailing list some emails appear as blank but in this mailing list is very rare.
Comment 3 Thiago Macieira 2004-07-12 05:07:25 UTC
I have been using KMail for years and never have I seen your problem.

Please attach the faulty email to this bug report for reference (save the email to a file first, don't copy/paste). Also attach the version you see in Evolution.
Comment 4 2004-07-12 05:13:40 UTC
Created attachment 6634 [details]
Email from forums.mozillazine.org that appears as blank email

Dont forget that wgat you see in the attachment is the code of the email that
Kmail displays as blank email.
The Evolution Version is 1.4.6
Comment 5 Tom Albers 2004-07-23 09:31:29 UTC
*** Bug 82652 has been marked as a duplicate of this bug. ***
Comment 6 Tom Albers 2004-07-23 09:35:39 UTC
The attachment contains only received-headers, an invalid from-header and a return-path, so actually there is nothing to show... Can anyone supply an attachment which behaves as reported but with a valid to- and from-header? Then I'll check with the development version of KMail if it is rendered properly. If not then this will soon be closed as invalid.
Comment 7 2004-07-23 14:05:38 UTC
Created attachment 6798 [details]
the last email displayed as (almost) blank email in kmail

The last email that you sended saying to attach a message with valid fromand to
header is displayed as (almost) blank email in kmail, i mean the sender, date
and subject appear as unknown and in the body appears this:
'pment version of KMail if it is rendered properly. If not then this will soon
be closed as invalid.' (without the quotes).
But when you click to see the code you can see whats going on.
Comment 8 Tom Albers 2004-07-23 14:40:27 UTC
If this particular e-mail is visible in an other emailclient, could you make a screenshot of that and attach it here, together with the e-mailmessage saved from that other client?
Comment 9 2004-07-23 15:21:16 UTC
Here is the screenshot and the email saved in Evolution.
=2D------ You are receiving this mail because: -------
You reported the bug, or are watching the reporter.
     =20
http://bugs.kde.org/show_bug.cgi?id=3D84896     =20




=2D------ Additional Comments From tomalbers kde nl  2004-07-23 09:35 -----=
=2D-
The attachment contains only received-headers, an invalid from-header and a=
 return-path, so actually there is nothing to show... Can anyone supply an =
attachment which behaves as reported but with a valid to- and from-header? =
Then I'll check with the development version of KMail if it is rendered pro=
perly. If not then this will soon be closed as invalid.



Created an attachment (id=6800)
fotografia1.png
Comment 10 Thiago Macieira 2004-07-27 00:48:38 UTC
The email that you attached is not the same email that was sent. Please check that all your email servers along the line are working properly. If in doubt, use servers that you know that it works.
Comment 11 2004-08-01 05:03:04 UTC
What i attached (id=6798) is only what appears, i didnt cut anything, and that only appears is u click to see the code, cause in the the email appears as blank
Comment 12 Luis Mendes 2004-08-24 02:45:04 UTC
I also suffer from this disease...  I loose between 3 to 6 e-mails per day!
I have something to add:
a) sometimes I receive e-mails that are completely blank already.  they are really not blank ones, but kmail looses all the sender/ subject/ date information
b) some others appear in the list of headings as perfectly normal until I click on them to preview them.  Then, they get blanked all of a suden.
c) I'm a subscriber of an information service.  All emails from them get blanked.  The only extra besides plain text they use is links to their site.  I can send one of these messages to someone interested in solving this problem.
d) however if I do a 'search' before I click in one of these e-mails that searches it, then I can click in them with no problem.  This applies to b) but not of course to c)
e) I'm really not sure, but perhaps this strange and very very annoying behavior began after the installation of gpg and it's plug-ins for kmail.  Maybe this can be checked with other users with the same problem.
f) I'm also using Mandrake 10.0, but now I've upgraded Kmail to 1.7 from tar balls, and the problem remains.

I really do like Kmail, but I cannot keep loosing so much information.  If there is someone willing to try to fix this bug, I'll be willing to experiment in my Kmail some things.

Regards,

Luis
Comment 13 Thiago Macieira 2004-08-24 04:03:13 UTC
I see a pattern here: both people with problems have @netvisao.pt emails. Could it be an incompatibility with the POP3 server the ISP is using? Would you guys know what software they use?
Comment 14 2004-08-24 04:39:09 UTC
I would like to remember that in Mandrake9.1 i used kmail with no problems and receive emails from the same places.
For example emails that come from foruns.mozillazine.org in Mandrake9.1 all come ok, now in Mandrake10.0 all appear in blank.
I always used the same internet provider, so i dont see any conection between the kmail problems and the ISP we use.

And i dont know what software they use.

Note: in evolution these same emails are well retrieved and displayed.
Comment 15 2004-08-24 04:40:57 UTC
Also fogot to say that a user from Denmark and other that replied me in linuxquestions.org (about this problem) have the same problem that we have.
Comment 16 Don Sanders 2004-08-24 09:11:59 UTC
On Tuesday 24 August 2004 10:45, Luis Mendes wrote:
...
> c) I'm a subscriber of an
> information service.  All emails from them get blanked.  The only
> extra besides plain text they use is links to their site.  I can
> send one of these messages to someone interested in solving this
> problem. 

Having a copy of some of these messages might help. If you could 
'File->Save As' a few of these messages then attach them as a tarball 
that would be nice.

Don.

Comment 17 Luis Mendes 2004-08-25 01:04:58 UTC
Created attachment 7261 [details]
two blank e-mails and three that always turn blank

As requested, I add this tarball with five files.
Two of them are e-mails that turned blank when I clicked on them. They're from
today.
The other three, are those of the kind that will for sure turn blank after
being clicked.
Comment 18 Luis Mendes 2004-08-25 01:36:45 UTC
Created attachment 7262 [details]
ill e-mails, as Evolution sees them

in this attachment there are three e-mails of the type that turn blank when
clicked.
I was surprised that they don't show any subject or sender data!
When I do that 'search' trick to find, for example, e-mails from this sender,
Kmail shows the the e-mail correctly.  But not evolution, for what I can see. 
Is this a clue?
Comment 19 A T Somers 2004-08-26 19:51:51 UTC
If I look at the attachsments above, I notice that there are errors in the headers. That might have something to do with it. I paste one here:

From unknown@nodomain.now.au Tue Aug 24 21:46:03 2004
Return-Path: <bounce-market_watch-836694@lyris.elliottwave.com>
Delivered-To: luis_lupe2@netvisao.pt
Received: (qmail 10948 invoked from network); 24 Aug 2004 21:46:03 -0000
Received: from unknown ([213.228.128.50]) (envelope-sender <>) by
 store1.netvisao.pt (qmail-ldap-1.03) with QMQP for <>; 24 Aug 2004 21:46:03
 -0000
Delivered-To: CLUSTERHOST store2.netvisao.pt luis_lupe2@netvisao.pt
Received: (qmail 26381 invoked from network); 24 Aug 2004 21:45:28 -0000
Received: from store-f1.netvisao.pt (HELO store?f1) ([213.228.128.92])
 (envelope-sender <bounce-market?watch-836694@lyris.elliottwave.com>) by
 store2.netvisao.pt (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP for
 <luis?lupe2@netvisao.pt>; 24 Aug 2004 21:45:28 -0000
Received: (qmail 21266 invoked by uid 0); 24 Aug 2004 21:43:54 -0000
traders. Better yet, you select just the coverage you need. No more, no less.  Intraday and Daily, Weekly & Monthly Forecasts are available for nearly all major world markets. View samples and our complete coverage menu at:
  http://www.elliottwave.com/wave/empsss
Date: Tue, 24 Aug 2004 17:38:15 -0400
MIME-Version: 1.0
Message-ID: <LYRIS-836694-6670-2004.08.24-17.38.14--luis_lupe2#netvisao.pt@lyris.elliottwave.com>
X-OriginalArrivalTime: 24 Aug 2004 21:38:14.0921 (UTC)
 FILETIME=[A96CAF90:01C48A22]
List-Unsubscribe: <mailto:leave-market_watch-836694I@lyris.elliottwave.com>
X-Evolution-Source: pop://rp018371@pop.netvisao.pt/
From: 
Subject: No Subject
Content-Transfer-Encoding: 8bit

Notice how the collon (:) is missing after the first From? I believe there should be one. Down below, we have another From, this time with a collon. However, it has no contents. So, KMail can not recognize a valid From field. I'm not familiar with the KMail code, but I can imagine it would confuse KMail. Furthermore, there is no To: field at all, in none of the three messages in the archive. 
What _is_ odd is that there is a subject ("No Subject", to be exact), but it is not shown. I think however that it was added by Evolution, but of course I can not confirm that. 

If I open the mails in KMail (3.3.0), I get to see the message but no From or To, which is in my view correct.
Comment 20 A T Somers 2004-08-26 19:57:43 UTC
On the blank emails from comment #17:

It is correct that KMail displays them as blank. There should be an empty line (that is: CRLF CRLF) separating the header from the contents of the message, wich there is not. So, KMail has no idea where the body of the message begins.

In my view, the bugs you report are actually bugs in the software that send these messages, not in KMail. I recommend to the KMail folks that this bug is closed.
Comment 21 2004-08-26 21:05:43 UTC
Close the bug?
Why? Isnt fixed.
So please explain me why Evolution and other email clients like for example Thunderbird displays these emails well, yes these same emails that kmail is incapable of correctly display, and instead displays these emails in blank.
Comment 22 David Faure 2004-08-26 21:09:05 UTC
On Thursday 26 August 2004 19:51, A T Somers wrote:
> Notice how the collon (:) is missing after the first From? I believe there should be one.
> Down below, we have another From, this time with a collon.
That's normal. Check any mail in a mbox, they are all like that.

> However, it has no contents. So, KMail can not recognize a valid From field. 
> I'm not familiar with the KMail code, but I can imagine it would confuse KMail. Furthermore, there is no To: field at all, in none of the three messages in the archive.
That shouldn't be a problem either - the groupware code generates mails without from/to and yet they appear fine.

Comment 23 A T Somers 2004-08-26 22:07:14 UTC
OK, maybe I judged too fast. Let me put it this way: I have looked at the attached messages in comments #17 and #18, and these render on my system (gentoo linux, kde 3.3.0, kmail 1.7) as may be expected. Some are blank, but they contain no body. Some miss To and From fields, but they are not present in the file. I don't experience any blanking.
So, *I* think it is save to conclude that there is no rendering bug. Having said that, there may be a bug somewhere else that messes up the message before it is saved to disk. That however, is hard to judge from just the saved messages. 

BTW: I don't have access to an mbox, so please forgive my ignorance. I use a maildir. 
Comment 24 Thiago Macieira 2004-08-27 01:58:54 UTC
We need a traffic dump (tcpdump or ethereal) of the POP3 connection when KMail receives this email, as well as when Evolution or whatever other software does.
Comment 25 Luis Mendes 2004-08-27 02:08:14 UTC
Created attachment 7308 [details]
comment #23 just got blank

Guess what?!!

the comment #23 from A T Somers just turned blank when I clicked in it in
Kmail!!

It appeared fine, just like the other four e-mails from today of this thread
that I received a few minutes ago in Kmail.  I previewed all the other four,
but not the last one #23.

Please see attachment that will follow with a screenshot.

In evolution it is displaying correctly.  I suppose that, contrary to what was
said in comment #20, the bug is really in Kmail!  Otherwise, how could I see
correctly all the previous messages from this thread in Kmail, except for nr.
23??  The sender's software is the same!

I think that we have to agree in a plan to find the buggy process.
Comment 26 2004-08-27 03:26:24 UTC
Created attachment 7309 [details]
Log created with ethereal of Kmail retrieving a email from the server

Now i will send the files created with Ethereal.
Here in this first attachment is the file that logs kmail retrieving a email
from the server.
Comment 27 2004-08-27 03:29:21 UTC
Created attachment 7310 [details]
Log created with ethereal of Evolution retrieving a email from the server

Here in the second attachment, is the file that logs Evolution retrieving a
email
from the server. 

Note: the email that is retrieved from the server with Kmail and Evolution is
the same email.
And dont worry about the password in this attachments because is changed.
Comment 28 2004-08-27 05:47:33 UTC
Now i want to let clear for once and for all that the problems that happens in kmail is only fault of Kmail, and has nothing to do with the ISP.
So far i know everybody understand thats, but i prefer to say it in a conscience discharge.
So when i receives emails from hotmail in Kmail it also happens to appear emails (html and text) displayed in blank with no sender, date and subject.
Comment 29 Thiago Macieira 2004-08-27 06:07:36 UTC
Comment on attachment 7310 [details]
Log created with ethereal of Evolution retrieving a email from the server

Please upload again without specifying the type as text/*, since this corrupts
the file.
Comment 30 2004-08-27 07:08:47 UTC
Created attachment 7311 [details]
Log created with ethereal of Evolution retrieving a email from the server (update of the attach 7310)

Now i just put to auto detect.
This is the log file of Evolution retrieving email from server
Comment 31 A T Somers 2004-08-27 08:21:58 UTC
You know what? I now remember seeing a similar effect that may be related and may be easier to reproduce (and hence, to fix):
If KMail has crashed, I often find on restart the messages I send in the previous session appear in the outbox. They appear there (that is: in the list of messages) complete with addressee, subject, etc. However, as soon as I click them and they are supposed to appear in the preview window, they are blanked. I did not try to see if there was anything left in terms of files in my mailbox, as the mail had allready been send off and was save in my Send-mail box, but it might be interesting to see why this happens, and if it could happen in other cases as well. It sounds like similar effect as what Ze is seeing. 
 
Comment 32 Andreas Gungl 2004-08-27 08:28:53 UTC
On Friday 27 August 2004 08:21, A T Somers wrote:
> You know what? I now remember seeing a similar
> effect that may be related and may be easier to reproduce (and hence, to
> fix): If KMail has crashed, I often find on restart the messages I send
> in the previous session appear in the outbox.

This problem is fixed in KMail 1.7. I remember the appropriate bug has been 
closed a while ago and in the meantime nobody ever has seen this bug. If 
you can still reproduce such a behavior, please let us know.

Comment 33 2004-08-27 09:38:47 UTC
A friend og mine just installed kmai-1.7 and told me that kmail continues with the same annoying bug.
Comment 34 A T Somers 2004-08-27 09:42:23 UTC
No, I have not been able to reproduce it. I just tried to using the X kill method. However, the problem sounded remarkable similar to what Ze (mmodem00) is seeing that I thought I might mention it. Maybe the same fix fixed his problem too? What version of KMail are you using Ze?
I think the bug you are refering to is bug 43931 by the way, right? 
Comment 35 2004-08-27 10:05:07 UTC
I can't understand why associate this bug with bug 43931.
I never said anything about having problems sending any message, so why are associanting to that bug?

By the way this email was displayed in blank in kmail, i had to run Evolution to be able to see the email.

Anyway,still in kmail i click to see the code of thie email and i saw a particulary line that caught my attention that isin the minimu strange or maybe related/solution with the problem:

X-Mail-Format-Warning: Bad RFC2822 header formatting in KMail are you using Ze?

But i am going to paste below all that appears when i clicked to see the code in kmail.

So, it stars here:

Return-Path: <anonymous@ktown.kde.org>
Delivered-To: mmodem00@netvisao.pt
Received: (qmail 3071 invoked from network); 27 Aug 2004 07:41:06 -0000
Received: from store-f1.netvisao.pt (HELO store?f1) ([213.228.128.92]) (envelope-sender <anonymous@ktown.kde.org>)
          by store3.netvisao.pt (qmail-ldap-1.03) with DES-CBC3-SHA encrypted SMTP
          for <mmodem00@netvisao.pt>; 27 Aug 2004 07:41:06 -0000
Received: (qmail 14202 invoked by uid 0); 27 Aug 2004 07:39:17 -0000
X-Mail-Format-Warning: Bad RFC2822 header formatting in KMail are you using Ze?
X-UID: 
X-Spam-Checker-Version: SpamAssassin 2.63 (2004-01-11) on 
 nl-217-129-161-143.netvisao.pt
X-Spam-Level: ***
X-Spam-Status: No, hits=3.1 required=5.0 tests=DATE_MISSING,FROM_NO_LOWER 
 autolearn=no version=2.63
Status: R
X-Status: N
X-KMail-EncryptionState:  
X-KMail-SignatureState:  
X-KMail-MDN-Sent: 
Comment 36 A T Somers 2004-08-27 10:17:16 UTC
>I can't understand why associate this bug with bug 43931. 
>I never said anything about having problems sending any message, so why are
>associanting to that bug? 
Because of the behaviour of messages showing up in the list of messages (with all relevant data there), but showing up blank and erasing the data in the list of messages as soon as you click them. That sounded similar to what you are seeing with incomming messages, unless I misunderstand your bugreport. That problem had to do with an index file that was out of sync with the actual mailbox. It may be totally unrelated, but it may also give a hint to the developers on where to search for the problem.

Do I understand your report correctly if I say that this is what you are seeing:
-initially, the message shows up correctly in the list of messages. That is: complete with data, subject and sender.
-at the moment you click the message in the list, the message turns up blank (or incomplete, missing the first paragraph perhaps?) in the preview area
-at that moment, the info in the list of messages dissapears as well.

> Anyway,still in kmail i click to see the code of thie email and i saw a
> particulary line that caught my attention that isin the minimu strange or
> maybe related/solution with the problem: 
 
> X-Mail-Format-Warning: Bad RFC2822 header formatting in KMail are you using Ze? 
That *does* look peculiar. Does that line show up in the headers in Evolution too? If not, KMail added it I'd say.
Comment 37 2004-08-27 11:32:51 UTC
Im going to try explain all:
Many times the emails appear without clicking anything already in blank, with unknown sender, date and subject.
Other times is possible to see the sender, subject and date but in the moment that you click in that email, it turns blank, with unknown sender, date and with no subject.
And even in other times, but very rare, it can appear a line ot teo and the rest of the email blank with unknown sender, date and no subject.

But in Kmail if you click to see the code, you see always something, and always appear that line "X-Mail-Format-Warning: Bad RFC2822 header formatting" and some text of the email, is than where i can get an ideia of the email and then go to Evolution and see that same email but now foe complete and well displayed.

In Evolution doesnt appear (this seeing the code) that line that i said "X-Mail-Format-Warning: Bad RFC2822 header formatting".

Hope now you can get the all picture of the problems i have in Kmail.

Now that im here i would to do a wish to Kmail, that is to put toolbar menus like in Evolution when you double click in a message and appears the email in a separated Window, in Evolution you have the capability of having toolbar menus and right click menus and do more things, and in Kmail you dont have it.
Comment 38 2004-08-27 16:02:20 UTC
Created attachment 7320 [details]
Two log files created with ethereal of Evolution and Kmail retrieving same email from the server

This bzip file contais the two logs that were created with Ethereal in wich
Evolution and Kmail retrieve the same Email from the server.
The file bzip was created because there was problems attaching the Evolution
log as text.
Comment 39 Thiago Macieira 2004-08-28 01:00:11 UTC
I cannot find where the warning "X-Mail-Format-Warning: Bad RFC2822 header formatting in KMail are you using Ze?" gets added anywhere in KDE code.

And I still cannot open the ethereal output files. They still seem to be corrupted because line terminations in the POP3 protocol appear as \n alone, instead of \r\n.
Comment 40 2004-08-31 13:51:18 UTC
I sent these ethereal logs packed in a bzip2 file to your mail thiago.macieira@kdemail.net.

Regarding the X-Mail format, excuse me because the line "X-Mail-Format-Warning: Bad RFC2822 header formatting ....." does not appear in the code of all messages displayed in blank by kmail.
But for example in comment #35 you can see there a line saing:
...
Received: (qmail 14202 invoked by uid 0); 27 Aug 2004 07:39:17 -0000
X-Mail-Format-Warning: Bad RFC2822 header formatting in KMail are you using Ze?
X-UID: 
...
Comment 41 Thiago Macieira 2004-08-31 17:48:23 UTC
The X-Mail-Format-Warning message could be unrelated, for all we know. But given the fact that it is present, it's quite likely that there is a header formatting problem somewhere in the message.

Maybe KMail receives the message correctly, then stores it in an mailbox folder as it was received, and then simply cannot read it anymore.

Ze: can you test if the same happens when messages are stored in a maildir folder?

Anyways, I still cannot open those ethereal logs. My ethereal and my tcpdump complain about an invalid network type.
Comment 42 2004-09-01 01:36:41 UTC
Like i said lately, i think the problem is when Kmail saves the messages.
By default i use the maildir format so the problem isnt from here.
Comment 43 Ingo Klöcker 2004-10-19 00:23:57 UTC
The "X-Mail-Format-Warning: Bad RFC2822 header formatting" headers are created by spamassassin. They appear if there's no empty line between header and body of the message.

Please try whether using fetchmail to fetch the mail from the POP server and then fetching this mail from the local mail spool with KMail fixes the problem. If this fixes the problem then the interaction between the POP server and KMail seems to be the problem.
Comment 44 2004-10-19 00:55:10 UTC
Fixed in kmail 1.7.1
Comment 45 Markus Karzelek 2007-09-11 09:29:51 UTC
Hm - you FIXED this bug - that's funny, because I have the same Problem in KMail 1.9.5.
Comment 46 Janet 2007-12-07 13:18:19 UTC
Same problem here with KMail 1.9.7, lost some invoices and other important stuff. Mail headers are shown correctly in filter dialog but after the mails are downloaded, some are blanked. Seems to happen the moment kmail marks them as read. I'll watch if this happens too when I configure kmail to *not* mark mails as read automatically.

Can someone please reopen this bug report?
Comment 47 Janet 2007-12-10 18:36:33 UTC
Yes it happens too. It does not happen when kmail marks the mail as read, it seems to happen the moment the mail gets touched the second time. But only a few mails from specific senders (applestore e.g.). Alas I was not able to take a look at the mail header before the mail was cleared. The email content gets cleared completely and all that remains in the header is X-Envelope-From, X-Envelope-To, X-Delivery-Time, X-UID, Return-Path, X-RZG-CLASS-ID, Received, Reply-To, Date and From.