Globalset by the Hub
The line includes another file, and its contents are read as if written right here. This is meant for a fleet: common settings are kept in one file, differences between nodes in separate ones, and each node includes its own.
Masks are allowed — one line can pull in a directory of files.
An HTTP address can be given instead of a path. The requirements for it are strict: absolute, with the http or https scheme, without a user name, a query string or a fragment. If request headers are needed — Authorization, for example — the <include-config> block is used.
The line works not only at the node level. It can also be written inside <source>, <domain>, <virtual-mta> and <smtp-pattern-list> — there the included content becomes part of the corresponding block.
The node has two files, and what divides them is not convenience but compatibility. /etc/pmta/config holds management, complaint receiving and receiver policies; /etc/pmta/virtualhost.txt holds submission logins, the pool and sending addresses. The layout is shared with Protosender: the same block names, the same division — which is why a node configured by the Hub connects to Protosender’s PMTA module, and vice versa.
The Hub assembles both files in full and overwrites them on every apply. An include added on the node by hand will be wiped out by the next apply — worth remembering when investigating “where did my line go.”
Three forms of the value — and the third calls for a decision rather than a setting:
| Value | When | What to keep in mind |
|---|---|---|
| file path | the usual case: common and specific settings in different files | the same permissions as the configuration itself |
| mask | a directory of files with one line | the reading order is not specified |
| HTTP address | the configuration is distributed centrally | the source must be trusted and must respond at reload time |
A separate note on HTTP. The file is pulled when the configuration is read, that is, at startup and on every reload. An unreachable source means a failed reload exactly when it is needed most.
# common settings in one file, node differences in separate ones include /etc/pmta/vmtas.txtinclude https://10.1.2.3:4000/my/config/file
what people get wrong and how it ends3 mistakes▶
§ 3.3.1.53
our experience
§ 3.3.1.53
3 relations
include<source>The same directive at the root of the file; there it adds node-level lines. § 3.3.1.53include<domain>The same directive at the root of the file; there it adds node-level lines. § 3.3.10.104include<virtual-mta>The same directive at the root of the file; there it adds node-level lines. § 3.3.12.14include<smtp-pattern-list>The same directive at the root of the file; there it adds node-level lines. § 3.3.1.53http-extra-headers<include-config>The regular include form does not support headers — that is why this block exists. § 3.3.24
pmta test config grep -rn '^ *include ' /etc/pmta/
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.