# HG changeset patch # User Timo Sirainen # Date 1243309143 14400 # Node ID 5a593a838f9051b9381c7ebf90c95870cba143bd # Parent c7db09d796b905d3789b959e1a380464de1cc77d Split NAMESPACE_FLAG_INTERNAL into distinct _NOQUOTA and _NOACL flags. diff -r c7db09d796b9 -r 5a593a838f90 src/deliver/deliver.c --- a/src/deliver/deliver.c Mon May 25 23:33:56 2009 -0400 +++ b/src/deliver/deliver.c Mon May 25 23:39:03 2009 -0400 @@ -1172,7 +1172,7 @@ raw_mail_user = mail_user_init(user); mail_user_set_home(raw_mail_user, NULL); raw_ns = mail_namespaces_init_empty(raw_mail_user); - raw_ns->flags |= NAMESPACE_FLAG_INTERNAL; + raw_ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL; if (mail_storage_create(raw_ns, "raw", "/tmp", MAIL_STORAGE_FLAG_FULL_FS_ACCESS, diff -r c7db09d796b9 -r 5a593a838f90 src/lib-storage/mail-namespace.c --- a/src/lib-storage/mail-namespace.c Mon May 25 23:33:56 2009 -0400 +++ b/src/lib-storage/mail-namespace.c Mon May 25 23:39:03 2009 -0400 @@ -115,7 +115,7 @@ if (ns->type == NAMESPACE_SHARED && strchr(ns->prefix, '%') != NULL) { /* dynamic shared namespace */ - ns->flags |= NAMESPACE_FLAG_INTERNAL; + ns->flags |= NAMESPACE_FLAG_NOQUOTA | NAMESPACE_FLAG_NOACL; driver = "shared"; } else { driver = NULL; diff -r c7db09d796b9 -r 5a593a838f90 src/lib-storage/mail-namespace.h --- a/src/lib-storage/mail-namespace.h Mon May 25 23:33:56 2009 -0400 +++ b/src/lib-storage/mail-namespace.h Mon May 25 23:39:03 2009 -0400 @@ -21,15 +21,17 @@ /* Namespace uses its own subscriptions. */ NAMESPACE_FLAG_SUBSCRIPTIONS = 0x10, - /* Namespace is created for internal use only. */ - NAMESPACE_FLAG_INTERNAL = 0x1000, /* Namespace was created automatically (for shared mailboxes) */ - NAMESPACE_FLAG_AUTOCREATED = 0x2000, + NAMESPACE_FLAG_AUTOCREATED = 0x1000, /* Namespace has at least some usable mailboxes. Autocreated namespaces that don't have usable mailboxes may be removed automatically. */ - NAMESPACE_FLAG_USABLE = 0x4000, + NAMESPACE_FLAG_USABLE = 0x2000, /* Automatically created namespace for a user that doesn't exist. */ - NAMESPACE_FLAG_UNUSABLE = 0x8000 + NAMESPACE_FLAG_UNUSABLE = 0x4000, + /* Don't track quota for this namespace */ + NAMESPACE_FLAG_NOQUOTA = 0x8000, + /* Don't enforce ACLs for this namespace */ + NAMESPACE_FLAG_NOACL = 0x10000 }; struct mail_namespace { diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/acl/acl-lookup-dict.c --- a/src/plugins/acl/acl-lookup-dict.c Mon May 25 23:33:56 2009 -0400 +++ b/src/plugins/acl/acl-lookup-dict.c Mon May 25 23:39:03 2009 -0400 @@ -112,7 +112,7 @@ string_t *id; int ret, ret2 = 0; - if ((ns->flags & NAMESPACE_FLAG_INTERNAL) != 0 || ns->owner == NULL) + if ((ns->flags & NAMESPACE_FLAG_NOACL) != 0 || ns->owner == NULL) return 0; id = t_str_new(128); diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/acl/acl-mailbox-list.c --- a/src/plugins/acl/acl-mailbox-list.c Mon May 25 23:33:56 2009 -0400 +++ b/src/plugins/acl/acl-mailbox-list.c Mon May 25 23:39:03 2009 -0400 @@ -562,7 +562,7 @@ void acl_mailbox_list_created(struct mailbox_list *list) { - if ((list->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) { + if ((list->ns->flags & NAMESPACE_FLAG_NOACL) != 0) { /* no ACL checks for internal namespaces (deliver, shared) */ if (list->ns->type == NAMESPACE_SHARED) acl_mailbox_list_init_shared(list); diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/acl/acl-storage.c --- a/src/plugins/acl/acl-storage.c Mon May 25 23:33:56 2009 -0400 +++ b/src/plugins/acl/acl-storage.c Mon May 25 23:39:03 2009 -0400 @@ -172,7 +172,7 @@ struct acl_mail_storage *astorage; struct acl_backend *backend; - if ((storage->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) { + if ((storage->ns->flags & NAMESPACE_FLAG_NOACL) != 0) { /* no ACL checks for internal namespaces (deliver) */ } else { astorage = p_new(storage->pool, struct acl_mail_storage, 1); diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/lazy-expunge/lazy-expunge-plugin.c --- a/src/plugins/lazy-expunge/lazy-expunge-plugin.c Mon May 25 23:33:56 2009 -0400 +++ b/src/plugins/lazy-expunge/lazy-expunge-plugin.c Mon May 25 23:39:03 2009 -0400 @@ -525,7 +525,7 @@ p = t_strsplit_spaces(getenv("LAZY_EXPUNGE"), " "); for (i = 0; i < LAZY_NAMESPACE_COUNT; i++, p++) { if (strcmp(storage->ns->prefix, *p) == 0) { - storage->ns->flags |= NAMESPACE_FLAG_INTERNAL; + storage->ns->flags |= NAMESPACE_FLAG_NOQUOTA; break; } } diff -r c7db09d796b9 -r 5a593a838f90 src/plugins/quota/quota-storage.c --- a/src/plugins/quota/quota-storage.c Mon May 25 23:33:56 2009 -0400 +++ b/src/plugins/quota/quota-storage.c Mon May 25 23:39:03 2009 -0400 @@ -557,7 +557,7 @@ struct quota_root *root; bool add; - if ((list->ns->flags & NAMESPACE_FLAG_INTERNAL) != 0) + if ((list->ns->flags & NAMESPACE_FLAG_NOQUOTA) != 0) add = FALSE; else if (list->ns->owner == NULL) { /* see if we have a quota explicitly defined for