Knowledge base

world-readable

<acct-file>

Whether to make the accounting file readable by all system users
in the configuration this is a lineworld-readable noinside the block <acct-file>
Who on the node will be able to read accounting

The line sets the permissions with which the engine creates a new accounting file. The default is no, that is, the file is accessible only to its owner.

There is one reason to enable it: accounting is read by a program running as another user. Your own collector, an export to storage, someone else’s monitoring agent.

But it is the crudest way to solve the task. 644 permissions on the whole file give read access to every user of the node, not to the one who needs it. It would be more precise to set up a shared group and group permissions — but the directive has no such setting.

What exactly gets opened is worth remembering. Accounting holds recipient addresses, message subjects with the corresponding field set, and receiver responses. These are personal data and your clients’ business correspondence.

The line does not touch files already created — only new ones.

The main trap is enabling it for one program and opening everything to everyone. On a node running several services or with human user accounts, this means handing out the address base. And a line enabled once usually stays forever.
What the Hub does. It does not write it — the files stay closed.

The main stream arrives via webhook, and the “Accounting stats” module parses the accounting files on the node itself, connecting over SSH with the node’s account — there is no need to open them to everyone for that. There is nowhere for a third-party collector on the node to come from for us.

If such a task appears, it is better to grant access through a group with system tools than to open the file to everyone with this line.

Recommended values

The answer is almost always “no”:

Value When
no (default) always
yes accounting is read by a program running as another user, and a group cannot be set up

Anonymization does not replace this decision, but it lowers the cost: privacy-policy with a hash leaves less in the file that you would hate to expose.

The no default and the fact that permissions are set when the file is created come from the manual (§ 3.3.11.13). The remark about the crudeness of the technique and the advice about a group are ours.
Example configuration
# someone else's collector reads the file as another user
<acct-file /var/log/pmta/acct.csv>
    records d, b
    world-readable yes    privacy-policy hmac-sha256 "KEY-32-BYTES-OR-LONGER"
</acct-file>
The second line is here for a reason: if the file is opened to everyone, the addresses in it should at least be anonymized.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.
▲

Common mistakes and problems

what people get wrong and how it ends2 mistakes▶

Opening the file to everyone for one program

our experience

What it costsAccounting with recipient addresses and receiver responses becomes accessible to every user of the node. These are personal data, and they are handed out in full.
How to spot itThe node has human user accounts, and the accounting file is readable by everyone.
How to do it rightGrant access through a group with system tools; if that is impossible, at least anonymize the addresses with privacy-policy.

Expecting the line to change the permissions of files already created

§ 3.3.11.13

What it costsPermissions are set at creation. Old files keep their previous ones, and the program keeps getting denied on them.
How to spot itNew files are readable, old ones are not.
How to do it rightFix the permissions on the old files by hand, once.
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.
Reference data
Syntax
world-readable <boolean>
Values
yes | no | true | false
Default
no § 3.3.11.13
Applying
reload, no restart needed
Queue
will not touch what is already queued
Where to write it
<acct-file>
How many times
once in the block
Everything here comes from the manual, with the section.
Inheritance
There is no inheritance: the line lives inside its <acct-file> and concerns only the permissions of its files. One stream can be open while the neighboring one is closed; that is the way to expose only part of it.
How to check on the node
The check is direct — look at the permissions of the created files:
ls -l /var/log/pmta/acct*.csv
Permissions like -rw-r–r– mean the line is enabled. Files created before the edit keep their previous permissions — they are changed by hand.
In the Hub
Cost of a mistake
reversible: harms only while it is set
Scenarios
Collect telemetry