- 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?
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.
- 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;
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.
-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?
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.
-In mail_stream: unsigned long nmsgs; /* # of associated msgs */ unsigned long recent; /* # of recent msgs */ 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.
- 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?
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.
