MTMalte Therkildsen Lab PostkontorP43 · Mail domains

Connect a domain

A mail platform takes a customer’s domain in four steps: the customer proves the domain is theirs, the platform sets it up on its mail server, the customer publishes the records the platform asks for, and the platform checks them at two public resolvers until both see every one. The three domains below are made up and their DNS is simulated, so a change reaches Cloudflare at once and Google one check later, as a real change propagates.

Moving from another provider. The domain gets its mail at another provider today. Its MX, SPF and autodiscover all point there, and it has not proved that it is ours.

Health
…
State
…
Records right
…
Checks run
0
at Cloudflare and Google

The records

Every record the platform asks for, looked up at Cloudflare and at Google. A record is right only when both resolvers see it.

StatusNameTypeWhat the check foundSeen at

The fixes

What would make every record right, as a zone file to paste at the DNS provider.

zone

Ownership

The platform makes a token from the account and the domain with a key only it holds. The record proves the customer controls the domain’s DNS, and a token made for another account proves nothing.

zone

Lifecycle

  1. Waiting for proof
  2. Provisioning
  3. Waiting for records
  4. Active

What happened

    Health

    …
    …

      How Postkontor is built
      1. Postkontor is the DNS side of a mail platform, written for this prototype from its specification: what a customer’s domain must publish so the platform can take its mail, how the platform proves the domain is the customer’s, and how it checks the records until they are right. Nothing here uses a DNS library.
      2. Ownership is a TXT record at _postkontor.<domain> holding a token: HMAC-SHA-256 over the account and the domain with a key only the platform has, the first 160 bits in base32. A token made for another account is recognised and refused. A domain that is not proved in 14 days is released.
      3. The platform asks for 9 kinds of record: MX, SPF and two DKIM keys (RSA and Ed25519) are required, and DMARC, MTA-STS, TLS reports, the SRV records that let mail apps find the servers, autoconfig and CAA are recommended. Each expected record is looked up at Cloudflare and at Google, and judged at each: right, missing, wrong, or in conflict, when something there would take mail or trust from the platform, such as a second MX at another provider or a second SPF record.
      4. A record that is right at one resolver and not yet at the other is propagating. A wildcard is found by asking for a random name first; a name that only the wildcard answers is reported as absent, even though it seems to resolve.
      5. The fixes are written so nothing the domain has is lost: the platform’s include goes into the SPF record that is there, before its all or redirect, and its all keeps its qualifier; a DMARC policy the domain already has is kept. The fixes are shown as a zone file, which the zone file reader can read back.
      6. The health score weighs the purposes, counts a propagating one at three quarters and a weak one at half, and a required purpose that fails holds the score at 64 or less. The problems are listed in the order to fix them.
      7. The lifecycle is a state machine: waiting for proof, provisioning, waiting for records, active. 2 failed checks in a row make an active domain degraded, and one good check makes it active again. A stopped payment suspends it.
      8. The three domains on the first page are made up, under .example, with addresses from the documentation ranges, and their DNS is simulated by two tables: a change reaches Cloudflare’s at once and Google’s at the next check.
      9. The audit asks real DNS through the Lab’s worker, which passes only a domain name and a record type from a short list to Cloudflare’s and Google’s DNS over HTTPS, and fetches an MTA-STS policy from https://mta-sts.<domain>/ without following a redirect and only up to 64 KB. Nothing is stored or logged.
      10. The audit reads the MX hosts and names the provider, walks the SPF record through every include and counts its lookups against the limit of 10, tries 34 common DKIM selectors and reads each key’s type and size, reads DMARC, MTA-STS and checks the policy covers every MX host, TLS reports, CAA and BIMI, checks that each mail host’s address names it back, and asks 3 blocklists about the first address.
      11. check_host is RFC 7208’s: the mechanisms in order, include and redirect followed, macros expanded, a lookup limit of 10 and a limit of 2 lookups that find nothing.
      12. What it does not do: it sends no mail and runs no SMTP, so it cannot see whether the mail server really offers TLS or signs with the keys it publishes; DKIM selectors are guessed, so a key under an unusual selector is not found; DNSSEC is not checked.