mirror of
https://github.com/bulwarkmail/webmail.git
synced 2026-11-03 16:16:59 +00:00
Folder management performed on a shared/group account was sent to the logged-in user's primary JMAP account instead of the mailbox owner's account. Subfolder creation therefore failed with invalidProperties for parentId, root folders could be created silently in the personal account, and rename, delete, role, and reorder targeted the wrong mailbox tree. Shared mailboxes use namespaced store ids to avoid cross-account collisions, while Mailbox/set requires the owner's accountId and the bare server mailbox id. Resolve that mutation context centrally: recover the mailbox originalId and owner account, use a directly connected owner client when one exists, otherwise reach delegated/group accounts through the active client with an explicit accountId. Thread the account target through create, update, and delete JMAP methods and all folder-management actions. Scope role replacement to the same owner account, and expose explicit root-folder creation from shared account headers without making personal root creation depend on the currently selected folder. Add unit coverage for JMAP request scoping, shared store routing, role isolation, direct-client handling, and reorder. Add a Stalwart integration scenario that creates root and nested group folders, renames them, and deletes them through the UI.