1.0.3 • Published 4 years ago

python-spfcheck2 v1.0.3

Weekly downloads
3
License
MIT
Repository
github
Last release
4 years ago

python-spfcheck2

build status code coverage code style styled with prettier made with lass license npm downloads

Node.js wrapper around Python's spf.check2 function which conforms to both RFC4408 and RFC7208

Table of Contents

Requirements

  1. Ensure that you have a Python version of >= 3.5 installed per pyspf requirements (note that Python v3 is required because of a bug with DNS recursive CNAME lookups on v2.7):

    python3 --version
  2. Install the packages pyspf and dnspython:

    pip3 install pyspf
    pip3 install dnspython

Install

npm:

npm install python-spfcheck2

yarn:

yarn add python-spfcheck2

Usage

const spfCheck2 = require('python-spfcheck2');

const ip = '69.55.226.139';
const address = 'terry@wayforward.net';
const host = 'mx1.wayforward.net';

// then/catch usage
spfCheck2(ip, address, host)
  .then([result, explanation] => console.log(result, explanation))
  .catch(console.error);

// async/await usage
(async () => {
  try {
    const [ result, explanation ] = await spfCheck2(ip, address, host);
    console.log(result, explanation);
  } catch (err) {
    console.error(err);
  }
})();

Note that result is a String (which also corresponds to a particular explanation), see table below for the full list:

ResultExplanation
passsender SPF authorized
failSPF fail - not authorized
neutralpermanent error in processing
softfaildomain owner discourages use of this host
permerrorpermanent error in processing
temperrortemporary DNS error in processing
none
localNo SPF result due to local policy
trustedNo SPF check - trusted-forwarder.org
ambiguousNo error, but results may vary

An error is thrown if the child process itself (spf.check2) errors.

Contributors

NameWebsite
Nick Baughhttp://niftylettuce.com/

License

MIT © Nick Baugh

1.0.3

4 years ago

1.0.2

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.0.8

4 years ago

0.0.7

4 years ago

0.0.6

4 years ago

0.0.5

4 years ago

0.0.4

4 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago