From 2060f287ae158ddabf1afe2b02da84c85c11ad8f Mon Sep 17 00:00:00 2001 From: mdecimus Date: Sun, 17 Aug 2025 21:52:23 +0100 Subject: [PATCH] IMAP: Add owner rights to ACL get responses --- crates/imap/src/op/acl.rs | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/crates/imap/src/op/acl.rs b/crates/imap/src/op/acl.rs index 2e2a687b..32c77a4e 100644 --- a/crates/imap/src/op/acl.rs +++ b/crates/imap/src/op/acl.rs @@ -54,6 +54,25 @@ impl Session { .to_unarchived::() .imap_ctx(&arguments.tag, trc::location!())?; + // Add the current user if they are the owner or a group member + if data.access_token.is_member(mailbox_id.account_id) { + permissions.push(( + data.access_token.name.clone(), + vec![ + Rights::Read, + Rights::Lookup, + Rights::Insert, + Rights::DeleteMessages, + Rights::Expunge, + Rights::Seen, + Rights::Write, + Rights::CreateMailbox, + Rights::DeleteMailbox, + Rights::Post, + ], + )); + } + for item in mailbox.inner.acls.iter() { if let Some(account_name) = data .server