Returns the contents of a configuration file.
The call is GET /configFile?op=read&filename=/etc/pmta/config, optionally with format=json-text: then the file arrives as a string inside JSON, without it — the file itself as is.
Not everything can be read. The file must be in /etc/pmta/ (on Windows, in the installation directory), and a file from a subdirectory must also be included from the main configuration. Otherwise the response is 403, and a nonexistent file gives 404.
Useful for reconciliation: it shows what is actually on the node, not what we think is there.
For reading, the key is not required if the requesting address has at least the operator level in http-access; the key from http-api-key in the X-API-Key header lifts the address restriction.
Parameters:
| Parameter | Required | What it sets |
|---|---|---|
| op | yes | read — read the file |
| filename | yes | the full path; only /etc/pmta/ and included files |
| format | no | json-text — the file as a string in JSON; without it, the file as is |
# the main configuration file as a string in JSON curl -s 'http://127.0.0.1:8080/configFile?format=json-text&op=read&filename=/etc/pmta/config'
2 relations
Replace the configuration file over the networkThe same thing, returned by a request. § 8.2.1ConfigurationThe screen that shows the same thing to a human. inference
List of configuration filesA neighboring catalog entry. § 8.2.3
curl -s -o /dev/null -w "%{http_code}\n" 'http://127.0.0.1:8080/configFile?op=read&filename=/etc/pmta/config'
grep -n 'http-access' /etc/pmta/config
3 articles
◇Accept, route, deliverA message’s path inside the node: accept, decide where, deliver — and all the settings live between these three steps.◇Four value types the whole config is written inBoolean, domain pattern, regular expression and time interval — defined once in § 3.2 and then used by all directives.◇Reloading settings versus restarting the serviceThe configuration is read at startup, and after that edits are picked up by the reload command — except for the directives the manual marks as requiring a restart.