I think I'm understanding what's happening here from looking at the log files. This is the log entry for selecting the INBOX (UID modified):
Quote:
C: C06 SELECT Inbox
S: * 149 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 81] Message 81 is first unseen
S: * OK [UIDVALIDITY 1] UIDs valid
S: * OK [UIDNEXT XXXX33] Predicted next UID
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
S: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)] Permanent flags
S: C06 OK [READ-WRITE] SELECT completed; now in selected state
|
Apparently, when polling Yahoo Mail via IMAP4 it will include deleted messages in the response. Yahoo Mail returns a Inbox message count of 149. So Yahoo stores delete messages in both the Trash folder and the original folder.
Zimbra is still bugged though because when it requests a fetch on all 149 messages, the ones that have been deleted have the "\Deleted" flag set and therefore should not be counted.
Here's 5 fetches that occurred on my Inbox (UIDs modified):
Quote:
C: C73 UID FETCH XXXX01,XXXX50,XXXX33,XXXX77,XXXX02 (FLAGS INTERNALDATE)
S: * 55 FETCH (FLAGS (\Seen) INTERNALDATE "16-Jul-2008 23:57:16 -0700" UID XXXX02)
S: * 56 FETCH (FLAGS (\Seen) INTERNALDATE "17-Jul-2008 15:26:04 -0700" UID XXXX77)
S: * 57 FETCH (FLAGS (\Seen) INTERNALDATE "21-Jul-2008 17:28:18 -0700" UID XXXX33)
S: * 58 FETCH (FLAGS (\Deleted \Seen) INTERNALDATE "22-Jul-2008 01:21:29 -0700" UID XXXX50)
S: * 59 FETCH (FLAGS (\Deleted \Seen) INTERNALDATE "22-Jul-2008 14:26:55 -0700" UID XXXX01)
|
These are 5 messages "in" the Inbox, but 2 of them have been deleted so are actually in the "Trash" folder and should be ignored.
So the Zimbra client can't just display what was received in the SELECT command. It needs to keep a tally on the responses to the FETCH's and not count any that have been "\Deleted".
I'm using the new Yahoo Mail, not the classic version if that makes a difference.
edit:
Okay I found a "fix" for this. Yahoo's servers will include deleted items in a folder via the IMAP4 SELECT command until a message is deleted from that folder using an IMAP4 client (I'm not sure what command is used, but it looks like it APPENDS to the trash). At this point the folder count will no longer include deleted items.
C: C19 SELECT Inbox
S: * 63 EXISTS
S: * 0 RECENT
S: * OK [UNSEEN 0] Message 0 is first unseen
S: * OK [UIDVALIDITY 1] UIDs valid
S: * OK [UIDNEXT XXXX45] Predicted next UID
S: * FLAGS (\Answered \Flagged \Deleted \Seen \Draft)
S: * OK [PERMANENTFLAGS (\Answered \Flagged \Deleted \Seen \Draft)] Permanent flags
S: C19 OK [READ-WRITE] SELECT completed; now in selected state
This seems to point towards some kind of initialization problem with Yahoo's IMAP server with respect to folders.
So the work around if you have this problem is to delete a message from each folder where the count is wrong and then sync. Wait about 30 seconds and sync again and the message counts will be correct.
Note you can move messages from the trash into the problem folders, sync and then delete those messages. That way you don't have to delete any messages you want to keep.