diff options
author | Alex Auvolat <alex@adnab.me> | 2022-07-21 12:50:44 +0200 |
---|---|---|
committer | Alex Auvolat <alex@adnab.me> | 2022-07-21 12:50:44 +0200 |
commit | 441730e1f7a27541d52d1aaccc59a8204a96d079 (patch) | |
tree | 793b5f3cf1fede10881de7cca165023ad4966800 /src/imap/command | |
parent | 54c467d3f77fae964400e9c1d78d32d9067c3b0f (diff) | |
download | aerogramme-441730e1f7a27541d52d1aaccc59a8204a96d079.tar.gz aerogramme-441730e1f7a27541d52d1aaccc59a8204a96d079.zip |
Fix open_mailbox
Diffstat (limited to 'src/imap/command')
-rw-r--r-- | src/imap/command/selected.rs | 10 |
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?; |