Knowledge base

<include-config>

Including configuration over HTTP with request headers
When you need a key to fetch the configuration

The block does exactly the same as include with an address: it fetches a configuration file over HTTP. There is one difference, and a practical one — request headers can be set.

What for. An address in the ordinary form cannot contain a user name, a query string or a fragment — that is, there is nowhere to pass an access key through it. The Authorization header solves this, and that is exactly the example the manual gives.

Where it is written is the same as for include: the root of the file, <source>, <domain>, <virtual-mta>, <smtp-pattern-list>. The address must be absolute, with the http or https scheme, without a user name, query string or fragment.

The node does not parse the headers — it only checks the form of the line. What exactly you pass and where remains your responsibility.

Example configuration
# the access key is passed in a header, not in the address
<include-config https://10.1.2.3:4000/my/config/file>
    http-extra-headers /etc/pmta/include-config-http-headers.txt
</include-config>
The manual’s example. The headers file holds lines like Authorization: 14ac5499…, one per line. The same file is readable by everyone with access to the node: keep permissions on it as for the configuration.
yellow — — directive names, blue — blocks. They are highlighted the same way in the text of the card.