Bug 104190 - IMAP: wrong number of new mails shown after folder name
Summary: IMAP: wrong number of new mails shown after folder name
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: 1.8
Platform: unspecified Linux
: VHI normal (vote)
Target Milestone: ---
Assignee: kdepim bugs
: 121812 (view as bug list)
Depends on:
Reported: 2005-04-19 09:33 UTC by Jens
Modified: 2015-04-12 10:25 UTC (History)
3 users (show)

See Also:
Latest Commit:
Version Fixed In:


Note You need to log in before you can comment on or make changes to this bug.
Description Jens 2005-04-19 09:33:57 UTC
Version:           1.8 (using KDE 3.4.0 Level "a" , unofficial build of SUSE )
Compiler:          gcc version 3.3.3 (SuSE Linux)
OS:                Linux (i686) release 2.6.5-7.151-default


I'm using KMail from KDE 3.4.0 (SuSE build) and IMAP (without cache, ie. online IMAP). My INBOX displays a curious phenomenon: When I check for new mail and the INBOX is *not* selected, it shows a number of new mails that is far too high (usually in the hundreds). As soon as I click on INBOX this number is updated to show the real number of new mails.

For example (right now), in a mailbox where mutt (directly on the server) says "[Msgs:932 New:38 Old:311 Del:873 Flag:1 4.0M]", KMail says "Posteingang (349)". I have no idea whwere it gets this number, but it might be connected with the IMAP folder contents because it is only displayed *after* I check for new mail.

Thank you,

Comment 1 Rich Birch 2005-04-19 19:43:03 UTC
I can see where the number has come from (38 + 311 = 349), but I presume
it should be showing the number of new msgs rather than new + old.

I wonder if this bug is anything to do with #86281 (which I'm still
Comment 2 Carsten Burghardt 2005-04-20 09:09:26 UTC
Is it possible that the 311 messages are marked as deleted?
Can you please switch off encryption for the account, start ethereal and then start a new-mail-check?
Comment 3 Jens 2005-04-20 09:35:55 UTC
No, mutt shows the 311 messages as "Old", not deleted. I have over 800 "deleted" messages in the mailbox (as shown by Mutt). :-) And KMail definitely did not show 311 messages in the INBOX message list.

I can't reproduce this problem right now. I'll get back to you as soon as I can, with an IMAP command log. I don't know if this is related to Bug 86281 (quoted here again to force Bugzilla to link it :-) )

Comment 4 David Grant 2005-07-31 19:12:33 UTC
Do you have "automatically compact (expunge) folders" option enabled in that account?
Comment 5 Jens 2005-08-01 14:33:43 UTC
No, definitely not.
Comment 6 Ferdinand Gassauer 2006-02-17 09:04:14 UTC
in kmail 1.9.1 KDE 3.5.1 Level a on a SuSE 10.0
the numbers of unread messages in SOME (!) imap folders are wrong (usually 1 to much)
even a empty folder shows ONE unread message.

thunderbird reports it correctly and previous versions of kmail too. 

IMHO introduced with KDE 3.5
Comment 7 Ferdinand Gassauer 2006-02-17 10:08:17 UTC
workaround to correct the wrong number:

copy a message into the folder and delete it afterwards.

it might have to do something with the imap server (SLOX), because the problem was observed on 2 different computers accessing the same imap folder.

one of the boxes was a fresh install.

Comment 8 Ferdinand Gassauer 2006-02-17 10:08:48 UTC
*** Bug 121812 has been marked as a duplicate of this bug. ***
Comment 9 Ferdinand Gassauer 2006-02-25 20:29:46 UTC
1) the workaround in comment 7 does not work
2) same problem in KDE 35 SVN of today on SUSE10.0/AMD64
Comment 10 Ferdinand Gassauer 2006-02-26 12:15:26 UTC
interesting: the folders with wrong number of messages are not always the same
Comment 11 Ferdinand Gassauer 2006-02-28 10:52:40 UTC
for each folder "Compact folder" seems to help.

I'll obeserve, if the problem comes up again.

BTW I do not know, what this function should do with IMAP folders. 
IMHO no "user" will usually neither find the folder nor know the size of the folder and if ever it is necessary to compact it.

The problem (and possible solution) is found on SUSE 3.5.1 rpm and SVN of today.
Comment 12 Ismail Onur Filiz 2006-03-11 10:04:44 UTC
Decreasing the severity as "major" is more for bugs that seriously affect the workflow. If you still think that it is a 'major' bug, you can change it back.
Comment 13 Ferdinand Gassauer 2006-03-11 10:17:21 UTC
IMHO changing the IMAP account settings to "automatically compact folders=ON" solves the problem.
I'll observe this.

my server splits up the incoming mails into about 15 different subfolders which tend to show wrong numbers of new mails and I can tell you this seriously affects working with kmail. 
Comment 14 Ferdinand Gassauer 2006-03-14 08:25:32 UTC
After changing the settings to "automatically compact folders=ON" this error is gone. 
I sett the priority to VHI, because it's a very irritating error, but should be easy to fix.
Comment 15 Philippe Cloutier 2006-04-26 10:05:16 UTC
Note that this was submitted against 3.2.2 downstream as Debian #253978.
Comment 16 Björn Ruberg 2009-12-21 00:39:53 UTC
Is this fixed now?
Comment 17 Laurent Montel 2015-04-12 10:25:24 UTC
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.