From 19a38910ebc984f8e9c413f234855ae1a3ac22e7 Mon Sep 17 00:00:00 2001 From: Nikolai Emil Damm Date: Wed, 25 Nov 2026 03:07:52 +0100 Subject: [PATCH] feat(dns): deliver company mail to the platform's mail server Point the domain's MX at mail.devantler.tech and retire the second iCloud MX record through the reviewed retirement list (devantler-tech/platform#5481). The iCloud SPF include and DKIM record stay until iCloud is retired, and DMARC stays at p=none until delivery is proven. Rollback: revert this change, which points mail_mx_01 back to mx01.mail.icloud.com and recreates mail_mx_02. Co-Authored-By: Claude Opus 5.5 --- .github/dns-retirements.json | 9 ++++++++- dns.tf | 20 +++++++------------- scripts/tests/test-dns-apply.sh | 8 +++++--- 3 files changed, 20 insertions(+), 17 deletions(-) diff --git a/.github/dns-retirements.json b/.github/dns-retirements.json index df0f8be..7463ac5 100644 --- a/.github/dns-retirements.json +++ b/.github/dns-retirements.json @@ -1,3 +1,10 @@ { - "retire": [] + "retire": [ + { + "address": "cloudflare_dns_record.mail_mx_02", + "name": "devantler.tech", + "type": "MX", + "content": "mx02.mail.icloud.com" + } + ] } diff --git a/dns.tf b/dns.tf index 097f9c6..cd6b624 100644 --- a/dns.tf +++ b/dns.tf @@ -59,23 +59,17 @@ resource "cloudflare_dns_record" "ksail_docs" { settings = { flatten_cname = false } } -# Company Email (iCloud). These must not change while the mail transport moves. +# Company Email is delivered to the platform's own mail server +# (devantler-tech/platform#5481); mail.devantler.tech is published by the +# platform. The former second iCloud MX record is retired through +# .github/dns-retirements.json. Rollback: revert this change, which points this +# record back to mx01.mail.icloud.com and recreates mx02.mail.icloud.com. The +# iCloud SPF include and DKIM record below stay until iCloud is retired. resource "cloudflare_dns_record" "mail_mx_01" { zone_id = cloudflare_zone.primary.id name = "devantler.tech" type = "MX" - content = "mx01.mail.icloud.com" - priority = 10 - ttl = 3600 - proxied = false - settings = {} -} - -resource "cloudflare_dns_record" "mail_mx_02" { - zone_id = cloudflare_zone.primary.id - name = "devantler.tech" - type = "MX" - content = "mx02.mail.icloud.com" + content = "mail.devantler.tech" priority = 10 ttl = 3600 proxied = false diff --git a/scripts/tests/test-dns-apply.sh b/scripts/tests/test-dns-apply.sh index e1301a8..96af4f1 100755 --- a/scripts/tests/test-dns-apply.sh +++ b/scripts/tests/test-dns-apply.sh @@ -277,8 +277,10 @@ printf '%s\n' "$noop_import" | plan | check printf '%s\n' '{"retire":[]}' > "$scratch/retirements.json" printf '%s\n' 'PASS: DNS records are deleted only as reviewed retirements, never replaced' -# 4. The declared mail records are the ones the company Email depends on. -grep -q 'content = "mx01.mail.icloud.com"' "$root/dns.tf" -grep -q 'content = "mx02.mail.icloud.com"' "$root/dns.tf" +# 4. The declared mail records are the ones the company Email depends on: the +# domain's mail goes to the platform's mail server alone (platform#5481). +grep -q 'content = "mail.devantler.tech"' "$root/dns.tf" +if grep -q 'content = "[^"]*mail\.icloud\.com"' "$root/dns.tf"; then exit 1; fi +jq -e '.retire == [{"address":"cloudflare_dns_record.mail_mx_02","name":"devantler.tech","type":"MX","content":"mx02.mail.icloud.com"}]' "$root/.github/dns-retirements.json" >/dev/null if grep -q '"_externaldns.devantler.tech"' "$root/dns.tf"; then exit 1; fi printf '%s\n' 'PASS: declared DNS keeps the Email records and never the typeless apex registry'