A DMARC aggregate report only gives you an IP, a From domain, and pass/fail results. To learn which platform actually sent the mail, key attribution on the message's authentication signature, not the IP: envelope MAIL FROM domain, DKIM signer and selectors, SPF/CNAME chains. Deterministic evidence decides first, an LLM fills gaps, and an audit verifies every LLM claim.
We build and run a DMARC aggregate-report SaaS. In November 2026 we rebuilt its sender-attribution layer against the full dataset: 664,000 report records, 36,891 source IPs, 5,974 distinct authentication signatures. This is what we built, the mislabels that forced each layer into existence, and the one architecture decision that made the rest work.
Why can't a DMARC report tell you who sent the mail?
The aggregate XML defined in RFC 7489 carries a source IP, a message count, the header From domain, and the SPF and DKIM results with their domains and selectors. It has no MTA name, no application, no account ID. On shared ESP infrastructure one IP carries thousands of unrelated senders, so "which IP" is not "who".
That gap is the whole product. A customer looking at their report wants to know "is this Klaviyo, our old Mailchimp account, or someone spoofing us?" Reverse DNS on an Amazon SES address answers "Amazon". That's true and useless, because SES sends from shared IP addresses by default, and the marketing platforms built on it inherit that pool.
So everything we know is inferred from authentication metadata. The skill is in which metadata you trust, in what order, and what you do when it disagrees. We learned some of that the hard way earlier this month, in Does DKIM pass + SPF fail mean "forwarded"?, where a plausible-looking signal misclassified 20,531 rows twice.
Why is the IP address the wrong key for tenant attribution?
Because tenancy belongs to a message, not a machine. The same SES address can send for a Flashy customer at 10:00 and a Remarkety customer at 10:01, so any per-IP tenant label is wrong for one of them. We split the model: IP rows describe only the network (SES, SendGrid), and the tenant lives on a per-record signature.
The signature is a three-part key: the header From domain, an envelope token, and a DKIM token. The envelope token reduces the SPF MAIL FROM domain to "self", a subdomain prefix under the sender's own domain (such as flashyapp or em1372), or a foreign base domain such as amazonses.com. The DKIM token records which selectors signed aligned, and which foreign domains signed at all.
signature(record):
header = record.header_from
envelope = classify(record.spf_mail_from, relative_to=header)
# "self" | "flashyapp" | "amazonses.com" | "none"
dkim = aligned_selectors(record) + foreign_signers(record)
return (header, envelope, dkim)
display(record) = tenant(signature(record)) x network(record.source_ip)
The rebuild collapsed 664k records into 5,974 signatures, each classified once and inherited by every record, at ingest, in the same poll pass that stores the report. We also dropped the legacy "tenant from IP" fallback entirely. Keeping it would have let the old wrong answers leak back into the display whenever a signature was unresolved.
Which signals identify the sending platform, and in what order?
Observed evidence beats declared evidence. The envelope domain a message actually authenticated with outranks what a domain's SPF record merely permits. Our classifier runs in this order: envelope prefix, envelope-subdomain SPF/CNAME chain, foreign DKIM signer, DKIM selector fingerprint, header-domain SPF include, owner-declared tools, then the LLM. The first confident hit wins.
| Layer | Evidence | Confidence |
|---|---|---|
| Envelope prefix | MAIL FROM subdomain named after a platform (flashyapp.<customer>) | 0.92 |
| Envelope SPF/CNAME | That subdomain's SPF include or CNAME target points at a known platform | 0.88 |
| Foreign DKIM | A platform's own signing domain on the message | 0.95 |
| Selector fingerprint | All aligned selectors fall inside one platform's default set | 0.90 |
| Header SPF include | Sender domain's SPF includes a platform, pruned and intersected | 0.80 |
| Declared tools | The domain owner told us which tools they use | 0.75 |
| LLM fallback | Everything above, reasoned over | Verified later |
The order is not sorted by confidence, and that's deliberate. Foreign DKIM is the strongest single signal when present, but on white-label setups the customer signs with their own domain, so it's usually absent, and the envelope prefix targets exactly that case. The confidence scores answer a different question: how much a result is worth when a human or a later layer has to weigh it.
Every layer carries guards. No tenant is ever assigned on a mailbox-provider network like Gmail or Outlook, because those hops are forwarded or relayed mail with nothing to attribute. A curated platform-to-substrate map prunes impossible answers, for example Mailchimp on SES. When a domain's SPF includes the substrate directly, the include layer abstains, because that domain is clearly using SES itself, not a platform on top of it.
How did 41 SES IPs end up labeled Remarkety when Flashy sent them?
Header SPF includes describe what may send for a domain, not what did send. Several customer domains carried an SPF include for Remarkety while their live traffic came from Flashy on the same SES ranges. Our include layer trusted the record and labeled 41 SES IPs Remarkety. The envelope MAIL FROM said otherwise on every message.
Each of those messages authenticated SPF as flashyapp.<customer-domain>. That is per-message ground truth, written by the platform that did the sending. We added the envelope layer at 0.92, ranked it above header includes, and let it displace the weaker guesses. The backfill re-resolved all 36,891 IPs and left 7 needing human review.
Whether that include was a leftover or a parallel integration, the record can't tell you. The incident also shaped a rule we now apply everywhere: platform-to-substrate knowledge is curated, never derived from live DNS. One platform's published SPF record pointed at SendGrid while its real traffic rode SES. We considered auto-building the substrate map from platforms' own SPF records and ruled it out, because it would encode exactly the kind of stale declaration that caused the mislabel.
How did a 131-IP JangoMail fleet hide behind datacenter hostnames?
The IPs had reverse DNS under a bland infrastructure domain and sat in a hosting provider's ASN, so the LLM layer labeled them "Hosting/ASN". That was the lazy answer. The tell was one hop further out: the PTR domain's own SPF record included jangomail.com. Once we fed that evidence to the model, 131 IPs resolved to the real operator.
The PTR base was jsmtp.net. Nothing about the name says JangoMail, and an IP-to-ASN lookup correctly reports the datacenter. But companies publish SPF for the domains their servers live under, and that record names who actually runs them. We added the PTR domain's SPF as a first-class evidence field (ptr_spf_includes) and wrote a matching deterministic PTR rule, so this fleet no longer needs the LLM at all.
We also re-queued every earlier LLM row that had answered "Hosting/ASN" while unexploited operator evidence was sitting in its record. Hosting is a legitimate answer only when nothing names an operator. A label that names the building instead of the tenant is technically correct and operationally worthless.
Where does an LLM belong in a sender-attribution pipeline?
Last, and on probation. The LLM only sees IPs and signatures that every deterministic layer abstained on. It gets a fixed evidence bundle and a prompt that orders its reasoning: PTR domain first, then sender SPF, then envelope domains, then ASN only as a last resort. Its job is to name the mail operator, not the hosting company.
The model choice mattered less than the contract around it, a pattern we've written about in why the AI model you pick barely matters. We run a fast, cheap model at temperature 0, in batches of 20, highest message volume first, and schema-validate every response. Proposed tenants then pass the same sanitizer as the deterministic layers: no tenants on mailbox-provider networks, no "tenant" that is just the sender's own domain, no invented platform names outside the curated labels.
Proposals that only restate the network, or that name a mailbox provider as a tenant (a common artifact of forwarded DKIM), are dropped automatically with a recorded reason. We considered letting the model write tenants straight to the trusted tables and rejected it. A batch of confident, fluent mislabels at 0.9 is far harder to unwind than a review queue.
How do you stop LLM labels from silently becoming ground truth?
Audit every claim against evidence the model didn't author. Our verification pass checks each LLM network label four ways: is the IP inside the operator's SPF-published ranges, does the PTR domain's SPF reference the operator, is the PTR domain the operator, and for hosting claims, does the ASN agree. Verified claims are promoted; unverifiable ESP claims drop to review.
Promotion is the part that compounds. When three or more IPs verify by range containment for the same operator, its SPF-walked ranges become an automatic IP feed, so the next resolve hits a deterministic layer and never reaches the model. Verified labels are also renamed from the operator's verified domain and pinned into the reverse-DNS map, which re-resolved 111 rows in one pass.
Building the audit also exposed a blind spot. Two self-hosted company mail servers had been given phantom ESP labels. The model saw the sender domain's SPF includes for its other tools and attributed the box to one of them. We added a self-hosted layer: when the PTR base domain matches the majority of the IP's aligned sender traffic, it's that organization's own server, displayed with its hosting network underneath.
One more guard protects the paid work. A full re-resolve keeps an existing LLM label whenever the new deterministic answer is weaker, and only merges in fresh evidence. Before that fix, a routine backfill quietly wiped labels we had paid tokens to produce.
Why is abstention a feature, not a failure?
Because a wrong tenant label is worse than none. A customer told "this is your Remarkety account" will chase a vendor that isn't sending their mail. Our classifier records ambiguous candidate sets in evidence instead of picking one, abstains when the evidence is contradictory, and flags any abstention that carries candidates for a human decision.
After the full rebuild, 21 of 5,974 signatures (0.35%) were left in review. The review UI asks one plain question per signature, "Is this X?", with "something else" and "sent directly" as alternatives, and the supporting evidence rendered in readable form. A human verdict is marked manual and is never overwritten by any automatic layer.
The 21 are not a backlog to drive to zero. They are the cases where the evidence genuinely doesn't decide, and they show us which platform map entry or evidence source to add next. A pipeline reporting 100% attribution on shared infrastructure is guessing somewhere.
What does the whole attribution pattern look like?
Key tenancy on the authentication signature, not the IP. Rank what was observed on the message above what DNS merely permits. Curate platform knowledge by hand, let an LLM handle only the leftovers, and treat its answers as claims until independent evidence corroborates them. Verified answers get promoted into the deterministic layer, so the model's share keeps shrinking.
The 41 SES IPs and the 131-IP fleet were not edge cases we patched. Each one exposed a layer that was trusting the wrong kind of evidence. Who sent the email behind a DMARC report is answerable for all but 21 of 5,974 signatures across 664k records, but only if the system knows which of its own answers it can't prove.