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:

  • count
  • count_rcpt (count per recipient)
  • size
  • size_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>


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