On Fri, 13 Mar 2009, Shawn Walker wrote:
The application has multiple threads with 2 connections to the IMAP server. One of them is for IDLE.

This application does not use c-client to do IMAP client. c-client does not support client-end IDLE.

Presumably, by "thread", you mean threads in a process as opposed to message threads.

UW imapd does not run multi-threaded; each IMAP session has its own process. Nor does the c-client library use threads.

So, whatever is threading and using IDLE does not seem to have anything to do with c-client or imapd.

When something happen on the IDLE thread, the server send a list of untagged IMAP commands to the client of what happened.

The server sends untagged IMAP responses, not commands.

The IDLE thread see that it need to update a folder, but the IDLE thread has two messages the UID of 100 and 101 (an example). But, UID 101 is doesn't exist anymore, but UID 102 is on the server. So, the IDLE thread request the message cache for UID 102 but c-client doesn't know about 102 in it's message cache due that it only know of UID 100 and 101 and return with a NIL. Hence, the message cache is stale.

This makes no sense, so I have to guess what you are talking about.

My guess is that client has two IMAP sessions open. One of those sessions did an IDLE command that notified the client of new messages. You expected that the other session would instantaneously know about those new messages, even though that session had not yet been notified.

That is not the way IMAP works. Each IMAP session has its own independent state, and is notified of new messages independently.

Why do you have two IMAP sessions open on the same mailbox? That, by itself, suggests that you are not using IMAP properly. No well-written application should need more than one IMAP session open to a mailbox at a time.

The only way that I can get the message cache to throw away it's message cache is to disconnect from the server and then reconnect to the server and then the message cache will have UID 100 and 102.

It there is a change in the mailbox state, the session will be notified of that fact as part of executing a command. State changes do not magically transfer from one session to another.

What I need is to tell c-client to refresh it's message cache to have UID 100 and 102. Is there a c-client call that I make that will do that?

You need to execute a command.  If nothing else, a NOOP command.

-- Mark --

http://panda.com/mrc
Democracy is two wolves and a sheep deciding what to eat for lunch.
Liberty is a well-armed sheep contesting the vote.
_______________________________________________
Imap-uw mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to