---
name: "Mail::MtPolicyd::Plugin::Quota"
section: "3pm"
platform: "linux"
package: "mtpolicyd"
version: "2.05-1.2"
release: "Debian 13 (Trixie)"
platforms: ["linux"]
url: "https://new.carta.tech/Mail::MtPolicyd::Plugin::Quota"
---

# Mail::MtPolicyd::Plugin::Quota(3pm)

mtpolicyd plugin for accounting in sql tables

## NAME

Mail::MtPolicyd::Plugin::Quota - mtpolicyd plugin for accounting in sql tables

## VERSION

version 2.05

## DESCRIPTION

This plugin can be used to do accounting based on request fields.

## Example

```
  <Plugin quota-clients>
    module = "Quota"
    table_prefix = "acct_"
    # per month
    time_pattern = "%Y-%m"
    # per ip
    field = "client_address"
    # allow 1000 mails
    metric = "count"
    threshold = 1000
    action = "defer you exceeded your monthly limit, please insert coin"
  </Plugin>
```

## Configuration

### Parameters

The module takes the following parameters:

- (uc\_)enabled (default: on)

  Enable/disable this check.

- (uc\_)field (required)

  The field used for accounting/quota.

- (uc\_)metric (required)

  The metric on which the quota should be based.

  The Accounting module stores the following metrics:

  - count

    Number of mails recivied.

  - count\_rcpt

    Number of mails recivied multiplied with number of recipients.

  - size

    Size of mails recivied.

  - size\_rcpt

    Size of mails recivied multiplied with number of recipients.

- time\_pattern (default: "%Y-%m")

  A format string for building the time key used to store counters.

  Default is to build counters on a monthly base.

  For example use:

  ```
    * "%Y-%W" for weekly
    * "%Y-%m-%d" for daily
  ```

  See "man date" for format string sequences.

  You must use the same time\_pattern as used in for the Accounting module.

- threshold (required)

  The quota limit.

- action (default: defer smtp traffic quota has been exceeded)

  The action to return when the quota limit has been reached.

- table\_prefix (default: "acct\_")

  A prefix to add to every table.

  The table name will be the prefix + field\_name.

## AUTHOR

Markus Benning \<ich@markusbenning.de\>

## COPYRIGHT AND LICENSE

This software is Copyright (c) 2014 by Markus Benning \<ich@markusbenning.de\>.

This is free software, licensed under:

```
  The GNU General Public License, Version 2, June 1991
```
