postal icon indicating copy to clipboard operation
postal copied to clipboard

Add support for CNAME delegated DKIM keys

Open schueffi opened this issue 1 year ago • 18 comments

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).

schueffi avatar Jul 02 '24 17:07 schueffi

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[bot] avatar Aug 17 '24 01:08 github-actions[bot]

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[bot] avatar Oct 18 '24 02:10 github-actions[bot]

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

johnceci-m3 avatar Oct 18 '24 12:10 johnceci-m3

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

willpower232 avatar Oct 18 '24 13:10 willpower232

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

alnalda avatar Jan 20 '25 10:01 alnalda

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.

LANWrench avatar Feb 19 '25 17:02 LANWrench

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[bot] avatar Apr 06 '25 02:04 github-actions[bot]

please merge

schueffi avatar Apr 06 '25 08:04 schueffi

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[bot] avatar May 22 '25 02:05 github-actions[bot]

who is able to merge this enhancement?

alnalda avatar May 22 '25 06:05 alnalda

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

violuke avatar May 22 '25 08:05 violuke

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[bot] avatar Jul 07 '25 02:07 github-actions[bot]

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[bot] avatar Aug 22 '25 02:08 github-actions[bot]

Keep open

violuke avatar Aug 22 '25 13:08 violuke

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[bot] avatar Oct 07 '25 02:10 github-actions[bot]

Please merge.

LANWrench avatar Oct 07 '25 02:10 LANWrench

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[bot] avatar Nov 22 '25 02:11 github-actions[bot]

Still required

violuke avatar Nov 22 '25 19:11 violuke