Giter Club home page Giter Club logo

maildev's Introduction

MailDev

npm npm downloads Docker Pulls License JavaScript Style Guide

MailDev is sponsored by ⭐️ inngest/inngest.

Inngest is the developer platform for easily building reliable workflows with zero infrastructure. Check it out and give it a star! ⭐️

MailDev is a simple way to test your project's generated email during development, with an easy to use web interface that runs on your machine built on top of Node.js.

MailDev Screenshot

Docker Run

If you want to use MailDev with Docker, you can use the maildev/maildev image on Docker Hub. For a guide for usage with Docker, checkout the docs.

$ docker run -p 1080:1080 -p 1025:1025 maildev/maildev

Usage

Usage: maildev [options]
Options Environment variable Description
-s, --smtp <port> MAILDEV_SMTP_PORT SMTP port to catch mail
-w, --web <port> MAILDEV_WEB_PORT Port to run the Web GUI
--mail-directory <path> MAILDEV_MAIL_DIRECTORY Directory for persisting mail
--https MAILDEV_HTTPS Switch from http to https protocol
--https-key <file> MAILDEV_HTTPS_KEY The file path to the ssl private key
--https-cert <file> MAILDEV_HTTPS_CERT The file path to the ssl cert file
--ip <ip address> MAILDEV_IP IP Address to bind SMTP service to
--outgoing-host <host> MAILDEV_OUTGOING_HOST SMTP host for outgoing mail
--outgoing-port <port> MAILDEV_OUTGOING_PORT SMTP port for outgoing mail
--outgoing-user <user> MAILDEV_OUTGOING_USER SMTP user for outgoing mail
--outgoing-pass <password> MAILDEV_OUTGOING_PASS SMTP password for outgoing mail
--outgoing-secure MAILDEV_OUTGOING_SECURE Use SMTP SSL for outgoing mail
--auto-relay [email] MAILDEV_AUTO_RELAY Use auto-relay mode. Optional relay email address
--auto-relay-rules <file> MAILDEV_AUTO_RELAY_RULES Filter rules for auto relay mode
--incoming-user <user> MAILDEV_INCOMING_USER SMTP user for incoming mail
--incoming-pass <pass> MAILDEV_INCOMING_PASS SMTP password for incoming mail
--incoming-secure MAILDEV_INCOMING_SECURE Use SMTP SSL for incoming emails
--incoming-cert <path> MAILDEV_INCOMING_CERT Cert file location for incoming SSL
--incoming-key <path> MAILDEV_INCOMING_KEY Key file location for incoming SSL
--web-ip <ip address> MAILDEV_WEB_IP IP Address to bind HTTP service to, defaults to --ip
--web-user <user> MAILDEV_WEB_USER HTTP user for GUI
--web-pass <password> MAILDEV_WEB_PASS HTTP password for GUI
--base-pathname <path> MAILDEV_BASE_PATHNAME Base path for URLs
--disable-web MAILDEV_DISABLE_WEB Disable the use of the web interface. Useful for unit testing
--hide-extensions <extensions> MAILDEV_HIDE_EXTENSIONS Comma separated list of SMTP extensions to NOT advertise (SMTPUTF8, PIPELINING, 8BITMIME)
-o, --open Open the Web GUI after startup
-v, --verbose
--silent
--log-mail-contents Log a JSON representation of each incoming mail

API

MailDev can be used in your Node.js application. For more info view the API docs.

const MailDev = require("maildev");

const maildev = new MailDev();

maildev.listen();

maildev.on("new", function (email) {
  // We got a new email!
});

MailDev also has a REST API. For more info view the docs.

Outgoing email

Maildev optionally supports selectively relaying email to an outgoing SMTP server. If you configure outgoing email with the --outgoing-* options you can click "Relay" on an individual email to relay through MailDev out to a real SMTP service that will *actually* send the email to the recipient.

Example:

$ maildev --outgoing-host smtp.gmail.com \
          --outgoing-secure \
          --outgoing-user '[email protected]' \
          --outgoing-pass '<pass>'

Auto relay mode

Enabling the auto relay mode will automatically send each email to it's recipient without the need to click the "Relay" button mentioned above. The outgoing email options are required to enable this feature.

Optionally you may pass an single email address which Maildev will forward all emails to instead of the original recipient. For example, using --auto-relay [email protected] will forward all emails to that address automatically.

Additionally, you can pass a valid json file with additional configuration for what email addresses you would like to allow or deny. The last matching rule in the array will be the rule MailDev will follow.

Example:

$ maildev --outgoing-host smtp.gmail.com \
          --outgoing-secure \
          --outgoing-user '[email protected]' \
          --outgoing-pass '<pass>' \
          --auto-relay \
          --auto-relay-rules file.json

Rules example file:

