Subject: Re: Total refresh of the stream

From: Jess Nielsen <[email-masked]>
Date: Wed, 12 Nov 2003 14:52:23 +0100

My problem is that I have to different sessions accessing the same 
mailbox.

When one of the sessions are deleting mails in the mailbox the other 
session 
still holds the data for theese deleted messages, which means that cache 
does 
not contain the same data as the store/mailbox.

I would like to force an update of the stream/cache to make sure that both
the store and cache will be in sync.

Regards,
Jess

Mark Crispin <[email-masked]>
Sent by: [email-masked]
12-11-2003 14:43

        To:     Jess Nielsen <[email-masked]>
        cc:     [email-masked]
        Subject:        Re: Total refresh of the stream

On Wed, 12 Nov 2003, Jess Nielsen wrote:
> I'm looking for a way that will refresh the entire screen and cache as
> well.

What is it that you wish to accomplish?  What do you mean by a "total
refresh"?

Since IMAP is a stateful protocol, there is generally no reason why you
would want to do the type of "refresh" operation that you need to do with
web pages or NFS.

More to the point; the only reasons why you need to call mail_open() again
is if you want to open a different mailbox or if the IMAP session got
broken and the stream is dead.  If you have a live stream open on the
mailbox that you want, there should be no reason to "refresh" it.

So, you may confused; I certainly am with your question.  I suspect that
you observed a problem, you think that the solution is to "refresh", and
are getting yourself deeper into trouble.  If this is the case, then what
you should do is re-examine the underlying issue.

-- Mark --

http://staff.washington.edu/mrc
Science does not emerge from voting, party politics, or public debate.
Si vis pacem, para bellum.

---

From: Mark Crispin <[email-masked]>
Date: Wed, 12 Nov 2003 08:18:26 -0600 (Central Standard Time)

> My problem is that I have to different sessions accessing the same

There is almost no legitimate reason to do that.  IMAP is not HTTP.

It's not going to be "more efficient"; nor is it going to be "faster".
IMAP servers are typically I/O bound, not CPU bound.  Either they are I/O
bound on the network to/from your client, or are I/O bound to the disk on
the mail data.  Either way, a second server session on the same mailbox
from the same client isn't going to gain anything.

What's more, some mail stores do not permit multiple opens on the same
mailbox, and either deny a second open or kill the previous open.  So, you
end up doing battle with yourself.

> session still holds the data for theese deleted messages, which means
> that cache does not contain the same data as the store/mailbox.

mail_ping(), or in extreme circumstances mail_check(), is all that you
need to ensure that both sessions are in sync.

-- Mark --