<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
<!DOCTYPE bugzilla SYSTEM "https://bugs.kde.org/page.cgi?id=bugzilla.dtd">

<bugzilla version="5.0.6"
          urlbase="https://bugs.kde.org/"
          
          maintainer="sysadmin@kde.org"
>

    <bug>
          <bug_id>276893</bug_id>
          
          <creation_ts>2011-07-01 14:44:06 +0000</creation_ts>
          <short_desc>Messages not correctly being marked as read when opened</short_desc>
          <delta_ts>2017-01-08 00:04:58 +0000</delta_ts>
          <reporter_accessible>1</reporter_accessible>
          <cclist_accessible>1</cclist_accessible>
          <classification_id>2</classification_id>
          <classification>Applications</classification>
          <product>kmail2</product>
          <component>general</component>
          <version>2.1.0</version>
          <rep_platform>Gentoo Packages</rep_platform>
          <op_sys>Linux</op_sys>
          <bug_status>RESOLVED</bug_status>
          <resolution>UNMAINTAINED</resolution>
          
          
          <bug_file_loc></bug_file_loc>
          <status_whiteboard></status_whiteboard>
          <keywords>regression</keywords>
          <priority>NOR</priority>
          <bug_severity>major</bug_severity>
          <target_milestone>---</target_milestone>
          
          
          <everconfirmed>0</everconfirmed>
          <reporter name="David">StormByte</reporter>
          <assigned_to name="kdepim bugs">pim-bugs-null</assigned_to>
          <cc>aspotashev</cc>
    
    <cc>asturm</cc>
    
    <cc>cpigat242</cc>
    
    <cc>graham.anderson</cc>
    
    <cc>kdenis</cc>
    
    <cc>lnxusr</cc>
    
    <cc>martin</cc>
    
    <cc>mpgkde</cc>
    
    <cc>web</cc>
          
          <cf_commitlink></cf_commitlink>
          <cf_versionfixedin></cf_versionfixedin>
          <cf_sentryurl></cf_sentryurl>
          <votes>55</votes>

      

      

      

          <comment_sort_order>oldest_to_newest</comment_sort_order>  
          <long_desc isprivate="0" >
    <commentid>1137401</commentid>
    <comment_count>0</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-07-01 14:44:06 +0000</bug_when>
    <thetext>Version:           2.1.0 (using KDE 4.6.4) 
OS:                Linux

When migrated from Kmail1 (I suppose it happens too when using kmail from scratch), it has a SEVERE problem when marking and counting unread and read messages.
For example, in a folder I created for a mail account, folder list says I have 700 unread messages, but from those 700, only a few are really unread.
Then, that 700 number is the TOTAL messages in that folder, NOT unreaded ones.
But the problem arise too, when I read messages and those are in the same color always and not updating count of unreaded ones.
This is VERY annoying, since when a huge amount of mail is received every day, makes kmail2 very unintuitive and not productive.

What has been with the behaviour of previous kmail in this matter? (Colouring read and unread messages in different ways, counting unread messages intead of total messages, etc..)?

I hope I explained it well, and I marked it as a major bug, since not only it can lead to an accidental data loss if you *think* you read that message and delete it (since it does not mark as read properly), but also because if this behaviour is not fixed, it renders kmail2 to be counterproductive (because I need to spend an extra time in recheck already read messages!).

I think this is a major thing to be fixed in order to keep kmail2 testing up to date.

Reproducible: Always

Steps to Reproduce:
Open kmail2, configure some mail account on it (and create a folder to store that messages), receive messages, and see that unreaded ones are treated in the same way than readed ones

Actual Results:  
- Colours for read and unread messages are the same
- Count of unread messages is wrong, and it counts *all* messages in folders

Expected Results:  
- Different colours for read and unread messages in message list of folder
- Have unread counting fixed

Didn&apos;t try yet to have a config of kmail2 from scratch, but since this seems to affect its core, I don&apos;t know it will change much this case.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1137402</commentid>
    <comment_count>1</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-07-01 14:47:48 +0000</bug_when>
    <thetext>I add more: Also, the left panel containing the tree of folders is very broken in this matter:
