Knowledge base

pmtastats

A summary of the accounting files
A report on what has already been recorded

Reads accounting files and computes statistics: throughput, delivery times, bounce categories, top domains — for the node as a whole or broken down by sending address, job, sender and header.

It works with files, not with a live node: it answers questions about the past. Several files can be named — for example, if accounting was rotated in the middle of a campaign; gzip-compressed files are accepted with the .gz or .gzip extension. The manual notes that the program currently works only with CSV accounting.

Reports are selected by words — vmta-summary, delivery-times, bounce-categories, top-rates and others, each with its own options. Common options filter records by job, sending address, recipient domain and age, and –output html produces the report as a page.

The main trap is computing over an incomplete set of files. Accounting rotates, and a “weekly” summary over one current file covers only the time since the last rotation. The needed period is set by the set of files and the –last option.
What the Hub does. It calls it — “Accounting stats” is built on it: the Hub runs pmtastats on the node itself over SSH against the accounting files with –quiet –output html and parses the finished report pages. Breakdowns for a single domain are computed separately, with –toDomain.
Recommended values

When to use it:

Question This command or not
how fast the node delivered over a period yes — delivery-times, top-rates
which bounce categories prevailed yes — bounce-categories
what happened to one message no — acctfind
what is happening now no — show status
The reports, common options, compressed files and the CSV caveat come from the manual (§ 12.4). The split of questions is ours.
Example configuration
# a summary by sending address and bounce category for one day
pmtastats --last 1d vmta-summary bounce-categories --bounceCat all acct*pmtastats --output html vmta-time-breakdown acct* > report.html
Both lines are assembled from the manual’s examples; acct* means all accounting files in the directory, including rotated ones.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
Compatibility
PowerMTA 6.0
described in the manual of this version · platform: any
The vendor does not state the first version for every directive — there is no note here. The name also appears in the 5.0 edition of the manual.
How to check on the node
Check that the program and the accounting files are in place:
pmtastats --version
ls -l /var/log/pmta/acct*
If the program is not found, check the search path: it is installed by the engine package together with pmta.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Troubleshoot deliverability