Subject: questions about using c-client

From: [email-masked]
Date: Tue, 26 Oct 2004 11:11:01 EDT

- In the "internal.txt" there is a section of "Main Program Callbacks". If  
c-client is used for implementing a imap client, are all of the  these mm_xxx 
callbacks required to be implemented, or could be selective?
 
- My understanding for using c-client is:
use mail_xxx to send request to host imap server, and result will be put  
into the "MAILSTREAM *stream" for that mail box. Is there documentation about  
how to extract the result for the interested request. i.e. listing sub folders;  
listing mails in the folders;
 
-Is the member "unsigned long nmsgs;  /* # of associated msgs */"  of 
mail_stream represents all mails in this mailbox (including mails inside sub  
folders), or only top level mails?
 
-In mail_stream:
  unsigned long nmsgs;  /* # of associated msgs */
unsigned long recent;   /* # of recent msgs */
Should they be  same when that mailbox is open?

- After did mail_open() for a mail box, the returned "stream"  will represent 
this mail box. Will all of the consequent request against this  mail box 
(i.e. mail_fetchstructure(); mail_recent();..) using same under line  socket, or a 
new socket will be open for each request?
 
-What is the difference between stream->tcpsi  and stream->tcpso?
 
Thanks for your help!

---

From: Mark Crispin <[email-masked]>
Date: Tue, 26 Oct 2004 14:18:59 -0700 (Pacific Daylight Time)

> callbacks required to be implemented, or could be selective?

It is mandatory to implement all the callbacks.  Look at the mtest, 
mailutil, and imapd programs to see what is required to be done in a 
callback.

> listing mails in the folders;

I strongly suggest that you read the specification of the IMAP protocol 
(RFC 3501) to understand how such things as wildcards work.  You will 
understand c-client much better if you understand IMAP.

> folders), or only top level mails?

The question is meaningless.  A mailbox only has one level of messages.

Any inferior-name mailbox (there is no such thing as "folder" in IMAP) is 
a separate mailbox.

> Should they be  same when that mailbox is open?

The recent message count is completely different from the number of 
messages.  Please read the IMAP specification.

> new socket will be open for each request?

All operations on a particular MAILSTREAM use the same socket.

> -What is the difference between stream->tcpsi  and stream->tcpso?

This is an internal detail which should not concern you.

Some network technologies require separate sockets for input and output, 
such as when the socket is actually a pipe to another process.  Since you 
will never access these values yourself (you will be dealing with a higher 
level abstaction such as MAILSTREAM, NETSTREAM, or TCPSTREAM) it doesn't 
matter what the code does internally.

-- Mark --

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