This commit is contained in:
mwiegand 2021-06-17 01:04:42 +02:00
parent 742d3db032
commit 0230dd4762

View file

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