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

smtpeshka

v0.1.0

Published

Virtual SMTP-server for debugging mail messages third-party applications

Downloads

6

Readme

smtpeshka Build Status

NPM

Virtual SMTP-server for debugging mail messages third-party applications

Overview

Virtual SMTP-server based on Haraka Mail Server using plug-ins. E-mail messages sent by third-party applications are not sent to the address. E-mail message are written to JSON file.

Installation

Installation is fairly straightforward, just install the npm module:

$ npm install -g smtpeshka

Running smtpeshka

Create a project for to store your sent messages and config files.

$ mkdir my-smtp-test
$ cd my-smtp-test
$ smtpeshka

Now configure your mail application to send emails via SMTP:

SMTP host: localhost
SMTP port: 2525

Start your application with these settings and send any e-mail message. Your message will not be sent to the address. This message is saved in the folder sent-emails your project my-smtp-test.

Web

Sent messages can be viewed in a browser at http://localhost:2580

API

GET localhost:2580/api

E-mail list

[
  {
    "html": <p>Hello World!</p>",
    "text": "Hello World!",
    "headers": {
      "received": "from person.local (ip6-localhost [::1]) by Server ...",
      "date": "Thu, 22 Jan 2015 23:09:13 +0300",
      "to": "[email protected]",
      "from": "E-mail Tester <>",
      "subject": "Hello",
      "message-id": "5684b0c0bd9a38962535083a3d5c79dc",
      "x-priority": "normal"
    },
    "subject": "Hello",
    "messageId": "5684b0c0bd9a38962535083a3d5c79dc",
    "priority": "normal",
    "from": [
      {
        "address": "info@localhost",
        "name": "Local Server"
      }
    ],
    "to": [
      {
        "address": "[email protected]",
        "name": "User"
      }
    ],
    "date": "2015-01-22T20:09:13.000Z"
  }
]

GET localhost:2580/api/email/:messageId

E-mail by message-id

{
    "html": <p>Hello World!</p>",
    "text": "Hello World!",
    "headers": {
      "received": "from person.local (ip6-localhost [::1]) by Server ...",
      "date": "Thu, 22 Jan 2015 23:09:13 +0300",
      "to": "[email protected]",
      "from": "E-mail Tester <>",
      "subject": "Hello",
      "message-id": "5684b0c0bd9a38962535083a3d5c79dc",
      "x-priority": "normal"
    },
    "subject": "Hello",
    "messageId": "5684b0c0bd9a38962535083a3d5c79dc",
    "priority": "normal",
    "from": [
      {
        "address": "info@localhost",
        "name": "Local Server"
      }
    ],
    "to": [
      {
        "address": "[email protected]",
        "name": "User"
      }
    ],
    "date": "2015-01-22T20:09:13.000Z"
  }

GET localhost:2580/api/status

Status SMTPeshka

{
  "web": {
    "port": 2580
  },
  "SMTP": {
    "port": 2525
  },
  "transport": {
    "json": {
      "saveto": "/home/user/my-smtp-test/sent-emails"
    }
  },
  "haraka": {
    "prog": {
        "dir": "/usr/local/lib/node_modules/smtpeshka/node_modules/Haraka"
     },
    "config": {
      "source": {
        "dir": "/usr/local/lib/node_modules/smtpeshka/haraka-def"
      },
      "build": {
        "dir": "/tmp/smtpeshka/haraka"
      }
    }
  }
}

Configuration

SMTPeshka can be configured using JSON in a smtpeshka.json in directory run the SMTPehska. For example:

"log": {
    "console": {
        "level": "debug"
    }
},
"web": {
    "port": 12580
},
"SMTP": {
    "port": 12525
},
"transport": {
    "json": {
        "saveto": "<%= directory %>/my-emails"
    }
},
"haraka": {
    "config": {
        "build": {
            "dir": "<%= directory %>/tmp"
        }
    }
}

License

MIT