Other than modifying the c-client code, there are no specific supported interfaces in c-client for sending custom commands. The reason for this is that, among other things, custom commands generally require handling of new responses, which in turn forces a modification to the c-client code in the response processor.

With that said, it is generally fairly easy to add support for a custom command in c-client. The file that you modify is imap4r1.c. To send a command, you set up a vector of IMAPARGs which represent the arguments to your command, then call imap_send() to send it. imap_send() returns an IMAPPARSEDREPLY which you can either handle yourself or pass to imap_OK() for general handling.

To field a new untagged response, you need to add a clause to the if-else change in imap_parse_unsolicited() of the form:
else if (!strcmp (reply->key,"MYNEWRESPONSE") .....


As a model, look at how the GETQUOTA command is implemented. That is, look at routine imap_getquota() to see how to send a command, and the processor for the QUOTA response (search for "this response has a bizarre syntax") to see how to field a response. You should be able to reuse existing parsing routines instead of having to write your own

One final comment. The whole idea of PROXYAUTH has been obsolete for a decade, having been replaced with SASL authentication/authorization ID. Rather than implement a bad idea from the past, perhaps you should implement the modern, standard way of doing things. What's more, c-client already supports it without you having to do anything.

The reality is as a company
required to integrate with a variety of IMAP servers, we pretty much
have to support this.

PROXYAUTH is not part of an IMAP server.

-- Mark --

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

Reply via email to