Fix: Unable to create subfolders under INBOX for group shared folder (closes #1817)
This commit is contained in:
@@ -188,13 +188,14 @@ impl<T: SessionStream> SessionData<T> {
|
||||
.details("Mailboxes under root shared folders are not allowed.")
|
||||
.code(ResponseCode::Cannot));
|
||||
}
|
||||
|
||||
// Build path
|
||||
let root = &mut path[2];
|
||||
if root.eq_ignore_ascii_case("INBOX") {
|
||||
*root = "INBOX";
|
||||
}
|
||||
let full_path = path.join("/");
|
||||
let prefix = Some(format!("{}/{}", path.remove(0), path.remove(0)));
|
||||
let prefix = Some(format!("{}/{}", path[0], path[1]));
|
||||
|
||||
// Locate account
|
||||
if let Some(account) = mailboxes
|
||||
|
||||
@@ -51,7 +51,6 @@ pub async fn test(mut imap_john: &mut ImapConnection, _imap_check: &mut ImapConn
|
||||
.assert_read(Type::Tagged, ResponseType::Ok)
|
||||
.await
|
||||
.assert_contains("Shared Folders/support@example.com/INBOX");
|
||||
|
||||
imap_jane
|
||||
.send("SELECT \"Shared Folders/support@example.com/INBOX\"")
|
||||
.await;
|
||||
@@ -64,6 +63,23 @@ pub async fn test(mut imap_john: &mut ImapConnection, _imap_check: &mut ImapConn
|
||||
imap_jane.send("UNSELECT").await;
|
||||
imap_jane.assert_read(Type::Tagged, ResponseType::Ok).await;
|
||||
|
||||
// Jane should be able to create folders under the Support account
|
||||
imap_jane
|
||||
.send("CREATE \"Shared Folders/support@example.com/inbox/Jane's Folder\"")
|
||||
.await;
|
||||
imap_jane.assert_read(Type::Tagged, ResponseType::Ok).await;
|
||||
imap_jane.send("LIST \"\" \"*\"").await;
|
||||
imap_jane
|
||||
.assert_read(Type::Tagged, ResponseType::Ok)
|
||||
.await
|
||||
.assert_equals(
|
||||
"* LIST () \"/\" \"Shared Folders/support@example.com/INBOX/Jane's Folder\"",
|
||||
);
|
||||
imap_jane
|
||||
.send("DELETE \"Shared Folders/support@example.com/INBOX/Jane's Folder\"")
|
||||
.await;
|
||||
imap_jane.assert_read(Type::Tagged, ResponseType::Ok).await;
|
||||
|
||||
// John should have no shared folders
|
||||
imap_john.send("LIST \"\" \"*\"").await;
|
||||
imap_john
|
||||
|
||||
Reference in New Issue
Block a user