# DMARC, SPF & DKIM Checker - Bulk Email Domain Audit (`hardreset83/dmarc-spf-dkim-checker`) Actor

Check SPF, DKIM, DMARC, MX, MTA-STS, TLS-RPT, BIMI and DNSSEC for thousands of domains. Get a grade, the email provider, the services each domain uses and clear fixes, in Excel, CSV or JSON.

- **URL**: https://apify.com/hardreset83/dmarc-spf-dkim-checker.md
- **Developed by:** [Flavio D'Orio](https://apify.com/hardreset83) (community)
- **Categories:** Developer tools, Lead generation, Marketing
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$3.00 / 1,000 domain checkeds

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

## DMARC, SPF & DKIM Checker (bulk email domain audit)

Check the email security of one domain or ten thousand at once. For every domain you get a **grade from A to F**,
the **email provider**, every problem in **SPF, DKIM and DMARC** with a clear fix, and the **services the company
uses** (marketing, CRM, support, collaboration), all read from public DNS. Results come as a table, JSON and a
ready **REPORT.xlsx** with the grades in color.

Since 2024 the big mailbox providers (Gmail, Yahoo, and Outlook since 2025) ask bulk senders for SPF, DKIM and a
DMARC policy. A domain that fails lands in spam or gets rejected. This Actor tells you which of your domains, or your
clients' domains, are ready and what to change.

### What it checks

- **SPF**: the record, the `all` qualifier (`-all`, `~all`, `?all`, `+all`), **DNS lookups against the limit of 10**
  (includes and redirects followed like a real mail server does), void lookups, duplicated records, typos, deprecated
  `ptr`.
- **DMARC**: policy (`none`, `quarantine`, `reject`), subdomain policy, `pct`, report addresses, alignment, the
  policy **inherited from the parent domain**, and whether an external report address has **authorized** the reports
  (when it has not, reports silently never arrive).
- **DKIM**: about 40 common selectors (Google, Microsoft, Mailchimp, SendGrid, Zoho, Proton and more) plus your own,
  with **key type and size**, revoked keys and test mode.
- **MX** and the **email provider** behind it (Google Workspace, Microsoft 365, Zoho, Proton, Mimecast, Proofpoint,
  OVHcloud, IONOS, GoDaddy and dozens more), null MX for domains that send no email.
- **MTA-STS** (with the policy mode), **TLS-RPT**, **BIMI** (logo and certificate) and **DNSSEC**.
- **Bulk sender ready**: SPF + DKIM + DMARC in place, in one yes/no column.
- **Services detected**: verification records and SPF includes reveal tools such as the email marketing platform,
  CRM, help desk, e-signature and collaboration apps.

### Who is it for

- **Email marketers and cold email teams**: check every sending domain before a campaign.
- **Agencies, MSPs and IT consultants**: audit all client domains in one run and send the Excel report.
- **Sales and lead generation**: find out which email provider and tools a company uses, from public DNS only.
- **Security teams**: see which domains can be spoofed, across a whole portfolio.
- **Developers, automations and AI agents**: clean JSON, works with Make, Zapier, n8n, webhooks and the Apify API.

### How to use it

1. Paste domains in **Domains** (website URLs and email addresses work too: only the domain is used), or upload a
   TXT/CSV file. The input is prefilled with two domains: press **Start** to see the result.
2. Optional: add your own DKIM selectors, pick the DNS resolver.
3. Open the **Storage** tab and download **REPORT.xlsx** (sheets *Domains* and *Issues*), or export the dataset in
   any format.

To monitor your domains, save the input as a **task** and add a **schedule** (for example every Monday), with an
email or Slack notification from the Apify integrations.

### Example output

```json
{
  "domain": "good-shop.example",
  "status": "ok",
  "grade": "A",
  "score": 98,
  "mailProvider": "Google Workspace",
  "spfStatus": "ok",
  "spfRecord": "v=spf1 include:_spf.google.com include:servers.mcsv.net -all",
  "spfAll": "-all",
  "spfDnsLookups": 5,
  "dmarcPolicy": "reject",
  "dmarcReports": "mailto:dmarc@good-shop.example",
  "dkimSelectorsFound": "google",
  "dkimKeys": [{"selector": "google", "keyType": "rsa", "keyBits": 2048, "revoked": false, "testing": false}],
  "mtaSts": "enforce",
  "tlsRpt": true,
  "bimi": false,
  "dnssec": true,
  "bulkSenderReady": true,
  "servicesDetected": ["Google Search Console", "Google Workspace", "Mailchimp"],
  "issuesCount": 0,
  "topIssue": "",
  "issues": []
}
```

Each item of `issues` has `severity` (critical, warning or info), `area` (SPF, DMARC, DKIM, MX, MTA-STS...), the
`issue` in plain words and the `fix`. The full SPF and DMARC analysis is in the `spf` and `dmarc` objects.

### Grades

The score (0-100) gives SPF up to 25 points, DMARC up to 30, DKIM 20, MX 10, MTA-STS 5, TLS-RPT 3, BIMI 2 and
DNSSEC 5. A: 90 and up, B: 75, C: 60, D: 40, F: below 40. Domains that send no email are not penalized for missing
DKIM, MTA-STS or BIMI: for them the best practice is `v=spf1 -all`, DMARC `p=reject` and a null MX.

### Pricing

**Pay per event: $3 per 1,000 domains checked** ($0.003 per domain). You pay only for domains that were checked:
domains that do not exist, duplicates and DNS errors are free. Set a maximum cost per run in the run options if you
like.

### FAQ

**Is it legal? Does it contact the mail servers?** It only reads public DNS records, the same data every mail
server reads before accepting an email. No email is sent and no mail server is contacted. For MTA-STS it reads the
public policy file the domain publishes for everyone.

**Why is DKIM "not found" when I know I have it?** DKIM keys are published under a selector name chosen by your
provider. If yours is not one of the common ones, add it in **Extra DKIM selectors** (the part before
`._domainkey`). When nothing at all exists under `_domainkey`, the Actor says so: that domain really does not sign
its email.

**How fast is it?** Around a thousand domains in a few minutes, with answers cached across domains.

**Can AI agents use it?** Yes: through the Apify API or the Apify MCP server, an agent can check domains and read
the JSON.

# Actor input Schema

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

Domains to check, one per line. Website URLs and email addresses work too: only the domain is used (the part before @ is thrown away). Duplicates are removed for free.

## `domainsFile` (type: `string`):

A TXT or CSV file with domains or website URLs in any column, for example an export from your CRM.

## `probeDkim` (type: `boolean`):

DKIM keys live under a selector name that only the sender knows. The Actor tries about 40 common selectors (Google, Microsoft, Mailchimp, SendGrid, Zoho and more).

## `extraDkimSelectors` (type: `array`):

Your own selectors, for example 's2024' or 'mailing' (the part before .\_domainkey).

## `detectServices` (type: `boolean`):

Reads the verification records and SPF includes in DNS to list services such as the email provider, marketing, CRM and support tools.

## `checkMtaStsPolicy` (type: `boolean`):

When a domain publishes MTA-STS, read its public policy file to report the mode (enforce, testing or none).

## `dnsResolver` (type: `string`):

The public DNS resolver to ask.

## `saveSpreadsheets` (type: `boolean`):

A ready Excel file with a Domains sheet (grades in color) and an Issues sheet with the fix for each problem, in the key-value store.

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

Stop after this many domains (0 = no limit). You can also set the maximum cost per run in the run options.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "example.com"
  ],
  "probeDkim": true,
  "extraDkimSelectors": [],
  "detectServices": true,
  "checkMtaStsPolicy": true,
  "dnsResolver": "cloudflare",
  "saveSpreadsheets": true,
  "maxDomains": 0
}
```

# Actor output Schema

## `domains` (type: `string`):

Every domain with its DMARC, SPF and DKIM results and the problems found.

## `report` (type: `string`):

REPORT.xlsx: every domain and every problem.

## `files` (type: `string`):

Every file of this run in the key-value store, with its link.

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

The result of the run in short: counts, totals, problems and the links to the files.

# 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": [
        "apify.com",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("hardreset83/dmarc-spf-dkim-checker").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": [
        "apify.com",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("hardreset83/dmarc-spf-dkim-checker").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": [
    "apify.com",
    "example.com"
  ]
}' |
apify call hardreset83/dmarc-spf-dkim-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,hardreset83/dmarc-spf-dkim-checker"
        }
    }
}
```

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/SmBgBLJVKlY8xbkcq/builds/VSQzoh1kjdapp4ZeR/openapi.json
