Back to blog
Threat Intel
Phishing Forensics

The Mimecast SPF Trap: PermErrors, SoftFails, and the 10-Lookup Limit

You deployed Mimecast to secure your email, but its default SPF configuration might silently push your DNS lookup count past the breaking point.

MailSleuth Research
Email Security Team
September 14, 20268 min read
An overloaded scale tipping under the weight of glowing digital blocks, representing a breached DNS limit.

The cutover is complete. You pointed your MX records to the new gateways, updated your TXT records, and watched the mail flow perfectly. The SOC is happy because inbound threats are dropping, and IT is happy because the implementation went exactly according to the deployment guide. Then, two weeks later, marketing runs their end-of-quarter campaign through Salesforce and SendGrid. Suddenly, recipient mail servers start dropping your outbound messages entirely.

The immediate instinct is to blame the new marketing tools, but the culprit is usually sitting right in the TXT record you configured during onboarding. When configuring your Mimecast spf record setup, the vendor documentation nudges you toward a seemingly harmless default string ending in a SoftFail. It looks safe. It is explicitly designed not to break things right away. Yet it sets up a structural fragility in your DNS architecture that detonates the moment a shadow IT project spins up.

To understand why messages bounce when you mix a massive Secure Email Gateway with third-party senders, we have to pull apart the mechanics of RFC 7208. We need to look at what that default include actually resolves to, why the vendor chose a SoftFail, and how to re-architect your authorization chain before you hit a fatal PermError.

Deconstructing the Mimecast Default String

Most organizations start their Mimecast journey by pasting a standard string into their DNS registrar. It usually consists of a version one SPF declaration followed by an include for Mimecast netblocks and a SoftFail mechanism.

v=spf1 include:_netblocks.mimecast.com ~all

On the surface, this is clean and readable. The include mechanism instructs receiving mail transfer agents to query the specified Mimecast domain, fetch its TXT records, and evaluate the underlying IP addresses as authorized senders for your domain. If the sender IP matches the Mimecast pool, the check passes. If it does not, the evaluation falls through to the all mechanism at the end of the string.

The tilde denotes a SoftFail. According to the specification, a SoftFail means the host is not authorized, but the receiver should probably accept the message anyway and just tag it as suspicious. In the era before DMARC, this was a polite suggestion to spam filters. Today, under DMARC policy evaluation, an SPF SoftFail effectively acts as a hard failure for alignment purposes if DKIM is also broken or missing.

The Rationale Behind the SoftFail

Vendors like Mimecast default to SoftFail for a highly pragmatic reason. They know that corporate networks are messy. The moment an IT admin changes an SPF record to a hard fail, some forgotten legacy application sending invoice receipts from an on-premises Exchange server is going to get blocked.

A SoftFail provides a fail-safe for unforeseen infrastructure. It gives administrators time to review aggregate DMARC reports, identify rogue sending IPs, and bring them into the fold. The vendor prioritizes mail delivery over strict enforcement during the initial deployment phase, which prevents the helpdesk from being overwhelmed on day one. But leaving that tilde in place permanently is a defensive compromise you should actively plan to remove.

The RFC 7208 Lookup Trap

The real danger of that default string is not the SoftFail. The danger lies in the include mechanism and the strict processing limits enforced by receiving mail servers. To prevent denial of service attacks against DNS resolvers, RFC 7208 explicitly limits SPF evaluation to a maximum of ten DNS lookups.

Every time a receiver sees an include, a, mx, ptr, or exists mechanism in your SPF record, it must perform a DNS query. If the included record contains more includes, those count against your global limit of ten. Once the evaluation hits eleven, the receiver stops processing and returns a PermError.

Consuming the DNS Budget

Mimecast operates a massive, globally distributed infrastructure. Their netblocks record is not just a flat list of IP addresses. Depending on the region and the specific routing configurations in play, resolving the Mimecast include often requires following a chain of nested lookups.

When you add the Mimecast include to your apex domain, you are not just spending one DNS lookup. You are inheriting the entire lookup tree of the vendor. In many cases, this immediately consumes three to four lookups from your budget of ten. You are nearly halfway to a PermError before you have authorized a single internal application or third-party marketing tool.

The Collision Course with Marketing Tools

The lookup trap remains dormant as long as your email architecture is simple. If all outbound mail flows exclusively through Mimecast, a four-lookup overhead is perfectly acceptable. The fracture happens when business units start bypassing the Secure Email Gateway for specialized outbound communications.

Imagine a mid-sized organization that relies on Salesforce for customer relationship management and SendGrid for automated marketing blasts. To ensure these platforms can send mail on behalf of the corporate domain, the IT team dutifully adds their respective includes to the TXT record.

v=spf1 include:_netblocks.mimecast.com include:_spf.salesforce.com include:sendgrid.net ~all