[
  { "allow": "*" },
  { "deny": "*@test.com" },
  { "allow": "[email protected]" },
  { "deny": "*@utah.com" },
  { "allow": "[email protected]" }
]

This would allow [email protected], [email protected], [email protected], but deny [email protected].

Configure your project

Configure your application to send emails via port 1025 and open localhost:1080 in your browser.

Nodemailer (v1.0+)

// We add this setting to tell nodemailer the host isn't secure during dev
process.env.NODE_TLS_REJECT_UNAUTHORIZED = "0";

const transport = nodemailer.createTransport({
  port: 1025,
  // other settings...
});

Django -- Add EMAIL_PORT = 1025 in your settings file [source]

Rails -- config settings:

config.action_mailer.delivery_method = :smtp
    config.action_mailer.smtp_settings = {
        address: "localhost",
        port: 1025,
        enable_starttls_auto: false
    }

Drupal -- Install and configure SMTP module or use a library like SwiftMailer.

Features

  • Toggle between HTML, plain text views as well as view email headers
  • Test responsive emails with resizable preview pane available for various screen sizes
  • Ability to receive and view email attachments
  • WebSocket integration keeps the interface in sync once emails are received
  • Command line interface for configuring SMTP and web interface ports
  • Ability to relay email to an upstream SMTP server

Ideas

If you're using MailDev and you have a great idea, I'd love to hear it. If you're not using MailDev because it lacks a feature, I'd love to hear that too. Add an issue to the repo here.

Contributing

Any help on MailDev would be awesome. There is plenty of room for improvement. Feel free to create a Pull Request from small to big changes.

To run MailDev during development:

npm install
npm run dev

The "dev" task will run MailDev using nodemon and restart automatically when changes are detected. On *.scss file save, the css will also be recompiled. Using test/send.js, a few test emails will be sent every time the application restarts.

If you want to debug you can use the nodemon debug profile in VSCode. To change arguments or environment variables edit the .vscode\launch.json.

The project uses the JavaScript Standard coding style. To lint your code before submitting your PR, run npm run lint.

To run the test suite:

$ npm test

Thanks

MailDev is built on using great open source projects including Express, AngularJS, Font Awesome and two great projects from Andris Reinman: smtp-server and mailparser. Many thanks to Andris as his projects are the backbone of this app and to MailCatcher for the inspiration.

Additionally, thanks to all the awesome contributors to the project.

License

MIT

maildev's People

Contributors

adamc00 avatar audig avatar constfilin avatar damienbrz avatar dcrouch79 avatar delbertooo avatar dependabot[bot] avatar djfarrelly avatar dominikserafin avatar donut87 avatar ebourmalo avatar geoffreybooth avatar henryqdineen avatar jovanmaric avatar kgeis avatar lewebsimple avatar madflow avatar mbertram avatar micoli avatar oktapodia avatar peter-kolenic avatar rpaterson avatar seidr avatar soulteary avatar sponte avatar ssansh avatar sscovil avatar wms avatar wok avatar xavierpriour avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

maildev's Issues

Add API documentation

Would be great to create an markdown file with the REST API documentation as well as a potential future Node.js API documentation. The Node.js API could look something like:

var MailDev = require('maildev');

var maildev = new MailDev();

maildev.on('new', function(email){
  // do somehting
});

maildev.getAllEmail(function(err, emails){
  emails.forEach(function(email){
    console.log(email.subject);
  });
})

Google App Engine development server crashes MailDev

Hi, trying to test mail sending with Google App Engine (GAE) development server using MailDev and I get the following error after several tries of different configurations:

createCredentials() is deprecated, use tls.createSecureContext instead
events.js:85
throw er; // Unhandled 'error' event
^
Error: read ECONNRESET
at exports._errnoException (util.js:746:11)
at TCP.onread (net.js:559:26)

GAE configuration details here: https://cloud.google.com/appengine/docs/python/tools/devserver#Python_Using_Mail
Any pointer for a workaround, or areas to look for fix would be appreciated.

API doesn't work?

Hi,

I really would like to use MailDev in integration tests, but this example code

var MailDev = require('maildev');
maildev = new MailDev();

does not work for me.
I am getting this error

Uncaught TypeError: object is not a function

Any idea what I might be doing wrong?
Thanks,
Thomas

SMTP-Connection can't handle simple greeting

When the server sends a 250, which is an exceptionally good response, the whole application crashes.

Error: Invalid greeting from server:
250 2.0.0 Ok: queued as B4C8112124D
at SMTPConnection._actionGreeting (/usr/lib/node_modules/maildev/node_modules/smtp-connection/src/smtp-connection.js:611:23)
at SMTPConnection._processResponse (/usr/lib/node_modules/maildev/node_modules/smtp-connection/src/smtp-connection.js:511:16)
at SMTPConnection._onData (/usr/lib/node_modules/maildev/node_modules/smtp-connection/src/smtp-connection.js:357:10)
at CleartextStream.emit (events.js:95:17)
at CleartextStream. (stream_readable.js:765:14)
at CleartextStream.emit (events.js:92:17)
at emitReadable
(_stream_readable.js:427:10)
at _stream_readable.js:420:7
at process._tickCallback (node.js:442:13)

