Skip to content
DMARC Pulse
Guides

Mimecast

Mimecast DKIM setup: SPF, DKIM and DMARC at the gateway

Mimecast DKIM setup depends on your mail path. Sign after the last change, add Mimecast to SPF only for outbound mail and confirm DMARC alignment.

Where Mimecast sits in your mail

Mimecast DKIM works when the signature comes from the last system that changes your message. Mimecast's own DKIM guide says the signer should be the platform that actually sends the message to the recipient. It also warns that a secure gateway that modifies a message after signing can make the signature fail, even with correct DNS.

Existing DMARC policy: authenticating Mimecast does not require resetting it. Keep one _dmarc record, preserve p, subdomain and alignment settings, and merge any needed rua address with existing destinations. The p=none example below is only for a new deployment without a valid record.

Mimecast is an email security service. Its job is to filter mail, and it can connect to your mail in two ways: through its secure gateway or through an API.

  • MX-based. Your MX record points to Mimecast, and all incoming mail routes through its gateway first.
  • API-based. Mimecast connects to your mail platform through an API, and your MX records stay as they are.

Neither mode tells you where your outgoing mail leaves from, and that path is what decides your SPF and DKIM. Send a message to an outside mailbox and paste its headers into the Email Header Analyzer. The delivery path shows which server handed the message to the recipient.

SPF: when Mimecast belongs in the record

Mimecast SPF record: who needs one

You need Mimecast in your SPF record only if your outbound internet mail leaves through Mimecast. SPF (Sender Policy Framework) lists the servers allowed to send for your domain. Microsoft's guidance for third-party filtering services follows the same rule: include the service only when your organization sends outbound internet email through it.

If Mimecast filters incoming mail and your mailbox platform delivers outgoing mail itself, keep that platform in SPF and leave Mimecast out. With Microsoft 365, that means include:spf.protection.outlook.com, as the Microsoft 365 guide explains.

If your outbound mail does pass through Mimecast:

  1. Get the include value from Mimecast's administrator documentation or your Mimecast contact. We do not print it here because we could not confirm it against Mimecast's documentation when we wrote this guide.
  2. Add it to the SPF TXT record you already have. A domain must have only one: RFC 7208 makes a second record a permerror, and Mimecast's own SPF guide tells you to update the existing record.
  3. Count your DNS lookups. SPF allows 10 terms that query DNS, and the lookups inside each include count too.
  4. End the record with ~all while you test. ~all is a softfail, a weak statement that a host is probably not authorized. -all is an explicit fail.
  5. Move to -all only when your DMARC reports show every sender passing. A sender you missed would then fail SPF outright.
  6. Keep your mailbox platform's old include until those reports show that no mail leaves directly through it.

DKIM: sign after the last change

Mimecast DKIM setup

DKIM (DomainKeys Identified Mail) adds a signature that receivers verify with a public key in your DNS. Mimecast's own advice is to avoid content changes after signing by placing DKIM signing as late as possible in the delivery path. If your outbound mail leaves through Mimecast, the signature should be applied there, after any change Mimecast makes. If it leaves your mailbox platform directly, sign on that platform.

Console menus and selector names are not listed here, because we could not confirm them against Mimecast's documentation. Use the names, hostname and key value that Mimecast gives you.

  1. Get a selector of its own and the public key for the domain in your From address. Mimecast recommends a different selector for each sender, which limits the impact of a configuration mistake. RFC 8301 requires RSA keys of at least 1024 bits and recommends 2048, so choose 2048 if Mimecast offers it.
  2. Publish the key at selector._domainkey.example.com. Use the record type you are given: Mimecast's guide notes that some platforms use a TXT record and others a delegated CNAME.
  3. Look up the selector with the DKIM checker before going further.
  4. Turn on signing. Publishing the key alone does not complete the setup. Caution: do this only after step 3 succeeds. If your DMARC policy is already quarantine or reject, a message whose DKIM fails relies on aligned SPF alone, and mail with neither can be quarantined or rejected.
  5. Send a test message to an outside mailbox and confirm dkim=pass with header.d= showing your domain.
  6. Keep any earlier key published until no active mail stream depends on it.

DMARC: what changes with a gateway

DMARC needs one aligned result: SPF or DKIM must pass for a domain that matches your From address. Aligned means the authenticated domain is the same as your From domain or, in the default relaxed mode, shares its organizational domain. SPF is checked against the MAIL FROM domain (the envelope sender), so a message with another domain there can pass SPF and still fail to align. An aligned DKIM signature added at the last hop gives DMARC the result it needs.

The record looks the same with or without a gateway. Publish one TXT record at _dmarc.example.com:

New policy only: use this starter value only when no valid DMARC record exists. For an existing record, keep its policy and merge the report address instead of pasting over the value.

