Mail::...:Quota(3pm)

πŸ’– Mail::MtPolicyd::Plugin::Quota πŸ’–

okay bestie, buckle up β€” this is the Mail::MtPolicyd::Plugin::Quota page from the User Contributed Perl Documentation set, and it's genuinely one of the good ones. no cap. it's the mtpolicyd plugin that does your accounting in sql tables, and honestly? she ate. ✨


🌸 VERSION 🌸

version 2.05 β€” yes, that's the one, don't @ me πŸ’…


πŸ¦‹ DESCRIPTION πŸ¦‹

so the whole vibe here is: this plugin lets you do accounting based on request fields. that's it, that's the job. you pick a field, you pick a metric, you count things, and when somebody blows past their limit you get to hit 'em with an action. iconic.

✨ Example ✨

here's what it looks like living in a config file, fr fr:

<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>

look at her go 🫢 monthly reset, tracked by IP, 1000 mails allowed, and then... coin please. 😭


πŸŽ€ Configuration πŸŽ€

πŸ’œ Parameters πŸ’œ

the module takes the following parameters, and yes we're going through every single one, no skimming, i would never do that to you:

  • (uc_)enabled (default: on) β€” turns this check on or off. that's the whole thing. she's simple, she's effective. 🌈
  • (uc_)field (required) β€” the field you're using for accounting/quota. required, bestie, so don't forget her. πŸ“
  • (uc_)metric (required) β€” the metric your quota is based on. also required. the Accounting module stores the following metrics:
    • count β€” number of mails that came in.
    • count_rcpt β€” number of mails that came in, multiplied by the number of recipients.
    • size β€” size of the mails that came in.
    • size_rcpt β€” size of the mails that came in, multiplied by the number of recipients.
  • time_pattern (default: "%Y-%m") β€” a format string used to build the time key that stores your counters.

the default builds counters on a monthly base.

for example, use:

  • "%Y-%W" for weekly
  • "%Y-%m-%d" for daily

check man date for the format string sequences. πŸ‘‘

you must use the same time_pattern as the one used for the Accounting module. like, this is not optional, the counters have to line up. πŸ’€
  • threshold (required) β€” the quota limit. required!! πŸ”₯
  • action (default: defer smtp traffic quota has been exceeded) β€” the action returned when the quota limit has been reached. so when someone maxes out, this is what they get. πŸŽ€
  • table_prefix (default: "acct_") β€” a prefix that gets added to every table.

the table name is gonna be the prefix + field_name. so it's giving very much "build your own table name" energy. πŸ’…


🌟 AUTHOR 🌟

Markus Benning <ich@markusbenning.de> β€” thank you for your service πŸ«‘πŸ’–


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

it's free software, licensed under:

The GNU General Public License, Version 2, June 1991

and that's the page, bestie!! πŸŽ‰ perl v5.38.2, dated 2024-05-26 β€” literally a whole snapshot in time, preserved forever, slay. go forth and quota responsibly. πŸ§šπŸ’œ

πŸ“¦ where this page comes from