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, + }