Version: Kontact: 1.2.3/KMail: 1.9.4 (using KDE KDE 3.5.4)
Installed from: SuSE RPMs
While add support to read X-Status from mails while import and set the correct state for the imported mails in KMail I found this problems:
* KMail never set the correct X-Status / Status flag to the header of the Mail (tested with dIMAP and local maildir) if you don't move the mail
* KMail update the X-Status / Status flag if you move a mail to another maildir
* If I change the state of a mail e.g. from read to unread, leave the folder, exit kontact and restart KMail (another folder is selected!) the state of the mail is only displayed a very short time (e.g. one unread mail for the folder) the the state is changed back to previous state (no unread mail left in the folder)
Looks as if there are problems with set the correct Flags in the mail-header.
We decided against updating the *Status headers because it's very expensive (it requires rewriting of all messages with changed status headers; think Mark All Messages as Read) compared to just updating the flags in the index file. So this explains observation no. 1. A possible solution would be to make KMail update the *Status headers during folder compactification.
Observation no. 2 is interesting because moving a maildir message locally should be a simply 'mv oldlocation newlocation' and thus don't change the moved messages at all. At most, the maildir flags (i.e. those appended to the file name) could be updated.
Observation no. 3 seems to be a bug. It seems that the index file isn't written properly. Do I understand correctly that you exit Kontact and then start KMail? Please file a separate bug report for this last problem because it seems to be a real bug while the other two problems are unrelated.
> A possible solution would be to make KMail update the *Status headers during
> folder compactification.
This sounds for me like a acceptable compromise between correct flags and performance. At least X-Status should be updated (Not shure what the Status flag is for atm).
> Observation no. 2 is interesting because ...
This was what I could observe while experience with read the status while import.
> Observation no. 3 seems to be a bug. ...
Yes looks like a bug, but no, my fault, I closed Kontact and reopend Kontact. Btw. I open a new bug for this problem.
The Status flag is the standard well-defined header for keeping the message status, but it only supports a very limited set of flags. Therefore X-Status was introduced which supports more flags than Status. But X-Status is still limited which is why Mozilla adds new X-Mozilla-Status* headers. And we will probably have to do something similar because our flags also do not all map to Status + X-Status. Or maybe we should first check whether we can use the X-Mozilla-Status* headers. OTOH, the latter is probably not a good idea unless Mozilla officially specifies the headers.
Thank you for taking the time to file a bug report.
KMail2 was released in 2011, and the entire code base went through significant changes. We are currently in the process of porting to Qt5 and KF5. It is unlikely that these bugs are still valid in KMail2.
We welcome you to try out KMail 2 with the KDE 4.14 release and give your feedback.