Relay to another email

Hi !

The ability to replace the recipient email address when clicking on "Relay" would be very convenient.

Have a good day !

Rewrite MailServer object as a class

The goal is to change the mailServer object that is exported in mailserver.js to a class that is instantiated instead of setup with the create method. The main purpose is to fully inherit from EventEmitter. This will allow for usage of once and allow it to behave more like an event emitter rather than the faking out it currently does.

This was kind of inspired by issues #89 and #90.

Emit sockets event on delete

Should delete and delete all emit events so that the frontend can react to deleted mail.

Currently, if one user deletes an item, other users still see it in the list and when they click on it they get shown the info landing page, and it's not intuitive that it's been deleted. They have to refresh the page to see the mail gone.

Maybe if a sockets event was emitted, the items could be removed from everyone's list.
Unless the user is actively looking at that item, in which case maybe you want some additional logic (the view that is currently shown can be left on screen until navigating elsewhere).

In fact, it looks like calling the Refresh logic is probably the desired result on delete.

Let me know your thoughts, and I might make a pull request later.

email immediately closing after click

Hi,

I'm using the docker version of maildev, and I have this weird issue that maildev catches the email but when I click on it, it opens for a millisecond and immediately closes again, so I can not see the email.

Email is plain text, nothing special about it... What is causing that?

Thanks!

Add off method

Right now there is no possibility to add multiple listeners, I mean you can do it, but will be truly nice to add "off" method, to detach particular listener.

Embedded images not displaying

Images embedded as base64 with Content-IDs, e.g: <img src="cid:{Content-ID}"/> are displaying as attachments but fail with net::ERR_UNKNOWN_URL_SCHEME in HTML view.

If you look at the Source view, you can see something along the lines of:

----boundary_1_...
Content-Type: image/png
Content-Transfer-Encoding: base64
Content-ID: <effcd49f6cec4e688d11ddd49cd6e9c5>

{Base64-Data}...

----boundary_1_...--

So maybe you can lookup the data related to the Content-ID in the img src, and in the html view replace the image with: <img src="data:{Content-Type};{Content-Transfer-Encoding},{Base64-Data}"/>?

Maildev install error on Ubuntu Server 14.04.2

Hello,

I've an error when I try to install Maildev on my local server with Ubuntu Server 14.04.2

