Octeth v6.0.7 Now Available! See What's New

Stage 6 of 12

Sender Domain Authentication for an Email Service Provider

An ESP authenticates mail on two kinds of domains: the infrastructure domain it owns, and every sender domain its customers bring. This guide covers a record layout that points customer records at a host you own, how SPF, DKIM and DMARC align for each customer, the Gmail, Yahoo and Microsoft bulk sender rules, and how to enforce them per customer in Octeth.

By Cem Hurturk, founder of Octeth Updated 12 min read

Skills
  • DNS records (SPF, DKIM, DMARC, CNAME)
  • On-demand TLS
On this page
  1. The domains in play
  2. Point customer records at a host you own
  3. The DNS records you and each customer add
  4. How SPF and DKIM alignment works for each customer
  5. The verification flow
  6. Test before the first customer
  7. Gmail, Yahoo and Microsoft bulk sender rules
  8. Enforce the rules per customer in Octeth

Mailbox providers judge your customers’ mail by its domains as much as by your IPs. In this stage you set up the domain you own for sending infrastructure, decide which records each customer adds, and make Octeth refuse to send until those records are in place. The IPs, reverse DNS and DKIM keys come from Stage 5, sending infrastructure and IP warm-up. The tracking edge comes from Stage 3, server infrastructure. New to the three standards? Read SPF, DKIM and DMARC explained first.

The domains in play

A campaign uses three names under the customer’s domain and one host on your infrastructure domain. The From domain and the DKIM signing domain are the same name.

NameExampleWhat it does
From domainexample.comThe address the recipient sees. DMARC is judged on this domain.
DKIM signing domainexample.comThe d= in the DKIM signature. The MTA signs with the From domain, so the signature aligns.
Return pathem.example.comThe envelope sender. Bounces go here, and SPF is checked on this name.
Tracking hosttrack-em.example.comClick, open and unsubscribe links.
Shared hostmailer.example-esp.netA host on your infrastructure domain. The customer’s records point here.

Keep the infrastructure domain apart from the domain your app runs on. Stage 3 covers why. Put the sender, tracking and DKIM records on a domain used only for sending infrastructure.

Customer DNS records and DMARC alignment A message from [email protected]. In the customer's zone, example.com is the From domain and the DKIM signing domain. The return path em.example.com, the tracking host track-em.example.com and the DKIM key name esp1._domainkey.example.com are CNAMEs to your shared host mailer.example-esp.net, or to its DKIM key name. The customer's zone also holds the DMARC record for example.com. The shared host holds an A record for the tracking edge, the SPF record with your sending IPs and the DKIM public key. Two checks follow. SPF passes on the return path em.example.com, which aligns with example.com under relaxed alignment only. DKIM passes on d=example.com, which aligns under strict and relaxed alignment. Either aligned pass gives DMARC a pass on example.com. A message from [email protected] Customer's zone example.com From domain, DKIM d=, DMARC em.example.com Return path CNAME track-em.example.com Tracking host CNAME esp1._domainkey.example.com DKIM key CNAME Your shared host mailer.example-esp.net A record: the tracking edge SPF: your sending IPs DKIM public key, selector esp1 The receiver checks SPF em.example.com Relaxed only DKIM d=example.com Strict and relaxed Either aligned pass is enough DMARC pass for example.com
The customer's records point at one host you own, so a new IP or DKIM key is one change in your zone. DKIM is the alignment that holds. SPF aligns only while the customer's DMARC record allows relaxed alignment.

Point customer records at a host you own

Have customers publish CNAMEs to one shared host on your infrastructure domain, and put SPF, DKIM and DMARC on that host. The customer’s zone then holds those CNAMEs, an ownership token and a DMARC record on its From domain.

The reason is one change instead of hundreds. When you add an IP or rotate a DKIM key, you edit your own zone once. No customer touches DNS again.

SPF needs no change in the customer’s own SPF record. SPF is checked on the return path, em.example.com, which is a CNAME to your shared host. Your shared host’s SPF TXT lists your sending IPs, so the customer’s root SPF record stays as it is.

