<acct-file>set by the Hub
The engine can add arbitrary headers to a webhook request only from a file — one per line. They cannot be written directly into the configuration.
The main use is authorization. The receiver has to somehow learn that the batch came from the right node, and the Authorization header is where that is customarily written.
The second use is overriding the content type. By default it is derived from the path extension, and if the receiver expects something else, a Content-Type line in this file overrides it.
A separate file is a good thing. The token gets neither into the address nor into the configuration itself: the file has its own permissions, and only the engine reads it.
The file name is our own, not a shared one. If the node is later connected to Protosender, its token will sit next to ours rather than over it.
The receiver accepts the token both in the Authorization: Bearer header and in the X-MTAHub-Token header; the comparison is constant-time, and the response to a wrong token and to a nonexistent node is identical — there is nothing to guess from differences in responses.
In the file — one header per line:
| Header | Why |
|---|---|
| Authorization | the receiver recognizes the node |
| Content-Type | to override the one derived from the extension |
| your own | if the receiver requires it |
File permissions — 600, owned by the user the engine runs as.
# the configuration holds only the path <acct-file /var/log/pmta/mtahub-webhook.json> http-webhook-url https://hub.example.com/api/telemetry/pmta/7 http-webhook-extra-headers /etc/pmta/mtahub-headers.txt</acct-file> # the file /etc/pmta/mtahub-headers.txt holds one header per line: # Authorization: Bearer d41d8cd98f00b204e9800998ecf8427e
what people get wrong and how it ends2 mistakes▶
our experience
§ 3.3.11.18
2 relations
ls -l /etc/pmta/mtahub-headers.txt && head -c 40 /etc/pmta/mtahub-headers.txt
3 articles
◇What the node tells about itself and through which channelsSeven observation surfaces: the web monitor, the console in four formats, the log, accounting, accounting search, metrics and export to external analytics.◇Two inbound report processors and what to do with themBounces by message and complaints are parsed by two identically structured blocks; each has its own address list and its own pair of decisions about the message’s fate.◇Five ways for a queue to hand off a messageA queue does not have to use SMTP: it can write to a file, run a program, call over HTTP or discard.