quota: expose global quota settings
With the options in the upstream dovecot module gone the quota support and its option now live in our downstream module. The only behavior change this introduces is not setting a global per user default instead of the previous 100G per user. Diabling quota support and setting per user quotas now raises an assertion: ```` Failed assertions: - Without quota support enabled, per-user quotas cannot be applied to the following accounts: - lowquota@example.com Either remove per user quota settings or re-enable `mailserver.quota.enable`. ````
This commit is contained in:
+34
-2
@@ -137,6 +137,35 @@ in
|
||||
description = "Message size limit enforced by Postfix.";
|
||||
};
|
||||
|
||||
quota = {
|
||||
enable = mkOption {
|
||||
type = types.bool;
|
||||
default = true;
|
||||
description = ''
|
||||
Whether to enable quota support.
|
||||
|
||||
When enabled, incoming mail can be rejected if a mailbox exceeds its
|
||||
quota.
|
||||
'';
|
||||
};
|
||||
|
||||
defaults = {
|
||||
perUser = mkOption {
|
||||
type = with types; nullOr str;
|
||||
default = null;
|
||||
example = "10G";
|
||||
description = ''
|
||||
Default quota applied to all users.
|
||||
|
||||
The value must use a size format like `500M`, `2G`, `10G`.
|
||||
|
||||
If set to `null`, no default per user quota is applied and only
|
||||
explicit per user quotas apply, if set.
|
||||
'';
|
||||
};
|
||||
};
|
||||
};
|
||||
|
||||
accounts = mkOption {
|
||||
type = types.attrsOf (
|
||||
types.submodule (
|
||||
@@ -260,8 +289,11 @@ in
|
||||
default = null;
|
||||
example = "2G";
|
||||
description = ''
|
||||
Per user quota rules. Accepted sizes are `xx k/M/G/T` with the
|
||||
obvious meaning. Leave blank for the standard quota `100G`.
|
||||
The quota limit for this user.
|
||||
|
||||
The value is must use a size format like `500M`, `2G`, `10G`.
|
||||
|
||||
If unset, will fall back to {option}`mailserver.quota.defaults.perUser` if set.
|
||||
'';
|
||||
};
|
||||
|
||||
|
||||
Reference in New Issue
Block a user