@emarketeer/spf-check
TypeScript icon, indicating that this package has built-in type declarations

1.1.0 • Public • Published

✉️ spf-check Build Status Coverage Status

This is a fork from mediamonks/node-spf-check

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.

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.

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

/@emarketeer/spf-check/

    Package Sidebar

    Install

    npm i @emarketeer/spf-check

    Weekly Downloads

    1

    Version

    1.1.0

    License

    MIT

    Unpacked Size

    46.2 kB

    Total Files

    13

    Last publish

    Collaborators

    • hamid_sajjadi
    • ayankovsky