From 0230dd476297a1d090b9b9c28b09322e3890b9fb Mon Sep 17 00:00:00 2001 From: mwiegand Date: Thu, 17 Jun 2021 01:04:42 +0200 Subject: [PATCH] wip --- bundles/opendkim/metadata.py | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/bundles/opendkim/metadata.py b/bundles/opendkim/metadata.py index c6ffcbc..181cf64 100644 --- a/bundles/opendkim/metadata.py +++ b/bundles/opendkim/metadata.py @@ -15,8 +15,16 @@ defaults = { 'domains': [], 'keys': {}, }, + 'dns': { + 'mail._domainkey.mail2.sublimity.de': { + 'TXT': [ + + ] + } + } } + @metadata_reactor.provides( 'opendkim/keys' ) @@ -66,3 +74,20 @@ def keys(metadata): 'keys': keys, } } + + +@metadata_reactor.provides( + 'opendkim/keys' +) +def dns(metadata): + dns = {} + + for domain, keys in metadata.get('opendkim/keys').items(): + raw_key = keys['public'].replace('ssh-rsa ', '') + dns[f'mail._domainkey.{domain}'] = { + 'TXT': f'v=DKIM1; k=rsa; p={raw_key}', + } + + return { + 'dns': dns, + }