Mail::...ounting(3pm)
๐ Mail::MtPolicyd::Plugin::Accounting ๐
okay so bestie, this page is Mail::MtPolicyd::Plugin::Accounting, and it lives in the User Contributed Perl Documentation section of the manual. It's an mtpolicyd plugin for accounting in sql tables. No cap, that's literally the whole vibe. ๐
โจ
โจ VERSION โจ
version 2.05 ๐
๐ธ SYNOPSIS ๐ธ
<Plugin acct-clients>
module = "Accounting"
# per ip and user
fields = "client_address,sasl_username"
# statistics per month
time_pattern = "%Y-%m"
table_prefix = "acct_"
</Plugin>
This will create a table acct_client_address and a table acct_sasl_username. ๐ซถ
If a request is received containing the field the plugin will update the row in the fields table. The key is the fields value(ip or username) and the time string build from the time_pattern.
For each key the following counters are stored:
countcount_rcpt(count per recipient)sizesize_rcpt(size * recipients)
The resulting tables will look like:
mysql> select * from acct_client_address;
+----+--------------+---------+-------+------------+--------+-----------+
| id | key | time | count | count_rcpt | size | size_rcpt |
+----+--------------+---------+-------+------------+--------+-----------+
| 1 | 192.168.0.1 | 2014-12 | 11 | 11 | 147081 | 147081 |
| 2 | 192.168.1.1 | 2014-12 | 1 | 1 | 13371 | 13371 |
| 12 | 192.168.2.1 | 2014-12 | 10 | 100 | 133710 | 1337100 |
...
like. look at those rows. iconic honestly. ๐ญ๐
๐งฎ PARAMETERS ๐งฎ
The module takes the following parameters:
(uc_)enabled(default:on) โ turn this check on or off. simple as that.fields(required) โ a comma separated list of fields used for accounting.
For each field a table will be created.
For a list of available fields see postfix documentation:
http://www.postfix.org/SMTPD_POLICY_README.html
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.
table_prefix(default:"acct_") โ a prefix to add to every table.
The table name will be the prefix + field_name.
๐ฆ DESCRIPTION ๐ฆ
This plugin can be used to do accounting based on request fields.
๐ 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
okay that's the whole page, we ate and left no crumbs ๐
this was Mail::...ounting(3pm) from perl v5.38.2, dated 2024-05-26 โ tysm for reading, mwah ๐๐๐ฆ
๐ฆ 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