username = t_strdup_until(args, p);
args = p+1;
+ if (strncmp(args, "noenforcing:", 12) == 0) {
+ /* FIXME: pretty ugly in here. the parameters should have
+ been designed to be extensible. do it in a future version */
+ _root->no_enforcing = TRUE;
+ args += 12;
+ }
+
if (*username == '\0')
username = getenv("USER");
- if (getenv("DEBUG") != NULL)
- i_info("dict quota: user = %s, uri = %s", username, args);
+ if (getenv("DEBUG") != NULL) {
+ i_info("dict quota: user=%s, uri=%s, enforcing=%d",
+ username, args, _root->no_enforcing);
+ }
/* FIXME: we should use 64bit integer as datatype instead but before
it can actually be used don't bother */
{
struct quota_root *root;
const struct quota_backend *backend;
- const char *p, *args, *backend_name;
+ const char *p, *args, *backend_name, *const *tmp;
/* <backend>[:<quota root name>[:<backend args>]] */
p = strchr(root_def, ':');
return NULL;
}
} else if (args != NULL) {
- while (*args == ' ') args++;
- if (*args != '\0') {
- i_fatal("Quota root %s: backend %s "
- "doesn't take any parameters (used: %s)",
- root->name, backend_name, args);
+ tmp = t_strsplit_spaces(args, " ");
+ for (; *tmp != NULL; tmp++) {
+ if (strcmp(*tmp, "noenforcing") == 0)
+ root->no_enforcing = TRUE;
+ else
+ break;
+ }
+ if (*tmp != NULL) {
+ i_fatal("Quota root %s backend %s: "
+ "Unknown parameter: %s",
+ root->name, backend_name, *tmp);
}
}
return root;