Matrix: M26M27
Open in panel — /app/domains
Configuration

Sending Domains

Every email you send must originate from a verified sending domain. PostMTA validates SPF, DKIM, and DMARC records to establish sender authenticity and protect deliverability.

Overview

A sending domain is the domain portion of the MAIL FROM address (also called the envelope sender or return path). PostMTA requires all sending domains to pass three DNS verification checks before they can be used for production delivery.

Domain verification is mandatory before production sending (PMH-SEC-026). Messages from unverified domains are rejected at the SMTP layer.

Adding a Domain

Domains can be added through the dashboard or via the REST API. After addition, you are given the exact DNS records to publish.

REST API

curl -X POST https://api.postmta.com/v1/domains \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN" \
  -H "Content-Type: application/json" \
  -d '{
    "domain": "mail.example.com",
    "default": true
  }'

Response:

{
  "id": "dom_01HX5K9P7N3M4Q6R8T2V4W6Y0",
  "domain": "mail.example.com",
  "status": "pending_verification",
  "SPF_pass": false,
  "DKIM_pass": false,
  "DMARC_pass": false,
  "dkim_selector": "pmx1",
  "default": true,
  "created_at": "2026-07-18T12:00:00Z"
}

Dashboard

Navigate to /app/domains and click Add Domain. Enter your subdomain (e.g., mail or marketing). PostMTA will display the three DNS records you must add.

SPF Record Setup

SPF (Sender Policy Framework) is a TXT record published on the sending domain that lists which mail servers are authorized to send email for that domain.

Record format

Create a TXT record on mail.example.com:

Type:  TXT
Host:   mail.example.com
Value:  "v=spf1 include:_spf.postmta.com ~all"

What the record means

Publishing -all (hard fail) before verifying your SPF record is correct can cause legitimate email to be rejected. Start with ~all (soft fail) and switch to -all after confirming delivery works correctly.

Multiple authorized senders

If you send from multiple providers, include each one:

"v=spf1 include:_spf.postmta.com include:_spf.google.com include:_spf.mailsender.com ~all"

DKIM Record Setup

DKIM (DomainKeys Identified Mail) adds a cryptographic signature to every outgoing message. PostMTA generates a unique DKIM key pair for each domain and provides you with the public key as a DNS record.

Record format

Create a CNAME record pointing to PostMTA's DKIM selector:

Type:  CNAME
Host:   pmx1._domainkey.mail.example.com
Value:  pmx1._domainkey.postmta.com

pmx1 is the DKIM selector assigned to your domain (shown in the dashboard and API response as dkim_selector). Do not change the selector value — it must match what PostMTA uses when signing your messages.

Verification

After adding the CNAME, verify DKIM status via API:

curl https://api.postmta.com/v1/domains/dom_01HX5K9P7N3M4Q6R8T2V4W6Y0 \
  -H "Authorization: Bearer YOUR_ACCESS_TOKEN"

When DKIM_pass becomes true, the DKIM signature is valid.

It may take up to 15 minutes for DKIM verification to update after DNS changes. DKIM signatures are applied to all outgoing messages automatically once verified.

DMARC Record Setup

DMARC (Domain-based Message Authentication, Reporting & Conformance) ties SPF and DKIM together with a policy telling receiving servers what to do when authentication fails.

Record format

Create a TXT record on _dmarc.mail.example.com:

Type:  TXT
Host:   _dmarc.mail.example.com
Value:  "v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@example.com; ruf=mailto:dmarc-forensics@example.com"

Policy values

PolicyEffectWhen to use
p=noneMonitor only — no action taken on failures.Initial DMARC deployment, before fixing authentication issues.
p=quarantineMark suspicious messages as spam/junk.Recommended starting policy. Protects without hard-rejecting.
p=rejectHard reject at the SMTP layer.Only after validating SPF/DKIM pass for all legitimate sending paths.

Aggregate and forensic reports

p=reject (DMARC reject policy) should only be set after you have confirmed all legitimate sending sources are covered by SPF or DKIM. Misconfigured reject policies will silently drop valid email.

Verified From in Production

PostMTA enforces PMH-SEC-026: the MAIL FROM domain must be a verified sending domain in your workspace. This means:

If a message is submitted with a MAIL FROM from an unverified domain, the SMTP session is rejected with:

550 5.7.1 Unverified sender domain. Please add and verify this domain in your PostMTA dashboard.

Subdomain Delegation

For multi-brand or multi-product sending, use a parent domain for DNS management and delegate subdomains to individual product teams without re-verifying the parent domain for each subdomain.

Pattern

Register mail.example.com as the parent verified domain. Each product team uses a subdomain such as alerts.mail.example.com ormarketing.mail.example.com. Only the parent domain needs the three DNS records; subdomains inherit the authentication.

# Parent domain (verified once):
mail.example.com   TXT   "v=spf1 include:_spf.postmta.com ~all"
pmx1._domainkey.mail.example.com  CNAME  pmx1._domainkey.postmta.com
_dmarc.mail.example.com  TXT  "v=DMARC1; p=quarantine; rua=mailto:dmarc@example.com"

# Product subdomain (inherits parent authentication — no additional DNS needed):
alerts.mail.example.com
marketing.mail.example.com

Rules

Domain Verification Troubleshooting

ProblemCommon causeFix
SPF stays false after DNS updateDNS record not propagated yet, or wrong hostnameCheck with dig TXT mail.example.com. Wait up to 48h for propagation.
DKIM stays falseCNAME target wrong, or selector mismatchVerify the CNAME target is exactly pmx1._domainkey.postmta.com. Check for typos.
DMARC stays falseRecord not on _dmarc.mail.example.com subdomainEnsure the record host is _dmarc.mail.example.com, not just mail.example.com.
All three stay falseDomain not yet added in PostMTAAdd the domain via API or dashboard before DNS can be verified.
550 Unverified sender domainDomain added but verification not completeWait for all three *_pass fields to be true before sending.

Next Steps