npm http GET https://registry.npmjs.org/maildev
npm http 304 https://registry.npmjs.org/maildev
npm http GET https://registry.npmjs.org/mailcomposer
npm http GET https://registry.npmjs.org/open
npm http GET https://registry.npmjs.org/mailparser
npm http GET https://registry.npmjs.org/simplesmtp
npm http GET https://registry.npmjs.org/smtp-connection
npm http GET https://registry.npmjs.org/smtp-server
npm http GET https://registry.npmjs.org/socket.io
npm http GET https://registry.npmjs.org/commander
npm http GET https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/mailcomposer
npm http 304 https://registry.npmjs.org/open
npm http 304 https://registry.npmjs.org/mailparser
npm http 304 https://registry.npmjs.org/socket.io
npm http 304 https://registry.npmjs.org/commander
npm http 304 https://registry.npmjs.org/express
npm http 304 https://registry.npmjs.org/smtp-connection
npm http 304 https://registry.npmjs.org/smtp-server
npm http 304 https://registry.npmjs.org/simplesmtp
npm WARN engine [email protected]: wanted: {"node":">=0.12"} (current: {"node":"v0.10.25","npm":"1.3.10"})
npm http GET https://registry.npmjs.org/graceful-readlink
npm http GET https://registry.npmjs.org/he
npm http GET https://registry.npmjs.org/dkim-signer
npm http GET https://registry.npmjs.org/follow-redirects/0.0.3
npm http GET https://registry.npmjs.org/mimelib
npm http GET https://registry.npmjs.org/mime
npm http GET https://registry.npmjs.org/socket.io-client/1.3.6
npm http GET https://registry.npmjs.org/socket.io-adapter/0.3.1
npm http GET https://registry.npmjs.org/has-binary-data/0.1.3
npm http GET https://registry.npmjs.org/debug/2.1.0
npm http GET https://registry.npmjs.org/engine.io/1.5.2
npm http GET https://registry.npmjs.org/socket.io-parser/2.2.4
npm http GET https://registry.npmjs.org/rai
npm http GET https://registry.npmjs.org/xoauth2
npm http 304 https://registry.npmjs.org/graceful-readlink
npm http 304 https://registry.npmjs.org/mime
npm http 304 https://registry.npmjs.org/he
npm http 304 https://registry.npmjs.org/mimelib
npm http GET https://registry.npmjs.org/uue
npm http GET https://registry.npmjs.org/encoding
npm http GET https://registry.npmjs.org/mimelib
npm http 304 https://registry.npmjs.org/follow-redirects/0.0.3
npm http 304 https://registry.npmjs.org/has-binary-data/0.1.3
npm http 304 https://registry.npmjs.org/socket.io-adapter/0.3.1
npm http GET https://registry.npmjs.org/array-flatten/1.1.0
npm http GET https://registry.npmjs.org/content-type
npm http GET https://registry.npmjs.org/content-disposition/0.5.0
npm http GET https://registry.npmjs.org/cookie/0.1.3
npm http GET https://registry.npmjs.org/cookie-signature/1.0.6
npm http GET https://registry.npmjs.org/debug
npm http GET https://registry.npmjs.org/escape-html/1.0.2
npm http GET https://registry.npmjs.org/depd
npm http GET https://registry.npmjs.org/etag
npm http GET https://registry.npmjs.org/finalhandler/0.4.0
npm http GET https://registry.npmjs.org/fresh/0.3.0
npm http GET https://registry.npmjs.org/merge-descriptors/1.0.0
npm http GET https://registry.npmjs.org/methods
npm http GET https://registry.npmjs.org/on-finished
npm http GET https://registry.npmjs.org/parseurl
npm http GET https://registry.npmjs.org/path-to-regexp/0.1.6
npm http GET https://registry.npmjs.org/qs/4.0.0
npm http GET https://registry.npmjs.org/proxy-addr
npm http GET https://registry.npmjs.org/range-parser
npm http GET https://registry.npmjs.org/send/0.13.0
npm http GET https://registry.npmjs.org/serve-static
npm http GET https://registry.npmjs.org/type-is
npm http GET https://registry.npmjs.org/vary
npm http GET https://registry.npmjs.org/utils-merge/1.0.0
npm http GET https://registry.npmjs.org/accepts
npm http 304 https://registry.npmjs.org/socket.io-client/1.3.6
npm http 304 https://registry.npmjs.org/engine.io/1.5.2
npm http 304 https://registry.npmjs.org/dkim-signer
npm http 304 https://registry.npmjs.org/socket.io-parser/2.2.4
npm http 304 https://registry.npmjs.org/debug/2.1.0
npm http 304 https://registry.npmjs.org/xoauth2
npm http 304 https://registry.npmjs.org/encoding
npm http 304 https://registry.npmjs.org/mimelib
npm http 304 https://registry.npmjs.org/content-type
npm http 304 https://registry.npmjs.org/rai
npm http 304 https://registry.npmjs.org/cookie-signature/1.0.6
npm http 304 https://registry.npmjs.org/debug
npm http 304 https://registry.npmjs.org/cookie/0.1.3
npm http 304 https://registry.npmjs.org/array-flatten/1.1.0
npm http 304 https://registry.npmjs.org/content-disposition/0.5.0
npm http 304 https://registry.npmjs.org/escape-html/1.0.2
npm http 304 https://registry.npmjs.org/depd
npm http 304 https://registry.npmjs.org/etag
npm http 304 https://registry.npmjs.org/fresh/0.3.0
npm http 304 https://registry.npmjs.org/methods
npm http GET https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/on-finished
npm http GET https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/parseurl
npm http GET https://registry.npmjs.org/object-keys/1.0.1
npm http GET https://registry.npmjs.org/debug/1.0.2
npm http GET https://registry.npmjs.org/socket.io-parser/2.2.2
npm http 304 https://registry.npmjs.org/uue
npm http 304 https://registry.npmjs.org/proxy-addr
npm http 304 https://registry.npmjs.org/merge-descriptors/1.0.0
npm http 304 https://registry.npmjs.org/range-parser
npm http 304 https://registry.npmjs.org/path-to-regexp/0.1.6
npm http 304 https://registry.npmjs.org/serve-static
npm http 304 https://registry.npmjs.org/type-is
npm http 304 https://registry.npmjs.org/vary
npm http 304 https://registry.npmjs.org/utils-merge/1.0.0
npm http 304 https://registry.npmjs.org/accepts
npm http 304 https://registry.npmjs.org/punycode
npm http 304 https://registry.npmjs.org/underscore
npm http 304 https://registry.npmjs.org/send/0.13.0
npm http GET https://registry.npmjs.org/addressparser
npm http 304 https://registry.npmjs.org/object-keys/1.0.1
npm http 304 https://registry.npmjs.org/socket.io-parser/2.2.2
npm http 304 https://registry.npmjs.org/addressparser
npm http 304 https://registry.npmjs.org/debug/1.0.2
npm http GET https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/finalhandler/0.4.0
npm http GET https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/qs/4.0.0
npm http GET https://registry.npmjs.org/array.prototype.findindex
npm http GET https://registry.npmjs.org/extend
npm http 304 https://registry.npmjs.org/ms/0.6.2
npm http GET https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/debug/1.0.3
npm http GET https://registry.npmjs.org/engine.io-parser/1.2.1
npm http GET https://registry.npmjs.org/ws/0.7.2
npm http 304 https://registry.npmjs.org/iconv-lite
npm http 304 https://registry.npmjs.org/extend
npm http 304 https://registry.npmjs.org/debug/1.0.3
npm http 304 https://registry.npmjs.org/engine.io-parser/1.2.1
npm http 304 https://registry.npmjs.org/ws/0.7.2
npm http 304 https://registry.npmjs.org/array.prototype.findindex
npm http 304 https://registry.npmjs.org/base64id/0.1.0
npm http GET https://registry.npmjs.org/debug/0.7.4
npm http GET https://registry.npmjs.org/json3/3.2.6
npm http GET https://registry.npmjs.org/component-emitter/1.1.2
npm http GET https://registry.npmjs.org/benchmark/1.0.0
npm http GET https://registry.npmjs.org/unpipe
npm http GET https://registry.npmjs.org/ee-first/1.1.1
npm http GET https://registry.npmjs.org/forwarded
npm http GET https://registry.npmjs.org/media-typer/0.3.0
npm http GET https://registry.npmjs.org/ipaddr.js/1.0.1
npm http GET https://registry.npmjs.org/mime-types
npm http GET https://registry.npmjs.org/negotiator/0.5.3
npm http 304 https://registry.npmjs.org/json3/3.2.6
npm http 304 https://registry.npmjs.org/component-emitter/1.1.2
npm http GET https://registry.npmjs.org/statuses
npm http GET https://registry.npmjs.org/destroy/1.0.3
npm http GET https://registry.npmjs.org/http-errors
npm http GET https://registry.npmjs.org/mime/1.3.4
npm http GET https://registry.npmjs.org/ms/0.7.1
npm http 304 https://registry.npmjs.org/benchmark/1.0.0
npm http 304 https://registry.npmjs.org/unpipe
npm http 304 https://registry.npmjs.org/isarray/0.0.1
npm http 304 https://registry.npmjs.org/forwarded
npm http 304 https://registry.npmjs.org/mime-types
npm http 304 https://registry.npmjs.org/debug/0.7.4
npm http 304 https://registry.npmjs.org/statuses
npm http 304 https://registry.npmjs.org/media-typer/0.3.0
npm http 304 https://registry.npmjs.org/ipaddr.js/1.0.1
npm http 304 https://registry.npmjs.org/http-errors
npm http 304 https://registry.npmjs.org/ms/0.7.1
npm http 304 https://registry.npmjs.org/destroy/1.0.3
npm http 304 https://registry.npmjs.org/mime/1.3.4
npm http GET https://registry.npmjs.org/has-binary/0.1.6
npm http GET https://registry.npmjs.org/object-component/0.0.3
npm http GET https://registry.npmjs.org/indexof/0.0.1
npm http GET https://registry.npmjs.org/parseuri/0.0.2
npm http GET https://registry.npmjs.org/to-array/0.1.3
npm http GET https://registry.npmjs.org/backo2/1.0.2
npm http GET https://registry.npmjs.org/engine.io-client/1.5.2
npm http GET https://registry.npmjs.org/component-bind/1.0.0
npm http 304 https://registry.npmjs.org/negotiator/0.5.3
npm http 304 https://registry.npmjs.org/parseuri/0.0.2
npm http GET https://registry.npmjs.org/after/0.8.1
npm http GET https://registry.npmjs.org/arraybuffer.slice/0.0.6
npm http GET https://registry.npmjs.org/base64-arraybuffer/0.1.2
npm http GET https://registry.npmjs.org/blob/0.0.2
npm http GET https://registry.npmjs.org/has-binary/0.1.5
npm http GET https://registry.npmjs.org/utf8/2.0.0
npm http 304 https://registry.npmjs.org/to-array/0.1.3
npm http 304 https://registry.npmjs.org/backo2/1.0.2
npm http 304 https://registry.npmjs.org/has-binary/0.1.6
npm http 304 https://registry.npmjs.org/object-component/0.0.3
npm http 304 https://registry.npmjs.org/indexof/0.0.1
npm http 304 https://registry.npmjs.org/engine.io-client/1.5.2
npm http 304 https://registry.npmjs.org/ee-first/1.1.1
npm http 304 https://registry.npmjs.org/component-bind/1.0.0
npm http 304 https://registry.npmjs.org/after/0.8.1
npm http 304 https://registry.npmjs.org/arraybuffer.slice/0.0.6
npm http 304 https://registry.npmjs.org/blob/0.0.2
npm http 304 https://registry.npmjs.org/has-binary/0.1.5
npm http 304 https://registry.npmjs.org/utf8/2.0.0
npm http 304 https://registry.npmjs.org/base64-arraybuffer/0.1.2
npm http GET https://registry.npmjs.org/mime-db
npm http 304 https://registry.npmjs.org/mime-db
npm http GET https://registry.npmjs.org/inherits
npm http GET https://registry.npmjs.org/better-assert
npm http 304 https://registry.npmjs.org/inherits
npm http 304 https://registry.npmjs.org/better-assert
npm http GET https://registry.npmjs.org/bufferutil
npm http GET https://registry.npmjs.org/utf-8-validate
npm http GET https://registry.npmjs.org/options
npm http GET https://registry.npmjs.org/ultron
npm http 304 https://registry.npmjs.org/bufferutil
npm http GET https://registry.npmjs.org/callsite/1.0.0
npm http 304 https://registry.npmjs.org/utf-8-validate
npm http 304 https://registry.npmjs.org/options
npm http 304 https://registry.npmjs.org/ultron
npm http 304 https://registry.npmjs.org/callsite/1.0.0
npm http GET https://registry.npmjs.org/bindings
npm http GET https://registry.npmjs.org/nan
npm http 304 https://registry.npmjs.org/bindings
npm http 304 https://registry.npmjs.org/nan
npm http GET https://registry.npmjs.org/has-cors/1.0.3
npm http GET https://registry.npmjs.org/parsejson/0.0.1
npm http GET https://registry.npmjs.org/parseqs/0.0.2
npm http GET https://registry.npmjs.org/parseuri/0.0.4
npm http GET https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz
npm http GET https://registry.npmjs.org/component-inherit/0.0.3
npm http GET https://registry.npmjs.org/debug/1.0.4
npm http 304 https://registry.npmjs.org/has-cors/1.0.3
npm http 304 https://registry.npmjs.org/parsejson/0.0.1
npm http 304 https://registry.npmjs.org/parseqs/0.0.2
npm http 304 https://registry.npmjs.org/debug/1.0.4
npm http 304 https://registry.npmjs.org/component-inherit/0.0.3

