On Wed, 3 Sep 2008, Shawn Walker wrote:

Steve Hubert wrote:
On Wed, 3 Sep 2008, Shawn Walker wrote:

Hrmm, how would I tell the SEARCHPGM to use "NOT DELETED" or "DELETED"? Is there a sample code that I can look at?

Something like this should find all the deleted messages. Change to pgm->undeleted for NOT DELETED messages. I haven't tried this actual code.

Steve

 SEARCHPGM *pgm;
 MESSAGECACHE *mc;
 unsigned long msgno, uid;

 pgm = mail_newsearchpgm();

 pgm->deleted = 1;

 mail_search_full(stream, charset, pgm, SE_UID | SE_FREE);

 for(msgno= 1L; msgno < stream->nmsgs; msgno++)
   if(stream && (mc=mail_elt(stream,msgno)) && mc->searched){
     /* msgno is marked deleted */

     /* it's uid is */
     uid = mail_uid(stream, msgno);
   }


Thanks for the tip!  Way easier than I thought it would be.

I'm assuming UNDELETED is the same as NOT DELETED? I just did a test with both of those and they both return the same UIDs.

Shawn

I'm pretty sure those should be equivalent. You can do a literal NOT if you want by something like

  origpgm = mail_newsearchpgm();
  origpgm->deleted = 1;

  pgm = mail_newsearchpgm();
  pgm->not = mail_newsearchpgmlist();
  pgm->not->pgm = origpgm;


_______________________________________________
Imap-uw mailing list
[email protected]
http://mailman2.u.washington.edu/mailman/listinfo/imap-uw

Reply via email to