New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

ethereal-email

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

ethereal-email

Create ethereal email addresses on the fly from your application.

  • 1.0.0
  • latest
  • Source
  • npm
  • Socket score

Version published
Maintainers
1
Created
Source

Ethereal Email

Create ethereal email addresses on the fly from your application.

EtherealEmail acquires a new email address from ethereal.email and starts listening for messages sent to this address.

This is useful for testing email applications where you want to use vanity addresses but also to be able to test how the final message looks like. There is an actual roundtrip over the internet so the message received by @ethereal.email addresses should look exactly like messages received by everybody else.

Usage

Retrieve parsed email

The mail object received is a simpleParser object documented in the MailParser docs.

'use strict';
const EtherealEmail = require('ethereal-email');

let inbox = new EtherealEmail();

inbox.on('email', email => {
    console.log('Listening for messages sent to <%s>', email);
});

inbox.connect(mail => {
    console.log('NEW MAIL!');
    console.log(mail);
});

Retrieve raw email stream

If you want to parse the incoming message yourself, then set raw to true

'use strict';
const EtherealEmail = require('ethereal-email');

let inbox = new EtherealEmail({
    raw: true
});

inbox.on('email', email => {
    console.log('Listening for messages sent to <%s>', email);
});

inbox.connect(mail => {
    console.log('NEW MAIL!');
    mail.pipe(process.stdout);
});

How does it work?

There is a MX server running on ethereal.email that proxies all messages to the connected clients, using randomly generated addresses. When your client connects to this server, then a random address is generated and all messages sent to this address are proxied to your client. If the connection between your client and the server breaks, then the address is lost forever.

License

EUPL-1.1

FAQs

Package last updated on 05 Feb 2017

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

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc