critical
All of the node’s configuration lives in one text file: /etc/pmta/config on Linux, c:\pmta\config.dat on Windows. The format is UTF-8, one line per directive, # starts a comment that runs to the end of the line. The encoding was chosen for a reason: domains and addresses in national alphabets are written into the file as is, without escaping.
It is read at startup and on the reload command. The manual explicitly advises reloading rather than restarting: a reload is more efficient and does not interrupt delivery. It picks up most edits; the few directives that require a restart are marked in their sections — we have twenty-eight of them.
There is more than one file. The second main one is /etc/pmta/config-defaults, with the defaults the main file is laid over. Plus the main file can include other files with an include line — by path, by mask and even over HTTP.
It is a secrets store. The manual says so in a separate section: the file holds passwords, API keys and private signing keys — in plain text. Permissions on it are not a wish but a requirement: chown pmta:pmta and chmod 640. The included files too, especially those holding keys.
The file can be replaced over the network. The web monitor accepts it with a POST request to /configFile, in the file field — with the admin right. There is no content check: whatever was sent is what gets written.
The Hub puts the files in place over SSH rather than with a request to the web monitor: that way there is something to go back to on rollback and something to show in the preview.
⚠️ The Hub writes submission passwords into the file in plain text — otherwise the engine will not accept them. That is what makes permissions on the file mandatory rather than desirable.
The file has no values of its own — it has requirements:
| What | How it should be |
|---|---|
| owner and permissions | pmta:pmta, 640 — the manual gives these commands directly |
| encoding | UTF-8; national domains are written as is |
| included files | the same permissions, especially where signing keys are |
| applying edits | pmta reload, not a restart |
| before applying | pmta test config — always, and especially after an edit over the network |
Secrets can be moved out of the file. The manual suggests storing signing keys in Vault and referencing them from the configuration (vault-support) — then the file holds a reference rather than the key itself.
# the main file: general node settings, sending addresses — in the included file host-id 5 smtp-listener 0/0:2525 smtp-listener 0/0:25 include /etc/pmta/virtualhost.txt # sending address blocks
what people get wrong and how it ends3 mistakes▶
§ 3.1
§ 1.6.3
§ 3.1
7 relations
The defaults fileThe second main file: the defaults this one is laid over. § 1.6.3includeGlobalThe main file can include others — by path, by mask and over HTTP. § 3.3.1.53
http-extra-headers<include-config>Included files carry the same sensitivity as the main one. § 1.6.3
Change a signing key without interrupting sendingBoth edits — adding and removing the key — are made in the main file or in an included one. § 1.6.2Reloading settings versus restarting the serviceA reload acts on the main file and on everything it includes. § 3.1http-accessGlobalThe operator level and above opens reading the configuration through the API — that is, the whole file with all the secrets in it. § 3.1Where the node writes why it did not startA startup failure is most often caused by an edit of exactly this file. § 4.2.1ConfigurationThe file this output refers to. § 5.6Configuration through the API and the file do not reconcileThe file the mechanism is concerned with. § 8.3
pmta test config ls -l /etc/pmta/config /etc/pmta/virtualhost.txt pmta reload
3 articles
◇How the node selects a source and combines its settingsA connection falls under all source blocks whose addresses cover it, and they act merged — the narrow one overrides the wide one; named blocks are attached only by direct reference.◇Accept, route, deliverA message’s path inside the node: accept, decide where, deliver — and all the settings live between these three steps.◇Who is allowed to submit mail and for whom to accept itOut of the box, the node accepts submission only from the machine itself; two different questions — “who can send through us” and “for whose addresses we accept mail” — are answered by different directives.