TXT
v=DMARC1; p=none; rua=mailto:dmarc@example.com

Preserve existing policy during authentication. For a new policy, start at p=none and collect representative reports, which may take months. After fixing all legitimate streams, consider p=quarantine and observe reports again. Evaluate p=reject separately: it is optional, needs aligned DKIM rather than SPF alone, and RFC 9989 §7.4 advises against it when users post to mailing lists. Forwarding and list transformations need testing; receiving servers decide the final disposition.

Mimecast DMARC Analyzer

Mimecast DMARC Analyzer is a Mimecast product for setting up and monitoring DMARC. The gateway and the reporting tool are separate products, and rua can point to any reporting service. Mimecast's guide shows the address as rua=mailto:CUSTOMERID@for.dmarcanalyzer.com, with your own customer value in place of CUSTOMERID.

The rua tag takes a comma-separated list, so you can send reports to two services while you compare them. If you are weighing options, see alternatives to Mimecast DMARC Analyzer. A report address on another domain needs a TXT authorization record at example.com._report._dmarc.<report-host>, published by the report destination.

Some guides still mention the pct tag, including Mimecast's DMARC guide. RFC 9989 removed that tag and added t=y, which signals that you expect a policy one level below the one you published.

Common problems

  • dkim=fail (body hash did not verify). The message changed after it was signed. Microsoft's troubleshooting guide names Mimecast as an example of a security service that can do this. Sign after the last change, and see the body hash error.
  • dkim=fail (no key for signature). Mimecast lists a missing TXT record, a selector mismatch or DNS propagation delay as causes. Compare the s= value in the signature with the name you published.
  • SPF passes and DMARC fails. In Microsoft's example, SPF passes for the gateway's own domain, which does not align with your From domain. Aligned DKIM resolves this.
  • Two SPF records after adding Mimecast. Merge them into one. See the multiple SPF records error.
  • Mail arriving through Mimecast looks spoofed in Microsoft 365. A message adopts the source IP of the last hop, so Microsoft 365 sees Mimecast's address. Microsoft strongly recommends Enhanced Filtering for Connectors on the inbound connector that receives this mail. That setting changes how your tenant evaluates arriving mail, and your own outbound mail still needs its SPF and DKIM.
  • A sender bypasses Mimecast. CRMs and marketing tools that deliver directly never reach the gateway, so they need their own SPF entry and their own DKIM key with a separate selector. Your DMARC reports show these sources. Mimecast says its Cloud Gateway can centralize authentication for platforms like these, so ask whether that applies to your account.

Frequently asked questions

Do I need Mimecast in my SPF record?
Only if your outbound internet mail leaves through Mimecast. If Mimecast only filters incoming mail and your mailbox platform delivers outgoing mail directly, SPF should authorize that platform instead. Microsoft gives the same rule for third-party filtering services.
Should Mimecast or Microsoft 365 sign my mail with DKIM?
The system that actually delivers the message to the recipient, after any content changes. Mimecast's DKIM guide says the signer should be the platform that actually sends the message to the recipient, and that a gateway changing mail after signing can break the signature.
Can I add a second SPF record just for Mimecast?
No. RFC 7208 says a domain must not have multiple SPF records, and more than one produces a permerror result. Add the Mimecast value to your existing record and keep the total at 10 DNS-querying terms or fewer.
Why does DMARC fail when SPF passes through Mimecast?
DMARC counts SPF only when the MAIL FROM domain aligns with your From domain. In Microsoft's gateway example, SPF passes for the gateway's own domain and does not align. An aligned DKIM signature added after the last change gives DMARC the result it needs.
Do I need Mimecast DMARC Analyzer to use DMARC with Mimecast?
No. The rua tag in your DMARC record can list any reporting address, so the gateway and the reporting tool can come from different vendors. Reports sent to another domain need an authorization record published by the report destination, as RFC 9990 describes.
Does Mimecast's API-based deployment change my DNS records?
Mimecast describes its API-based deployment as having no MX record changes. If your outbound mail does not pass through Mimecast, Mimecast is not a sending source for your domain and does not belong in your SPF record.

Sources consulted

Mimecast: Email Security
checked 2026-11-09
Mimecast: How to Set Up DKIM
checked 2026-11-09
Mimecast: DKIM Fail
checked 2026-11-09
Mimecast: DKIM Selector
checked 2026-11-09
Mimecast: DMARC Analyzer
checked 2026-11-09
Mimecast: DMARC Compliance
checked 2026-11-09
RFC 8301 §3.2: Key Sizes
checked 2026-11-09

Keep it healthy

Know the moment something breaks

Point your DMARC reports to DMARC Pulse and see who sends email as your domain, what fails and why — with a calm alert when anything changes.

Free plan: 1 domain, no credit card.