Permalink
Browse files
mboxlist: implement reverse ACLs
To enable, set 'reverseacls: yes' in imapd.conf and restart the server. Since it requires a complete table sweep in a transaction, this will only be done by ctl_cyrusdb -r at startup. You can also remove the reverse ACL support by removing the config key - at next startup it will remove all keys starting with $RACL. To enable reverse ACLs, it creates a key called '$RACL' If this key is present, then the reverse ACLs are used for looking up records in NAMESPACE_USER and NAMESPACE_SHARED. NOTE: reverse ACLs are not used by admin connections at all, since admins tend to have read access to everything, and it would be pointless and create bloat. Likewise, reverse ACLs aren't use for the user's own folders (INBOX and friends), because they are always accessible to their owner. When the $RACL key is present, all updates from mboxlist_update or mboxlist_delete will cause the ACL to be examined, and for each user who: a) is not the mailbox owner b) is not an admin (NOTE: making an existing user not an admin will break things) c) has the 'l' right A record will be created or removed. If the folder is in NAMESPACE_USER then the record will have key: $RACL$U$<acluserid>$<intname> If it's NAMESPACE_SHARED, then it will be: $RACL$S$<acluserid>$<intname> The record has a zero-length value. This works in all decent DB types, because it's also the method used by the subscriptions database. When a LIST (mboxlist_findall) command is run, then if it's a non-admin request, and $RACL is present in the mailboxes.db, the reverse ACLs will be read into a strarray_t, and each record will be called with cyrusdb_forone.
- Loading branch information
Showing
with
187 additions
and 4 deletions.
- +6 −3 imap/ctl_cyrusdb.c
- +175 −1 imap/mboxlist.c
- +2 −0 imap/mboxlist.h
- +4 −0 lib/imapoptions