Normally the node’s configuration decides everything about signing. This mechanism hands some decisions over to the message: the submitting side sets the X-DKIM-Options header, and it overrides the settings for that one message.
There are five parameters, separated by semicolons, like the tags in the signature itself: s — the selector, d — the domain, i — the signing identity, q — the key query method, key-list — the name of the list to take the key from.
The override is not unlimited. The header chooses among the declared keys rather than bringing its own: the specified selector or domain must exist in the configuration, otherwise the message is not signed. And the mechanism itself works only if processing of this header is enabled on the source.
# two keys for one domain — the message chooses the second domain-key key1, example.com, /etc/pmta/key1.example.com.pem domain-key key2, example.com, /etc/pmta/key2.example.com.pem # and in the message itself: X-DKIM-Options: s=key2
what people get wrong and how it ends2 mistakes▶
our experience
§ 10.3.3
2 relations
grep -n process-x-dkim-options /etc/pmta/config grep -i 'DKIM-Signature' /var/log/pmta/pmta.log | tail -3
3 articles
◇Do not send what will fail the check at the receiverThe node checks the SPF of its own mail before sending: if it fails, it bounces the message without waiting for someone else’s refusal.◇How the node signs messages and chooses a keyThe key is chosen by the sending domain from the headers, going through the declarations from top to bottom.◇A second signature on the same messageTwelve lines with the second- prefix: the message is signed twice, with different keys and under different identities.