It does not actually count well how much items a folder has in it (be read or unread).
Example: Create a new mail in composer, save it as a draft. Watch what drafts folder properties say: Counter for messages is wrong!
Now delete that draft, and look how this counter is still wrong (in my case, I have 0 drafts, but it says it has 2 unread, 1 total, and 1.2 KiB but it is empty!</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1137403</commentid>
    <comment_count>2</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-07-01 14:49:10 +0000</bug_when>
    <thetext>The same goes for every other folders, I recently noted (after submitting comment), that deleting a message in every folder, does not seem to update its counter.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1140601</commentid>
    <comment_count>3</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-07-11 13:28:23 +0000</bug_when>
    <thetext>Can confirm this bug</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1142606</commentid>
    <comment_count>4</comment_count>
    <who name="Torgny Nyblom">nyblom</who>
    <bug_when>2011-07-17 06:18:03 +0000</bug_when>
    <thetext>(In reply to comment #3)
&gt; Can confirm this bug

Which? The original or the appended one in comment #2?

As for the original I cannot confirm and I&apos;ve been using KMail2 since.. well the beginning.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1146025</commentid>
    <comment_count>5</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-07-27 11:18:58 +0000</bug_when>
    <thetext>(In reply to comment #4)
&gt; (In reply to comment #3)
&gt; &gt; Can confirm this bug
&gt; 
&gt; Which? The original or the appended one in comment #2?
&gt; 
&gt; As for the original I cannot confirm and I&apos;ve been using KMail2 since.. well
&gt; the beginning.

Did you upgrade from kmail1 or used a fresh kmail2 install? I reported it by using migration wizard and not a clean and fresh install and config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1146201</commentid>
    <comment_count>6</comment_count>
    <who name="Torgny Nyblom">nyblom</who>
    <bug_when>2011-07-27 19:08:58 +0000</bug_when>
    <thetext>Both actually.

And again, what bug can you confirm, wrong unread count or wrong total counter?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1146281</commentid>
    <comment_count>7</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-07-27 22:44:12 +0000</bug_when>
    <thetext>Since I reported the bug, I can confirm both two. But I am installing a fresh install of gentoo with kde 4.7.0 and will retest once it is finished with a clean config.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1149873</commentid>
    <comment_count>8</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-08-04 14:13:33 +0000</bug_when>
    <thetext>I retested with a clean system clean config kde 4.7.0 and can confirm both problems:
On one hand the counter problem: Currently it is displaying 45 unread messages (all of those messages are in blue color in messagelist).
It does not matter whether I open a message or whether I right click on folder and select &apos;Mark all mails as read&apos; option.
On the other hand is the messagelist display:
The most annoying thing is that messages in messagelist keep having blue color instead of changing color to mark them as efectivelly read.

And there is a bit more, when I right click a message and mark it as important, nothing happens however if I click the &quot;exclamation&quot; button at the right part of the message (in messagelist) it is correctly marked as important, so maybe a problem of signal connections?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1149876</commentid>
    <comment_count>9</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-08-04 14:17:09 +0000</bug_when>
    <thetext>Another thing which can be the cause of this too: I saw that in custom colors config, there is no option for &apos;read message&apos; color, but there is for &apos;new message&apos;, &apos;unread message&apos;, and so on.
So that could be the cause to a message not changing its color after being read??</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1154667</commentid>
    <comment_count>10</comment_count>
    <who name="David">StormByte</who>
    <bug_when>2011-08-17 16:15:08 +0000</bug_when>
    <thetext>Well, since no support is being received from developers, and this is a blockstopper bug from using Kmail, I am switching to another software hoping this will be solved really soon (I loved kmail...)

I will provide an image which will show what I am talking about of this serious regression.

In this image can be seen that I have 166 Unreaded messages on &quot;StormByte&quot; folder, but all of those have already been opened and read!!

Well, this is the image proving it is deadly wrong: http://2.bp.blogspot.com/-Ao7mAZyFiy4/Tkvo24UxS-I/AAAAAAAAACQ/HqUIbH9m1XI/s1600/kmail.png</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1160248</commentid>
    <comment_count>11</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-09-06 12:28:54 +0000</bug_when>
    <thetext>Can confirm &quot;wrong unread count &quot;, don&apos;t use total count...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1170240</commentid>
    <comment_count>12</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-10-05 08:15:31 +0000</bug_when>
    <thetext>http://adishatz.1s.fr/~gnumdk/kmail2/

Here screenshot showing what is happening:
- mail1.png: We receivre a new mail, marked as unread, in maildir, we can see mail is marked as unread.
- mail2.png: We read mail in kmail, marked as read in kmail, as unread in maildir and in roundcube
- mail3.png: We read mail again in kmail, marked as read in kmail, as read in maildir and as read in roundcube.

So, it seems kmail (akonadi?) do not append &quot;,S&quot; to mail filename first time we read email.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1170243</commentid>
    <comment_count>13</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-10-05 08:25:09 +0000</bug_when>
    <thetext>Here what happens in logs:

First time i read the message:

processing retrieval request for item 50388  parts: (&quot;RFC822&quot;)  of resource: &quot;akonadi_imap_resource_1&quot; 
continuing 
request for item 50388 succeeded 

Seconde time:

akonadi_imap_resource_1(8209)/libakonadi Akonadi::ItemSync::updateItem: Stored flags  QSet(&quot;\SEEN&quot;) new flags  QSet()</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1170266</commentid>
    <comment_count>14</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-10-05 10:50:01 +0000</bug_when>
    <thetext>Can confirm bug on Archlinux and Kubuntu 11.10</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1171967</commentid>
    <comment_count>15</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-10-11 07:19:49 +0000</bug_when>
    <thetext>797	8.360787	194.254.144.254	194.254.144.12	IMAP	Request: A000218 UID STORE 3439 FLAGS (\Seen)

Can confirm that akonadi do not send this the first time you read a message...</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1172055</commentid>
    <comment_count>16</comment_count>
      <attachid>64406</attachid>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-10-11 11:33:59 +0000</bug_when>
    <thetext>Created attachment 64406
Always mark message as read

Here a patch fixing the issue...

It seems kmail mark mail as read internaly but don&apos;t send information to akonadi.

Don&apos;t know if it&apos;s the best way to fix the bug... But it will give you a information on what&apos;s going wrong.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1172501</commentid>
    <comment_count>17</comment_count>
    <who name="Cédric Bellegarde">web</who>
    <bug_when>2011-10-12 17:40:10 +0000</bug_when>
    <thetext>Ok, i delete all my .kde4 .local and .config directories and now all is working well without previous patch...

WTF ? :-(

Will wait to see if bug appear again or if it&apos;s a migration issue or if it was fixed by recent archlinux update (4.7.2-2).</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1250730</commentid>
    <comment_count>18</comment_count>
    <who name="Martin Pagh Goodwin">mpgkde</who>
    <bug_when>2012-04-29 19:26:42 +0000</bug_when>
    <thetext>I have just installed Kubuntu 12.04, and initially my mail would work correctly (marking messages as read as I was opening them). I have then been through various contotions of errors with mail import from my old (11.10) home folder, and as a result Kmail no longer marks messages as read when reading them. 

If the reading pane is enabled, I have no problems, but I do not want to use the reading pane.

On a test account I created, where my import went more smoothly, &quot;mark as read when read&quot; works.

Thus a quick fix would be to be able to completely reset Kmail to the pristine state of &quot;just installed&quot;/&quot;new user&quot;. Dropping the akonadi database does not seem to impact the problem</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1339951</commentid>
    <comment_count>19</comment_count>
    <who name="Martin Koller">martin</who>
    <bug_when>2013-02-10 12:03:47 +0000</bug_when>
    <thetext>I can not reproduce with 4.10.0
Is this still an issue for you with this current version ?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1349276</commentid>
    <comment_count>20</comment_count>
    <who name="Graham Anderson">graham.anderson</who>
    <bug_when>2013-03-09 21:03:38 +0000</bug_when>
    <thetext>I still see this bug everyday; Platform Version 4.10.1 &quot;release 552&quot;

All my mail is via imap....</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1449043</commentid>
    <comment_count>21</comment_count>
    <who name="Andreas Sturmlechner">asturm</who>
    <bug_when>2014-05-16 20:52:26 +0000</bug_when>
    <thetext>Haven&apos;t seen that problem in a long time. Others?</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1624748</commentid>
    <comment_count>22</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2016-09-24 18:08:41 +0000</bug_when>
    <thetext>This bug has only been reported for versions before 4.14, which have been unsupported for at least two years now. Can anyone tell if this bug still present?

If noone confirms this bug for a Framework-based version of kmail2 (version 5.0 or later, as part of KDE Applications 15.12 or later), it gets closed in about three months.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1634329</commentid>
    <comment_count>23</comment_count>
    <who name="">lnxusr</who>
    <bug_when>2016-10-21 17:35:41 +0000</bug_when>
    <thetext>This bug is back in version 4:16.04.3.  This is the version I can recall seeing it.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1634331</commentid>
    <comment_count>24</comment_count>
    <who name="">lnxusr</who>
    <bug_when>2016-10-21 17:41:44 +0000</bug_when>
    <thetext>(In reply to lnxusr from comment #23)
&gt; This bug is back in version 4:16.04.3.  This is the version I can recall
&gt; seeing it.

OK, it seems there was a delay of some sorts when I set &apos;Mark selected message as read after&apos; to 0 seconds before it started actually marking them as read after opening.  It&apos;s now working.</thetext>
  </long_desc><long_desc isprivate="0" >
    <commentid>1652634</commentid>
    <comment_count>25</comment_count>
    <who name="Denis Kurz">kdenis</who>
    <bug_when>2017-01-08 00:04:58 +0000</bug_when>
    <thetext>Just as announced in my last comment, I close this bug. If you encounter it again in a recent version (at least 5.0 aka 15.08), please open a new one unless it already exists. Thank you for all your input.</thetext>
  </long_desc>
      
          <attachment
              isobsolete="0"
              ispatch="1"
              isprivate="0"
          >
            <attachid>64406</attachid>
            <date>2011-10-11 11:33:59 +0000</date>
            <delta_ts>2011-10-11 11:33:59 +0000</delta_ts>
            <desc>Always mark message as read</desc>
            <filename>fix_unread_messages.diff</filename>
            <type>text/plain</type>
            <size>1372</size>
            <attacher name="Cédric Bellegarde">web</attacher>
            
              <data encoding="base64">ZGlmZiAtLWdpdCBhL2ttYWlsL2ttbWFpbndpZGdldC5jcHAgYi9rbWFpbC9rbW1haW53aW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