/* Limits in default_rule override backend's quota limits */
unsigned int force_default_rule:1;
+ /* TRUE if any of the warning_rules have reverse==TRUE */
+ unsigned int have_reverse_warnings:1;
};
struct quota_root {
warning->command = p_strdup(root_set->set->pool, p+1);
warning->rule = rule;
warning->reverse = reverse;
+ if (reverse)
+ root_set->have_reverse_warnings = TRUE;
quota_root_recalculate_relative_rules(root_set,
root_set->default_rule.bytes_limit,
continue;
}
- if (!(*rootp)->auto_updating)
+ /* If there are reverse quota_warnings, we'll need to track
+ how many bytes were expunged even with auto_updating roots.
+ (An alternative could be to get the current quota usage
+ before and after the expunges, but that's more complicated
+ and probably isn't any better.) */
+ if (!(*rootp)->auto_updating ||
+ (*rootp)->set->have_reverse_warnings)
ctx->auto_updating = FALSE;
}