GitOps Email Auth: Terraform & Cloudflare DNS Blueprint for SPF (<10 Lookups), MTA-STS & TLS-RPT

Keep 100% ownership of your authoritative Cloudflare or Route53 DNS zone. Validate RFC 7208 10-lookup limits on every Terraform PR and deploy deterministic CIDR-flattened SPF + MTA-STS policies.

⚡ 1-Click Live Diagnostic • Zero Login • <1.5s Edge Execution

Run a Live Deterministic Check Right Now

Scan real corporate DNS via Cloudflare DoH, simulate a broken AI-agent OpenAPI PR, or audit WCAG 2.2 / EN 301 549 clauses instantly.

1-Click Real DNS Presets:
Click Scan Live DNS & Flatten SPF or any preset above to query live TXT records via Cloudflare DoH (cloudflare-dns.com/dns-query) and compute your exact X / 10 DNS Lookups (RFC 7208) score.

Terraform / OpenTofu + Cloudflare DNS Blueprint (SPF + MTA-STS + TLS-RPT)

Test your live domain right now with our Zero-Click Live SPF & MTA-STS Demo, then commit the generated deterministic records into your cloudflare_record Terraform configuration:

resource "cloudflare_record" "spf_flattened" {
  zone_id = var.cloudflare_zone_id
  name    = "@"
  type    = "TXT"
  ttl     = 300
  content = "v=spf1 ip4:35.190.247.0/24 ip4:64.233.160.0/19 ip4:149.72.0.0/16 -all"
}

resource "cloudflare_record" "mta_sts_policy_id" {
  zone_id = var.cloudflare_zone_id
  name    = "_mta-sts"
  type    = "TXT"
  ttl     = 300
  content = "v=STSv1; id=2026111701;"
}

resource "cloudflare_record" "smtp_tls_rpt" {
  zone_id = var.cloudflare_zone_id
  name    = "_smtp._tls"
  type    = "TXT"
  ttl     = 300
  content = "v=TLSRPTv1; rua=mailto:tls-rpt@${var.domain};"
}

CI/CD Gate Command: Add uvx --from git+https://github.com/profalexandrezamboni-ui/spfguard-cli@v1.2.0 spfguard-cli --domain ${DOMAIN} to your Terraform Pull Request pipeline to block any zone change that exceeds the RFC 7208 10-lookup ceiling.

10-Second Onboarding Builder • Zero Docker

Generate Your Drop-In CI/CD or .pre-commit Config in 10 Seconds

Select your CI stack, deterministic gates, and repository scale to generate ready-to-commit YAML.

2. Deterministic Gates to Enforce
.github/workflows/specgate.yml
name: SpecGate Deterministic CI Gates
on: [pull_request]
jobs:
  deterministic-gates:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: profalexandrezamboni-ui/specgate-action@v1.2.0
        env:
          SPECGATE_API_KEY: ${{ secrets.SPECGATE_API_KEY }}
        with:
          base_spec: openapi/base.json
          head_spec: openapi/head.json
      - run: pipx run --spec git+https://github.com/profalexandrezamboni-ui/spfguard-cli@v1.2.0 spfguard-cli --domain example.com
Recommended for 3–15 Repositories: Starter Plan ($19/mo flat team rate) unlocks SPECGATE_API_KEY for up to 15 private/public repos, automated inline PR comments, and 1,000 checks/hr.

Transparent Pricing — Instant Activation via Paddle

Start free on up to 2 repositories or domains. Upgrade anytime for multi-repository governance, signed PR overrides, and compliance exports.

Free Open-Source

$0/mo
  • Up to 2 repositories / domains
  • Deterministic CLI & GitHub Action
  • Interactive Web Playground
  • 60 API requests/hour
Install from GitHub

Team & Compliance

$39/mo

Paddle Price ID: pri_01m72s8sgdake5vfj2ygs54x50

  • Unlimited repositories & domains
  • Auditable PR Sign-Off override workflow
  • SOC 2 Audit Trail & EN 301 549 exports
  • 10,000 API requests/hour
Subscribe Team — $39/mo

14-Day Self-Serve Refund Guarantee: Payments, sales tax, and VAT are handled by our Merchant of Record (Paddle). Cancel immediately or trigger an automated 14-day full refund anytime via POST /api/v1/support/ticket.

Frequently Asked Technical Questions

Why manage flattened SPF and MTA-STS in Terraform instead of delegating to hosted dynamic SPF CNAMEs?

Hosted dynamic SPF services ($44.99–$89.99/mo) put a third-party vendor's DNS infrastructure in the critical path of every outbound corporate email. Pre-merge CIDR flattening with SPFGuard keeps 100% of DNS resolution inside your authoritative Cloudflare or AWS Route53 zone with full Git auditability.

How do we prevent vendor IP rotation drift when flattening SPF in Terraform?

Run spfguard-cli on a scheduled nightly/weekly GitHub Action alongside every DNS Pull Request. If Google Workspace, SendGrid, or Amazon SES adds a new netblock or a teammate adds an 11th lookup, SPFGuard flags the exact diff before mail delivery breaks.