The return-path name is a CNAME to your shared host, which has no MX and whose A record is the tracking edge, where nothing accepts mail. So bounces sent back later to customer return paths are not delivered, and Octeth gets bounces only through the MTA’s bounce webhook. Stage 5 covers that route.

The DNS records you and each customer add

example-esp.net is your infrastructure domain and example.com is a customer’s domain. The return-path label is em and the DKIM selector is esp1. The tracking host track-em is the tracking prefix and the return-path label joined with Octeth’s merge character, -. Octeth’s defaults are the label sl and the prefix track.

Records in your zone, once:

; shared host: DNS only, never proxied
mailer.example-esp.net.                IN  A     203.0.113.10        ; tracking edge, not the MTA
mailer.example-esp.net.                IN  TXT   "v=spf1 ip4:192.0.2.11 ip4:192.0.2.12 -all"
esp1._domainkey.mailer.example-esp.net. IN TXT   "v=DKIM1; k=rsa; p=<public key>"
_dmarc.mailer.example-esp.net.         IN  TXT   "v=DMARC1; p=none; adkim=r; aspf=r"

; root of the infrastructure domain: it sends no mail of its own
example-esp.net.                       IN  TXT   "v=spf1 -all"
_dmarc.example-esp.net.                IN  TXT   "v=DMARC1; p=reject"

List only the IPs your MTA sends this platform’s mail from, and end the record with -all. Every IP of the platform signs with this one selector, as Stage 5, sending infrastructure and IP warm-up, sets up. A whole /24 belongs in the record only if the whole range is yours. Do not add an MX record to the shared host.

Records each customer adds for example.com:

em.example.com.                     IN  CNAME  mailer.example-esp.net.
track-em.example.com.               IN  CNAME  mailer.example-esp.net.
esp1._domainkey.example.com.        IN  CNAME  esp1._domainkey.mailer.example-esp.net.
esp1._domainkey.em.example.com.     IN  CNAME  esp1._domainkey.mailer.example-esp.net.
<random>.em.example.com.            IN  TXT    "<ownership hash>"

; required: DMARC on the From domain, one of these two
_dmarc.example.com.                 IN  TXT    "v=DMARC1; p=none; rua=mailto:[email protected]"
; or, instead of the TXT above:
; _dmarc.example.com.               IN  CNAME  _dmarc.mailer.example-esp.net.

; optional: DMARC for mail sent from the return-path subdomain
_dmarc.em.example.com.              IN  CNAME  _dmarc.mailer.example-esp.net.
  • DMARC goes on the From domain. The customer publishes its own record at _dmarc.example.com, or a CNAME to your shared record. Publish one of the two, not both.
  • DKIM goes at two names. The MTA signs with d= the From domain, usually the customer’s root, so the key must resolve under example.com. The second name covers mail sent from the return-path subdomain.
  • The selector must not contain the return-path label. When a customer picks a custom subdomain, Octeth replaces the label anywhere in a record name, including inside a selector. A selector such as em1 with label em breaks.
  • The tracking record keeps links working. Campaign links use track-em.example.com, or the return-path host when the domain has no separate tracking subdomain. Both point at the shared host, whose A record is the tracking edge. From 6.0.4, a domain without a verified tracking record falls back to the install’s fallback tracking host.

Make the CNAMEs DNS only at Cloudflare. The new Octeth interface can export a domain’s records as a zone file whose CNAME lines import into Cloudflare as DNS only.

Generate and check single records with the SPF record generator, the DKIM generator and the DMARC record generator.

DMARC on the customer’s From domain

A receiver looks for DMARC at _dmarc. plus the From domain, then walks up to the parent domains. It never looks below the From domain (RFC 9989, section 4.10.1). That is why the root record is required and the _dmarc.em record is optional: the subdomain record covers only mail whose From address is on em.example.com.

The two ways to provide the root record:

  • The customer publishes its own. Ask for at least v=DMARC1; p=none with a report address. Yahoo strongly recommends the report address.
  • A CNAME to your record. The template asks for _dmarc.example.com as a CNAME to your shared DMARC record. This sets one policy for all of the customer’s mail, including mail it sends from other services, so it suits domains that send only through you.

