You're Invited:Meet the Socket Team at BlackHat and DEF CON in Las Vegas, Aug 7-8.RSVP
Socket
Socket
Sign inDemoInstall

maileron

Package Overview
Dependencies
Maintainers
1
Versions
1
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

maileron

Server that receives SMTP and serves mail up as JSON via HTTP


Version published
Maintainers
1
Created

Readme

Source

Maileron build status

SMTP ==> HTTP REST JSON API

wtf

Stand-alone server for receiving email via SMTP and providing access to it via an HTTP REST JSON API. Useful for automated testing that requires receiving email and doing stuff with it. I wanted to be able to test things like the "forgot password" flow, or "email confirmation", from automated tests.

Currently has no persistence or notification. It just receives mail, serves up a mailbox as a JSON array, and lets you clear a mailbox with DELETE. That's it.

status

Prototype. Not ready for production use, but could be used for basic testing purposes.

install

npm install -g maileron

setup

sudo maileron

The sudo is required to listen to ports 25 and 80 for SMTP and HTTP, respectively. Without sudo, maileron will run on ports 9025 and 9080, which means it would only work with specially-configured mail clients.

Now, point your MX record for a domain (in my case, pat.agnoster.net) to the server running maileron (which for me is also pat.agnoster.net).

use

Send an email to example@pat.agnoster.net, for instance:

MAIL example@pat.agnoster.net
Subject: Hello World

How are you?

Then hit the webserver (in this example, pat.agnoster.net) and check it out (some values elided for clarity):

GET /inbox/example
200 OK
Content-type: application/json

[
  {
    "text": "How are you?",
    "headers": { ... },
    "subject": "Hello World",
    "from": [
      {
        "address": "i@agnoster.net",
        "name": "Isaac Wolkerstorfer"
      }
    ],
    "to": "example",
    "envelope": {
      "from": "agnoster@gmail.com",
      "to": ["example@pat.agnoster.net"],
      "date": "2012-08-23T17:50:20.013Z"
    }
  },
  ...
]

That's really all there is to it. You can DELETE a mailbox to clear it.

ideas

GET test.example.com/inbox/example.user.1/?limit=1&timeout=60

Wait for the next mail to come into this mailbox. This means you can easily do a DELETE, perform an action that should trigger an email, then issue a GET ?limit&timeout to wait for the email to show up.

license = MIT

Keywords

FAQs

Package last updated on 23 Aug 2012

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc