This commit is contained in:
cronekorkn 2023-04-28 11:11:11 +02:00
parent 5fa4969cfe
commit a0dc65f568
Signed by: cronekorkn
SSH key fingerprint: SHA256:v0410ZKfuO1QHdgKBsdQNF64xmTxOF8osF1LIqwTcVw
2 changed files with 7 additions and 2 deletions

View file

@ -43,12 +43,16 @@ defaults = {
)
def dns(metadata):
dns = {}
for domain in metadata.get('mailserver/domains'):
dns[domain] = {
'MX': [f"5 {metadata.get('mailserver/hostname')}."],
'TXT': ['v=spf1 a mx -all'],
}
report_email = metadata.get('mailserver/dmarc_report_email')
dns[f'_dmarc.{domain}'] = {
'TXT': [f'v=DMARC1; p=reject; rua=mailto:{report_email}; ruf=mailto:{report_email}; fo=1;'],
}
return {
'dns': dns,
@ -66,4 +70,4 @@ def letsencrypt(metadata):
},
},
},
}
}

View file

@ -113,6 +113,7 @@
'mailserver': {
'hostname': 'mail.sublimity.de',
'admin_email': 'postmaster@sublimity.de',
'dmarc_report_email': 'dmarc@sublimity.de',
'domains': {
'ckn.li',
'sublimity.de',