# Domain Email Security Audit - SPF, DMARC, DKIM, MTA-STS, DNSSEC (`noisy_jubilee/domain-email-security-audit`) Actor

Bulk-check domains for SPF (10-lookup limit), DMARC, DKIM key size, MTA-STS, TLS-RPT, BIMI, CAA, DNSSEC and HTTPS certificate expiry. Score, grade and fix list per domain.

- **URL**: https://apify.com/noisy_jubilee/domain-email-security-audit.md
- **Developed by:** [Stephen](https://apify.com/noisy_jubilee) (community)
- **Categories:** Developer tools, Marketing
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $3.00 / 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.

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

## Domain Email Security Audit — SPF, DMARC, DKIM, MTA-STS, DNSSEC

Paste a list of domains, get one row per domain with a **0–100 score, an A–F grade and a prioritised fix list**, plus the raw findings:

| Check | What you get |
|---|---|
| **SPF** | Record, `all` qualifier, includes, **recursive DNS-lookup count vs the RFC 7208 limit of 10**, `ptr` use, duplicate records |
| **DMARC** | Policy, subdomain policy, pct, alignment; falls back to the organisational domain and tells you when the policy is inherited. Report addresses are shown as `mailto:***@domain` (mailbox removed) |
| **DKIM** | Keys found at ~36 common selectors + your own, key type and **RSA key size** (flags < 2048-bit), revoked keys |
| **MX** | MX hosts, **null MX** (RFC 7505) detection |
| **MTA-STS** | `_mta-sts` TXT, policy file from `https://mta-sts.<domain>/.well-known/mta-sts.txt` (RFC 8461), mode, and whether every MX is covered |
| **TLS-RPT, BIMI** | Presence and settings |
| **CAA** | Allowed certificate authorities (inherited from parent zones per RFC 8659) |
| **DNSSEC** | Signed (DS at parent) and validated (AD flag from a validating resolver) |
| **HTTPS** | Certificate issuer, TLS version and **days until expiry** |

Domains without MX are treated as non-mail domains: they're scored on the "don't let anyone spoof me" basics (SPF `-all`, DMARC reject) instead of being penalised for missing DKIM/MTA-STS.

### Who it's for

- **Agencies, MSPs and IT consultants** auditing client portfolios before Google/Yahoo/Microsoft bulk-sender rules bite.
- **Cold-email / deliverability teams** checking sending domains every week (schedule it and diff the results with any dataset-diff Actor).
- **Security teams** monitoring brand domains for weak DKIM keys, missing DMARC or expiring certificates.

### Pricing (pay per event)

| Event | Price |
|---|---|
| Domain audited | **$0.003** per domain |
| Actor start (Apify standard, once per run) | $0.0003 |

Invalid domains and domains that don't exist (NXDOMAIN) are **free**. 1,000 domains = $3. Set "Maximum cost per run" and the Actor stops cleanly when it's reached.

### Input example

```json
{ "domains": ["example.com", "https://www.cloudflare.com/", "postmaster@yourcompany.co.jp"], "dkimSelectors": ["s2048"] }
```

### Output example

Real output for `example.com`: [listing/output-example.json](listing/output-example.json). Each row has `domain`, `status`, `score`, `grade`, `issues[]` (severity, code, message, points) and one object per check (`spf`, `dmarc`, `dkim`, `mx`, `mtaSts`, `tlsRpt`, `bimi`, `caa`, `dnssec`, `https`).

### How it works / responsible use

- All data comes from **public DNS**, by default through Cloudflare's public resolver 1.1.1.1 over DNS-over-HTTPS (no API key; Cloudflare's resolver privacy commitments apply). About 40–60 small DNS queries per domain.
- The only HTTP request is the **MTA-STS policy file at the fixed well-known URL defined by RFC 8461** (published precisely so that senders fetch it automatically), sent without following redirects as the RFC requires. The HTTPS check opens one TLS handshake to port 443 and reads the certificate; no pages are crawled.
- **No personal data is collected or stored**: no WHOIS, no SOA contact mailbox, and email addresses in DMARC/TLS-RPT/CAA records are reduced to their domain.
- Connections to private/internal IP addresses are refused.
- DKIM selectors can't be enumerated, so "DKIM not found" means "not at the selectors tried" — add your provider's selector.

### Limits

- The score is our own weighting, not an industry standard. It is a checklist, not a deliverability guarantee.
- DNS answers come from one resolver at one moment; changes still propagating may not show yet.
- Default memory 256 MB; our test run (1 domain) peaked at 55 MB.

Not affiliated with Google, Microsoft, Yahoo, Cloudflare or any mailbox provider.

### No warranty

Provided as is, without warranty of any kind. Results are automated and can be incomplete or wrong; check anything important against the original source before relying on it.

# Actor input Schema

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

Domain names to audit. URLs and email addresses are accepted and reduced to their domain (the mailbox part of an email address is discarded and never stored). A leading www. is removed.

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

DKIM selectors to try in addition to ~36 common ones (google, selector1, selector2, k1, s1, mandrill, ...). DKIM selectors cannot be enumerated from DNS, so add your provider's selector for an accurate result.

## `checkHttps` (type: `boolean`):

Open one TLS connection to <domain>:443 to read the certificate issuer and expiry. Nothing else is requested from the web server.

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

Where DNS queries are sent. DoH gives DNSSEC validation (AD flag).

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

How many domains are audited at the same time.

## `maxDnsConcurrency` (type: `integer`):

Upper bound on simultaneous DNS-over-HTTPS queries (be gentle with the public resolver).

## Actor input object example

```json
{
  "domains": [
    "example.com",
    "cloudflare.com"
  ],
  "dkimSelectors": [],
  "checkHttps": true,
  "dnsResolver": "doh",
  "maxConcurrency": 5,
  "maxDnsConcurrency": 20
}
```

# Actor output Schema

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

One row per domain: SPF, DMARC, DKIM, MX, MTA-STS, TLS-RPT, BIMI, CAA, DNSSEC, HTTPS, score, grade, issues.

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

SUMMARY record in the default key-value store: counts, charges and status of the run.

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

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

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

```

## MCP server setup

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

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/ddkRcqIyU8pcgn0PG/builds/KAFunpuHTgvguJ5vD/openapi.json
