The task. Questions answered by accounting fields — whether delivery was encrypted, which proxy it went through, after how many failures — come up after the campaign. But a field not named in advance did not get into the file, and there is no data for that period.
What it is made of:
The parts have different scopes. Fields are selected per record type in each <acct-file> block, so a node can write a detailed file for one consumer and a sparse one for another. Record types are selected the same way: by default only d and b.
How they interact. This is one decision, not four: what a delivery record must say. Without these fields it says the message arrived; with them — with what transport protection, through which proxy, after how many failures and how long it all took. The cost is bytes per record; the limitation is that a field works only going forward.
What to name and what it gives:
| Field | In the star | What it answers |
|---|---|---|
| dlvTlsProtocol, dlvTlsCipher | no | whether delivery was encrypted and with what |
| numRetries, timeFirstAttempt, totalSecondsQueued | no | how many failures and how much time before delivery |
| dlvProxyName | no | which proxy the message went through |
| bounceCat | yes for b, no for d | bounce category |
<acct-file /var/log/pmta/acct.csv> records d, b record-fields d *, timeFirstAttempt, numRetries, dlvTlsProtocol, dlvTlsCipher, dlvProxyName record-fields b *, timeFirstAttempt, numRetries </acct-file>
grep -n 'record-fields' /etc/pmta/config head -1 "$(ls -t /var/log/pmta/acct-*.csv | head -1)"