npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

email-security-check

v1.0.0

Published

Fast, zero-dependency email security scanner. Checks DMARC, SPF, DKIM, MTA-STS, BIMI, and DANE for any domain.

Downloads

20

Readme

email-security-check

Fast, zero-dependency email security scanner for Node.js. Checks DMARC, SPF, DKIM, MTA-STS, BIMI, and DANE records for any domain.

6 checks. 1 function call. 0 dependencies.

npx email-security-check google.com
  email-security-check v1.0.0
  ─────────────────────────────────────
  Scanning google.com ...

  Score: ██████████████████████████░░░░ 87/100  A

  [OK] DMARC     PASS     p=reject
       DMARC reject — spoofed emails are blocked. Well configured.

  [OK] SPF       PASS     -all
       SPF configured with -all (hardfail). 4 DNS lookups.

  [OK] DKIM      PASS     found
       DKIM selectors found: google.

  [~ ] MTA-STS   MEDIUM   mode=testing
       MTA-STS is in testing mode — failures are reported but mail is still delivered without TLS.

  [OK] BIMI      PASS     full
       BIMI configured with logo and VMC authority certificate.

  [- ] DANE      LOW      missing
       No TLSA records for MX hosts. DANE is uncommon but provides strong TLS authentication when present.

Install

npm install email-security-check

Usage

As a library

import { scan } from "email-security-check";

const result = await scan("example.com");

console.log(result.grade);           // "A+" | "A" | "B" | "C" | "D" | "F"
console.log(result.score);           // 0-100
console.log(result.dmarc.policy);    // "reject" | "quarantine" | "none"
console.log(result.spf.all_qualifier); // "-all" | "~all" | "?all" | "+all"
console.log(result.dkim.selectors_found); // ["google", "selector1"]
console.log(result.mta_sts.mode);    // "enforce" | "testing" | "none"
console.log(result.mx_hosts);        // ["mx1.example.com", "mx2.example.com"]

Individual checks

import { checkDmarc, checkSpf, checkDkim, checkMtaSts, checkBimi, checkDane } from "email-security-check";

const dmarc = await checkDmarc("example.com");
const spf   = await checkSpf("example.com");
const dkim  = await checkDkim("example.com", ["google", "selector1"]);

CLI

# Pretty output
email-security-check example.com

# JSON output (pipe to jq, scripts, CI)
email-security-check example.com --json

# Custom DKIM selectors
email-security-check example.com --selectors default,google,o365

CI/CD Integration

# .github/workflows/email-security.yml
name: Email Security Audit
on:
  schedule:
    - cron: "0 9 * * 1"  # Every Monday at 9am
jobs:
  check:
    runs-on: ubuntu-latest
    steps:
      - run: npx email-security-check your-domain.com --json > report.json
      - run: |
          GRADE=$(cat report.json | jq -r '.grade')
          if [[ "$GRADE" =~ ^(D|F)$ ]]; then
            echo "::error::Email security grade is $GRADE"
            exit 1
          fi

What gets checked

| Check | What | RFC / Standard | |----------|-------------------------------------------|----------------------| | DMARC | Policy, pct, rua/ruf, subdomain policy | RFC 7489 | | SPF | Mechanism, all qualifier, lookup count | RFC 7208 | | DKIM | Selector enumeration (22 common selectors)| RFC 6376 | | MTA-STS | DNS record + policy file + mode | RFC 8461 | | BIMI | Logo URL + VMC authority | IETF Draft | | DANE | TLSA records on MX hosts | RFC 7672 |

Scoring

Each finding carries a severity weight:

| Severity | Weight | Example | |----------|--------|----------------------------------| | Critical | -40 | No DMARC, SPF +all | | High | -25 | DMARC p=none, no SPF | | Medium | -10 | SPF ~all, no DKIM selectors found| | Low | -3 | No MTA-STS, no BIMI | | Pass | 0 | Correctly configured |

Score = 100 - sum(weights). Grade: A+ (90+), A (80+), B (70+), C (60+), D (40+), F (<40).

API Reference

scan(domain, options?)

| Parameter | Type | Description | |-----------|------|-------------| | domain | string | Domain to scan (with or without protocol) | | options.dkim_selectors | string[] | Custom DKIM selectors to check | | options.timeout | number | MTA-STS fetch timeout in ms (default: 5000) | | options.follow_includes | boolean | Reserved for future SPF include resolution |

Returns: Promise<ScanResult>

ScanResult

{
  domain: string;
  score: number;          // 0-100
  grade: string;          // A+ through F
  scanned_at: string;     // ISO 8601
  findings: Finding[];    // All 6 findings
  dmarc: DmarcResult;
  spf: SpfResult;
  dkim: DkimResult;
  mta_sts: MtaStsResult;
  bimi: BimiResult;
  dane: DaneResult;
  mx_hosts: string[];
}

Why this exists

Most email security tools are either SaaS-only, outdated, or pull in a tree of dependencies for what is fundamentally DNS lookups. This package uses only Node.js built-in dns and https modules — nothing else.

Built by DC INFOSEC for automated compliance scanning at scale.

License

MIT