# Email Security Checker: SPF, DKIM, DMARC, MX (`required_truth/domain-email-security`) Actor

Audits the email setup of a list of domains from public DNS: SPF, DKIM, DMARC, MX, MTA-STS, TLS-RPT and BIMI records, the mail provider, a protection level and a plain-language list of problems. One row per domain.

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

## Pricing

$5.00 / 1,000 domains audited

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

Check how well a list of domains is protected against spoofed email. For every domain you get its SPF, DKIM and DMARC setup, the service that handles its mail, a protection level (`strong`, `partial` or `none`) and a short list of what is wrong, written in plain words.

**This Actor only reads public DNS records.** It never sends email, never contacts a mail server and never opens a connection to the domain. That makes it fast, and safe to run on domains you do not own, such as a prospect list or your suppliers.

### What people use it for

- **Audit your own domains** before a deliverability problem: find the missing DMARC record, the SPF record that needs too many lookups, the domain with two SPF records.
- **Qualify leads**: agencies and email-security or deliverability vendors find the companies whose DMARC policy is `none` or missing.
- **See who a company uses for email**: `mail_provider` (Google Workspace, Microsoft 365, Proofpoint and others) and `spf_includes` (the sending and marketing services listed in SPF).
- **Check suppliers and partners** for domains that anyone can send mail as.

### What it checks

- **MX**: the mail servers, most preferred first, whether the domain accepts mail at all, and the provider behind them.
- **SPF**: the record, what it says about senders that are not listed (`-all`, `~all`, `?all`, `+all`), how many DNS lookups it needs including its includes (the limit is 10), and the services it includes.
- **DMARC**: the record, the policy that applies to the domain (`none`, `quarantine`, `reject`), the share of mail it covers, and whether reports go anywhere. For a subdomain without its own record, the parent domain's record is used, as receivers do.
- **DKIM**: looks for keys under 47 selector names used by the large mail providers and sending services, plus any names you add. For each key found: type, size in bits, and whether it is revoked or in test mode. A domain that gives the same answer for every selector name is recognised (`dkim_wildcard`), so a blanket record is not mistaken for 47 keys.
- **MTA-STS, TLS-RPT and BIMI**: whether the records are published.

### Input

| Field | Type | Default | Notes |
|---|---|---|---|
| `domains` | list of strings | required | Up to 50,000 per run. Email addresses and web addresses are accepted: the domain is taken from them. |
| `checkDkim` | boolean | `true` | Turn off to check SPF, DMARC and MX only. |
| `dkimSelectors` | list of strings | `[]` | Extra selector names to try, up to 20. |

```json
{ "domains": ["github.com", "wikipedia.org", "example.com"] }
```

### Output

One row per domain in the dataset, plus a `SUMMARY` record with counts by status.

```json
{
  "input": "acme-example.com",
  "domain": "acme-example.com",
  "status": "ok",
  "protection": "partial",
  "issue_count": 2,
  "issues": [
    "DMARC policy is 'none': mail that fails the checks is reported but still delivered.",
    "SPF needs 12 DNS lookups. The limit is 10, and receivers may treat the record as broken."
  ],
  "domain_exists": true,
  "accepts_mail": true,
  "mx_found": true,
  "null_mx": false,
  "mx_hosts": ["aspmx.l.google.com", "alt1.aspmx.l.google.com"],
  "mail_provider": "Google Workspace",
  "spf_found": true,
  "spf_record": "v=spf1 include:_spf.google.com include:servers.mcsv.net include:sendgrid.net ~all",
  "spf_record_count": 1,
  "spf_all": "softfail",
  "spf_dns_lookups": 12,
  "spf_includes": ["_spf.google.com", "servers.mcsv.net", "sendgrid.net"],
  "dmarc_found": true,
  "dmarc_record": "v=DMARC1; p=none; rua=mailto:dmarc@acme-example.com",
  "dmarc_source_domain": "acme-example.com",
  "dmarc_policy": "none",
  "dmarc_subdomain_policy": null,
  "dmarc_pct": 100,
  "dmarc_reports": true,
  "dmarc_report_addresses": ["dmarc@acme-example.com"],
  "dkim_found": true,
  "dkim_selectors": ["google"],
  "dkim_keys": [{ "selector": "google", "key_type": "rsa", "key_bits": 2048, "revoked": false, "testing": false }],
  "dkim_selectors_checked": 47,
  "dkim_wildcard": false,
  "mta_sts_found": false,
  "mta_sts_record": null,
  "tls_rpt_found": false,
  "tls_rpt_record": null,
  "bimi_found": false,
  "bimi_record": null
}
```

#### Protection level

| Level | Meaning |
|---|---|
| `strong` | DMARC tells receivers to quarantine or reject all mail that fails the checks. |
| `partial` | SPF or DMARC is published, but failing mail is still delivered (policy `none`, a policy that covers only part of the mail, or SPF without DMARC). |
| `none` | Nothing published stops other people from sending mail as this domain. |

#### Status

| Status | Meaning | Charged |
|---|---|---|
| `ok` | The domain was checked in full. | Yes |
| `domain_not_found` | The domain does not exist in DNS. | No |
| `invalid_domain` | The input is not a domain name. | No |
| `lookup_failed` | A DNS lookup failed on our side. Run it again. | No |

### Price

You pay per domain checked in full: the `domain-audited` event. Domains that do not exist, input that is not a domain, duplicates and lookups that failed are returned without charge. Set a maximum charge for the run if you want a hard limit; the Actor stops when it is reached.

### Limits, said plainly

- **DKIM cannot be listed from DNS.** A domain may use any selector name. A key found is certain; no key found under the names tried is not proof that the domain has no DKIM. If you know the selector, add it under `dkimSelectors`.
- **No mailbox or server test.** The Actor does not check whether the mail servers answer, which TLS versions they offer or whether an address exists.
- **The MTA-STS policy file is not fetched.** Only the DNS record that announces it is read.
- **SPF macros are not expanded.** A record that uses them is counted as written.
- Records are read at the time of the run. DNS changes can take hours to reach every resolver.

### Tips

- Start with `protection` and `issue_count` to sort a long list, then read `issues` for the domains that matter.
- For lead lists, filter on `dmarc_policy` (`none` or empty) and `mail_provider`.
- For your own domains, run it after every change to SPF or DMARC: the lookup count changes whenever a provider you include changes its own record.

### What the Actor tells its developer

At the end of a run the Actor sends its developer one short, signed usage summary: the Actor's name, how many results the run was charged for, the run's ID and whether the account is on a paid plan. Your input and your results are never sent anywhere.

# Actor input Schema

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

The domains to check, one per line. Email addresses and web addresses are accepted too: the domain is taken from them. Up to 50,000 per run; each distinct domain is checked once.

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

Tries the selector names used by the large mail providers and sending services. Turn off for a faster check of SPF, DMARC and MX only.

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

Optional. Selector names to try in addition to the common ones, for example the name your sending service gave you. Up to 20.

## Actor input object example

```json
{
  "domains": [
    "github.com",
    "wikipedia.org",
    "example.com"
  ],
  "checkDkim": true,
  "dkimSelectors": []
}
```

# Actor output Schema

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

One row per domain.

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

Counts by status.

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

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

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

```

## MCP server setup

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

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/6LhPhXR9bQnlcq9fy/builds/LYB1xSTNI5ZdnZJgp/openapi.json
