By default, DKIM is inherited by all the subdomains, as defined in RFC 6376, 3.10:
Signing by Parent Domains
In some circumstances, it is desirable for a domain to apply a
signature on behalf of any of its subdomains without the need to
maintain separate selectors (key records) in each subdomain. By
default, private keys corresponding to key records can be used to
sign messages for any subdomain of the domain in which they reside;
for example, a key record for the domain example.com can be used to
verify messages where the AUID ("i=
" tag of the signature) is
sub.example.com
, or even sub1.sub2.example.com
.
In order to limit
the capability of such keys when this is not intended, the "s
" flag
MAY be set in the "t=
" tag of the key record, to constrain the
validity of the domain of the AUID. If the referenced key record
contains the "s
" flag as part of the "t=
" tag, the domain of the AUID
("i=
" flag) MUST be the same as that of the SDID (d=
) domain. If
this flag is absent, the domain of the AUID MUST be the same as, or a
subdomain of, the SDID.
As opendkim-genkey
also creates the DNS key record it has this capability of setting the t=s
flag:
−S
(−−[no]subdomains
) Disallows subdomain signing by this key. By
default the key record will be generated such that verifiers are told
subdomain signing is permitted. Note that for backward compatibility
reasons, −S
means the same as −−nosubdomains
.
This means that:
- Without the
t=s
it is possible to use d=example.com;s=selector
to also authenticate messages from subdomains ([email protected]
).
- When the
t=s
flag is set it is only possible to sign
Practically, DKIM does not care whether the ID in signature matches the From
header. Therefore, it is used together with DMARC, which has relaxed mode (RFC 7489, 3.1.1) where the d=example.com
and From: <[email protected]>
are considered to be aligned because they are sharing the same Organizational Domain (3.2).
It seems OpenDKIM has not implemented the i=
, probably because a milter does not have trustworthy information on the user to authenticate the local-part
. It is a bit strange to implement t=s
without implementing the i=
, indeed.