libcyrus and the imap proto

Patrick Welche prlw1 at newn.cam.ac.uk
Wed Mar 5 10:50:07 EST 2003


On Thu, Feb 27, 2003 at 07:01:28PM +0000, Patrick Welche wrote:
> On Thu, Feb 27, 2003 at 09:53:57AM -0500, John Alton Tamplin wrote:
> > Patrick Welche wrote:
> ... 
> > >same for eg
> > >. fetch 1 (internaldate)
> > >* 1 FETCH (INTERNALDATE "30-Jan-2003 19:23:41 +0000")
> > >. OK Completed
> > >
> > >How can I see the result of fetch?
> > > 
> > >
> > I have not used the C library, but the perl interface is similar so I 
> > suspect this approach will work for you.  What I did was add a callback 
> > with an empty string for a trigger.  The callback gets called on every 
> > line, and you can parse it as you please.
> ...
> 
> Great idea - I kept thinking "14 RECENT" was keyword "RECENT".. but evidently
> not..
> 
>   imclient_addcallback(imp, "",     /* keyword */
>               NULL,                 /* flags   */
>               callback_all,         /* proc    */
>               NULL,                 /* rock    */
>               NULL);
> 
> did the trick. Incidentally, I didn't receive the messages if I set the
> CALLBACK_NOLITERAL flag. What does it do? (I thought it meant don't use
> eg. {42} followed by 42 characters, but in eg. 14 RECENT, no literal is used,
> yet I didn't see those messages either)

Even better, the solution is:

  imclient_addcallback(fromimp, "RECENT",       /* keyword */ 
              CALLBACK_NUMBERED,                /* flags   */
              callback_recent,                  /* proc    */
              &curmbox,                         /* rock    */ 
              NULL);

in other words, RECENT returns a mesg number, that's why it didn't match
the keyword withouth the CALL_NUMBERED flag..

Cheers,

Patrick




More information about the Info-cyrus mailing list