MT Infra Solutions

Proton Mail + Cloudflare DNS

Mail routing and authentication (MX/SPF/DKIM/DMARC) in Cloudflare authoritative DNS for mtinfrasolutions.com.

Status: Draft

Scope / Objective

  • Scope: Cloudflare DNS records required by Proton Mail for a custom domain.
  • Objective: Ensure inbound/outbound mail works and authentication passes: SPF, DKIM, DMARC.
  • Non-goals: Mailbox provisioning and client configuration inside Proton; website hosting changes.

Dependencies / Preconditions

Change plan

  1. Capture pre-change DNS state (Cloudflare UI + DoH JSON).
  2. Apply Proton Mail records in Cloudflare DNS (TXT/MX/CNAME).
  3. Validate external resolution and mail flow; confirm SPF/DKIM/DMARC via headers.
  4. Capture evidence pack and hashes; document final state.

Implementation steps

1) Create/verify required DNS records (Cloudflare → DNS → Records)

Current known record set (example; keep values exact):

  • TXT @: protonmail-verification=9fdaae1801cf7eacf099ac4ce2c40ec188d5bc43
  • TXT @: v=spf1 include:_spf.protonmail.ch ~all
  • MX @: mail.protonmail.ch (priority 10)
  • MX @: mailsec.protonmail.ch (priority 20)
  • CNAME protonmail._domainkeyprotonmail.domainkey.doh6uihhddl23jwdrsmbij47dx7khyzej6e3bmu7ydx46p3q46g6q.domains.proton.ch
  • CNAME protonmail2._domainkeyprotonmail2.domainkey.doh6uihhddl23jwdrsmbij47dx7khyzej6e3bmu7ydx46p3q46g6q.domains.proton.ch
  • CNAME protonmail3._domainkeyprotonmail3.domainkey.doh6uihhddl23jwdrsmbij47dx7khyzej6e3bmu7ydx46p3q46g6q.domains.proton.ch
  • TXT _dmarc: v=DMARC1; p=quarantine

All mail records should be DNS only (not proxied).

2) Cloudflare UI verification

  1. Open Cloudflare zone mtinfrasolutions.com → DNS → Records.
  2. Confirm the Proton records exist exactly as provided.
  3. Confirm there are no duplicate/conflicting SPF TXT records at @.

3) Optional: DMARC policy posture

Current DMARC policy is p=quarantine. Consider aligning long-term policy to organizational risk tolerance and reporting requirements (e.g., add rua= reporting address).

Validation (with exact commands)

A) DoH DNS checks (PowerShell)

$domain   = "mtinfrasolutions.com"
$BasePath = "$env:USERPROFILE\Documents\MTINFRA-EvidencePack"

# SPF TXT
$spf = Invoke-RestMethod -Uri ("https://cloudflare-dns.com/dns-query?name=$domain&type=TXT") -Headers @{ accept="application/dns-json" }
$spf | ConvertTo-Json -Depth 10 | Out-File (Join-Path $BasePath "EV-MAIL-10-TXT-Apex-DoH.json") -Encoding utf8

# MX
$mx = Invoke-RestMethod -Uri ("https://cloudflare-dns.com/dns-query?name=$domain&type=MX") -Headers @{ accept="application/dns-json" }
$mx | ConvertTo-Json -Depth 10 | Out-File (Join-Path $BasePath "EV-MAIL-11-MX-DoH.json") -Encoding utf8

# DMARC
$dmarc = Invoke-RestMethod -Uri ("https://cloudflare-dns.com/dns-query?name=_dmarc.$domain&type=TXT") -Headers @{ accept="application/dns-json" }
$dmarc | ConvertTo-Json -Depth 10 | Out-File (Join-Path $BasePath "EV-MAIL-12-DMARC-DoH.json") -Encoding utf8

# DKIM selectors
$dk1 = Invoke-RestMethod -Uri ("https://cloudflare-dns.com/dns-query?name=protonmail._domainkey.$domain&type=CNAME") -Headers @{ accept="application/dns-json" }
$dk1 | ConvertTo-Json -Depth 10 | Out-File (Join-Path $BasePath "EV-MAIL-13-DKIM1-DoH.json") -Encoding utf8

B) Mail flow + header authentication

  1. Send a test email from an external mailbox to <your-proton-recipient>@mtinfrasolutions.com.
  2. In Proton Mail, open message → view full headers/original.
  3. Confirm Authentication-Results indicates:
    • SPF: pass
    • DKIM: pass
    • DMARC: pass/aligned
  4. Save headers to a TXT file.

Rollback plan

  1. Remove newly added Proton-related DNS records (only those introduced by the change).
  2. Restore previous values from evidence pack (pre-change JSON/Cloudflare export).
  3. Revalidate mail flow and authentication.

Evidence pack checklist

Evidence IDArtifactWhat it proves
EV-CF-05EV-CF-05-DNS-WebRecords.pngDNS records exist; mail records intact (UI proof)
EV-MAIL-10EV-MAIL-10-TXT-Apex-DoH.jsonTXT values externally visible
EV-MAIL-11EV-MAIL-11-MX-DoH.jsonMX routing externally visible
EV-MAIL-12EV-MAIL-12-DMARC-DoH.jsonDMARC policy externally visible
EV-MAIL-13EV-MAIL-13-DKIM1-DoH.jsonDKIM selector resolves correctly
EV-MAIL-01EV-MAIL-01-Headers-AuthResults.txtSPF/DKIM/DMARC pass in real mail flow

Final state

  • Proton Mail MX, SPF, DKIM, DMARC records present and externally resolvable
  • Mail flow validated via headers (SPF/DKIM/DMARC pass/aligned)
  • Records are DNS-only (not proxied)