Searches accounting files for records by field values and prints the selected fields of the found records — as standard output, CSV, TSV, HTML, XML, “pretty” XML or a custom format.
On Unix the program is called pmtaacctfind and lives in /usr/sbin; on Windows it is acctfind in the program directory.
Filtering is by record types and by fields. –delivered, –bounced, –status and –mta select record types; without them the search covers deliveries and bounces. –match compares a field with a Perl regular expression or with a case-insensitive string, and short options like –to and –dsnStatus do the same for one field.
It answers the question “what happened to the message to such-and-such recipient” without exporting all of accounting. It does not work with JSON accounting — only with CSV.
When to use it:
# what happened to messages to one recipient: outcome, queue time and delivery time pmtaacctfind --iso-times --to test@example.com --output tsv[to,dsnAction,timeQueued,timeDelivered] /var/log/pmta/acct-*.csv
1 relation
ls -l /var/log/pmta/acct* head -1 "$(ls -t /var/log/pmta/acct-*.csv | head -1)"
3 articles
◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.◇The watchdog that restarts the engineKeeps an eye on the engine and brings it back up after a crash by itself, sending a crash report to the postmaster address.◇How the policy for a receiver is assembledSettings are assembled from the most general pattern to the most precise; the order of blocks in the file means nothing.