Setting up an email sending domain: SPF, DKIM, DMARC and MAIL FROM
The DNS records that let your app send email from your own domain, what each one tells a receiving server, how HonkIO checks them, and three common mistakes to avoid.
When your app sends a receipt or a password reset from receipts@mail.acme.ca, the server at the other end has to decide whether that message really came from you. It decides with DNS: a few records you publish on the domain. With the right records in place, receiving servers can tell your mail is genuine. With missing or broken ones, it is more likely to land in spam or be refused. This guide walks through each record and how HonkIO checks them.
Send from a subdomain
HonkIO takes a domain or a subdomain you control, and we suggest a subdomain such as mail.acme.ca. It keeps your app's mail apart from the mail your team sends from acme.ca. Either way, none of the records HonkIO asks for go on your root domain, so your own mail and your existing SPF record stay as they are.
The four records
Add the domain on the Domains page of the dashboard, or with POST /v1/email-domains. The response lists the records to publish at your DNS host. For mail.acme.ca, they look like this:
; At your DNS host, for mail.acme.ca
honkio1._domainkey.mail.acme.ca. TXT "v=DKIM1; k=rsa; p=<the key from records>"
send.mail.acme.ca. MX <the value from records>
send.mail.acme.ca. TXT "<the SPF value from records>"
_dmarc.mail.acme.ca. TXT "v=DMARC1; p=none; rua=mailto:dmarc-reports@mail.acme.ca"- DKIM: a public key under the selector honkio1. HonkIO creates a 2048-bit RSA key pair for your domain and signs each message with the private key. The receiving server checks the signature against the key you publish.
- MX on send.mail.acme.ca: the return path. Bounces for your mail go to this subdomain rather than to your own mail server.
- SPF on send.mail.acme.ca: authorizes the servers that send your mail to use that return path.
- DMARC at _dmarc.mail.acme.ca: tells receiving servers what to do with mail that fails the checks, and where to send reports. It is recommended, and HonkIO doesn't require it to verify the domain.
Why the send subdomain
Every email has two sender addresses. The From address is the one people see. The return path, also called the envelope sender or MAIL FROM, is where bounces go, and it is the domain SPF checks. For SPF to count toward DMARC, the return path has to belong to the same domain as the From address. Putting it on send.mail.acme.ca gives you that alignment, and it keeps the MX and SPF records off your root domain.
Verifying the domain
Once the records are published, press Check now on the domain in the dashboard, or call verify:
curl -X POST https://api.honkio.ca/v1/email-domains/DOMAIN_ID/verify \
-H "Authorization: Bearer mk_live_YOUR_KEY"
{ "status": "verified", "verified": true, "missing": [] }The domain verifies once DKIM, the MX and the SPF record are found. Until then a send from it is refused with EMAIL_DOMAIN_NOT_VERIFIED, and the verify response names any record still missing. The sending domains docs cover each status and the daily re-check.
Three mistakes to avoid
- Two SPF records: a domain may publish only one TXT record that starts with v=spf1. With two, receiving servers return a permanent error and SPF fails for every message, so merge them into one. HonkIO's SPF record sits on its own send subdomain, so it never adds a second one to your root domain.
- DMARC left at p=none: p=none only asks for reports, and mail that fails is delivered as usual. It is the right place to start. Once the reports show your real mail passing, move to p=quarantine, then p=reject. The record HonkIO suggests sends reports to dmarc-reports@ on your domain, so make sure that address can receive mail, or change it to one you read.
- A short DKIM key: an RSA key of 1024 bits still works, but 2048 bits is the usual size now, and many receivers ignore keys shorter than 1024 bits. HonkIO signs with 2048 bits. If another service signs your mail with a shorter key, ask it to rotate.
Check your work
Before you press Check now, the free SPF, DKIM and DMARC checker can read the records back. Enter honkio1 as the selector when you check mail.acme.ca, since the checker only tries common selectors on a name with its own SPF or MX record, then check send.mail.acme.ca for the SPF record.
Next steps
You don't need DNS to start building. A test key can send from test.honkio.ca, which needs no records; testing transactional email without emailing real people shows how. When you're ready for your own domain, the sending domains docs cover limits and tracking, and the email quickstart takes you to your first send. HonkIO Email has the overview.
HonkIO