# Subdomain SPF & Return-Path Architecture: Isolate Transactional, Marketing, and Corporate Mail

> Design clean DNS authentication boundaries across corporate (@example.com), transactional (@notify.example.com), and marketing (@news.example.com) streams.

- **Canonical URL**: https://opslint.dev/spf/subdomain-spf-delegation-transactional-vs-marketing/
- **Category**: `SPF`
- **Interactive Workbench**: [Open in Live Workbench](https://opslint.dev/spf/#domain=postmarkapp.com)
- **Normative Specifications**: `RFC 7208 §2.4 (Checking MAIL FROM & HELO Identities)`, `RFC 7489 §3.1.1 (SPF Identifier Alignment: Organizational Domain Match)`, `M3AAWG Sender Best Common Practices (Stream Isolation)`

## Incident Symptom & Root Cause

**Production Symptom**: A single marketing newsletter blast hits spam traps and tanks domain/IP reputation—dragging urgent 2FA codes, password resets, and executive Google Workspace threads straight into Gmail's Spam folder—while cramming 7 ESPs onto the apex domain breaks the 10-lookup SPF limit.

**Protocol / Engine Root Cause**: Sharing one root domain and one SPF record across corporate human mail, automated transactional receipts, and cold/bulk marketing merges both DNS lookup budgets AND mailbox-provider sender reputation (Gmail Postmaster Tools tracks reputation per subdomain as well as organizational domain!). Additionally, SPF does NOT automatically inherit down to subdomains: an unconfigured subdomain has SPF=None!

## Remediation Diff (Broken vs Verified Fix)

### Monolithic Apex Domain Mixing Corporate, 2FA, and Bulk Marketing

```text
; Everything jammed onto apex example.com:
; 1. High lookup count (9/10 -> fragile!)
; 2. Marketing unsubscribe spikes degrade reputation of CEO & 2FA emails!
; 3. CNAME bounce subdomain incompatible with publishing TXT on same label!
example.com. 3600 IN TXT "v=spf1 include:_spf.google.com include:spf.mtasv.net include:mailgun.org include:servers.mcsv.net ~all"
```

### 3-Tier Subdomain Isolation (Corporate + Transactional + Marketing)

```text
; Tier 1 — Corporate Employee Mail ONLY (From: @example.com, Return-Path: @example.com):
example.com.                3600 IN TXT   "v=spf1 include:_spf.google.com -all"

; Tier 2 — Transactional / 2FA (From: @notify.example.com or @example.com w/ aspf=r):
; Note: Postmark uses a CNAME to pm.mtasv.net which hosts BOTH Return-Path MX and v=spf1 TXT!
pm-bounces.notify.example.com. 3600 IN CNAME pm.mtasv.net.
notify.example.com.         3600 IN TXT   "v=spf1 include:spf.mtasv.net -all"

; Tier 3 — Bulk Marketing (From: @news.example.com -> separate reputation & DMARC policy!):
news.example.com.           3600 IN TXT   "v=spf1 include:mailgun.org -all"
_dmarc.news.example.com.    3600 IN TXT   "v=DMARC1; p=reject; rua=mailto:dmarc@example.com"
```

## Engineering Deep Dive

Remember a fundamental asymmetry between SPF and DMARC: DMARC inherits from the organizational apex domain to subdomains automatically (via _dmarc.example.com's sp= or p= tag), whereas SPF NEVER inherits to subdomains! If an application sends mail with Return-Path:<bounce@alerts.example.com> and you never published a TXT record on alerts.example.com, receivers do NOT fall back to example.com's SPF record—SPF returns None, failing DMARC SPF alignment unless DKIM saves it!

Pay close attention to RFC 1034 / RFC 2181's CNAME coexistence ban when configuring ESP custom Return-Path subdomains! Providers like Postmark, SendGrid, and Mailgun frequently ask you to create a CNAME record (for example pm-bounces.example.com CNAME pm.mtasv.net, or em1234.example.com CNAME u1234.wl.sendgrid.net). Because DNS forbids publishing a TXT record at the exact same hostname as a CNAME record, the ESP hosts BOTH the bounce MX record AND the v=spf1 TXT record on the CNAME target for you! Never delete their CNAME to replace it with a bare TXT record, or inbound bounce processing (hard-bounce suppression) stops working!

For maximum deliverability isolation, segment visible From: headers onto dedicated functional subdomains for automated streams too: keep human staff on @example.com, put 2FA/password resets/receipts on @notify.example.com (using a dedicated transactional-only provider like Postmark that bans bulk marketing on shared IPs), and put newsletters/promotions on @news.example.com.

## SPF vs DMARC Subdomain Inheritance & CNAME Rules

| Case / Engine | Protocol Behavior | Production Remediation |
| :--- | :--- | :--- |
| **Subdomain without its own TXT record (sub.example.com)** (`#subdomain-spf-no-inheritance`) | SPF does NOT inherit apex v=spf1; returns SPF=None ( whereas DMARC DOES inherit apex _dmarc!). | Publish explicit v=spf1 on every sending subdomain (and v=spf1 -all on sensitive non-sending subdomains). |
| **ESP CNAME Return-Path (e.g. pm-bounces CNAME pm.mtasv.net)** (`#subdomain-cname-return-path`) | DNS CNAME delegates both MX (bounce webhook handling) and TXT (v=spf1) to the ESP automatically. | Do NOT add a conflicting TXT record on the CNAME label; DNS servers reject CNAME + TXT collisions. |
| **Visible From: @news.example.com vs @notify.example.com** (`#subdomain-reputation-isolation`) | Isolates DKIM d= domain and From: subdomain reputation in Gmail Postmaster Tools. | Keep bulk marketing strictly off the domain used for 2FA codes and password resets. |
| **Bounce messages (MAIL FROM:<> empty reverse-path)** (`#subdomain-helo-identity`) | RFC 7208 §2.4 evaluates SPF against the SMTP HELO/EHLO hostname when MAIL FROM is <>! | Publish v=spf1 ip4:<mta-ip> -all on every self-hosted MTA's EHLO hostname (smtp1.example.com). |

## Frequently Asked Engineering Questions

### Why did my DNS provider reject adding a TXT record on pm-bounces.example.com with 'CNAME and other data'?

RFC 1034 §3.6.2 and RFC 2181 §10.1 prohibit a CNAME record from coexisting with any other record type (TXT, MX, A) at the exact same owner name! Because pm.mtasv.net ALREADY serves a valid v=spf1 TXT record at the end of the CNAME chain, no extra TXT record is needed on pm-bounces.example.com.

### Wait: if Postmark uses CNAME pm-bounces.example.com, do I still need include:spf.mtasv.net on my root example.com?

Once custom Return-Path (pm-bounces.example.com) is verified and active in Postmark, ALL Postmark mail uses pm-bounces.example.com as its SMTP MAIL FROM domain—so SPF queries pm-bounces.example.com (never touching root example.com!), saving you a lookup on your apex domain!

### Does isolating newsletters on @news.example.com protect @example.com from total domain blocklisting if we send spam?

Subdomain isolation separates stream reputation against honest user-complaint fluctuations, NOT deliberate abuse: anti-spam blocklists (Spamhaus DBL) and Gmail still roll severe abuse up to the organizational domain (psl root example.com).

## Related Problem-Cluster Guides

- [Fix SPF PermError: Too Many DNS Lookups (Exceeding the RFC 7208 10-Lookup Limit)](https://opslint.dev/spf/permerror-too-many-dns-lookups-10-limit/) — Understand which SPF mechanisms count toward RFC 7208 §4.6.4's hard 10-lookup ceiling, why nested vendor includes blow the budget, and how to cut lookups safely.
- [DMARC Identifier Alignment Explained: SPF Pass + DKIM Pass Can Still Fail DMARC!](https://opslint.dev/dmarc/identifier-alignment-spf-dkim-relaxed-vs-strict/) — Why emails with spf=pass and dkim=pass still bounce with dmarc=fail when Return-Path or DKIM d= domains don't align with From:, plus aspf=r/s and adkim=r/s rules.
- [DMARC Organizational Domain Discovery, Public Suffix List (PSL) Fallback, and sp= Tag](https://opslint.dev/dmarc/organizational-domain-public-suffix-fallback-sp-tag/) — How RFC 7489 §3.2 uses the Mozilla Public Suffix List (e.g. .co.uk, .com.au, .github.io) to find organizational _dmarc policies and apply sp= subdomain rules.
- [DKIM 2048-Bit RSA Key Rotation, Selector Naming, and CNAME Vendor Delegation](https://opslint.dev/dmarc/dkim-2048-bit-key-rotation-and-cname-delegation/) — Upgrade weak 1024-bit DKIM keys to 2048-bit RSA without mid-flight verification failures using dual-selector blue/green rotation and vendor CNAME delegation.
