Last Comment Bug 540554 - IMAP: In some folders a lot of mails is false marked as unread. (CONDSTORE is supportted by IMAP server)
: IMAP: In some folders a lot of mails is false marked as unread. (CONDSTORE is...
[has protocol log][gs]
: regression
Product: Thunderbird
Classification: Client Software
Component: Folder and Message Lists (show other bugs)
: unspecified
: x86 Linux
-- major with 11 votes (vote)
: Thunderbird 3.1b1
Assigned To: David :Bienvenu
: 539035 539947 540970 541114 541299 541337 541637 541900 542075 543029 543544 545174 545792 546661 (view as bug list)
Depends on:
Blocks: 524902 541699
  Show dependency treegraph
Reported: 2010-01-19 01:24 PST by Joachim
Modified: 2014-10-13 10:48 PDT (History)
47 users (show)
See Also:
Crash Signature:
QA Whiteboard:
Iteration: ---
Points: ---

imap.log from a short thunderbird session (1.53 MB, text/plain)
2010-01-19 06:12 PST, Joachim
no flags Details
proposed 3.01 fix (5.46 KB, patch)
2010-01-20 14:03 PST, David :Bienvenu
no flags Details | Diff | Splinter Review
right patch (941 bytes, patch)
2010-01-21 08:34 PST, David :Bienvenu
no flags Details | Diff | Splinter Review
patch with c++ unit test (6.87 KB, patch)
2010-01-22 13:56 PST, David :Bienvenu
standard8: review+
standard8: superreview+
standard8: approval‑thunderbird3.0.2+
Details | Diff | Splinter Review
nspr log with 3.0.2pre (1.39 MB, text/x-log)
2010-01-25 10:56 PST, Philipp Kewisch [:Fallen]
no flags Details

Description User image Joachim 2010-01-19 01:24:24 PST
User-Agent:       Mozilla/5.0 (X11; U; Linux i686 (x86_64); de; rv:1.9.2pre) Gecko/20100118 Namoroka/3.6pre
Build Identifier: Mozilla/5.0 (X11; U; Linux i686 (x86_64); de-DE; rv: Gecko/20100118 Lightning/1.0b1 Shredder/3.0.2pre

IMAP: In some folders a lot of mails is false marked as unread.

I have to select "Properties" ("Eigenschaften") and than "rebuild index" (Index wiederherstellen). Now all is o.k.
~1 hour later, exacly the same mails get marked unread again.
This is since start of this year. (3.0.1pre).

Reproducible: Always

Steps to Reproduce:
1.Connect to IMAP (cyrrus:
Escape character is '^]'.
3.Several mail in some folders suddenly are marked unread
Actual Results:  
Readed mails are marked unread

Expected Results:  
Readed mails keep marked read
Comment 1 User image Wayne Mery (:wsmwk, NI for questions) 2010-01-19 05:43:04 PST
Joachim, can you provide an imap log of this activity
Comment 2 User image Joachim 2010-01-19 06:12:31 PST
Created attachment 422318 [details]
imap.log from a short thunderbird session

I started tb and waited till i saw 2 messages marked wrongly as unread.
These mails are in Genetik.Genetik, dated 30.11.2000 and 06.12.2000, 7 messages at all, these are the latest two
Comment 3 User image Wayne Mery (:wsmwk, NI for questions) 2010-01-19 06:14:24 PST
thanks Joachim
Comment 4 User image David :Bienvenu 2010-01-19 15:22:48 PST
This is really a dup of an other condstore bug, but it has an excellent log, so I'm going to do the work here.
Comment 5 User image Joachim 2010-01-20 05:39:23 PST
A test with TB 3.01 on WinXP gave the same bug.
Comment 6 User image David :Bienvenu 2010-01-20 14:02:31 PST
I've requested a try server build for a fix for this on the 3.0 branch -

Joachim, Can you try this build when it comes out in a couple hours?
Comment 7 User image David :Bienvenu 2010-01-20 14:03:00 PST
Created attachment 422619 [details] [diff] [review]
proposed 3.01 fix
Comment 8 User image David :Bienvenu 2010-01-20 16:35:10 PST
*** Bug 540970 has been marked as a duplicate of this bug. ***
Comment 9 User image David :Bienvenu 2010-01-20 17:07:53 PST
Windows build is here - - please let me know if this fixes the problem for you...
Comment 10 User image Joachim 2010-01-21 05:01:17 PST

I tested for 5 houres on Linux and 3 on Windows.
The bug did not hit me any more.
Comment 11 User image David :Bienvenu 2010-01-21 08:32:41 PST
*** Bug 541114 has been marked as a duplicate of this bug. ***
Comment 12 User image David :Bienvenu 2010-01-21 08:34:37 PST
Created attachment 422760 [details] [diff] [review]
right patch

This has been reported to fix this for one user so far.

I'm going to write unit tests for nsImapFlagAndUidState, instead of worrying about adding condstore support to the fake imap server...
Comment 13 User image David :Bienvenu 2010-01-21 09:11:14 PST
*** Bug 539035 has been marked as a duplicate of this bug. ***
Comment 14 User image David :Bienvenu 2010-01-21 20:22:54 PST
*** Bug 541299 has been marked as a duplicate of this bug. ***
Comment 15 User image Joachim Jablon 2010-01-22 06:49:09 PST
I have the exact same problem. (it's a curse on the people named "Joachim" ^^).

I'll test the build and tell you if it works (or mainly "if I don't come back, then it works and thanks")
Comment 16 User image Jeroen van der Ham 2010-01-22 06:59:02 PST
Bug 535404 and 517461 appear to be a duplicate of this bug. These are reported to be fixed.

There was a comment that this fix was supposed to land in TB 3.0.1, but it doesn't seem like it did. The nightly Shredder appear to have the fix though.
Comment 17 User image David :Bienvenu 2010-01-22 07:54:45 PST
*** Bug 541337 has been marked as a duplicate of this bug. ***
Comment 18 User image Pyther 2010-01-22 08:40:56 PST
This patch seems to resolve the issue for me.
Comment 19 User image David :Bienvenu 2010-01-22 13:56:49 PST
Created attachment 423060 [details] [diff] [review]
patch with c++ unit test

This adds a c++ unit test that fails w/o the fix, and succeeds with it. The unit test can be run from objdir/mozilla/dist/bin/TestImapFlagAndUidState.exe
Comment 20 User image David :Bienvenu 2010-01-23 10:52:30 PST
*** Bug 541637 has been marked as a duplicate of this bug. ***
Comment 21 User image Joachim Jablon 2010-01-23 11:04:15 PST
The build doesn't work for me, i still get old message that get unread on a few folders (always the same).
Comment 22 User image David :Bienvenu 2010-01-23 11:16:20 PST
Joachim Jablon, you might try turning off condstore support (config editor, toggle mail.server.default.use_condstore to false) , select those folders, see if it corrects the counts. Then turn condstore support back on, and see if the problem re-occurs.
Comment 23 User image thunderbird 2010-01-23 12:39:42 PST
Turning off condstore works for me on 3.0.1.
Comment 24 User image Dennis 2010-01-23 16:13:28 PST
Works for me too when turning off condstore.
Comment 25 User image Joachim Jablon 2010-01-23 17:17:49 PST
Yup, works fine. Sorry I didn't get that "condstore" reference on the first place, a little bit of research on my side would have easied your work. Lesson taken ^^'

Thank you for spending time on that one ! Great job ^_^.
Comment 26 User image Luigi Rosa 2010-01-23 21:14:12 PST
Confirmed that turning off condstore solved the problem (TB 3.0.1 on Ubuntu and Dovecot 2.0 beta 1)
Comment 27 User image David Halik 2010-01-23 21:23:16 PST
It might be more useful if those of you turning off condstore left it on and instead tested David's 3.0.2pre build to make sure that it is indeed patched. They are aware that condstore support is the issue and turning it off is a quick fix, but the patch needs to ensure that TB 3.0.2 is working properly with condstore on.
Comment 28 User image Luigi Rosa 2010-01-23 21:26:20 PST
David, I would be happy to, but right now I only have two linux boxes at hand. Maybe in the afternoon or on Monday I can try David's build
Comment 29 User image Justin Dolske [:Dolske] 2010-01-23 23:28:02 PST
(In reply to comment #9)
> - please let me know if this fixes the problem for you...

I've been running the OS X build from your try push for a couple of days now, and it seems to have fixed the problem for me... No instances of folders becoming marked unread, and it was happening to me daily before.
Comment 30 User image thunderbird 2010-01-24 06:54:49 PST
David, the pre build from #9 works with condstore for me.
Comment 31 User image Ben Webb 2010-01-24 14:12:15 PST
I can confirm that turning off condstore fixes bug. Running 3.0.1 on XP using imap mail.
Comment 32 User image Harald Dunkel 2010-01-25 03:27:43 PST
I tried the patch on top of 3.0.1: Seems to work.
Comment 33 User image David :Bienvenu 2010-01-25 07:43:12 PST
*** Bug 541900 has been marked as a duplicate of this bug. ***
Comment 34 User image Daniel 2010-01-25 08:16:49 PST
I used the Mac OSX version of the pre build from #9 for 8 hours now, and can confirm it works for me as well.
Comment 35 User image Philipp Kewisch [:Fallen] 2010-01-25 10:56:26 PST
Created attachment 423376 [details]
nspr log with 3.0.2pre

I just tested 3.0.2pre (build id 2010012503) and it does not fix the issue for me. Disabling condstore works for me though.

I just before line 13682, the message count for Folder .projects.mozilla went up to ~1500.

Around line 14007, I selected "mark folder read". Then I selected other folders.

I went back to .projects.mozilla around line 14042, which caused the unread message count to reach ~1500 again. There is a total of ~3000 messages in that folder.

My IMAP server is dovecot, I believe version 1.2.9.
Comment 36 User image Mark Banner (:standard8) 2010-01-25 14:38:21 PST
*** Bug 542075 has been marked as a duplicate of this bug. ***
Comment 37 User image David :Bienvenu 2010-01-26 07:30:16 PST
fixed for 3.02 - nightly builds from tomorrow on will have the fix.
Comment 38 User image David :Bienvenu 2010-01-26 09:49:30 PST
marking fixed - the TFV is bogus, but we don't have TFV's for 3.0x; we're using status flags instead. This bug doesn't exist on the trunk.
Comment 39 User image Jay Levitt 2010-01-26 11:31:25 PST
This also fixes my problem on OS X (entire folders would generally become unread when condstore was enabled).
Comment 40 User image David :Bienvenu 2010-01-28 07:13:04 PST
*** Bug 539947 has been marked as a duplicate of this bug. ***
Comment 41 User image David :Bienvenu 2010-01-28 09:05:45 PST
I landed the c++ unit test on the 3.0x branch.
Comment 42 User image Philipp Kewisch [:Fallen] 2010-01-29 08:32:17 PST
*** Bug 543029 has been marked as a duplicate of this bug. ***
Comment 43 User image Mark Banner (:standard8) 2010-01-30 11:28:40 PST
*** Bug 543224 has been marked as a duplicate of this bug. ***
Comment 44 User image javad 2010-01-31 01:15:23 PST
my bug 543224 though marked as duplicate - if i see this whole communication - there could be some difference. 
1. I am using POP and not imap.
2. My problem is not wrong mails or already read mails marked unread - problem is say i have 25 unread mails - the folder name with bracket showing count of unread messages may say 5 or 10 or any number as unread mails but not 25.

anyway - still you might be correct as i do not know much in details, i just wanted to convey the difference.
Comment 45 User image David :Bienvenu 2010-02-09 13:28:37 PST
*** Bug 545174 has been marked as a duplicate of this bug. ***
Comment 46 User image David :Bienvenu 2010-02-11 13:33:53 PST
*** Bug 543544 has been marked as a duplicate of this bug. ***
Comment 47 User image David :Bienvenu 2010-02-11 18:11:59 PST
*** Bug 545792 has been marked as a duplicate of this bug. ***
Comment 48 User image David :Bienvenu 2010-02-17 08:26:42 PST
*** Bug 546661 has been marked as a duplicate of this bug. ***
Comment 50 User image K Moser 2014-10-13 10:04:04 PDT
I'm using 31.1.2 (Windows) and have this problem. I'm using POP exclusively (never IMAP).

If it matters, I started by importing my old Eudora email. I had to go back and mark much of it as "read" even though it had been read ages ago. For a few days many of the old imported emails (often an entire folder) would sporadically revert to "unread". I thought I had it under control but once in a while it pops up. It even marked some as unread after I did a multi-folder search. I don't know how to reliably reproduce this.
Comment 51 User image rsx11m 2014-10-13 10:22:59 PDT
This bug is closed and was addressing an issue with the IMAP implementation. Please open a new bug report with a detailed description of the issue as it manifests itself using POP now.

Note You need to log in before you can comment on or make changes to this bug.