Welcome to smtp-server
smtp-server is a powerful Node.js library for creating custom SMTP and LMTP server instances on the fly. Built by the team behind Nodemailer, it provides a flexible and extensible foundation for email infrastructure.Why smtp-server?
Full Protocol Control
Complete control over SMTP/LMTP protocol handling with customizable command processing and authentication flows.
Enterprise Ready
Production-tested features including TLS/STARTTLS support, multiple authentication methods, and proxy protocol support.
Developer Friendly
Simple, event-driven API with comprehensive hooks for validation, authentication, and message processing.
High Performance
Stream-based message handling for efficient processing of large emails with configurable size limits.
Key Features
- Multiple Protocol Support: Create both SMTP and LMTP servers
- Flexible Authentication: Built-in support for PLAIN, LOGIN, and CRAM-MD5 authentication methods
- TLS/STARTTLS: Full support for secure connections with SNI (Server Name Indication)
- Proxy Protocol: PROXY protocol support for deployment behind load balancers
- Stream Processing: Efficient handling of large messages using Node.js streams
- Extensible Validation: Custom validation hooks for sender, recipient, and message content
- Advanced Features: DSN (Delivery Status Notifications), ENHANCEDSTATUSCODES, REQUIRETLS, and more
Quick Example
Here’s a minimal SMTP server that logs received messages:The server listens on port 2525 by default in examples to avoid requiring root privileges (ports below 1024 require elevated permissions).
Use Cases
Testing & Development
Create local SMTP servers for testing email functionality in your applications without sending real emails.
Email Processing Pipelines
Build custom email processing systems with validation, filtering, and routing logic.
Webhook Bridges
Convert incoming emails into webhooks or API calls for integration with other services.
Next Steps
Installation
Get started by installing smtp-server in your project
Quick Start
Build your first SMTP server in minutes
API Reference
Explore the complete API documentation
Core Concepts
Learn key concepts and configuration
System Requirements
smtp-server requires Node.js 18.18.0 or higher. Make sure your environment meets this requirement before installation.
Community & Support
smtp-server is part of the Nodemailer ecosystem and is actively maintained:- GitHub: nodemailer/smtp-server
- License: MIT-0 (Public Domain Equivalent)
- Author: Andris Reinman and contributors
- Issues: Report bugs and feature requests on GitHub Issues