aboutsummaryrefslogtreecommitdiff
path: root/src/imap/command
diff options
context:
space:
mode:
Diffstat (limited to 'src/imap/command')
-rw-r--r--src/imap/command/selected.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/imap/command/selected.rs b/src/imap/command/selected.rs
index 40e75e2..0be8ff2 100644
--- a/src/imap/command/selected.rs
+++ b/src/imap/command/selected.rs
@@ -1,6 +1,6 @@
use std::sync::Arc;
-use anyhow::{bail, Result};
+use anyhow::Result;
use boitalettres::proto::Request;
use boitalettres::proto::Response;
use imap_codec::types::command::CommandBody;
@@ -99,7 +99,13 @@ impl<'a> SelectedContext<'a> {
let mb_opt = self.user.open_mailbox(&name).await?;
let mb = match mb_opt {
Some(mb) => mb,
- None => bail!("Mailbox does not exist"),
+ None => {
+ return Ok((
+ Response::no("Destination mailbox does not exist")?
+ .with_extra_code(Code::TryCreate),
+ flow::Transition::None,
+ ))
+ }
};
let (uidval, uid_map) = self.mailbox.copy(sequence_set, mb, uid).await?;