trustyourinbox

Mailtrap SPF and DKIM setup

The four CNAME records to publish for Mailtrap Email Sending, the rwmt1 and rwmt2 DKIM selectors, and why there is no SPF include to copy.

Verified 2026-08-30 against the official Mailtrap documentation.

What you are setting up

Mailtrap Email Sending (the production product, not the Email Sandbox) sends your transactional and bulk mail through Mailtrap's servers. You authenticate a sending domain by publishing the records on its Domain Verification page: four CNAME records and one DMARC TXT record. There is no SPF value to paste, which surprises people who have set up other ESPs. Mailtrap says the SPF check is covered by the domain verification record, so the CNAMEs are the whole job.

Publish SPF and DKIM

In Mailtrap, open Domains in the left navigation, click Add Domain, and enter the domain you send from. The Domain Verification page then lists the records under Type, Name, and Value. Copy each one into your DNS host:

Type:  CNAME   (Domain Verification)
Host:  the name Mailtrap shows you
Value: the target Mailtrap shows you

Type:  CNAME   (DKIM 1)
Host:  rwmt1._domainkey
Value: the target Mailtrap shows you

Type:  CNAME   (DKIM 2)
Host:  rwmt2._domainkey
Value: the target Mailtrap shows you

Type:  CNAME   (Domain Tracking)
Host:  the tracking host Mailtrap shows you, e.g. mt-link
Value: the target Mailtrap shows you

The two DKIM records are CNAMEs, not TXT keys. They delegate the selectors rwmt1 and rwmt2 to Mailtrap, which hosts the public keys and rotates them for you. Because the selectors live under your domain, the signature carries d=yourdomain.com and aligns for DMARC. Some DNS hosts want the full name; if so, enter rwmt1._domainkey.yourdomain.com and rwmt2._domainkey.yourdomain.com. The targets have changed between Mailtrap generations, so copy them from your own page rather than from any guide. Leave TTL at the default Mailtrap shows.

Back in Mailtrap, click Re-check DNS Records (it also checks hourly on its own). Each record moves from Missing to Verified, then the domain goes through Mailtrap's automatic review before it can send. Mailtrap says the SPF check for your mail is covered by the domain verification record, so there is no separate SPF record to add on the sending domain.

Add DMARC

Mailtrap lists a DMARC TXT on the same page. Make sure the record you publish carries a reporting address, or you will never see the aggregate reports:

Type:  TXT
Host:  _dmarc
Value: v=DMARC1; p=none; rua=mailto:dmarc@yourdomain.com

A reporting address does not get in the way of Mailtrap's check. Build it with our DMARC builder and progress past p=none once your reports are clean.

The Mailtrap gotcha

Do not go hunting for an SPF include. Every other ESP guide starts with one, so people add a guessed include: or paste a stale value from a blog post, and then wonder why the Domain Verification page still shows a red dot. Mailtrap covers SPF through the verification CNAME; the only SPF text you should ever publish for it is the one the console shows you. Two smaller traps: on Cloudflare, turn the proxy off on all four CNAMEs (it is on by default), since a proxied CNAME resolves to Cloudflare's addresses instead of Mailtrap's and never verifies. And give the check time: Mailtrap says detection usually takes 15 minutes to a few hours, and in rare cases up to 24 hours.

Confirm it worked

  • Check the status in Mailtrap. Every record on the Domain Verification page should read Verified, and the domain should carry the Verified badge after the automatic review.
  • Send a test and read the headers. Send through Mailtrap, open the message, and confirm the DKIM signature shows d=yourdomain.com with s=rwmt1 or s=rwmt2, and dmarc=pass. Our header analyzer reads it back plainly.
  • Watch the reports. Mailtrap should appear as an aligned, passing source in your DMARC aggregate reports, labeled as a known sender in trustyourinbox.

Let trustyourinbox publish Mailtrap for you.

Connect Cloudflare or AWS Route 53 once and the Mailtrap records are one click. We email you the exact record, wait five minutes, write it, and read it back from public DNS. Then we keep watching this sender in your DMARC reports and alert you when Mailtrap mail starts failing.

Was this page helpful?

Keep reading.

Start with one domain. See it with your own data.

Free for one domain, no card. Add one DNS record and the first reports usually arrive within a day.

  1. Monitoring
  2. Quarantine
  3. Reject