Writes the submitted configuration files to the node — one or more per request.
The call is POST /configFile as a multipart/form-data form: op=commit, and for each file file.N.name (the full path), file.N.op=write and file.N.content. The format field — json or xml — sets the response form, xml by default.
🔴 There is no content check: the endpoint will write a broken configuration too. And by itself it applies nothing — for the write to take effect, the configuration is reloaded separately.
A file from a subdirectory can be written only if it is already included from the main configuration.
Writing requires the key from http-api-key in the X-API-Key header — regardless of the address level in http-access.
Form fields:
| Field | Required | What it sets |
|---|---|---|
| op | yes | commit — write the files |
| file.N.name | yes | the full path of the N-th file |
| file.N.op | yes | write — write it |
| file.N.content | yes | the contents; with @ curl substitutes a local file |
| format | no | json or xml, xml by default |
# write a file and check the configuration on the node right away curl -s -X POST -H 'X-API-Key: KEY' 'http://127.0.0.1:8080/configFile' -F op=commit -F format=json -F file.1.name=/etc/pmta/config -F file.1.op=write -F file.1.content='@/tmp/config.new'pmta test config
4 relations
Configuration parse checkThe same output from the command line. § 8.2.2Apply a changed configuration without stoppingThe same output from the command line. § 8.2.2
ConfigurationThe same subject on the monitor screen. inference
pmta test config pmta reload
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.