Scripts2026年7月15日·1 分钟阅读

MailDev — SMTP Server and Web UI for Email Testing

A local SMTP server with a web interface for viewing and testing emails during development, eliminating the need to send real emails while building applications.

Agent 就绪

Agent 可直接安装

这个资产可安装;Agent 先选择当前运行时、检查安装计划,再运行匹配命令。

Native · 98/100策略:允许
Agent 入口
任意 MCP/CLI Agent
类型
Skill
安装
Single
信任
信任等级:Established
入口
MailDev Overview
直接安装命令
npx -y tokrepo@latest install 9e43a243-808e-11f1-9bc6-00163e2b0d79 --target codex

先 dry-run 确认安装计划,再运行此命令。

Introduction

MailDev is a lightweight SMTP server with a built-in web interface designed for email testing during development. Instead of configuring real SMTP servers or risking accidental email delivery, developers point their application at MailDev and instantly view all outgoing emails in a browser, complete with HTML rendering, plain text, headers, and attachments.

What MailDev Does

  • Runs a local SMTP server that captures all outgoing emails without delivering them
  • Provides a web UI to browse, search, and inspect captured emails
  • Renders HTML emails, plain text, and displays raw headers and source
  • Shows email attachments with download links
  • Exposes a REST API for programmatic access to captured emails in test suites

Architecture Overview

MailDev runs a Node.js-based SMTP server (using the smtp-server package) on a configurable port (default 1025). Every email sent to this server is captured in memory and made available through both a web interface (default port 1080) and a REST API. The web UI is a single-page application that auto-refreshes when new emails arrive via WebSocket. Emails can optionally be relayed to a real SMTP server for selective forwarding.

Self-Hosting & Configuration

  • Run via Docker: docker run -p 1080:1080 -p 1025:1025 maildev/maildev
  • Or install via npm: npm install -g maildev
  • Configure your application's SMTP host to localhost and port to 1025
  • Use --smtp and --web flags to customize ports
  • Set --outgoing-host and --outgoing-user to relay specific emails to a real SMTP server

Key Features

  • Zero-configuration setup: run one command and start catching emails
  • Web interface with real-time updates via WebSocket
  • REST API for integration with automated test suites (GET /email, DELETE /email/all)
  • SMTP authentication support for testing auth-required email flows
  • Docker image available for consistent CI/CD pipeline integration

Comparison with Similar Tools

  • Mailpit — Newer Go-based alternative with a modern UI and lower resource usage
  • MailHog — Similar concept but no longer actively maintained; MailDev is actively updated
  • Ethereal — Nodemailer's disposable email service; MailDev runs locally with no external dependency
  • Mailtrap — Commercial SaaS for email testing; MailDev is free, open source, and self-hosted
  • Papercut — Windows-focused SMTP test server; MailDev is cross-platform

FAQ

Q: Will MailDev send real emails? A: No. By default, MailDev captures all emails and never delivers them. You can optionally configure relay forwarding for specific messages.

Q: Can I use MailDev in CI/CD pipelines? A: Yes. Run the Docker container in your CI environment and use the REST API to verify emails sent during integration tests.

Q: Does MailDev support HTML email rendering? A: Yes. The web UI renders HTML emails in an iframe and also shows the raw HTML source and plain text alternatives.

Q: What license does MailDev use? A: MIT License.

Sources

讨论

登录后参与讨论。
还没有评论,来写第一条吧。

相关资产