# spf-check

> SPF validator

Latest version **0.4.3** (published 2019-07-15) · MIT license · 0 weekly downloads

## Install

```sh
npm install spf-check
pnpm add spf-check
yarn add spf-check
bun add spf-check
```

## Health

**Score 15/100 (F)** — status: abandoned.

Positive: no vulnerabilities.

Warnings: low downloads; no types; no esm support; pre 1.0.

Negative: abandoned; low maintenance score.

## Facts

| | |
|---|---|
| Version | 0.4.3 |
| Published | 2019-07-15 |
| First published | 2019-01-15 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | none |
| Module format | CommonJS |
| Dependencies | 4 |
| Unpacked size | 30.4 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| Maintainers | devmonk |
| Keywords | spf, dns |

## Links

- npm: https://www.npmjs.com/package/spf-check
- npm.io page: https://npm.io/package/spf-check

## Dependencies (4)

- [tldjs](https://npm.io/package/tldjs.md) ^2.3.1
- [lodash](https://npm.io/package/lodash.md) ^4.17.11
- [ipaddr.js](https://npm.io/package/ipaddr.js.md) ^1.8.1
- [spf-parse](https://npm.io/package/spf-parse.md) ^1.0.4

## Recent versions

- 0.4.3 (latest) — 2019-07-15
- 0.4.1 — 2019-01-30
- 0.4.0 — 2019-01-15

## README

# ✉️  spf-check [![Build Status](https://travis-ci.org/mediamonks/node-spf-check.svg)](https://travis-ci.org/mediamonks/node-spf-check) [![Coverage Status](https://coveralls.io/repos/github/mediamonks/node-spf-check/badge.svg)](https://coveralls.io/github/mediamonks/node-spf-check)

[RFC4408]: https://tools.ietf.org/html/rfc4408
[RFC4408-2.5]: https://tools.ietf.org/html/rfc4408#section-2.5

Implements [RFC4408] Sender Policy Framework (SPF) `check_host()` validation.

## Install

    yarn add spf-check

## Usage

The stable API returns a string with one of the [possible returns][RFC4408-2.5].

```js
const spf = require('spf-check');
const result = spf(ip, domain, sender);

if (result === spf.Pass) {
    // Yay!
}
```

## API

This module also exports `SPF` and `SPFResult` classes to allow inspect the
result and read the expected message.

```js
const validator = new spf.SPF('mediamonks.com', 'info@mediamonks.com');

validator.check('185.16.22.2').then(result => {
    assert(result instanceof spf.SPFResult);

    if (result.result !== spf.Pass || result.result !== spf.Neutral) {
        console.error(result.message);
    }
});
```

## License

MIT © [MediaMonks](https://www.mediamonks.com/)

---
_Source: https://npm.io/package/spf-check · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
