Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 8 additions & 1 deletion .github/dns-retirements.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
{
"retire": []
"retire": [
{
"address": "cloudflare_dns_record.mail_mx_02",
"name": "devantler.tech",
"type": "MX",
"content": "mx02.mail.icloud.com"
}
]
}
20 changes: 7 additions & 13 deletions dns.tf
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 5 additions & 3 deletions scripts/tests/test-dns-apply.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Loading