]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
acl: Don't set acl_defaults_from_inbox=yes as default after all.
authorTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 13 Dec 2016 12:51:20 +0000 (14:51 +0200)
committerTimo Sirainen <timo.sirainen@dovecot.fi>
Tue, 13 Dec 2016 13:01:38 +0000 (15:01 +0200)
Reverts b56d462fff46511b7efa0ccf254ba93d72322920 and removes the FIXME.
Some people might actually want to give someone else access to their INBOX
but not to all the other mailboxes. We should make it possible to use the
"" mailbox name as the default ACL instead.

src/plugins/acl/acl-backend.c

index 86b99980940afd8eca0cd0a37ec6113678d1cf04..f351a56da3036a55ce9ca04119ed35190289cef3 100644 (file)
@@ -163,16 +163,18 @@ unsigned int acl_backend_lookup_right(struct acl_backend *backend,
 
 struct acl_object *acl_backend_get_default_object(struct acl_backend *backend)
 {
+       struct mail_user *user = mailbox_list_get_user(backend->list);
        struct mail_namespace *ns = mailbox_list_get_namespace(backend->list);
        const char *default_name = "";
 
        if (backend->default_aclobj != NULL)
                return backend->default_aclobj;
 
-       if (ns->type == MAIL_NAMESPACE_TYPE_PRIVATE ||
-           ns->type == MAIL_NAMESPACE_TYPE_SHARED)
-               default_name = "INBOX";
-
+       if (mail_user_plugin_getenv(user, "acl_defaults_from_inbox") != NULL) {
+               if (ns->type == MAIL_NAMESPACE_TYPE_PRIVATE ||
+                   ns->type == MAIL_NAMESPACE_TYPE_SHARED)
+                       default_name = "INBOX";
+       }
        backend->default_aclobj =
                acl_object_init_from_name(backend, default_name);
        return backend->default_aclobj;