# Email Domain Security Checker: SPF, DMARC, DKIM, MX Grade (`evenwork/email-domain-security-checker`) Actor

Bulk-check domains for SPF, DMARC, DKIM, MX, MTA-STS, TLS-RPT and BIMI. Each domain gets an A to F grade, a list of problems and the exact DNS fix.

- **URL**: https://apify.com/evenwork/email-domain-security-checker.md
- **Developed by:** [Evenwork](https://apify.com/evenwork) (community)
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.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/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 Domain Security Checker

Paste in a list of domains, website URLs or email addresses. For each domain you get a grade from A to F, every SPF, DMARC, DKIM and MX problem found, and the DNS change that fixes it.

It reads public DNS only. It sends no email and does not log in anywhere.

### What it checks

| Check | What you get |
|---|---|
| MX | Mail servers, the mail provider (Google Workspace, Microsoft 365, Zoho, Fastmail, Mimecast and 17 more), null MX for domains that take no mail |
| SPF | The record, whether it is valid, the `all` ending (`-all`, `~all`, `?all`, `+all`), the DNS lookup count against the limit of 10, duplicate records, broken `include:` targets and include loops |
| DMARC | The record, the policy (`none`, `quarantine`, `reject`), `pct`, whether reports go anywhere (`rua`), and the policy a subdomain inherits from its parent |
| DKIM | Keys found on about 40 common selectors, plus any selectors you add |
| MTA-STS, TLS-RPT, BIMI | Whether each record is published |

### Why it matters

Google's email sender guidelines ask every sender to Gmail for SPF or DKIM, and anyone sending more than 5,000 messages a day to Gmail for SPF, DKIM and DMARC. A domain with no DMARC record, or with `p=none`, gives receiving servers no instruction to block mail that fails SPF and DKIM, so spoofed mail in your name is more likely to get through.

### Input

```json
{
  "domains": ["example.com", "https://www.example.co.uk/contact", "info@example.org"],
  "checkDkim": true,
  "dkimSelectors": ["mail2024"],
  "concurrency": 20,
  "maxDomains": 0
}
```

Duplicates are removed, and `www.` is dropped. Entries that are not a domain, URL or email address are skipped and listed in the log.

### Output

One row per domain:

```json
{
  "domain": "example.co.uk",
  "grade": "C",
  "score": 65,
  "mailProvider": "Microsoft 365",
  "mxHosts": ["example-co-uk.mail.protection.outlook.com"],
  "spfRecord": "v=spf1 include:spf.protection.outlook.com -all",
  "spfValid": true,
  "spfAll": "-all",
  "spfLookups": 1,
  "dmarcRecord": "v=DMARC1; p=none",
  "dmarcPolicy": "none",
  "dmarcPct": 100,
  "dmarcReporting": false,
  "dkimSelectorsFound": ["selector1"],
  "mtaSts": false,
  "tlsRpt": false,
  "bimi": false,
  "issues": [
    "DMARC policy is p=none: mail that fails checks is not blocked",
    "DMARC has no rua= address, so nobody receives the reports"
  ],
  "fixes": [
    "Move DMARC to p=quarantine, then p=reject, once your reports show all real mail passes",
    "Add rua=mailto:<address> to the DMARC record"
  ],
  "checkedAt": "2026-11-25T09:00:00+00:00"
}
```

Download it as CSV, Excel or JSON, or use the Overview table in the run.

### How the score works

Out of 100: MX 10, SPF valid 20 (plus 5 for `-all` or `~all`), DMARC present 15 (plus 15 for `quarantine` or 20 for `reject`, plus 5 for reports, minus 5 if `pct` is below 100), DKIM key found 15, MTA-STS 5, TLS-RPT 5. A is 85 or more, B 70, C 55, D 40, F below 40.

### Pricing

$2 per 1,000 domains checked ($0.002 a domain). A domain that does not exist still counts as checked. If a DNS lookup fails twice (timeout or no nameserver answering), the row says so and you are not charged for it. Apify also charges $0.00005 each time a run starts (once per GB of memory; this actor's default is under 1 GB).

### Limits

- DKIM has no public index, so a key on a custom selector is only found if you add that selector to `dkimSelectors`. "No DKIM key found" means none on the selectors tried.
- The parent domain used for DMARC inheritance is worked out with a simple rule (the last two labels, or three under suffixes such as `.co.uk`), not the full public suffix list.
- Lookups go to public resolvers (Cloudflare, Google, Quad9). Records changed in the last few minutes may not show yet.

# Actor input Schema

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

Domains to check. Website URLs and email addresses also work: the domain is taken from them. Duplicates are removed.

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

Try about 40 common DKIM selectors (Google, Microsoft 365, Zoho, Fastmail, Mailchimp, SendGrid and others). DKIM has no index, so a key on a custom selector can only be found if you add it below.

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

Your own DKIM selectors, e.g. 'mail2024'. Checked on every domain as well as the common ones.

## `concurrency` (type: `integer`):

1 to 50.

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

Stop after this many domains. 0 means no limit.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "gov.uk",
    "example.com"
  ],
  "checkDkim": true,
  "concurrency": 20,
  "maxDomains": 0
}
```

# Actor output Schema

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

One row per domain: grade, SPF, DMARC, DKIM, MTA-STS, problems and fixes.

# 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",
        "gov.uk",
        "example.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("evenwork/email-domain-security-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",
        "gov.uk",
        "example.com",
    ] }

# Run the Actor and wait for it to finish
run = client.actor("evenwork/email-domain-security-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",
    "gov.uk",
    "example.com"
  ]
}' |
apify call evenwork/email-domain-security-checker --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,evenwork/email-domain-security-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/LIflv7x2nukBlPC9Z/builds/FA88wk32lhIt7Xy9v/openapi.json
