Skip to content

Conversation

@schueffi
Copy link

@schueffi schueffi commented Jul 2, 2024

In order to use a DKIM public key, it has to be published in the DNS system. The most easy setup simply puts it directly into the appropriate TXT record. A more advanced setup also allows them to be delegated to some other record pointed to by a CNAME record.

As an example, both variants are equivalent in terms of DKIM key validation:

selector1._domainkey.example.org IN TXT "v=DKIM1; p=..."

and

selector1._domainkey.example.org IN CNAME "somekey.mailprovider.org." somekey.mailprovider.org IN TXT "v=DKIM1; p=..."

So, the actual key management can be delegated to some other party by means of using a CNAME.

This is of special importance for infrastructure automation and DKIM key rotation (we just ask the customer / domain dns owner once to add the appropriate CNAME pointing to the corresponding record on our own domain, and then we're able to modify the DKIM keys on our own without requiring the customers to update their DNS records all the time).
As key rotation is a current best practice, the added CNAME support will ease the respective implementation.

This commit changes the code to first check a TXT record (as before), and in addition checks a CNAME record (and if found, check the record it is referring to - up to a limit of 10 recursion steps to avoid endless recursions).

In order to use a DKIM public key, it has to be published in the DNS system.
The most easy setup simply puts it directly into the appropriate TXT record.
A more advanced setup also allows them to be delegated to some other record
pointed to by a CNAME record.

As an example, both variants are equivalent in terms of DKIM key validation:

selector1._domainkey.example.org IN TXT "v=DKIM1; p=..."

and

selector1._domainkey.example.org IN CNAME "somekey.mailprovider.org."
somekey.mailprovider.org IN TXT "v=DKIM1; p=..."

So, the actual key management can be delegated to some other party by means of
using a CNAME.

This is of special importance for infrastructure automation and DKIM key rotation
(we just ask the customer / domain dns owner once to add the appropriate CNAME
pointing to the corresponding record on our own domain, and then we're able to
modify the DKIM keys on our own without requiring the customers to update their
DNS records all the time).
As key rotation is a current best practice, the added CNAME support will ease
the respective implementation.

This commit changes the code to first check a TXT record (as before), and in
addition checks a CNAME record (and if found, check the record it is referring
to - up to a limit of 10 recursion steps to avoid endless recursions).
@github-actions
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Oct 18, 2024
@johnceci-m3
Copy link

This would be quiet useful for those of us that need advanced setups

@willpower232
Copy link
Collaborator

its supposed to ignore things which have labels but apparently it doesn't work 👌

@alnalda
Copy link

alnalda commented Jan 20, 2025

Could this enhancement be merged? This is pretty useful.
Thank you

@LANWrench
Copy link

What would it take to get this enhancement merged?

We send email on behalf of several domains and we use CNAME records to delegate management of the DKIM records to us.

I can help in any way I can.

@github-actions
Copy link
Contributor

github-actions bot commented Apr 6, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Apr 6, 2025
@schueffi
Copy link
Author

schueffi commented Apr 6, 2025

please merge

@github-actions github-actions bot removed the stale label Apr 7, 2025
@github-actions
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label May 22, 2025
@alnalda
Copy link

alnalda commented May 22, 2025

who is able to merge this enhancement?

@violuke
Copy link

violuke commented May 22, 2025

This is one of the main blockers for us moving to Postal, so seeing this merged would be fantastic 🙏

@github-actions
Copy link
Contributor

github-actions bot commented Jul 7, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Aug 22, 2025
@violuke
Copy link

violuke commented Aug 22, 2025

Keep open

@github-actions
Copy link
Contributor

github-actions bot commented Oct 7, 2025

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Oct 7, 2025
@LANWrench
Copy link

Please merge.

@willpower232 willpower232 removed the stale label Oct 7, 2025
@github-actions
Copy link
Contributor

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

@github-actions github-actions bot added the stale label Nov 22, 2025
@violuke
Copy link

violuke commented Nov 22, 2025

Still required

@github-actions github-actions bot removed the stale label Nov 23, 2025
@github-actions
Copy link
Contributor

github-actions bot commented Jan 7, 2026

This PR is stale because it has been open 45 days with no activity. Remove stale label or comment or this will be closed in 10 days.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants