Subject: Search and callbacks

From: "Omar Khan" <[email-masked]>
Date: Fri, 18 Jul 2003 12:27:28 -0700

Hi,

Two questions... On the comp.mail.imap newsgroup just recently Mark
Crispin told me that the best way to get messages between two uids was:

>Why not use <last_known_UID + 1>:*?  That is, if the last known UID is
>32121, do 32122:*.

So in c-client, is the best interpretation to use a search with the
searchset first and last properties equal to the first and last uid...
Or is there another more appropriate way?

2nd question... Callbacks. I know you shouldn't call a mail_* function
from within a callback (say mm_exists). So suppose that call back gets
innundated with 20 new messages and we want to process them. What's the
recommended way of doing this? (essentially my program is waiting around
and checks for new messages every 5 minutes or so... But I can't call
the mail_* functions from within the callback because of the lock)

Thanks

omar

-- 
------------------------------------------------------------------
 For information about this mailing list, and its archives, see: 
 http://www.washington.edu/imap/c-client-list.html
------------------------------------------------------------------

---

From: Mark Crispin <[email-masked]>
Date: Mon, 18 Aug 2003 17:21:14 -0700 (Pacific Daylight Time)

Sorry for the delay in responding.  I was on vacation.

> searchset first and last properties equal to the first and last uid...

By "first uid" I assume that you mean "last known UID + 1" and not "UID
1", right?  If so, that sounds reasonable.

> recommended way of doing this?

In the callback, set a request to your main program to do the processing,
then return.

Then, in your main program, after finishing the current processing, check
to see if you have any requests and if so do them.

-- Mark --

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