Knowledge base

Selected message headers

header_XXX
One column for each

The values of the message headers selected in the accounting setup — one column for each.

Only what is named gets written: a header is specified in record-fields as header_NAME; complaint records already have header_From, header_Return-Path, header_X-Job and header_Subject by default. The field set is defined in the accounting block, and fields are worth adding deliberately: there are as many delivery records as delivered recipients, and every extra column is multiplied by that volume.

A way to carry into accounting mailing data the engine does not have: a campaign label, a segment, anything.

The main trap is expecting headers from the star. For d, b, t and r records, message headers are not written until they are named via header_ plus the header name; for f complaints the star gives only From, Return-Path, X-Job and Subject.
What the Hub does. It requests one header: in complaint records the webhook carries header_feedback-id. The event normalizer does not parse it yet, and there are no other headers in the field set.
Recommended values

Where the field exists and whether the star includes it:

Record type In the star
d — delivery no
b — bounce no
t — temporary failure no
r — reception no
f — complaint only From, Return-Path, X-Job, Subject

In a shared file an empty value comes in two kinds: the line has no data — or the field is not selected for its record type.

The record types with this field and the default set markers come from the manual (§ 12.2.1, § 12.2.2, § 12.2.3, § 12.2.5, § 12.2.7); a list without the star replaces the set — § 3.3.11.12. The table is ours.
Example configuration
<acct-file /var/log/pmta/acct.csv>
    record-fields d *, header_Message-Id</acct-file>
An example from the manual: the header name is written after header_, and the star keeps the default fields.
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 whether the column is in the latest accounting file:
head -1 "$(ls -t /var/log/pmta/acct-*.csv | head -1)" | tr -d '\r' | tr ',' '\n' | grep -n '^header_'
The line number in the output is the column number in the file; empty means the field is not selected for any record type in this file.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing