Skip to content

Latest commit

 

History

History
61 lines (57 loc) · 2.64 KB

90-quota.md

File metadata and controls

61 lines (57 loc) · 2.64 KB

90-quota.conf

dovecot_quota:
  plugins:
    # Quota limits are set using "quota_rule" parameters. To get per-user quota
    # limits, you can set/override them by returning "quota_rule" extra field
    # from userdb. It's also possible to give mailbox-specific limits, for example
    # to give additional 100 MB when saving to Trash:
    - limits:
        quota_rule: "*:storage=1G"
        quota_rule2: "Trash:storage=+100M"
        # LDA/LMTP allows saving the last mail to bring user from under quota to
        # over quota, if the quota doesn't grow too high. Default is to allow as
        # long as quota will stay under 10% above the limit. Also allowed e.g. 10M.
        quota_grace: 10%%
        # Quota plugin can also limit the maximum accepted mail size.
        quota_max_mail_size: 100M
    # You can execute a given command when user exceeds a specified quota limit.
    # Each quota root has separate limits. Only the command for the first
    # exceeded limit is executed, so put the highest limit first.
    # The commands are executed via script service by connecting to the named
    # UNIX socket (quota-warning below).
    # Note that % needs to be escaped as %%, otherwise "% " expands to empty.
    - warnings:
        quota_warning: storage=95%% quota-warning 95 %u
        quota_warning2: storage=80%% quota-warning 80 %u
    # Multiple backends are supported:
    #   dirsize: Find and sum all the files found from mail directory.
    #            Extremely SLOW with Maildir. It'll eat your CPU and disk I/O.
    #   dict: Keep quota stored in dictionary (eg. SQL)
    #   maildir: Maildir++ quota
    #   fs: Read-only support for filesystem quota
    - backends:
        # quota: dirsize:User quota
        # quota: maildir:User quota
        # quota: dict:User quota::proxy::quota
        quota: fs:User quota
    # Multiple quota roots are also possible, for example this gives each user
    # their own 100MB quota and one shared 1GB quota within the domain:
    - backends_extended2:
        quota: dict:user::proxy::quota
        quota2: dict:domain:%d:proxy::quota_domain
        quota_rule: "*:storage=102400"
        quota2_rule: "*:storage=1048576"

  # Example quota-warning service. The unix listener's permissions should be
  # set in a way that mail processes can connect to it. Below example assumes
  # that mail processes run as vmail user. If you use mode=0666, all system users
  # can generate quota warnings to anyone.
  services:
    - quota-warning:
        executable: script /usr/local/bin/quota-warning.sh
        user: dovecot
        listeners:
          - quota-warning:
              type: unix
              user: vmail