MailDev logo

MailDev

Local SMTP server for testing emails during development

MailDev provides a simple SMTP server and web interface for capturing and viewing emails generated during development, eliminating the need for external mail services.

MailDev banner

Overview

Overview

MailDev is a lightweight development tool built on Node.js that captures outgoing emails from your application and displays them in an intuitive web interface. Designed for developers who need to test email functionality without sending real messages, it runs entirely on your local machine.

Key Capabilities

The tool provides a complete SMTP server (default port 1025) that intercepts emails, paired with a web GUI (default port 1080) for viewing message content, headers, and attachments. Optional features include email persistence to disk, selective relay to real SMTP servers for integration testing, and auto-relay mode with configurable allow/deny rules.

Integration & Deployment

MailDev integrates seamlessly with popular frameworks including Nodemailer, Django, and Rails through simple port configuration. Deploy via npm package, Docker container (maildev/maildev), or embed directly in Node.js applications using the programmatic API. Authentication options for both SMTP and web interfaces support team environments, while HTTPS support enables secure local testing.

Highlights

Built-in SMTP server with web UI for viewing captured emails
Docker support and Node.js API for flexible deployment
Selective email relay to real SMTP servers for integration testing
Auto-relay mode with configurable allow/deny filtering rules

Pros

  • Zero-configuration startup for immediate local email testing
  • Clean web interface for inspecting email content and attachments
  • Optional persistence and relay features for advanced workflows
  • Works with any framework or library that supports SMTP

Considerations

  • Requires Node.js runtime or Docker for deployment
  • Not designed for production email handling or high volume
  • Web interface lacks advanced search or filtering capabilities
  • Auto-relay rules require manual JSON file configuration

Managed products teams compare with

When teams consider MailDev, these hosted platforms usually appear on the same shortlist.

Mailinator logo

Mailinator

Disposable email testing inboxes with public and private domains

Mailosaur logo

Mailosaur

Email & SMS testing with disposable inboxes and phone numbers

MailReach logo

MailReach

Email warm-up and spam testing to boost inbox placement

Looking for a hosted option? These are the services engineering teams benchmark against before choosing open source.

Fit guide

Great for

  • Local development teams testing transactional email flows
  • CI/CD pipelines requiring email verification without external services
  • Debugging email templates and content before production deployment
  • Integration testing with selective relay to staging SMTP servers

Not ideal when

  • Production email delivery or customer-facing mail services
  • Load testing high-volume email sending scenarios
  • Teams requiring advanced email analytics or tracking
  • Environments without Node.js or Docker availability

How teams use it

Password Reset Flow Testing

Developers verify reset email content and links without sending to real user addresses during feature development

CI/CD Email Verification

Automated tests capture and validate email output in pipelines without external SMTP dependencies or credentials

Staging Environment Relay

QA teams review emails locally, then selectively relay approved messages to real addresses for end-to-end testing

Multi-Framework Development

Teams working across Django, Rails, and Node.js projects use a single tool for consistent email testing

Tech snapshot

SCSS55%
JavaScript23%
HTML22%
Shell1%
Dockerfile1%

Tags

smtp-servermailcatchernodemailerdevelopmenttestingsmtpmaildevnodejsdeveloper-toolsdocker

Frequently asked questions

How do I configure my application to use MailDev?

Point your application's SMTP settings to localhost port 1025. For example, in Django add EMAIL_PORT = 1025, or configure Nodemailer with port: 1025. Then access the web interface at localhost:1080.

Can MailDev send emails to real recipients?

Yes, using the relay feature. Configure outgoing SMTP settings with --outgoing-host and credentials, then click 'Relay' on individual emails or enable --auto-relay mode to forward all messages automatically.

Does MailDev persist emails between restarts?

Only if you specify --mail-directory with a file path. By default, emails are stored in memory and lost when MailDev stops.

Can I use MailDev in Docker containers?

Yes, the official maildev/maildev image is available on Docker Hub. Run with docker run -p 1080:1080 -p 1025:1025 maildev/maildev to expose both the SMTP and web ports.

How do I secure the web interface?

Use --web-user and --web-pass to add HTTP basic authentication. For encrypted connections, enable --https with --https-key and --https-cert pointing to your SSL certificate files.

Project at a glance

Active
Stars
5,802
Watchers
5,802
Forks
540
LicenseMIT
Repo age12 years old
Last commit4 days ago
Primary languageSCSS

Last synced 3 hours ago