From fret at memecode.com Thu Oct 1 21:26:54 2009 From: fret at memecode.com (Matthew Allen) Date: Thu Oct 1 21:26:59 2009 Subject: [Imap-protocol] List of UID's removed with expunge? Message-ID: Hi, Is there a reasonable way of getting the UID's of the messages removed with the expunge command? It _seems_ from reading the RFC that I have to: - Do a SEARCH to get all the sequence numbers of the \deleted messages - Do a FETCH with that sequence set return from the search to get their UID's - Then do the EXPUNGE and hope that nothing has changed in the mailbox between the various commands. Sounds dubious at best. Alternatively instead of relying on the server to tell me whats going on I could just look though my local cache and remove all the "\deleted" message's metadata after I expunge, assuming that it's more or less the same. I guess the best way would've been to have the server report the information in the untagged response ala: * EXPUNGE [UID ] or something, but that horse has bolted some decades ago. Regards -- Matthew Allen From alexey.melnikov at isode.com Fri Oct 2 02:01:13 2009 From: alexey.melnikov at isode.com (Alexey Melnikov) Date: Fri Oct 2 02:01:31 2009 Subject: [Imap-protocol] List of UID's removed with expunge? In-Reply-To: References: Message-ID: <4AC5C159.5080804@isode.com> Matthew Allen wrote: >Hi, > > Hi Matthew, >Is there a reasonable way of getting the UID's of the messages removed with the expunge command? > >It _seems_ from reading the RFC that I have to: >- Do a SEARCH to get all the sequence numbers of the \deleted messages >- Do a FETCH with that sequence set return from the search to get their UID's >- Then do the EXPUNGE and hope that nothing has changed in the mailbox between the various commands. > >Sounds dubious at best. Alternatively instead of relying on the server to tell me whats going on I could just look though my local cache and remove all the "\deleted" message's metadata after I expunge, assuming that it's more or less the same. > > You want to use "UID EXPUNGE " from RFC 4315. It is almost universally implemented. >I guess the best way would've been to have the server report the information in the untagged response ala: >* EXPUNGE [UID ] >or something, but that horse has bolted some decades ago. > >