This looks like a logical, compliant configuration. But let us count the cost. Salesforce is notorious for its complex SPF architecture, often eating three to four lookups on its own as it chains through various ExactTarget and internal infrastructure domains. SendGrid adds another lookup, and if they rely on chained provider networks, potentially more.

Suddenly, your lookup count hits eleven. When a receiver like Google or Microsoft processes an incoming message, they resolve Mimecast, then they resolve Salesforce, and right as they attempt to resolve the final block, the DNS resolver hits the RFC limit. The evaluation violently aborts.

A PermError is catastrophic for deliverability. It means the SPF check is broken. Even if the sending IP was perfectly valid and listed right there in the SendGrid block, the receiver never got that far. The message fails SPF, and if DKIM is not strictly aligned, DMARC will block or quarantine the mail.

Diagnosing the PermError in the Headers

When users complain about bouncing emails, you cannot rely on vendor dashboards alone. You have to look at the raw SMTP transaction and the resulting headers stamped by the receiving mail transfer agent. The truth is always in the Authentication-Results header.

If you inspect the headers of a rejected message from this scenario, you will not see a simple fail verdict. A standard failure means the IP was evaluated and found wanting. A PermError means the system gave up.

Authentication-Results: mx.google.com; spf=permerror (google.com: domain of marketing@example.com uses a mechanism not recognized or limits exceeded) smtp.mailfrom=marketing@example.com; dmarc=fail (p=reject sp=reject dis=none) header.from=example.com — Real-world Google Workspace PermError Evaluation

That specific verdict string points directly to a structural defect in the DNS record. It tells the analyst that the domain is functionally broken for receivers adhering to strict RFC processing limits. The challenge for the SOC analyst is proving to the IT engineering team that the issue is not a temporary network glitch, but a permanent architectural ceiling they just crashed into.

Mapping the Lookup Chain

To prove the failure, you need to manually walk the DNS tree. You can do this from the command line using the dig command, querying the TXT records of each included domain recursively and keeping a tally. But recursive manual querying is tedious and prone to human error, especially when vendors dynamically update their nested includes.

The smarter operational move is to script the resolution or use a dedicated parsing tool that unfolds the entire tree visually. You need to see exactly which include is tipping the scale from ten to eleven. Often, you will find legacy vendor includes that were added years ago, pointing to deprecated infrastructure that is burning lookups for absolutely no operational benefit.

The Defender's Playbook for Lean Infrastructure

Fixing a bloated authorization chain requires a structural shift in how you manage outbound email identity. You cannot simply keep appending includes to the apex domain every time a department buys a new SaaS tool. The attack surface becomes too large, and the DNS budget becomes too tight.

The most immediate tactical fix is flattening. If a legacy vendor uses three lookups to authorize a static block of four IP addresses, you can replace their include mechanism with an ip4 mechanism. IP mechanisms do not require additional DNS lookups. They are evaluated instantly. By converting static vendor ranges into flat IP blocks, you reclaim valuable lookup budget for dynamic vendors like Mimecast that truly require an include.

Segregating Outbound Traffic

The strategic fix is isolating outbound sending platforms on dedicated subdomains. There is rarely a business requirement for SendGrid to send marketing blasts directly from your apex corporate domain.

By moving third-party senders to subdomains like marketing.example.com or notifications.example.com, you isolate their SPF records. The subdomain gets its own discrete allowance of ten DNS lookups, completely separate from the Mimecast configuration on the apex domain. This prevents vendor collision, simplifies incident response, and dramatically reduces the blast radius if a third-party platform suffers a supply chain compromise.

Finally, once the architecture is lean and the authorized senders are isolated, you must drop the SoftFail. Transition the apex domain from a tilde to a hyphen, enforcing a strict hard fail. This tells the world that your infrastructure is deliberate, monitored, and closed to unauthorized spoofing.

The takeaway

Email forensics is unforgiving because the protocols are rigid. Mimecast provides excellent security filtering, but integrating it safely requires understanding the downstream consequences of every DNS mechanism you deploy. A seemingly harmless default configuration can lie dormant for months, only to trigger a catastrophic cascade of PermErrors when a completely unrelated system is added to the stack.

Defense in depth means managing your identity boundaries with precision. Stop treating your TXT records as an infinite dumping ground for vendor requirements. Flatten your static blocks, isolate your third-party senders on dedicated subdomains, and lock down the apex domain. When you are ready to stop guessing and start enforcing, dropping your raw headers into MailSleuth.AI can immediately highlight the exact mechanism causing the break. What does your current lookup tree actually look like under the hood?

#spf#mimecast#dns-limits#permerror#email-forensics
MailSleuth Research
Email Security Team

We dissect phishing campaigns and email infrastructure so you don't have to.