args += 12;
continue;
}
+ if (strncmp(args, "ignoreunlimited:", 16) == 0) {
+ _root->disable_unlimited_tracking = TRUE;
+ args += 16;
+ continue;
+ }
if (strncmp(args, "ns=", 3) == 0) {
p = strchr(args, ':');
if (p == NULL)
for (tmp = t_strsplit(args, ":"); *tmp != NULL; tmp++) {
if (strcmp(*tmp, "noenforcing") == 0)
_root->no_enforcing = TRUE;
+ else if (strcmp(*tmp, "ignoreunlimited") == 0)
+ _root->disable_unlimited_tracking = TRUE;
else if (strncmp(*tmp, "ns=", 3) == 0)
_root->ns_prefix = p_strdup(_root->pool, *tmp + 3);
else {
/* don't enforce quota when saving */
unsigned int no_enforcing:1;
+ /* If user has unlimited quota, disable quota tracking */
+ unsigned int disable_unlimited_tracking:1;
};
struct quota_transaction_context {
for (; *tmp != NULL; tmp++) {
if (strcmp(*tmp, "noenforcing") == 0)
root->no_enforcing = TRUE;
+ else if (strcmp(*tmp, "ignoreunlimited") == 0)
+ root->disable_unlimited_tracking = TRUE;
else
break;
}
root_set->name, root->backend.name, *tmp);
}
}
+ if (root_set->default_rule.bytes_limit == 0 &&
+ root_set->default_rule.count_limit == 0 &&
+ root->disable_unlimited_tracking)
+ return NULL;
return root;
}
i_array_init("a->namespaces, count);
for (i = 0; i < count; i++) {
root = quota_root_init(root_sets[i], quota);
- array_append("a->roots, &root, 1);
+ if (root != NULL)
+ array_append("a->roots, &root, 1);
}
return quota;
}