infrastructure/dns/default_records.js

40 lines
1.1 KiB
JavaScript

function mx_default(dkim) {
return [
CNAME("autoconfig", "mail.serguzim.me."),
CNAME("autodiscover", "mail.serguzim.me."),
SRV("_autodiscover._tcp", 1, 1, 443, "mail.serguzim.me."),
TXT("@", "v=spf1 mx -all"),
TXT("mail-ses", "v=spf1 include:amazonses.com -all"),
TXT("_dmarc", "v=DMARC1; p=quarantine; rua=mailto:dmarcreports@serguzim.me; ruf=mailto:dmarcreports@serguzim.me; rf=afrf; sp=quarantine; fo=1; pct=100; ri=604800; adkim=r; aspf=r"),
TXT("dkim._domainkey", "v=DKIM1; k=rsa; t=s; s=email; p=" + dkim),
TLSA("_25._tcp", 3, 1, 1, "e66a608a3ec459bda7fb1f2d500b8abeb78f2910f26641204b6bc454b8aa2a49"),
MX("@", 10, "mail.serguzim.me."),
MX("*", 10, "mail.serguzim.me."),
MX("mail-ses", 10, "feedback-smtp.eu-north-1.amazonses.com.")
];
}
function pgp_verify() {
return TXT("@", "openpgp4fpr:723B78C0BF8D8C721D2C4EEF41E544A54E2533B2");
}
function all_defaults(domain, add_pgp) {
var result = [
collect_services(domain),
];
if (add_pgp) {
result.push(pgp_verify());
}
if (dkim[domain]) {
result.push(mx_default(dkim[domain]));
}
return result;
}