From Octeth 6.0.6, a template that asks for the root DMARC CNAME also accepts the customer’s own record, as long as it is the only DMARC record on that host and it has a policy. So the template can ask for the CNAME and still verify customers who keep their own record.

How SPF and DKIM alignment works for each customer

DMARC passes when SPF or DKIM passes and the passing domain aligns with the From domain. Relaxed alignment needs the same organizational domain. Strict alignment needs the identical domain (RFC 9989, section 4.4). RFC 9989, published in May 2026, replaces RFC 7489 as the DMARC specification.

With the records above, a message from [email protected] aligns twice:

CheckAuthenticated domainAligned with example.com
DKIMd=example.comStrict and relaxed
SPFem.example.com (return path)Relaxed only

The lower half of the diagram in The domains in play shows these two checks and the DMARC pass.

DKIM is the alignment that holds. If a customer sets aspf=s in its own DMARC record, SPF stops aligning and DKIM still carries DMARC. Gmail recommends aligning both SPF and DKIM and says alignment with both is likely to become a requirement (Gmail sender FAQ).

You can check a customer’s published SPF and DKIM with the SPF and DKIM checker.

The verification flow

Octeth runs each customer domain through these steps. The Octeth docs page on sender domains has the screens and settings.

  1. The customer adds the domain. Octeth renders the records from the plan’s DNS template and stores them with the domain. Template changes reach only domains created after the change.
  2. The customer publishes the records. The new interface offers them as a zone file. A subdomain of a domain the account has already verified needs no ownership TXT, from Octeth 6.0.7.
  3. The customer clicks Verify. Octeth looks up each record, by default through Cloudflare’s public resolver, and compares it with the expected value. It reads the first answer and the first TXT string only, so a 2048-bit DKIM key or a host with several TXT records will not verify as a direct TXT. CNAMEs to your host avoid that. When all pass, the domain is Enabled.
  4. Staff approve, if you require it. With new domain approval turned on in the user group, a domain that passes moves to Blocked and waits for staff to enable it. This option exists from Octeth 6.0.1.
  5. Octeth keeps checking. A background job checks every Enabled domain once a day. Three failures in a row move the domain back to Approval Pending, and it stops sending. The staff sender domain health report lists failing and demoted domains.

Octeth checks that each record matches. It does not evaluate the SPF, DKIM or DMARC policies behind your shared host. Your shared host’s records and the MTA’s DKIM key are yours to get right, and every customer depends on them.

If a customer changes its return-path subdomain later, Octeth regenerates the records and resets the domain to Approval Pending.

Sender domain verification states in Octeth The customer adds the domain and Octeth renders its records from the plan's DNS template. The customer publishes the records and clicks Verify, and Octeth looks up each record. When all pass, the domain is Enabled. If new domain approval is turned on in the user group, a domain that passes moves to Blocked instead and waits until staff enable it. A background job checks every Enabled domain once a day. A passing check keeps it Enabled. Three failures in a row move the domain to Approval Pending, and it stops sending. A change to the return-path subdomain also regenerates the records and resets the domain to Approval Pending. 1. Customer adds the domain Records come from the plan's DNS template 2. Customer publishes the records The new interface offers a zone file 3. Customer clicks Verify Octeth looks up each record All records pass No approval step Approval on Blocked Waits for staff Staff enable it Enabled Sends Passes Daily check Every Enabled domain Return path changed Records regenerated Three failures in a row Approval Pending Stops sending
New domain approval adds a staff step after Verify. An Enabled domain falls back to Approval Pending after three failed daily checks in a row, and a return-path change also resets it.

