<source>critical
The default is false. With the permission the engine extracts a private key in PEM format from the X-DKIM-Key header, signs the message with it and strips the header before sending.
One permission is not enough. A selector is needed — it is passed in a separate X-DKIM-Options header, which means a permission for it is needed too: process-x-dkim-options. It never takes fewer than two lines.
Next comes the part that makes this page worth reading to the end. The manual says directly: if the permission is not set, the engine does not remove the header, — and advises checking your installation so that private keys do not leak. That is, the absence of the permission does not protect: it does exactly the opposite and leaves the key in the message.
The neighboring section about retaining the same header says the opposite: with both directives false, the header is supposedly stripped anyway. Follow the manual’s own advice — check.
Most dangerous is a combination that is easy to arrive at without any ill intent: the submitting platform can pass the key in the message, someone enabled that on its side, and the permission is not set on the node. The key travels the whole way and reaches the recipient.
And the second half: even with the permission enabled, the key travels to the node inside the message — through the submitting side’s queues, its logs, intermediate storage. Stripping the header protects the recipient, not that path.
It is still worth checking whether such a header arrives from submitting platforms: without the permission, by the letter of § 3.3.7.46, the engine will not strip it.
What to set. Both sides of the choice are unpleasant, and that is normal for a directive like this:
| Value | When |
|---|---|
| no (default) | keys are declared in the configuration — the usual case, ours included |
| yes | an intermediary signs for many clients with their own keys, and all the keys cannot be kept on the node |
The second case is justified only where the entire path from the submitting application to the node is fully yours. Through someone else’s network, through an intermediate relay, through a shared queue — no.
Whatever you choose, retain-x-dkim-key must stay false.
# without the second line the key is useless: the selector arrives in a separate header <source 10.0.0.0/24> process-x-dkim-key true process-x-dkim-options true </source>
what people get wrong and how it ends3 mistakes▶
§ 3.3.7.46
§ 3.3.7.46
our experience
3 relations
grep -n 'process-x-dkim-key\|retain-x-dkim-key' /etc/pmta/config /etc/pmta/virtualhost.txt
3 articles
◇A signing key that came along with the messageA private key is passed in a message header; the node signs with it and removes the header before sending.◇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.