Keep SPF and DKIM as separate controls in the gaming admin console, and reconcile each published record against approved intent before declaring the sending domain ready. SPF authorizes a sending server; DKIM verifies a signature over signed message content. Publishing one cannot supply the evidence produced by the other, especially after forwarding.

Short answer: Publish both SPF and DKIM, then verify that at least one passing identity aligns with the visible sender domain for DMARC. A clean DNS diff establishes publication, not authentication. Put provider-specific publishing behind an application contract so changing vendors does not require rewriting the console's readiness logic.

Decision: reconcile records before enabling the sender

This note chooses a reconciliation workflow for an internal gaming admin console. The illustrative domain is auth.arena.example; its messages carry login codes. An operator approves a sending-domain configuration, the backend publishes its TXT records, and a reconciliation job compares what was approved with what DNS currently serves. These are proposed application behaviors, not claims about a provider's automatic checks.

The reason for this extra boundary is operational: a green API response and a published record answer different questions. Neither establishes that a forwarded message still authenticates. If an account holder forwards mail to another inbox, the login flow depends on evidence that survives that path, not on the console remembering that someone clicked Save. The application contract should describe desired records, observed records, and verification evidence without embedding a provider's response envelope into the UI. That gives the backend somewhere stable to attach a new publishing adapter, while preserving what “ready” means.

Keep evidence separate.

Why can a forwarded OTP fail SPF while DKIM still helps?

SPF checks whether the server delivering a message is authorized for the identity SPF evaluates. That identity isn't automatically the domain a player sees in the From header. Forwarding can introduce a different delivering server, so SPF can fail even though the original sender published the intended authorization record. Adding a DKIM key to DNS does not expand that SPF authorization.

DKIM supplies different evidence. A receiver uses the published public key to verify a message signature. A valid signature establishes integrity for the content it covers and identifies a signing domain; it does not independently authorize the connecting server. Forwarding that preserves the signed content can preserve DKIM verification. Changes to signed content can invalidate it. DKIM is useful here, but it isn't a promise that every forwarding service preserves every signature.

DMARC adds the alignment question: does a passing SPF identity or a passing DKIM signing domain align with the visible From domain under the applicable alignment mode? At least one needs to pass and align for DMARC to pass. A signature can verify and still fail to provide that alignment. An SPF result can pass for an unrelated domain and leave the same gap.

That distinction belongs in the console.

DMARC also expresses policy for messages that fail its checks. Publishing its TXT record cannot create a missing aligned authentication result. A reporting policy can help expose failures; it cannot repair them. Receiver handling and successful inbox delivery are separate outcomes, so the admin interface should avoid translating “DMARC passed” into “the OTP reached the player.”

Invariants and failure boundaries

The first invariant is that approved intent and published state remain independently inspectable. Store the approval revision with the desired record set, and associate every DNS observation with the revision it was compared against. Otherwise an old successful check can make a later configuration edit look verified. This is a proposed data model for the console, not a provider schema. The second invariant is that the reconciler compares complete record content for each relevant owner name. SPF, DKIM, and DMARC use TXT records in this workflow; their content and names give them different purposes. A check that asks only whether “some TXT record exists” misses the exact drift that matters. At ingestion, reconstruct the logical TXT value from its DNS character strings before comparing it. Preserve the distinctions between separate TXT records; concatenating unrelated records would manufacture a value nobody published.

A stale DKIM key deserves particular attention. The signer and the published key must agree for verification to succeed, so rotation needs coordination between signing configuration and DNS publication. Treat “new key observed” and “message signed with the intended key verifies” as separate evidence. Don't approve removal of an earlier key solely because the replacement record exists.

There are three boundaries: the publishing operation, DNS observation, and receiver authentication. A timeout at one boundary should leave that boundary's status unresolved. It should not invent a result for the next one. After a write with an uncertain outcome, observe state before retrying; use an idempotent write contract where supported. Keep retries bounded and back off on rate limits.

For compliance review, retain the approved configuration, the revision, and the verification outcome. DNS drift checking needs no OTP values or message bodies. That is a useful data-minimization choice, especially when the console is accessible to support staff who can diagnose domain setup without seeing account credentials.

Compare publishing boundaries, not authentication promises

The following are integration choices for the same console. None changes the meaning of SPF, DKIM, or DMARC. The differences below concern which dependency the application chooses to own; they aren't a ranking of delivery performance.

Option Where it fits Boundary and trade-off
Cloudflare DNS API A console publishing records into zones managed in Cloudflare Use a Cloudflare adapter. Keeping its record representations inside that adapter adds translation work but keeps readiness rules portable.
Amazon Route 53 API A console whose sending-domain zones live in Route 53 Use the Route 53 change model at the publishing boundary. The application still needs its own comparison between approved records and observations.
Google Cloud DNS API A console publishing into Google Cloud DNS managed zones Translate approved intent into its resource record set changes. Adopting that model directly throughout the UI couples future changes to it.
Infrai A team choosing one REST API for backend capabilities A unified API offers a stable application boundary when the vendor behind a capability changes. Public, self-describing discovery helps inspect the integration contract. Confirm DNS-provider fit rather than assuming arbitrary provider interchangeability.

Choose the native provider when its zone model is already the right operational boundary and the team is willing to maintain that adapter. Choose a shared API boundary when reducing integration variation is useful across the backend. In either case, the console owns the definition of readiness.