> [email protected] install /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild

npm http 304 https://registry.npmjs.org/parseuri/0.0.4

> [email protected] install /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
npm http 200 https://github.com/rase-/node-XMLHttpRequest/archive/a6b6f2.tar.gz
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/engine.io/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
npm http GET https://github.com/component/global/archive/v2.0.1.tar.gz

> [email protected] install /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
> node-gyp rebuild


> [email protected] install /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
> node-gyp rebuild

npm http 200 https://github.com/component/global/archive/v2.0.1.tar.gz
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/utf-8-validate
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
/bin/sh: 1: node: not found
gyp: Call to 'node -e "require('nan')"' returned exit status 127. while trying to load binding.gyp
gyp ERR! configure error
gyp ERR! stack Error: `gyp` failed with exit code: 1
gyp ERR! stack     at ChildProcess.onCpExit (/usr/share/node-gyp/lib/configure.js:431:16)
gyp ERR! stack     at ChildProcess.EventEmitter.emit (events.js:98:17)
gyp ERR! stack     at Process.ChildProcess._handle.onexit (child_process.js:797:12)
gyp ERR! System Linux 3.16.0-30-generic
gyp ERR! command "nodejs" "/usr/bin/node-gyp" "rebuild"
gyp ERR! cwd /usr/local/lib/node_modules/maildev/node_modules/socket.io/node_modules/socket.io-client/node_modules/engine.io-client/node_modules/ws/node_modules/bufferutil
gyp ERR! node -v v0.10.25
gyp ERR! node-gyp -v v0.10.10
gyp ERR! not ok
npm WARN This failure might be due to the use of legacy binary "node"
npm WARN For further explanations, please read
/usr/share/doc/nodejs/README.Debian

