MBOX-Line: From alexey.melnikov at isode.com  Fri Oct  2 02:01:13 2009
To: imap-protocol@u.washington.edu
From: Alexey Melnikov <alexey.melnikov@isode.com>
Date: Fri Jun  8 12:34:42 2018
Subject: [Imap-protocol] List of UID's removed with expunge?
In-Reply-To: <XV827.6141YYD@memecode.com>
References: <XV827.6141YYD@memecode.com>
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 <uidset>" 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:
>* <sequence> EXPUNGE [UID <uid>]
>or something, but that horse has bolted some decades ago.
>  
>


