From 93f943aa802163eb47feef592c1504112e4588c5 Mon Sep 17 00:00:00 2001 From: Quentin Dufour Date: Tue, 7 Jun 2022 13:27:26 +0200 Subject: Add some more commands --- src/service.rs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'src/service.rs') diff --git a/src/service.rs b/src/service.rs index f032971..4d4c288 100644 --- a/src/service.rs +++ b/src/service.rs @@ -61,12 +61,16 @@ impl Service for Connection { fn call(&mut self, req: Request) -> Self::Future { tracing::debug!("Got request: {:#?}", req); - let cmd = command::Command::new(self.mailstore.clone(), self.session.clone()); + let cmd = command::Command::new(req.tag, self.mailstore.clone(), self.session.clone()); Box::pin(async move { match req.body { CommandBody::Capability => cmd.capability().await, CommandBody::Login { username, password } => cmd.login(username, password).await, - _ => Response::bad("Error in IMAP command received by server."), + CommandBody::Lsub { reference, mailbox_wildcard } => cmd.lsub(reference, mailbox_wildcard).await, + CommandBody::List { reference, mailbox_wildcard } => cmd.list(reference, mailbox_wildcard).await, + CommandBody::Select { mailbox } => cmd.select(mailbox).await, + CommandBody::Fetch { sequence_set, attributes, uid } => cmd.fetch(sequence_set, attributes, uid).await, + _ => Response::bad("Error in IMAP command received by server."), } }) } -- cgit v1.2.3