Test before the first customer

  1. Look up every record on Cloudflare’s and Google’s public resolvers, and compare the published DKIM key with the MTA’s signing key.
  2. Add a test domain with a custom subdomain and check the records Octeth shows.
  3. Send a real campaign to a Gmail address and read the Authentication-Results header: SPF, DKIM and DMARC pass.
  4. Confirm the received message carries List-Unsubscribe with an https address and List-Unsubscribe-Post: List-Unsubscribe=One-Click.
  5. Click a tracked link and the unsubscribe link in that email.
  6. Send to an address that does not exist and confirm the bounce reaches Octeth. Preview sends are not registered as bounces, so use a real campaign.

A separate HELO name with no SPF record shows spf=none for the HELO check. That does not affect DMARC, which uses the return path.

Gmail, Yahoo and Microsoft bulk sender rules

All three apply extra rules to bulk senders. Gmail and Microsoft draw the line at about 5,000 messages a day, and Yahoo names no number. We checked each source on 2026-11-18.

Gmail

  • Who counts. Close to 5,000 or more messages to personal Gmail accounts in 24 hours, counted across the primary domain. A sender that crosses it once is a bulk sender for good.
  • Authentication. SPF and DKIM, plus DMARC with at least p=none.
  • Alignment. The From domain aligns with the SPF or the DKIM domain.
  • Infrastructure. Valid forward and reverse DNS on sending IPs (Stage 5, sending infrastructure and IP warm-up), and TLS for transmitting mail.
  • Unsubscribe. One-click unsubscribe for marketing and subscribed mail, plus a visible link in the body. Gmail recommends honouring requests within 48 hours.
  • Spam rate. Below 0.10% in Postmaster Tools, and never 0.30% or higher.
  • Enforcement. From November 2025, non-compliant mail gets temporary and permanent rejections. Above a 0.3% spam rate, Gmail offers no mitigation.

Yahoo

  • Who counts. A sender of significant volume, judged per authenticated or From domain. Yahoo does not specify a threshold.
  • Authentication. SPF and DKIM, plus a DMARC policy of at least p=none that passes.
  • Alignment. The From domain aligns with the SPF or the DKIM domain. Relaxed alignment is acceptable.
  • Infrastructure. Valid forward and reverse DNS on sending IPs (Stage 5, sending infrastructure and IP warm-up).
  • Unsubscribe. A list-unsubscribe header that supports one-click, with the RFC 8058 POST method highly recommended, plus a visible link in the body. Unsubscribes are honoured within 2 days.
  • Spam rate. Below 0.3%, measured on mail delivered to the inbox.
  • Enforcement. Rolled out gradually from February 2024.

Microsoft (Outlook.com)

  • Who counts. Domains sending more than 5,000 emails a day to hotmail.com, live.com and outlook.com addresses.
  • Authentication. SPF must pass, DKIM must pass, and DMARC must have at least p=none.
  • Alignment. DMARC aligns with SPF or DKIM, preferably both.
  • Unsubscribe. A functional, visible unsubscribe link, listed as a recommendation. No deadline and no spam rate threshold are stated.
  • Enforcement. From 5 May 2025, non-compliant mail is rejected with 550 5.7.515.

Sources: Gmail sender guidelines, Gmail sender guidelines FAQ, Yahoo sender best practices, Yahoo sender FAQ, Microsoft’s Outlook.com announcement.

Microsoft first said non-compliant mail would go to Junk. Its update of 29 April 2025 changed that to rejection, starting on 5 May 2025 as planned.

Gmail does not accept mailto or a link to a landing page as one-click unsubscribe. It wants the two headers from RFC 8058 with one https address. RFC 8058 also requires a valid DKIM signature that covers both headers, and it forbids answering the POST with a redirect.

What these rules mean for an ESP

  • Treat every customer as a bulk sender. Gmail counts volume per primary domain, and a customer that crosses the line once stays a bulk sender. Your infrastructure gives every customer the same records, so give every customer the bulk sender setup from the first send.
  • The spam rate belongs to the customer’s domain. Gmail reports spam rate per domain in Postmaster Tools, and each customer’s mail is signed with the customer’s domain. Yahoo’s Complaint Feedback Loop is set up per DKIM domain. Stage 10, Deliverability operations, covers both.
  • Unsubscribes are your system’s job. The customer cannot fix a missing header or a slow opt-out. Octeth processes the one-click POST itself.

