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 🙏

© 2024 – Pkg Stats / Ryan Hefner

authheaders

v2.0.2

Published

Node.js wrapper around the Python pip package authheaders

Downloads

24

Readme

authheaders

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

Node.js wrapper around the Python pip package authheaders exposing a function to generate Authentication-Results headers

Table of Contents

Requirements

  1. Ensure that you have a Python version of >= 3.6 installed.

    python3 --version
  2. Install the package authheaders from our fork which contains a fix (until https://github.com/ValiMail/authentication-headers/pull/6 is merged and released):

    pip3 install git+https://github.com/forwardemail/authentication-headers.git
  3. Install dnspython v1.16.0:

    pip3 install dnspython==1.16.0
  4. Install pyspf:

    pip3 install pyspf

Install

npm:

npm install authheaders

yarn:

yarn add authheaders

Usage

authenticateMessage

const fs = require('fs');

const { authenticateMessage } = require('authheaders');

const message = fs.readFileSync('/path/to/example.eml');
const authservId = 'mx.example.com';
const ip = '1.2.3.4';
const mailFrom = 'example.net';
const helo = 'domain.of.sender.example.net';

// then/catch usage
authenticateMessage(message, authservId, ip, mailFrom, helo)
  .then(console.log)
  .catch(console.error);

// async/await usage
(async () => {
  try {
    const result = await authenticateMessage(message, authservId, ip, mailFrom, helo);
    console.log(result);
  } catch (err) {
    console.error(err);
  }
})();

The value of result is an Object with properties header (String), and Objects for spf, dkim, arc, and dmarc.

These Objects contain a result (String) and conditionally a reason (String) value.

An example result object is provided below:

{
  header: 'example.com; spf=none smtp.helo=domain.of.sender.net smtp.mailfrom=test.com; dkim=pass header.d=forwardemail.net; arc=pass; dmarc=fail (Used From Domain Record) header.from=gmail.com policy.dmarc=none',
  spf: { result: 'none' },
  dkim: { result: 'pass' },
  arc: { result: 'pass' },
  dmarc: { policy: 'none', result: 'fail', reason: 'Used From Domain Record' }
}

Contributors

| Name | Website | | -------------- | -------------------------- | | Nick Baugh | http://niftylettuce.com/ |

License

MIT © Nick Baugh