quota-plugin

See also

See Quota Plugin for an overview of the quota system.

Settings

quota
  • Default: <empty>

  • Values: String

Quota root configuration has the following syntax:

quota = <backend>[:<quota root name>[:<backend args>]]

The quota root name is just an arbitrary string that is sent to IMAP clients, which in turn may show it to the user. The name has no meaning. By default, an empty string is used, but you may want to change that since some clients (Apple Mail) break and don’t show quota at all then.

You can define multiple quota roots by appending an increasing number to the setting label:

plugin {
  quota = maildir:User quota
  quota2 = fs:Disk quota
  #quota3 = ...
}

Globally available arguments for <backend args> parameter:

Name

Description

noenforcing

Don’t try to enforce quotas by calculating if saving would get user over quota. Only handle write failures.

ns=<prefix>

A separate namespace-specific quota that’s shared between all users.

If you want to specify multiple backend arguments, separate them with ‘:’ (e.g. noenforcing:ns=Public/:foo:bar).

See also

Quota Root

quota_exceeded_message
  • Default: <empty>

  • Values: String

The message specified here is passed on to a user who goes over quota.

The value is either the message or the path to a file (prefixed with a <) that will be used as the message data.

Example:

plugin {
  quota_exceeded_message = Quota exceeded.

  # Read message from a file
  #quota_exceeded_message = </path/to/quota_exceeded_message.txt
}
quota_grace

If set, allows message deliveries to exceed quota by this value.

See also

Quota Grace

quota_max_mail_size

New in version v2.2.29.

The maximum message size that is allowed to be saved (e.g. by LMTP, IMAP APPEND or doveadm save).

0 means unlimited.

quota_over_flag
  • Default: <empty>

  • Values: String

New in version v2.2.16.

An identifier that indicates whether the overquota-flag is active for a user.

This identifier is compared against quota_over_flag_value to determine if the overquota-flag should be determine to be set for the user.

Usually, this value will be loaded via userdb.

See also

Overquota-flag

quota_over_flag_lazy_check

New in version v2.2.25.

If enabled, overquota-flag is checked only when current quota usage is going to already be checked.

Can be used to optimize the overquota-flag check in case it is running too slowly.

quota_over_flag_value
  • Default: <empty>

  • Values: String

New in version v2.2.16.

The search string to match against quota_over_flag to determine if the overquota-flag is set for the user.

Wildcards can be used in a generic way, e.g. *yes or *TRUE*

See also

Overquota-flag

quota_over_script
  • Default: <empty>

  • Values: String

New in version v2.2.16.

The service script to execute if overquota-flag is wrong. Configured the same as quota_warning scripts.

The current quota_over_flag value is appended as the last parameter.

Example:

plugin {
  quota_over_script = quota-warning mismatch %u
}

Important

obox installations using quota_over_script must currently also have quota_over_flag_lazy_check enabled. Otherwise the quota_over_flag checking may cause a race condition with metacache cleaning, which may end up losing folder names or mail flags within folders.

quota_rule
  • Default: <empty>

  • Values: String

Quota rule configuration has the following syntax:

quota_rule = <mailbox name>:<limit configuration>

You can define multiple quota rules by appending an increasing number to the setting label.

* as the mailbox name configures the default limit, which is applied on top of a mailbox-specific limit if found.

? as the mailbox name works almost like *. The difference is that ? is used only if quota backend doesn’t override the limit.

* and ? wildcards can be used as a generic wildcard in mailbox names, so for example box* matches boxes.

The following limit names are supported:

Name

Description

backend

Quota backend-specific limit configuration.

bytes

Quota limit (without suffix: in bytes). 0 means unlimited.

ignore

Don’t include the specified mailbox in quota at all.

messages

Quota limit in number of messages. 0 means unlimited.

storage

Quota limit (without suffix: in kilobytes). 0 means unlimited.

Settings with a limit value support the Size syntax as a suffix.

Settings also support % as a suffix. Percents are relative to the default rule. For example:

plugin {
  quota = maildir:User quota
  quota_rule = *:storage=1GB
  # 10% of 1GB = 100MB
  quota_rule2 = Trash:storage=+10%%
  # 20% of 1GB = 200MB
  quota_rule3 = Spam:storage=+20%%
}

Note that % is written twice to escape it, because Config Variables are expanded in plugin section. User Databases (userdb) configuration may or may not require this escaping.

Backend-specific configuration currently is used only with Maildir++ quota backend. It means you can have the quota in Maildir++ format (e.g. 10000000S).

See also

Quota Root

quota_set
  • Default: <empty>

  • Values: String

A dictionary string where your quota limit exists and can be modified.

quota_vsizes

New in version v2.2.19.

With this setting, virtual sizes rather than physical sizes are used for quota-related calculations.

quota_warning
  • Default: <empty>

  • Values: String

You can configure Dovecot to run an external command when user’s quota exceeds a specified limit. Note that the warning is ONLY executed at the exact time when the limit is being crossed, so when you’re testing you have to do it by crossing the limit by saving a new mail. If something else besides Dovecot updates quota so that the limit is crossed, the warning is never executed.

Quota warning configuration has the following syntax:

quota_warning = <limit configuration> <quota-warning socket name> <parameters>

limit_configuration is almost exactly same as for quota, with the exception of adding - before the value for “reverse” warnings where the script is called when quota drops below the value. Usually you want to use percents instead of absolute limits.

Only the command for the first exceeded limit is executed, so configure the highest limit first. The actual commands that are run need to be created as services (create a named Dovecot service and use the service name as the quota-warning socket name argument).

Note

The percent sign (%) needs to be written as %% to avoid variable expansion.

You can define multiple quota rules by appending an increasing number to the setting label.