npm WARN optional dep failed, continuing [email protected]
/usr/local/bin/maildev -> /usr/local/lib/node_modules/maildev/bin/maildev
[email protected] /usr/local/lib/node_modules/maildev
├── [email protected]
├── [email protected]
├── [email protected]
├── [email protected] ([email protected])
├── [email protected] ([email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected], [email protected])
├── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected])
└── [email protected] ([email protected], [email protected], [email protected], [email protected], [email protected], [email protected])

Do you have any idea ?

Export to eml

Hi all !

A new idea for you :)

The possibility to export one or more selected email to eml files.

Have a good day !

Bye !

Auto-relay mode

Hi !

Idea:

Add the ability to configure maildev in auto relay mode.
We could see in this case the emails that pass, but they would be transmitted to recipients.

Have a good day !

Save Emails in a DB

It should be possible to save emails.

I want use MailDev for my Website as Email Server

Add bounce address or return path address to email headers

Can the headers view get the bounce address added to it? This would be the from address that the smtp server sends initially, the envelope from or also the return path.

I'd be happy to help with pull requests or anything also. A push in the right direction would be helpful ;)

Group emails by to

It would be really useful if you can group the emails by recipient. Given that you wanna use that tool on a system that is sending out a lot emails to different recipients it is kinda hard to find the right email you are interested in at that moment. So having a email to first select recipient and then look at all the emails would be a huge improvement.

