From c2a518a997fa12f6e82b2a9eb1ba8cd6059fdf41 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Fri, 19 Jan 2024 17:39:55 +0100 Subject: filter expunge --- src/imap/command/selected.rs | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'src/imap/command/selected.rs') diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs index 98b3b00..154e28c 100644 --- a/src/imap/command/selected.rs +++ b/src/imap/command/selected.rs @@ -59,7 +59,10 @@ pub async fn dispatch<'a>( criteria, uid, } => ctx.search(charset, criteria, uid).await, - CommandBody::Expunge => ctx.expunge().await, + CommandBody::Expunge { + // UIDPLUS (rfc4315) + uid_sequence_set, + } => ctx.expunge(uid_sequence_set).await, CommandBody::Store { sequence_set, kind, @@ -114,7 +117,7 @@ impl<'a> SelectedContext<'a> { // We expunge messages, // but we don't send the untagged EXPUNGE responses let tag = self.req.tag.clone(); - self.expunge().await?; + self.expunge(&None).await?; Ok(( Response::build().tag(tag).message("CLOSE completed").ok()?, flow::Transition::Unselect, @@ -223,13 +226,13 @@ impl<'a> SelectedContext<'a> { )) } - async fn expunge(self) -> Result<(Response<'static>, flow::Transition)> { + async fn expunge(self, uid_sequence_set: &Option) -> Result<(Response<'static>, flow::Transition)> { if let Some(failed) = self.fail_read_only() { return Ok((failed, flow::Transition::None)); } let tag = self.req.tag.clone(); - let data = self.mailbox.expunge().await?; + let data = self.mailbox.expunge(uid_sequence_set).await?; Ok(( Response::build() -- cgit v1.2.3