Subject: Re: questions about how to do multiple IMAP sessions to the server in c-client

From: [email-masked]
Date: Mon, 1 Nov 2004 17:01:47 EST

In a message dated 2004/10/28 13:45:24 Eastern Standard Time,  
[email-masked] writes:

I strongly  suggest that you buy a copy of the book "Internet Email 
Protocols: A  Developer's Guide", by Kevin Johnson, published by Addison 
Wesley, ISBN  0-201-43288-9.
Definitely I need to study this book. It is out of print now and I am  
getting  a used one soon. Thanks.
 
While I am reading the RFC 3501, come across one question about the mail's  
UID.
 
If the requirement for the client, which uses c-client, is to list all  mails 
for each mailbox in UI in one connection. And store the mail's UID in  local, 
later if user clicks on that mail, its UID will be used to fetch the  mail's 
body. It could be done by doing mail_open(...) for each  mailbox  one-by-one. 
But seems there is problem for this approach.

in 2.3.1.1 Unique Identifier (UID) Message  Attribute
It says: 
"The unique identifier of a message MUST NOT change during  the session, and 
SHOULD NOT change between sessions."  
It means the UID might change between sessions (true/false?).

So after select another mailbox, the previous opened mailbox's session is  
closed and the UID of the mail in previous mailbox might not be simply  valid. 
Does it mean if user clicks one the mail, the client have to do
1. reselect the mailbox by mail_open(),
2. check the validity of the UIDs, (is there a function in c-client does  
this?)
3. use the adjusted/valid UID for fetching body?
 
Or is there a better approach with c-client?
 
Thanks for your help!

---

From: Mark Crispin <[email-masked]>
Date: Mon, 1 Nov 2004 15:29:01 -0800 (Pacific Standard Time)

> 2. check the validity of the UIDs, (is there a function in c-client does

It's not a function.  It's the uid_validity on the stream (e.g. 
stream->uid_validity).  If it is different from the uid_validity from a 
previous stream, then none of the UIDs from the previous stream are useful 
any more.

-- Mark --

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