# Email Security Check: SPF, DMARC, DKIM & MX (`kacperor/email-security-dns-check`) Actor

Bulk-check how well domains are protected against email spoofing: SPF, DMARC policy, DKIM keys, MX and mail provider, MTA-STS, BIMI. Score, grade and a plain-language fix list per domain.

- **URL**: https://apify.com/kacperor/email-security-dns-check.md
- **Developed by:** [Kacper Kruszka](https://apify.com/kacperor) (community)
- **Categories:** Developer tools, Lead generation
- **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 domains

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 Security Check: SPF, DMARC, DKIM & MX

Check how well any domain is protected against email spoofing and phishing — in bulk. For each domain you get the mail provider, SPF, DMARC policy, DKIM keys found, MTA-STS, TLS reporting, BIMI and DNSSEC, plus a **score out of 100, a grade A–F and a plain-language list of what to fix**.

It reads public DNS through Google Public DNS over HTTPS. No login, no browser, no proxy — hundreds of domains finish in a minute.

### What you can do with it

- **Lead generation for IT and email agencies** — find companies whose domain can be spoofed (no DMARC, `p=none`, SPF `+all`) and offer them a fix.
- **Deliverability checks** — Gmail and Yahoo require SPF, DKIM and DMARC from bulk senders; see which of your clients' domains would fail.
- **Vendor and supplier due diligence** — spot partners whose domains are easy to impersonate in invoice fraud.
- **Monitoring your own domains** — run it on a schedule and watch for a DMARC record or SPF include that disappeared.

### Input

| Field | What it does |
|---|---|
| `domains` | Domains, URLs or email addresses: `example.com`, `https://shop.com`, `info@company.com` |
| `dkimSelectors` | Optional extra DKIM selectors to try (common ones like `google`, `selector1`, `selector2`, `default`, `k1`, `s1` are always tried) |
| `maxConcurrency` | Domains checked in parallel (default 5) |

### Output (one row per domain)

Real output from a run on 23 Nov 2026 (long records shortened here).

````json
{
  "domain": "apify.com",
  "domainExists": true,
  "mailProvider": "Google Workspace",
  "mx": [
    {
      "priority": 1,
      "host": "aspmx.l.google.com"
    },
    {
      "priority": 5,
      "host": "alt1.aspmx.l.google.com"
    }
  ],
  "spf": {
    "found": true,
    "record": "v=spf1 a mx include:_spf.google.com include:mailgun.org incl…",
    "all": "fail (-all)",
    "lookups": 6,
    "multiple": false
  },
  "dmarc": {
    "found": true,
    "record": "v=DMARC1; p=reject; sp=reject; pct=100; rua=mailto:dmarc-rep…",
    "policy": "reject",
    "subdomainPolicy": "reject",
    "pct": 100,
    "reporting": true
  },
  "dkim": {
    "selectorsChecked": 13,
    "selectorsFound": [
      "google"
    ]
  },
  "mtaSts": true,
  "tlsRpt": true,
  "bimi": true,
  "dnssec": true,
  "score": 100,
  "grade": "A",
  "issues": [],
  "spfPolicy": "fail (-all)",
  "dmarcPolicy": "reject",
  "dkimFound": true,
  "checkedAt": "2026-11-23T21:54:20.049Z",
  "error": null
}```

The table view shows grade, score, provider, SPF and DMARC policy, DKIM, MTA-STS and the issue list. A `SUMMARY` record in the key-value store counts grade-A domains and domains without SPF or DMARC.

### How the score works

SPF present and ending in `-all`/`~all`, DMARC present and enforcing (`quarantine` or `reject`, with reports), a DKIM key on a known selector and an MX record carry most of the points; MTA-STS, TLS-RPT and BIMI add a few. DNSSEC is reported but not scored.

### Limits

- DKIM keys live under a selector chosen by the sender. If a domain uses a custom selector, add it in `dkimSelectors`; otherwise "no DKIM found" means "not on the common selectors".
- The check reads DNS only. It does not send email or connect to mail servers.

### Pricing

Pay per event: you pay only for domains checked and saved to the dataset. Domains that fail with an error are saved with the error text.



# Actor input Schema

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

Domains, website URLs or email addresses, e.g. example.com, https://shop.com or info@company.com.
## `dkimSelectors` (type: `array`):

Optional. Selectors to try besides the common ones (google, selector1, selector2, default, k1, s1…).
## `maxConcurrency` (type: `integer`):

How many domains are checked at once.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "apify.com"
  ],
  "dkimSelectors": [],
  "maxConcurrency": 5
}
````

# Actor output Schema

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

No description

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

No description

# 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"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("kacperor/email-security-dns-check").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",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("kacperor/email-security-dns-check").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"
  ]
}' |
apify call kacperor/email-security-dns-check --silent --output-dataset

```

## MCP server setup

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

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/Vu40uYdWHnsdhXFN0/builds/HEuA2kvoGXxBgBELD/openapi.json
