The short version
Mail Mailgun sends from your domain passes DMARC only when it is DKIM signed with your domain, or sent with a bounce address on your domain. Set up DKIM first: it is the fix that survives forwarding.
1. DKIM with your domain
Add your domain in Mailgun and publish the DKIM TXT record it shows; Mailgun signs as your domain once it verifies.
Mailgun's own instructions: Mailgun documentation.
2. SPF
Adding include:mailgun.org to your SPF record makes SPF pass, but for DMARC it counts only when Mailgun sends with a bounce (return-path) address on your domain. Where it offers a custom return-path, set one up; otherwise rely on DKIM, and leave the include out to save SPF lookups.
example.com. TXT "v=spf1 include:mailgun.org ~all"
Merge it into your one existing SPF record rather than adding a second, and keep the total under 10 lookups: the SPF Check counts them.
3. Check it worked
-
Send a message through Mailgun to an outside mailbox and open its headers. The
DKIM-Signatureshould showd=example.com, your domain; itss=tag is the selector. - Look the selector up with the DKIM Inspector to confirm the key is published.
- In your DMARC reports, Mailgun's traffic should now pass DMARC. In DMARCLoop it moves from Known sender, failing to Compliant on the domain's Sources tab.
4. DMARC
If your domain has no DMARC record yet, publish one at p=none with a report address,
so you can see every service sending as your domain before you tighten the policy. Build it with the
DMARC Record Wizard, and see
how to publish a DMARC record for the path to
p=reject: quarantine by day 30, reject from day 60.