From bd449436615a26143d4501f38da5ae26cc894bda Mon Sep 17 00:00:00 2001 From: Maurus Decimus <11444311+mdecimus@users.noreply.github.com> Date: Sun, 19 Jul 2026 07:54:33 +0200 Subject: [PATCH] Fix JMAP: Read-only sharee cannot set `isSubscribed` on a shared mailbox --- crates/jmap/src/mailbox/set.rs | 18 +++++++++++++++++- 1 file changed, 17 insertions(+), 1 deletion(-) diff --git a/crates/jmap/src/mailbox/set.rs b/crates/jmap/src/mailbox/set.rs index d4fc5667..2e348fb6 100644 --- a/crates/jmap/src/mailbox/set.rs +++ b/crates/jmap/src/mailbox/set.rs @@ -201,7 +201,23 @@ impl MailboxSet for Server { .caused_by(trc::location!())?; if ctx.is_shared { let acl = mailbox.inner.acls.effective_acl(access_token); - if !acl.contains(Acl::Modify) { + let subscription_only = object.keys().all(|key| { + matches!( + key, + Key::Property(MailboxProperty::IsSubscribed | MailboxProperty::Id) + ) + }); + if subscription_only { + if !acl.contains(Acl::Read) { + ctx.response.not_updated.append( + id, + SetError::forbidden().with_description( + "You are not allowed to access this mailbox.", + ), + ); + continue 'update; + } + } else if !acl.contains(Acl::Modify) { ctx.response.not_updated.append( id, SetError::forbidden()