Key takeaways
- Use a dedicated sending subdomain for cold outreach, publish one SPF record on it that includes mailgun.org, keep the qualifier at ~all while you audit senders, and count DNS lookups before you add any other tool.
- Do not reuse the apex domain that carries your company mail.
- Cold outreach carries complaints and bounces you do not want attached to your main domain.
For cold email through Mailgun, the SPF record is a set of decisions before it is a DNS entry: which domain sends, which senders share it, whether the qualifier is `~all` or `-all`, and how many DNS lookups the record can spend. Get those right and the TXT record itself is one line. This guide is for the planning step. For the record syntax, see the setup guide, and for failures, the troubleshooting guide.
Research checked: 12 November 2026
The short answer
Use a dedicated sending subdomain for cold outreach, publish one SPF record on it that includes `mailgun.org`, keep the qualifier at `~all` while you audit senders, and count DNS lookups before you add any other tool. Do not reuse the apex domain that carries your company mail.
Four decisions before you publish
Decision 1: Which domain sends the cold mail?
Cold outreach carries complaints and bounces you do not want attached to your main domain. A separate subdomain, such as `outreach.example.com`, gives you a place to put that risk. Mailgun's verification flow requires the domain you verify, so create the subdomain in Mailgun first and then publish its SPF record there.
Trade-off: a subdomain needs its own DMARC and reputation history, and it starts with none. Plan for the new domain to be handled differently from your transactional sending from day one.
Decision 2: Who else is on the record?
Every service that sends from the same domain has to be in the one SPF record. Make a list before you edit it:
- Mailgun (`include:mailgun.org`)
- Your mailbox provider, if you send from a mailbox on that domain
- Any warm-up, CRM or sequencing tool that sends on your behalf
Each `include:` may trigger further DNS lookups. RFC 7208 caps the number of DNS-querying mechanisms at 10 during evaluation. Count them before you add a tool: an `include:` inside an `include:` counts too. If you are close to the limit, remove a sender that is no longer used rather than publishing a second record.
Decision 3: Softfail or hard fail?
`~all` tells receivers the sending list is probably complete but not certain. `-all` says anything outside the list must not be sent. For a new cold domain, keep `~all` until a test shows every legitimate sender passing. Switch to `-all` only after you have checked every source for a full week of sending, because a missed sender then fails hard.
Decision 4: What does a passing check prove?
A pass on SPF means the sending server is authorised for the return-path domain. It says nothing about the content, your list quality or the recipient's own policy. Google's bulk sender requirements require SPF or DKIM plus DMARC for senders above 5,000 messages a day to Gmail, and the From domain must align with one of them. Treat SPF as one input, not a status.
A pre-send checklist
- [ ] The cold sending domain is separate from your company's main mail domain.
- [ ] One SPF record exists at the sending name, beginning `v=spf1`.
- [ ] It includes `mailgun.org` and every other sender on your list.
- [ ] DNS lookups counted; the total is 10 or fewer.
- [ ] Qualifier is `~all` until the audit is complete.
- [ ] Test message shows `spf=pass` in `Authentication-Results`.
How to test your own list
Send a small batch of about 20 messages spread over two days, not a single burst, then check the Authentication-Results header on several received copies. Count any `spf=fail` or `spf=softfail` results and find which sender produced them. Do not scale volume until those counts are explained. There is no universal threshold we can verify from a vendor, so set your own limit based on this test.