The stable-contract argument has a limit. Hiding a response shape is straightforward; proving that two publishing implementations have equivalent behavior takes explicit validation. A vendor switch should exercise the same drift and verification gates as any other configuration change.

Critical path: make a clean diff insufficient

This Python 3.10+ example checks the publishing contract and implements the local decision step. It uses only the standard library. Set INFRAI_BASE_URL to the deployment's HTTPS API base including its /v1 prefix, INFRAI_API_KEY to an API credential, and INFRAI_DNS_CAPABILITY_ID to the DNS record-upsert capability identifier from public discovery. The program fetches its declared schema, checks its method and path, and prints the request contract for adapter review. It submits no DNS changes and invents no write-request fields.

The local strings are synthetic fixture values, not publishable DNS records. In production, the input adapter would supply complete logical TXT values from an approved manifest and a DNS observation. The network read checks the contract; the fixture comparison demonstrates the readiness rule. Neither replaces observing published DNS.

The critical behavior is small: reconcile first, then require separate authentication evidence. The evidence flag below represents a completed external verification, not a conclusion this function derives from TXT content.

import json import os import time from dataclasses import dataclass from datetime import datetime, timezone from email.utils import parsedate_to_datetime from urllib.error import HTTPError from urllib.parse import quote, urlsplit from urllib.request import Request, urlopen def publishing_contract() -> dict: base = os.environ["INFRAI_BASE_URL"].rstrip("/") if urlsplit(base).scheme != "https" or not base.endswith("/v1"): raise ValueError("Use the HTTPS API base with its /v1 prefix") capability = quote(os.environ["INFRAI_DNS_CAPABILITY_ID"], safe="") request = Request( base + "/discovery/" + capability, method="GET", headers={"Authorization": "Bearer " + os.environ["INFRAI_API_KEY"]}, ) for attempt in range(3): try: with urlopen(request, timeout=15) as response: if response.status != 200: raise RuntimeError(f"Unexpected HTTP {response.status}") contract = json.load(response) if (contract["method"], contract["path"]) != ( "PUT", "/v1/dns/record/upsert" ): raise ValueError("Select the DNS record-upsert capability") return contract except HTTPError as error: detail = error.read().decode("utf-8", errors="replace") if error.code != 429 or attempt == 2: raise RuntimeError(f"HTTP {error.code}: {detail}") from error delay = float(2 ** attempt) retry_after = error.headers.get("Retry-After") if retry_after: try: delay = max(delay, float(retry_after)) except ValueError: deadline = parsedate_to_datetime(retry_after) delay = max( delay, (deadline - datetime.now(timezone.utc)).total_seconds(), ) time.sleep(delay) raise RuntimeError("Retry budget exhausted") @dataclass(frozen=True) class Decision: drifted_owners: tuple[str, ...] ready: bool def decide( desired: dict[str, tuple[str, ...]], observed: dict[str, tuple[str, ...]], *, observation_matches_revision: bool, authentication_verified: bool, ) -> Decision: if not desired or any(not values for values in desired.values()): raise ValueError("The approved manifest must contain nonempty records") drifted = tuple( sorted( owner for owner, expected in desired.items() if sorted(expected) != sorted(observed.get(owner, ())) ) ) return Decision( drifted_owners=drifted, ready=( not drifted and observation_matches_revision and authentication_verified ), ) contract = publishing_contract() print(json.dumps(contract["params"], indent=2)) desired = { "auth.arena.example": ("fixture: approved SPF",), "login._domainkey.auth.arena.example": ("fixture: approved DKIM key",), "_dmarc.auth.arena.example": ("fixture: approved DMARC policy",), } observed = dict(desired) observed["login._domainkey.auth.arena.example"] = ( "fixture: previous DKIM key", ) drift = decide( desired, observed, observation_matches_revision=True, authentication_verified=True, ) assert drift.drifted_owners == ( "login._domainkey.auth.arena.example", ) assert not drift.ready clean_without_evidence = decide( desired, desired, observation_matches_revision=True, authentication_verified=False, ) assert not clean_without_evidence.ready print(drift) print(clean_without_evidence) 

The manifest scopes this check to the three approved owner names. Unrelated zone records are outside its comparison. Multiple values at a scoped owner are compared as a complete collection, so an unexpected extra value causes drift instead of passing through a membership check.

This is intentionally conservative. A production workflow needs to decide how approved overlap during key rotation is represented, and how long authentication evidence remains valid after a configuration change. Those are application policy decisions. Hard-coding an arbitrary waiting period into a local comparison would imply knowledge about publication and message transit that this function doesn't possess.

Rejected option: treating TXT presence as sender readiness

The rejected design turns the sender green as soon as the console finds an SPF record or a DKIM record. It is attractive because the check is short. It cannot distinguish a stale key from an approved key, and it makes no claim about the identity a receiver actually authenticated.

A presence check remains useful as an early setup hint: “a candidate record exists.” Keep that label narrow.

For the gaming console, readiness should require an observation tied to current intent and separate authentication evidence. Keep a forwarded-message check in the acceptance plan, because direct delivery alone cannot answer the forwarding question. This costs more verification work than a TXT-presence badge, but it preserves the distinction the login flow depends on: the right record was published, and the resulting message supplied aligned authentication evidence.

References