Skip to content

Commit

Permalink
Creating a mailbox in a shared folder results in wrong hierarchy (fixes
Browse files Browse the repository at this point in the history
  • Loading branch information
mdecimus committed Jan 28, 2025
1 parent 84d3c82 commit c394fa6
Show file tree
Hide file tree
Showing 22 changed files with 60 additions and 61 deletions.
76 changes: 38 additions & 38 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion crates/cli/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ authors = ["Stalwart Labs Ltd. <[email protected]>"]
license = "AGPL-3.0-only OR LicenseRef-SEL"
repository = "https://github.com/stalwartlabs/cli"
homepage = "https://github.com/stalwartlabs/cli"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
readme = "README.md"
resolver = "2"
Expand Down
2 changes: 1 addition & 1 deletion crates/common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "common"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion crates/directory/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "directory"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion crates/email/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "email"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion crates/imap-proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "imap_proto"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion crates/imap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "imap"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
5 changes: 2 additions & 3 deletions crates/imap/src/op/create.rs
Original file line number Diff line number Diff line change
Expand Up @@ -297,16 +297,15 @@ impl<T: SessionStream> SessionData<T> {
let mut parent_mailbox_name = None;
let (account_id, path) = {
let mailboxes = self.mailboxes.lock();
let first_path_item = path.first().unwrap();
let account = if first_path_item == &self.server.core.jmap.shared_folder {
let account = if path.first() == Some(&self.server.core.jmap.shared_folder.as_str()) {
// Shared Folders/<username>/<folder>
if path.len() < 3 {
return Err(trc::ImapEvent::Error
.into_err()
.details("Mailboxes under root shared folders are not allowed.")
.code(ResponseCode::Cannot));
}
let prefix = Some(format!("{}/{}", first_path_item, path[1]));
let prefix = Some(format!("{}/{}", path.remove(0), path.remove(0)));

// Locate account
if let Some(account) = mailboxes
Expand Down
2 changes: 1 addition & 1 deletion crates/jmap-proto/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jmap_proto"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
2 changes: 1 addition & 1 deletion crates/jmap/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[package]
name = "jmap"
version = "0.11.2"
version = "0.11.4"
edition = "2021"
resolver = "2"

Expand Down
Loading

0 comments on commit c394fa6

Please sign in to comment.