Configuration
Sending Domains
A sending domain is the domain in your email's From address. PostMTA requires domain verification to send from any domain.
Adding a Domain
curl -X POST https://api.postmta.com/v1/domains -H "Authorization: Bearer pmta_live_xxxx" -H "Content-Type: application/json" -d '{"domain":"mail.example.com"}'Required DNS Records
1. DKIM Record
| Field | Value |
|---|---|
| Type | TXT |
| Host | pmta._domainkey.example.com |
| Value | v=DKIM1; k=rsa; p=YOUR_DKIM_PUBLIC_KEY |
2. SPF Record
| Field | Value |
|---|---|
| Type | TXT |
| Host | example.com |
| Value | v=spf1 include:_spf.postmta.com ~all |
3. DMARC Record
| Field | Value |
|---|---|
| Type | TXT |
| Host | _dmarc.example.com |
| Value | v=DMARC1; p=quarantine; rua=mailto:dmarc-reports@postmta.com |
DNS propagation can take up to 48 hours, though it is typically within 5-30 minutes.
Verifying Domain Ownership
curl -X POST https://api.postmta.com/v1/domains/mail.example.com/verify -H "Authorization: Bearer pmta_live_xxxx"Domain Statuses
| Status | Description |
|---|---|
pending | Domain added, verification not yet attempted |
unverified | Verification attempted but DNS records not found |
verified | Domain verified, ready to send |
suspended | Domain suspended due to policy violation |
Using Subdomains
Best practice: use a subdomain for sending (e.g. mail.example.com) rather than your root domain. This isolates PostMTA sending reputation from your other email flows.
Deleting a Domain
Deleting a domain stops all email sending from that domain immediately. This cannot be undone.
curl -X DELETE https://api.postmta.com/v1/domains/mail.example.com -H "Authorization: Bearer pmta_live_xxxx"