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

python-arf

v0.0.3

Published

Node.js wrapper around the Python package arf, which is a processor for Abuse Reporting Format (ARF) messages.

Downloads

26

Readme

python-arf

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

Node.js wrapper around the Python package arf, which is a processor for Abuse Reporting Format (ARF) messages.

Table of Contents

Requirements

  1. Ensure that you have a Python version of >= 3.5 installed (we do not support older versions of Python anymore across the entire organization):

    python3 --version
  2. Install the package arf:

    pip3 install arf-mime

Install

npm:

npm install python-arf

yarn:

yarn add python-arf

Usage

Note that the source is an ARF message and can be a file path (String), String, or Buffer.

const arf = require('python-arf');

// then/catch usage
arf(source)
  .then(console.log)
  .catch(console.error);

// async/await usage
(async () => {
  try {
    const result = await arf(source);
    console.log(result);
  } catch (err) {
    console.error(err);
  }
})();

Note that result is an Object that looks like this:

{
  MessageHeaders: {
    Received: [
      'from example.com (example.com [10.0.1.11])    by example.net with ESMTP id O63d4137594e46; Thu, 08 Mar 2005 16:00:00 -0400',
      'from mailserver.example.net (mailserver.example.net [192.0.2.1]) by example.com with ESMTP id M63d4137594e46; Thu, 08 Mar 2005 14:00:00 -0400'
    ],
    From: '<[email protected]>',
    Date: 'Thu, 8 Mar 2005 17:40:36 EDT',
    Subject: 'FW: Earn money',
    To: '<[email protected]>',
    MimeVersion: '1.0',
    ContentType: 'multipart/report; report-type=feedback-report; boundary="part1_13d.2e68ed54_boundary"'
  },
  OriginalMessageHeaders: {
    From: '<[email protected]>',
    Received: 'from mailserver.example.net (mailserver.example.net [192.0.2.1]) by example.com with ESMTP id M63d4137594e46; Thu, 08 Mar 2005 14:00:00 -0400',
    To: '<Undisclosed Recipients>',
    Subject: 'Earn money',
    MimeVersion: '1.0',
    ContentType: 'text/plain',
    MessageId: '[email protected]',
    Date: 'Thu, 02 Sep 2004 12:31:03 -0500'
  },
  FeedbackReport: {
    FeedbackType: 'abuse',
    UserAgent: 'SomeGenerator/1.0',
    Version: '1',
    OriginalMailFrom: '<[email protected]>',
    OriginalRcptTo: '<[email protected]>',
    ArrivalDate: 'Thu, 8 Mar 2005 14:00:00 EDT',
    ReportingMta: 'dns; mail.example.com',
    SourceIp: '192.0.2.1',
    AuthenticationResults: 'mail.example.com; spf=fail [email protected]',
    ReportedDomain: 'example.net',
    ReportedUri: [ 'http://example.net/earn_money.html', 'mailto:[email protected]' ],
    RemovalRecipient: '[email protected]'
  },
  OriginalMessagePayload: 'From: <[email protected]>\n' +
    'Received: from mailserver.example.net (mailserver.example.net\n' +
    '\t[192.0.2.1]) by example.com with ESMTP id M63d4137594e46;\n' +
    '\tThu, 08 Mar 2005 14:00:00 -0400\n' +
    'To: <Undisclosed Recipients>\n' +
    'Subject: Earn money\n' +
    'MIME-Version: 1.0\n' +
    'Content-type: text/plain\n' +
    'Message-ID: [email protected]\n' +
    'Date: Thu, 02 Sep 2004 12:31:03 -0500\n' +
    '\n' +
    'Spam Spam Spam\n' +
    'Spam Spam Spam\n' +
    'Spam Spam Spam\n' +
    'Spam Spam Spam'
}

Therefore if you wanted to access the original message payload in the ARF report (which is what we needed to do in Forward Email, then you'd retrieve it via result.OriginalMessagePayload.

Contributors

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

License

MIT © Nick Baugh