aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command/selected.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap/command/selected.rs')
-rw-r--r--src/imap/command/selected.rs13
1 files changed, 13 insertions, 0 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index 220a952..0653226 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -59,6 +59,9 @@ pub async fn dispatch<'a>(
uid,
} => ctx.copy(sequence_set, mailbox, uid).await,
+ // UNSELECT extension (rfc3691)
+ CommandBody::Unselect => ctx.unselect().await,
+
// In selected mode, we fallback to authenticated when needed
_ => {
authenticated::dispatch(authenticated::AuthenticatedContext {
@@ -84,6 +87,16 @@ impl<'a> SelectedContext<'a> {
))
}
+ async fn unselect(self) -> Result<(Response<'static>, flow::Transition)> {
+ Ok((
+ Response::build()
+ .to_req(self.req)
+ .message("UNSELECT completed")
+ .ok()?,
+ flow::Transition::Unselect,
+ ))
+ }
+
pub async fn fetch(
self,
sequence_set: &SequenceSet,