# Email DNS Auditor: SPF, DKIM, DMARC, BIMI & MTA-STS (`thomson-digital/email-dns-auditor`) Actor

Bulk-audit email authentication for any list of domains or emails: SPF (with the 10-DNS-lookup limit check), DMARC policy, DKIM across 45 common selectors, BIMI, MTA-STS, TLS-RPT and mail provider. Score, A-F grade and concrete fixes per domain.

- **URL**: https://apify.com/thomson-digital/email-dns-auditor.md
- **Developed by:** [Matt](https://apify.com/thomson-digital) (community)
- **Categories:** Developer tools, Lead generation, SEO tools
- **Security:** Limited permissions
- **Stats:** 1 total users, 0 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$1.50 / 1,000 domain auditeds

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

## Email DNS Auditor: SPF, DKIM, DMARC, BIMI & MTA-STS

Audit **email authentication for any number of domains** in one run. For each domain you get a **0–100 score, an A–F grade, and a list of concrete issues with fixes**. It covers SPF, DMARC, DKIM, BIMI, MTA-STS, TLS-RPT, MX and the mailbox provider.

It runs on DNS only, so there's no browser, no proxies and no login. Paste domains, URLs or even email addresses (the part after `@` is used).

### Why use it

- **Cold email and lead gen:** check prospect or sending domains before a campaign, or qualify leads by their mail provider (Google Workspace, Microsoft 365, Zoho, Proofpoint, Mimecast…)
- **Gmail / Yahoo bulk-sender rules:** find domains with no DMARC, `p=none`, missing DKIM or a broken SPF
- **MSPs and agencies:** run a security audit across every client domain and export it to a sheet
- **Spoofing risk:** `spoofable: true` flags any domain where DMARC is missing or set to `p=none`
- **Monitoring:** schedule it daily with `onlyBelowScore` so you hear only about domains that slip

### What it checks

| Area | Details |
|---|---|
| **SPF** | Record, `all` qualifier, **recursive DNS-lookup count vs the RFC 7208 limit of 10**, void lookups, multiple records (permerror), `+all`, deprecated `ptr`, and recognised senders (SendGrid, Mailchimp, HubSpot, Amazon SES…) |
| **DMARC** | Policy `p` / `sp`, `pct`, `rua` / `ruf` report addresses, DKIM/SPF alignment, duplicate records |
| **DKIM** | Probes **44 common selectors** (google, selector1/2, k1–k3, s1/s2, mandrill, zoho, protonmail, fm1–3, sendgrid…) plus your own; approximate key size, revoked keys, wildcard detection |
| **MX** | Records, null MX, **mail provider** detection |
| **BIMI** | Record, logo URL, VMC certificate |
| **MTA-STS / TLS-RPT** | TXT records and the live policy file mode (`enforce` / `testing`) |
| **Extras** | DNSSEC-validated flag; SaaS verification tokens found in TXT (google, facebook, atlassian, openai, stripe…), which make a handy tech-stack signal |

### Input

```json
{
  "domains": ["github.com", "apify.com", "jane@stripe.com"],
  "dkimSelectors": ["mycustomselector"],
  "onlyBelowScore": 101
}
```

- `onlyBelowScore`: set it to `80` to output (and pay for) only domains graded C or worse
- `onlyCustomSelectors`: probe only your selectors, which is faster
- `dnsTransport`: `auto` (the default) uses plain DNS and falls back to DNS-over-HTTPS automatically

### Example result

```json
{
  "domain": "apify.com",
  "grade": "A",
  "score": 97,
  "spoofable": false,
  "mailProvider": "Google Workspace",
  "spfRecord": "v=spf1 include:_spf.google.com ... -all",
  "spfAllQualifier": "-all (fail)",
  "spfDnsLookups": 10,
  "dmarcPolicy": "reject",
  "dmarcRua": ["mailto:..."],
  "hasDkim": true,
  "dkimSelectorsFound": ["google"],
  "hasBimi": true,
  "mtaStsMode": "enforce",
  "issues": [{"severity": "warning", "area": "spf", "message": "SPF uses 10/10 DNS lookups; one more include will break it."}]
}
```

A `SUMMARY` record in the key-value store holds the grade distribution and counts of domains without SPF, DMARC or DKIM, plus spoofable domains.

### Scoring

The score starts at 100 and loses points for each problem. The biggest deductions are no SPF or no DMARC (−25 each), `+all` (−25), SPF over 10 lookups (−20), multiple SPF records (−20), `p=none` (−10), no DKIM found (−10) and no DMARC reports (−5). Grades are A ≥ 90, B ≥ 80, C ≥ 65, D ≥ 50, and F below that.

DKIM can't be listed from DNS, so it's found by probing selectors. A domain that uses an unusual selector can show `hasDkim: false` even though it signs mail. If you know the selector, add it in `dkimSelectors`.

### Pricing

**$1.50 per 1,000 domains** (pay-per-event, `domain-audited`). There's no start fee and you don't pay for platform usage. Domains whose DNS lookups fail are output with an `error` and **aren't charged**.

### FAQ

**Does it send email or connect to mail servers?** No. It only does public DNS lookups, plus one HTTPS request for the MTA-STS policy file.

**How fast is it?** About 1,000 domains in a few minutes at the default concurrency.

# Actor input Schema

## `domains` (type: `array`):

One per line. Bare domains, URLs or email addresses (the part after @ is used). Duplicates are removed.

## `dkimSelectors` (type: `array`):

Your own DKIM selectors to probe in addition to the 45 built-in common ones (google, selector1, selector2, k1, s1, mandrill, zoho, protonmail, ...).

## `onlyCustomSelectors` (type: `boolean`):

Skip the built-in selector list and probe only the selectors above (faster).

## `checkDkim` (type: `boolean`):

Probe DKIM selectors.

## `countSpfLookups` (type: `boolean`):

Recursively expand includes to count DNS lookups against the RFC 7208 limit of 10.

## `fetchMtaStsPolicy` (type: `boolean`):

When an MTA-STS TXT record exists, fetch https://mta-sts.<domain>/.well-known/mta-sts.txt for its mode.

## `onlyBelowScore` (type: `integer`):

Output (and pay for) only domains with a score below this value. 101 = output everything; 80 = only domains graded C or worse.

## `maxDomains` (type: `integer`):

Hard cap on domains per run.

## `maxConcurrency` (type: `integer`):

Domains audited in parallel.

## `dnsTimeoutSecs` (type: `integer`):

Timeout per DNS query.

## `nameservers` (type: `array`):

Resolver IPs to query.

## `dnsTransport` (type: `string`):

auto = plain DNS with automatic DNS-over-HTTPS fallback (Cloudflare / Google) if UDP is filtered or fails.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "apify.com",
    "stripe.com"
  ],
  "dkimSelectors": [],
  "onlyCustomSelectors": false,
  "checkDkim": true,
  "countSpfLookups": true,
  "fetchMtaStsPolicy": true,
  "onlyBelowScore": 101,
  "maxDomains": 10000,
  "maxConcurrency": 10,
  "dnsTimeoutSecs": 5,
  "nameservers": [
    "1.1.1.1",
    "8.8.8.8"
  ],
  "dnsTransport": "auto"
}
```

# Actor output Schema

## `results` (type: `string`):

Dataset with one row per domain

## `summary` (type: `string`):

Totals for the run

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "domains": [
        "github.com",
        "apify.com",
        "stripe.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("thomson-digital/email-dns-auditor").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "domains": [
        "github.com",
        "apify.com",
        "stripe.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("thomson-digital/email-dns-auditor").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "domains": [
    "github.com",
    "apify.com",
    "stripe.com"
  ]
}' |
apify call thomson-digital/email-dns-auditor --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,thomson-digital/email-dns-auditor"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/F9RTMhmEQLab31t7M/builds/qwxldhsFMaHNMjVOQ/openapi.json
