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 π«‘π
π COPYRIGHT AND LICENSE π
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
- debian trixie: mtpolicyd 2.05-1.2 Β· GPL-2.0-only
- ubuntu questing: mtpolicyd 2.05-1.2
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms