# Email Security Checker: SPF, DMARC, DKIM, MTA-STS & BIMI Audit (`data_factory_nerd/email-security-checker`) Actor

Audit email security for thousands of domains: SPF validity with 10-lookup count, DMARC policy and reports, DKIM selector discovery and key size, MX provider, MTA-STS, TLS-RPT, BIMI, DNSSEC. Get a 0-100 score, A-F grade, spoofable flag and exact fixes. $2 per 1,000 domains.

- **URL**: https://apify.com/data_factory_nerd/email-security-checker.md
- **Developed by:** [Joe Pena](https://apify.com/data_factory_nerd) (community)
- **Categories:** Developer tools, Lead generation, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $1.80 / 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.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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

### What is Email Security Checker?

**Email Security Checker** audits the email authentication setup of any number of domains and tells you, in plain words, **what is broken and how to fix it**. For each domain you get:

- **SPF**: record, validity, `-all` / `~all` qualifier, the **recursive DNS-lookup count** (the 10-lookup limit that silently breaks SPF), every include and the **sending services** it authorizes (Google, Microsoft 365, SendGrid, Mailchimp, HubSpot, Salesforce…)
- **DMARC**: policy (none / quarantine / reject), subdomain policy, pct, rua/ruf report addresses, alignment, and inheritance from the parent domain
- **DKIM**: automatic discovery across **40+ common selectors** (google, selector1/2, k1, s1, mandrill, zendesk…) plus your own, with key type, **key size** (1024 vs 2048-bit) and revoked keys
- **MX** and email provider, null MX, **MTA-STS** (DNS + policy mode), **TLS-RPT**, **BIMI** (logo + VMC) and **DNSSEC**
- A **0–100 score**, **A–F grade**, a **spoofable** flag and a **prioritized issue list with the exact fix** for each problem

Everything is read from public DNS (DNS over HTTPS). No emails are sent and no mailboxes are probed. Invalid inputs and DNS failures are listed in the run SUMMARY and not charged.

> Need registrar, creation/expiry dates or domain availability instead? Use our [Domain WHOIS & DNS Lookup](https://apify.com/data_factory_nerd/domain-whois-dns-lookup). This Actor goes deep on email security only.

### What data can you get?

| Field | Example |
|---|---|
| `grade` / `score` / `spoofable` | A / 92 / false |
| `issues` | \[{"severity": "low", "check": "SPF", "message": "SPF uses 10 of 10 allowed DNS lookups…", "fix": "Remove unused includes…"}] |
| `mxProvider` / `acceptsEmail` | Microsoft 365 / true |
| `spfAllQualifier` / `spfDnsLookups` / `spfValid` | ~all (soft fail) / 10 / true |
| `spfSenders` | \["Mailchimp", "Marketo", "Microsoft 365", "Salesforce", "SendGrid", "Zendesk"] |
| `dmarcPolicy` / `dmarcSubdomainPolicy` / `dmarcPct` | quarantine / reject / 100 |
| `dmarcRua` | \["mailto:dmarc@github.com"] |
| `dkimSelectorsFound` | \[{"selector": "google", "keyType": "rsa", "keyBits": 2048}] |
| `mtaSts` / `tlsRpt` / `bimi` / `dnssec` | {"mode": "enforce"} / v=TLSRPTv1… / {"logoUrl": "…svg"} / true |

### Use cases

- 📬 **Cold email and deliverability teams**: check sending domains before a campaign; catch SPF over 10 lookups, missing DKIM or p=none
- 🛡️ **Security audits and MSPs**: grade every client or vendor domain and hand over a fix list
- 🎯 **Lead generation**: find companies with spoofable domains or weak setups (great for email-security, IT and MSP sales), and see which tools they send with
- 🧾 **Compliance**: prove Gmail/Yahoo bulk-sender requirements (SPF, DKIM, DMARC) across all your brands
- 🔁 **Monitoring**: schedule it weekly to catch DNS changes that break authentication

### How to check SPF, DMARC and DKIM in bulk

1. Paste **Domains** (domains, URLs or email addresses all work).
2. Optional: add your own **Extra DKIM selectors**.
3. Click **Start** and download the audits as JSON, CSV or Excel from the **Output** tab.

#### Input example

```json
{
  "domains": ["github.com", "shopify.com", "sales@example.com", "https://www.paypal.com"],
  "dkimSelectors": ["mycompany2024"]
}
```

#### Output example

```json
{
  "domain": "github.com",
  "grade": "A",
  "score": 92,
  "spoofable": false,
  "mxProvider": "Microsoft 365",
  "spfAllQualifier": "~all (soft fail)",
  "spfDnsLookups": 10,
  "spfSenders": ["Mailchimp", "Marketo", "Microsoft 365", "Salesforce", "SendGrid", "Zendesk"],
  "dmarcPolicy": "quarantine",
  "dmarcSubdomainPolicy": "reject",
  "dmarcPct": 100,
  "dkimSelectorsFound": [{"selector": "google", "keyType": "rsa", "keyBits": 2048, "revoked": false}],
  "issues": [
    {"severity": "low", "check": "SPF", "message": "SPF uses 10 of 10 allowed DNS lookups; one more include will break it.", "fix": "Remove unused includes before adding new senders."},
    {"severity": "low", "check": "DKIM", "message": "A 1024-bit DKIM key is in use.", "fix": "Rotate to a 2048-bit RSA key."}
  ]
}
```

### How is the score calculated?

Start at 100. Each **high** issue (no SPF, SPF over 10 lookups, +all, no DMARC, multiple records) costs 25 points, each **medium** issue (DMARC p=none, no DKIM found, ?all) 12, each **low** issue (1024-bit DKIM, pct < 100, no DMARC reports) 4. MTA-STS in enforce mode and BIMI add small bonuses. Grades: A ≥ 90, B ≥ 75, C ≥ 60, D ≥ 40, F below. `spoofable` is true unless DMARC enforces quarantine or reject on 100% of mail.

### How much does it cost?

**Pay per result: $2.00 per 1,000 domains** ($0.002 per domain).

- Auditing 500 prospect domains costs $1.
- A weekly check of 50 client domains costs about $0.40 a month.
- Apify's free plan includes $5 of monthly usage, enough for about 2,500 domains.

### API example

```python
from apify_client import ApifyClient

client = ApifyClient("<YOUR_APIFY_TOKEN>")
run = client.actor("data_factory_nerd/email-security-checker").call(run_input={"domains": ["github.com", "shopify.com"]})
for d in client.dataset(run["defaultDatasetId"]).iterate_items():
    print(d["domain"], d["grade"], d["dmarcPolicy"], [i["message"] for i in d.get("issues", [])])
```

### FAQ

#### Why does "SPF DNS lookups" matter?

SPF allows at most 10 DNS-querying mechanisms (include, a, mx, ptr, exists, redirect), counted recursively. Above 10, receivers return a permanent error and SPF fails, even though the record "looks fine". Most simple checkers don't count nested includes; this one does.

#### No DKIM was found but I'm sure we sign mail. Why?

DKIM keys live under a selector name that can't be listed from DNS. We check 40+ common selectors; if your provider uses a custom one, add it under **Extra DKIM selectors**. You can find it in the `s=` tag of the DKIM-Signature header of any email you send.

#### Do you send test emails or check mailboxes?

No. It only reads public DNS records (and the public MTA-STS policy file when one is published).

#### Found a bug or need a check?

Open an issue on the **Issues** tab. We reply quickly.

### Related Actors by data_factory_nerd

| Actor | What it does |
|---|---|
| [SEC EDGAR Filings Scraper](https://apify.com/data_factory_nerd/sec-edgar-filings-scraper) | 10-K, 10-Q, 8-K and full-text search of all SEC filings |
| [GitHub Repository Search Scraper](https://apify.com/data_factory_nerd/github-repo-search-scraper) | Search GitHub repos or list an org's repos with stars, topics, license and activity |
| [Domain WHOIS & DNS Lookup](https://apify.com/data_factory_nerd/domain-whois-dns-lookup) | Registrar, creation/expiry dates, availability and DNS records in bulk |
| [Tech Stack Detector](https://apify.com/data_factory_nerd/tech-stack-detector) | Which CMS, analytics, payments and frameworks a website uses |
| [SAM.gov Contract Opportunities](https://apify.com/data_factory_nerd/sam-gov-contract-opportunities) | Federal bids with NAICS, set-asides, deadlines and contacts |
| [Multi-ATS Jobs Scraper](https://apify.com/data_factory_nerd/ats-jobs-scraper) | Jobs from 6 ATS (Lever, Ashby, Workable…) in one schema |
| [Workday Jobs Scraper](https://apify.com/data_factory_nerd/workday-jobs-scraper) | Every job from any myworkdayjobs.com careers site |

# Actor input Schema

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

Domains, URLs or email addresses (the domain part is used). One per line, up to many thousands.

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

Your own DKIM selectors to check, in addition to 40+ common ones (google, selector1, selector2, k1, s1, mandrill...).

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

When a domain publishes MTA-STS, download its policy to report mode and max_age.

## `maxItems` (type: `integer`):

Stop after this many domains (controls cost). 0 = no limit.

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

Lower it if you see DNS failures.

## Actor input object example

```json
{
  "domains": [
    "apify.com",
    "github.com",
    "example.com"
  ],
  "fetchMtaStsPolicy": true,
  "maxItems": 0,
  "maxConcurrency": 20
}
```

# Actor output Schema

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

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

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

```

## MCP server setup

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