Knowledge base

Return a node file

critical

/getFile
Logs and accounting over the network

Returns a log or accounting file by name — the one the “Logs” page offers for download.

The call is GET /getFile?file=log.txt, where log.txt is a file name from the /logs list. There is no format parameter: the file itself arrives.

A way to read the log without logging into the machine. ⚠️ And at the same time a way to read it for anyone who has reached the monitor port: logs and accounting hold recipient addresses and receiver replies.

To cut off files while keeping the monitor, use the deny-logs qualifier on the monitor level in http-access.

The key from http-api-key in the X-API-Key header grants full access from any address.

The main trap is opening the files along with the monitor. The monitor level without the deny-logs qualifier serves both logs and accounting: an address given “just a look at the queue” also gets recipients and receiver replies.
What the Hub does. It does not ask: accounting events reach the Hub as a stream through the webhook, and it computes the “Accounting statistics” summaries on the node itself over SSH. At the same time the Hub gives its own addresses in http-access the monitor level without deny-logs — the files are formally open to them.
Recommended values

What to ask this endpoint:

Question This one or not
log lines without logging into the machine yes
messages from previous days yes — through the accounting file, until it is deleted
which files exist no — /logs
The call address, the file parameter and the deny-logs qualifier come from the manual (§ 5.11, § 3.3.1.58.3). The split of questions and the conclusion about leaks are ours.
Example configuration
# download a log file by name from the list
curl -s 'http://127.0.0.1:8080/getFile?file=log.txt' -o log.txt
The name log.txt is the manual’s example; real names come from the /logs response.
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 who the files are open to:
curl -s -o /dev/null -w "%{http_code}\n" 'http://127.0.0.1:8080/getFile?file=log.txt'
grep -n 'http-access' /etc/pmta/config
Code 200 from an outside address means the files are open to everyone the monitor is open to; close them with the deny-logs qualifier.
In the Hub
Cost of a mistake
safe: a wrong value breaks nothing
Scenarios
Untangle a stuck queue · Collect telemetry
Priority
critical