Enforce the rules per customer in Octeth

Customers do not read mailbox provider rules. Build them into the plan settings, so an account cannot send without them.

  • Require a verified domain. Turn on sender domain management in every plan’s user group. Customers in those groups need at least one verified sender domain before they can send a campaign.
  • Fill both DNS templates before you open signups. Octeth has a campaign template and a gateway template. A sender domain created under an empty template is Enabled at once, with no verification.
  • Review new domains. Turn on new domain approval for plans where staff should look at each domain before it sends, such as the free plan.
  • Keep the default sender domain for testing only. A default sender domain skips DNS verification, and gateway mail from it gets no unsubscribe link in the body. Octeth still adds the List-Unsubscribe header. If you use one, keep its monthly limit low.
  • Leave the unsubscribe header on. Octeth adds the List-Unsubscribe header to campaign, autoresponder and gateway mail unless staff turn on “Disable the List-Unsubscribe header” for the user group or the account. Leave that off for every plan. For gateway mail, each sender domain also has an “Insert unsubscribe link” option that adds an opt-out link to the body. Octeth adds List-Unsubscribe-Post only when the unsubscribe address is https. Set the app URL to https, and set the tracking URL protocol to https once the tracking edge serves certificates. Octeth’s health check reports when one-click is suppressed.
  • Watch for drift. The daily check demotes a domain after three failed checks. Look at the sender domain health report each week, and contact customers whose domains are failing before they are demoted.
  • Act on complaints per account. Stage 8, abuse prevention, sets the complaint and bounce limits that suspend an account. Keep that limit well below the 0.3% that both Gmail and Yahoo name.

The same rules feed signup review. A new account whose domain fails verification, or whose first campaign fails DMARC, is not ready to send on shared IPs.

Before you move on

  • You have an infrastructure domain used only for sending, with a shared host that carries SPF, DKIM and DMARC.
  • The shared host's A record points at your tracking edge, not at the MTA.
  • Your DKIM selector does not contain the return-path subdomain label.
  • Both DNS templates, campaign and gateway, are filled in, and a test domain renders the records you expect.
  • Every plan's user group has sender domain management on, so customers must verify a domain before they send.
  • You know where each customer's DMARC record comes from: their own record, or a CNAME to yours.
  • The app and tracking URLs use https, so Octeth adds the one-click unsubscribe header.
  • A test send to Gmail shows SPF, DKIM and DMARC pass, and a real tracked link and unsubscribe link work.
  • You decided whether new sender domains need staff approval before they send.
  • You check the sender domain health report for domains whose records stopped matching.

What we've seen go wrong

The shared host pointed at the MTA

On one build, the shared host that customer records point at had its A record on the MTA's IP. With a verified sender domain, Octeth builds campaign links on a host under the customer's domain, and with no separate tracking subdomain that host is the return-path host. So every tracked and unsubscribe link in the test sends failed with a TLS error. We pointed the shared host at a server with Caddy on-demand TLS and added a tracking CNAME to the template. Click a real link from a real email before you call the setup done.

Two DMARC records on one domain

A customer domain had two DMARC records on the same host. A host with more than one DMARC record has no DMARC policy, so the domain failed DMARC until the customer deleted one. Check the customer's existing records before you blame your own.

A typo in a template host

During a platform move we found a DMARC host in a template override with a double dot in its name. Octeth stores each domain's records when the domain is created, so a template fix reaches only new domains. None of the existing domains had the typo, so nothing else needed fixing. Render a test domain after every template change.

A test tool that cached the old DNS

Right after a DNS change, a public test tool kept reporting a DKIM failure for a selector we had just published. The published key matched the signing key, and Gmail reported SPF, DKIM and DMARC pass. The tool caches negative answers, so it was most likely still serving the earlier one. Test against Gmail's Authentication-Results, not only a third-party tool, in the first hour after a change.

We build ESPs

Rather have us build this?

We set up sender authentication on the MTA and in Octeth, and advise on DNS records and the bulk sender rules.