Bug 66354 - Kmail reports the wrong number of messages in IMAP folders
Summary: Kmail reports the wrong number of messages in IMAP folders
Status: RESOLVED DUPLICATE of bug 65418
Alias: None
Product: kmail
Classification: Applications
Component: IMAP (show other bugs)
Version: unspecified
Platform: RedHat Enterprise Linux Linux
: NOR normal
Target Milestone: ---
Assignee: kdepim bugs
URL:
Keywords:
: 66952 (view as bug list)
Depends on:
Blocks:
 
Reported: 2003-10-21 21:11 UTC by mhirsch
Modified: 2007-09-14 12:17 UTC (History)
1 user (show)

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description mhirsch 2003-10-21 21:11:07 UTC
Version:            (using KDE KDE 3.1.4)
Installed from:    RedHat RPMs
OS:          Linux

I use IMAP (MS Exchange, in particular) with kmail to read mail.  I find that kmail no longer reports the proper number of emails in a folder.

For instance, right now my linux inbox says that there are 282 unread messages and 104 total messages.  Obviously one of those numbers is incorrect.

When I select the folder, it redisplays as 104 messages with no unread messages--the right numbers.

If I select some other folder, then the next time it scans for mail it goes back to reading 282 unread messages.  

I don't know how to get into this situation initially.  It may be a MS Exchange bug, or an interaction bug.
Comment 1 mhirsch 2003-10-22 16:09:55 UTC
I have discovered that if I right click the folder and select Compact, the problem goes away on that folder.  

Until I move the mail.  I compacted a folder and the problem was gone.  Then I selected all email in a folder (38 messages) and dragged them all to another folder.  Then I pressed the "Chekc mail in" button.  When mail was checked, the now empty folder says it has 38 messages in it.  Compacting again makes it go away.

So apparently dragging mail from one folder to another does not update something correctly.  Whether it is in the client or the server I don't know.
Comment 2 mhirsch 2003-10-23 16:00:45 UTC
Another data point:  When I do the same thing in Outlook (select all messages in a folder, then drag them to a different folder) kmail correctly detects that the folder is empty.

Not an entirely fair comparison, since outlook, running under crossover office, uses MAPI, not IMAP, but interesting.
Comment 3 Ingo Klöcker 2003-10-31 09:55:07 UTC
*** Bug 66952 has been marked as a duplicate of this bug. ***
Comment 4 Thomas Reitelbach 2003-11-03 21:36:21 UTC
I can confirm this bug, it is still present in KMail 1.5.93 (2003-11-03).
The problem is that KMail counts messages that are marked as deleted.

Here is how i can reproduce it:
1. I send 3 or more testmail to my imap-inbox.
2. I click on unread message 1, hold shift, then click unread message 3. This marks message 1 to 3, leaving the "unread" tag for message 2 since i never clicked it.
3. delete my 3 marked messages
4. change to a different folder than inbox
5. click on "look for email" button

The result: The folder pane shows 1 unread message for inbox. When i open the inbox no unread message is in there.

The reason: KMail did not really delete the three messages, but only marked them as deleted. This is a nice feature of the imap protocol and no error at all. But when KMail counts unread messages for a folder, it counts deleted messages, too.
The one unread message disappears as soon as i compact my inbox.
In addition if i configure KMail to expunge all deleted messages immediately, this bug does not occur.

Hope my explanation is helpful to someone who can fix this :-)

Bye,
Thomas
Comment 5 Carsten Burghardt 2003-11-15 00:26:57 UTC
Kmail simply shows the unread count that is reported by the server so if this number is wrong it's a server bug.
The total number is calculated by kmail and this number decreases if you delete a mail. That's why these two numbers may be different if you do not select to expunge automatically (account settings).
The only thing we could do to get the numbers in sync is to fully support messages that are marked as deleted (actually show them). There is already a wish for this so I tend to close this report. OK?
Comment 6 Thomas Reitelbach 2003-12-04 21:23:55 UTC
if you consider this not beeing a real bug, then kmail at least should be consistent and _always_ show the wrong number of unread messages.
currently i can see the wrong unread count when my inbox is not selected, but as soon as i click my inbox kmail re-reads messages and the wrong unread-count disappears.

in addition as long as we cannot easily get rid of this annoyance i would suggest a little warning message when the "automatically expunge messages" option is beeing disabled by the user. something like "warning: kmail does not fully support marked-as-deleted messages on imap folders. if you disable this option you might get confusing unread-message counts."

on the other hand i will vote for the wish you mentioned (fully support mark as delete) :-)

thomas
Comment 7 mhirsch 2003-12-08 15:15:50 UTC
I suspect that this is more of a MSExchange bug.  If I use Mail::IMAPClient (perl module) to mark messages as deleted on mu MSExchange, the don't show up in kmail, but they _do_ show up in outlook.  They also show up in the web interface to MSExchange.

I suspect that MS as incorrectly implemented the mark as deleted feature.  If I expunge the folder they go completely away.

So a workaround is to offer an expunge when deleting option.  I assume this would slow things down a bit, but it does solve the problem.
Comment 8 Ferdinand Gassauer 2003-12-11 10:52:32 UTC
Subject: RE:  Kmail reports the wrong number of messages in IMAP
 folders

Do not use MS exchange but SuSE Openexchange

--
Best Regards
Ferdinand Gassauer

> -----Original Message-----
> From: owner@bugs.kde.org [mailto:owner@bugs.kde.org] On 
> Behalf Of mhirsch@nubridges.com
> Sent: Monday, December 08, 2003 3:16 PM
> To: gassauer@kde.org
> Subject: [Bug 66354] Kmail reports the wrong number of 
> messages in IMAP folders 
> 
> 
> ------- You are receiving this mail because: -------
> You are on the CC list for the bug, or are watching someone who is.
>      
http://bugs.kde.org/show_bug.cgi?id=66354     




------- Additional Comments From mhirsch@nubridges.com  2003-12-08 15:15
------- I suspect that this is more of a MSExchange bug.  If I use
Mail::IMAPClient (perl module) to mark messages as deleted on mu MSExchange,
the don't show up in kmail, but they _do_ show up in outlook.  They also
show up in the web interface to MSExchange.

I suspect that MS as incorrectly implemented the mark as deleted feature.
If I expunge the folder they go completely away.

So a workaround is to offer an expunge when deleting option.  I assume this
would slow things down a bit, but it does solve the problem.



Comment 9 Till Adam 2003-12-28 14:01:23 UTC
It's still a duplicate.

*** This bug has been marked as a duplicate of 65418 ***