The manual devotes a separate section to this, and for good reason: PowerMTA configuration files hold submission passwords, API keys and private DKIM signing keys — in plain text. Otherwise the engine will not accept them.
There are two main files: config with the settings themselves and config-defaults with the defaults. But not only they need protection: the main file can include others with the include line, and the manual names them directly — “they may also contain sensitive information,” especially where signing keys are kept.
The commands are given literally: owner pmta:pmta, permissions 640. The owner matters as much as the permissions: the engine runs as the pmta user and must be able to read its configuration. A file with 640 permissions and owner root cannot be read by anyone but root — including the engine itself.
Secrets can be moved out of the file. The manual suggests keeping signing keys in Vault and referring to them from the configuration (vault-support); then the file holds a reference, not the key itself.
The operator has nothing to do: the Hub delivers the files, and their permissions are its responsibility, not the operator’s.
⚠️ One subtlety in our code. The owner change is executed with the error suppressed, and permissions are then set unconditionally. If the node has no pmta user — for example, the engine is not installed yet — the file will get permissions 640 and owner root, and the engine will not be able to read it later. This will surface not on delivery but at the first start.
What should end up on the node:
| Path | Owner | Permissions |
|---|---|---|
| main configuration file | pmta:pmta | 640 |
| file with address blocks | pmta:pmta | 640 |
| signing key directory | the engine directory’s owner | 700 |
| private keys inside | the same | 600 |
| telemetry token file | pmta:pmta | 600 |
Permissions 640 are the manual’s minimum, not the ceiling. Anything read only by the engine itself and not needed by its group can happily live with 600. The difference matters where the node has other services in the same group.
On Windows the procedure is different: the system account is set as the owner, and the users group is denied read and write.
# permissions are set for the whole bundle, not for one file chown pmta:pmta /etc/pmta/config /etc/pmta/config-defaults chmod 640 /etc/pmta/config /etc/pmta/config-defaults chown pmta:pmta /etc/pmta/virtualhost.txt && chmod 640 /etc/pmta/virtualhost.txtchmod 700 /etc/pmta/dkim && chmod 600 /etc/pmta/dkim/*
what people get wrong and how it ends3 mistakes▶
§ 1.6.3
§ 1.6.3
§ 1.6.3
2 relations
Restrict who can reach the node at allHere it is network access, there file permissions. You need both or neither. § 1.6.3License fileKey material in the configuration directory — its permissions are the same. § 1.6.3volume-audit-api-keyGlobalThe key sits in the configuration in plain text; it is protected by the file permissions. § 1.6.3includeGlobalIncluded files are part of the configuration, and their permissions should be the same. § 1.6.3http-api-keyGlobalThe key sits in the file in plain text, so the permissions on the file are worth as much as the key itself. § 1.6.3log-file-world-readableGlobalThe same permissions question as for the configuration file: a detailed log holds no less. § 1.6.3
ls -l /etc/pmta/config /etc/pmta/config-defaults /etc/pmta/virtualhost.txt ls -ld /etc/pmta/dkim && ls -l /etc/pmta/dkim/ pmta test config
3 articles
◇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.◇The group that grants management rightsMembership in the pmta group gives an unprivileged user the right to call the node’s commands and use submission.◇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.