using imclient

Patrick Radtke phr2101 at columbia.edu
Wed Mar 16 16:04:48 EST 2005


I'll add a little code sample

// server returns NO on an error
imclient_addcallback(imclient, "NO",
		       CALLBACK_NOLITERAL,
		       callback_error,
		       &error_string,
		       NULL);

  nc =1;
   imclient_send(imclient,end_command,(void*) &nc,"create 
\"user/bigtestuser3\"");
  while(nc > 0) {
     imclient_processoneevent(imclient);
       }
cout << "create data is " << error_string << endl;


So bigtestuser3 already exists. So I would expect the imap server to 
return 'NO Mailbox already exists'.
So I add a callback on the keyword 'NO', but it never gets called. Are 
there other settings I need to use on the callback?

The 'nc' and 'end_command' stuff is how things were done in 'man 
imclient'.

thanks,

-Patrick


On Mar 16, 2005, at 12:41 PM, Patrick Radtke wrote:

> Hi,
>
> I am trying to write a program using imclient.
>
> I am not sure how to detect errors when I use send.
>
> For example when I send 'create user/phr2101'
> I am unsure how to get the error message from the action (since the 
> account already exists).
>
> Does anyone know? or have sample code using imclient that I could look 
> at?
>
> thanks,
>
> Patrick
>
> ---
> Cyrus Home Page: http://asg.web.cmu.edu/cyrus
> Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
> List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html

---
Cyrus Home Page: http://asg.web.cmu.edu/cyrus
Cyrus Wiki/FAQ: http://cyruswiki.andrew.cmu.edu
List Archives/Info: http://asg.web.cmu.edu/cyrus/mailing-list.html




More information about the Info-cyrus mailing list