Deleting mails is slow - the entire screen redraws.

It's kind of hard to describe, but the whole screen refreshes whenever I delete an email. This makes deleting slow.

I guess it's not much of priority, but I left MailDev running for a few weeks as an open SMTP server (which does not relay anywhere, so it's not contributing to spam) and got hundreds of crappy emails that I have to delete. It's annoying that the refresh takes so long.

Would be very happy to contribute, if someone could give me a few pointers - I don't know angular so there's that learning curve too.

Small video of the whole refresh thing:
https://dl.dropboxusercontent.com/u/9470118/Recording%20%232.mp4

Write tests

Add test framework to be run via grunt. Need to test:

  • URLs
  • Attachments
  • UI

Refactor into smaller modules for npm

Refactor maildev into a standalone email receiver and break web GUI into separate module entirely.

Need to create a simple, easy to consume API for the maildev server that could be used as a standalone or hooked into another app.

Moving in this direction may make it easier to create a future wrapper using node-webkit or similar.

Unable to send 100 mails

Hi,

When I try to send 100 mails, I get this error :

Error: Invalid greeting from server:
451 ESMTP MailEnable Service temporarily refused connection at 11/27/15 11:25:27 from IP (2.13.169.206) because the server is too busy.
at SMTPConnection._actionGreeting (/opt/apps/maildev/node_modules/smtp-connection/src/smtp-connection.js:611:23)
at SMTPConnection._processResponse (/opt/apps/maildev/node_modules/smtp-connection/src/smtp-connection.js:511:16)
at SMTPConnection._onData (/opt/apps/maildev/node_modules/smtp-connection/src/smtp-connection.js:357:10)
at Socket.EventEmitter.emit (events.js:107:17)
at readableAddChunk (_stream_readable.js:159:16)
at Socket.Readable.push (_stream_readable.js:126:10)
at TCP.onread (net.js:514:20)

Maybe MailDev cannot send so many mails ?

Thanks & have a nice day !

Tag docker images

Hi,

Can you tag the maildev docker images in the Docker Hub with a specific version number instead of only latest? Thanks!

weird things happen. mail is accepted and never appears

hi. i am having a bit of an issue figuring something that i think might be filesystem related. i am running maildev in an lxc container. it's running fine, i can connect to both smtp and http port, UI looks ok, it accepts mails (i can also see "Temporary directory created at ..." and "Saving mail: ... ", the folder gets created, but after that i see nothing in the file system, and the UI doesn't show any mails.

root# node -v
v0.10.32

root# /usr/local/maildev/bin/maildev -V
0.5.2

a bit "unusual": i built my own node, and it is in a non-standard location (/usr/local/node-0.10.32) and so i have to set NODE_PATH accordingly for it to work.

any ideas what i should check / try?

Redesign UI

Remove twitter bootstrap and design new web UI.

MailDev preventing Node from exiting?

Hopefully there is a simple answer to my problem, but I couldn't find anything from searching past issues or the web.

I have a very simple Jasmine unit test set up where I programatically launch a MailDev server, send a few emails, validate they were received by MailDev and then shutdown. However, the moment I introduce a MailDev server into my test, it prevents Node from exiting after the tests are complete. Here's a reduced use case that causes the problem. The "Do nothing" test passes, then the Shut down message gets printed, but it looks like MailDev still has active handles/requests open, preventing Node from exiting.

beforeAll(function (done) {
    mailServer = new MailDev({
        smtp: port,
        web: 8082,
        verbose: false
    });
    mailServer.listen(function (err) {
        if (err) {
            console.log(err);
            return done.fail();
        }
        console.log('Started up');
        done();
    });
});

afterAll(function (done) {
    mailServer.end(function () {
        console.log('Shut down');
        done();
    });
});

it("Do nothing", function (done) {
    done();
});

The moment I comment out the listen and end calls (still need to call done), the problem goes away, so I'm pretty sure the issue in in MailDev itself. I hope I'm just doing something wrong on my end, but any help would be appreciated. Thanks.

Emails with <base> break embedded images

Related to #69 , if the email contains a tag on its head, the images will not show. For example:

<html>
<head><base href="http://example.com"/></head>
<body>
<img src="/email/cGVlFdin/attachment/myImage.png"/>
</body>
</html>

That's the HTML generated by MailDev, which looks correct, except that the image will be accessed at "http://example.com/email/cGVlFdin/attachment/myImage.png" instead of "http://localhost:1080/email/cGVlFdin/attachment/myImage.png"

Options on Docker image

