Knowledge base

How long the message sat in the queue

totalSecondsQueued
A ready duration instead of subtraction

The number of seconds the message spent in the queue.

It is not written by default — the field has to be named in record-fields. 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.

The same as the difference of timestamps, but calculated by the engine. Convenient because it does not depend on the time format.

The main trap is expecting the field from the star. The star gives only the default fields, and this field is not among them: until it is named in record-fields, the file has no such column at all.
What the Hub does. It reads it — this is one of the fourteen fields the event normalizer parses: delivery time is calculated from it. The field is not in the default set, so the Hub names it in record-fields explicitly — both for the webhook and for the accounting file, where “Accounting stats” parses it as well.
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

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); 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 *, totalSecondsQueued</acct-file>
The star is the default fields, and totalSecondsQueued is added to them; for other record types the line is repeated with its own letter.
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 '^totalSecondsQueued$'
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