Description
The problem
Subscriptions storage is based on the mailbox name thus do not allow to distinguish two mailboxes with the same name belonging to other users, thus leading to buggy behaviors in the face of delegation.
This behavior can be encoutered:
- In JMAP with James' mailbox sharing
- In JMAP we built an extension called team mailboxes (essentially functional mailboxes) that runs in this pitfall.
Solution
Rework subscription storage to rely on MailboxPath.
Data migration can be avoided by storing the mailbox path as a string, and supporting fallbacks for non-mailbox path mailboxes.