Your application allow to set many options.

Would be great to be able to add it on the docker image, like the verbose one for example.

MailDev Crashes (socket.io)

io.configure is not possible with the newest socket.io thus maildev just crashes.

pls fix

easiest fix would be to use 0.9.17 in your package.json

Access to the SMTP from API

Hey guys, you did an awesome work.
I'm using your service in selenium tests, I'm catching emails after user registration. But I stuck with the issue, I cannot create just listener in nodejs code without creation new SMTP service, the problem appears when I run several tests in parallel.

How I see it should be:

  1. I launch SMTP in console: maildev
  2. From the code I create listener:
    var maildev = new MailDev(false); // -> for example *false* tells service do not create new instance, just connect to existing one maildev.on('new', function(email){ // We got a new email! });

Thanks in advance.

Attachements

Hello, is it possible to get the attachments working ?

postfix denies relayed mails

I'm using the docker image of v0.12.0.

I'm inserting simple mails using the unix mail command:

echo "teest" | mail -S 'smtp=smtp://localhost:1025' -s 'a subject' [email protected]

My outgoing configuration seems OK, but when I try to relay the above email postfix responds with

NOQUEUE: reject: RCPT from unknown[192.168.88.105]: 550 5.1.1 <null>: Recipient address rejected: User unknown in local recipient table; from=<> to=<null> proto=ESMTP helo=<[127.0.0.1]>

This appearently means that both From: and To: are empty.
I "fixed" this using a small patch, but I have no clue whether this is the correct approach ...

The patch is:

diff --git a/lib/mailserver.js b/lib/mailserver.js
index 02d7211..b617e5a 100644
--- a/lib/mailserver.js
+++ b/lib/mailserver.js
@@ -255,7 +255,16 @@ function relayMail(idOrMailObject, autoRelay, done) {

       var mailSendCallback = function(err, info) {

-        var recipients = mail.envelope.to.map(function(toItem) { return toItem.address; });
+        var get_address = function(address) {
+          email = address.address;
+          if (email === undefined) {
+            email = address;
+          }
+          return email;
+        }
+
+        var recipients = mail.envelope.to.map(get_address);
+        var sender = get_address(mail.envelope.from);

         if (autoRelay && mailServer.autoRelayRules) {
           recipients = getAutoRelayableRecipients(recipients);
@@ -267,7 +276,7 @@ function relayMail(idOrMailObject, autoRelay, done) {
         }

         mailServer.client.send({
-          from: mail.envelope.from.address,
+          from: sender,
           to: recipients
         }, rawEmailStream, function (err, info) {
           if (err) {

I'd be happy to create a merge request if you're willing to accept this patch.

Bug with attachments

Hi, from what it seems the latest attachment will be shown for all emails that have one.

Error: ECONNRESET on Email receive

Hello.
node -v: 0.12.4
npm version: 2.11.2

When running maildev and upon receiving an Email, maildev instantly crashes for me with the following log:

MailDev app running at 0.0.0.0:1080
MailDev SMTP Server running at 0.0.0.0:1025
createCredentials() is deprecated, use tls.createSecureContext instead
events.js:85
      throw er; // Unhandled 'error' event
            ^
Error: read ECONNRESET
    at exports._errnoException (util.js:746:11)
    at TCP.onread (net.js:559:26)

Any idea what it could be?

Steps to reproduce:

PS> npm install -g maildev
PS> maildev
Receive email from anywhere

Ability to run as daemon

Additionally, there should be an easy way to kill the process from the UI and the command line interface.

Create .app wrapper

Hi

It would be great if Maildev comes as a simple .app to start/stop the mail server.
You may use Platypus for this and ideally select the 'Web View' output type to show the inbox as the app's window.

Notification on receive

I didn't find any reference to this being supported, but it would be nice to have a desktop notification be sent when an email is received.

Add maildev.json for quick project configuration

So people can share maildev configurations across projects w/out the need for command line options. This would also deprecate the rules.json that a maildev user can use. Idea:

maildev.json

{
  "smtp": 1025,
  "web": 1080,
  "autoRelayRules": [
    { "allow": "*@allsafe.com" },
    { "deny":  "[email protected]" },
    { "allow": "*@evilcorp.com" },
  ]
}

Thoughts or input are greatly appreciated!

Move deps to package.json

I'd like to avoid bundling the Angular.js libs in app/components by moving them into package.json and creating the build via Browserify. This would make the repo smaller when installing from npm. After this is done all bower references should also be removed. This is not really crucial, but would be nice to tidy the repo up a bit.

  • normalize
  • Font Awesome
  • Angular

Show Version

Can we show the version somewhere on the Web-GUI?

Maildev on virtualbox

Hello, i work on virtualmachine.
On my vm, i installed debian7

When i execute the command 'maildev',that work but the problem is that the console is blocked by maildev.

Is there a solution for this problem?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.