Documentation Index
Fetch the complete documentation index at: https://mintlify.com/puiusabin/bun-smtp/llms.txt
Use this file to discover all available pages before exploring further.
Welcome to bun-smtp
A fast SMTP/LMTP server library built natively on Bun, designed to be a drop-in replacement forsmtp-server with significantly better performance.
Why bun-smtp?
bun-smtp leverages Bun’s native APIs likeBun.listen(), socket.upgradeTLS(), and Bun.CryptoHasher to deliver a high-performance SMTP server without relying on Node.js compatibility layers. If you’re already using Bun, bun-smtp provides a seamless, fully-typed experience for handling email.
Quickstart
Get up and running in minutes with a minimal SMTP server
Authentication Guide
Learn how to implement SASL authentication (PLAIN, LOGIN, CRAM-MD5, XOAUTH2)
API Reference
Explore the complete API including all options and callbacks
Examples
See real-world examples of TLS, authentication, and message handling
Key Features
Bun-native Performance
Bun-native Performance
Built directly on Bun’s native APIs without Node.js compatibility overhead. Uses
Bun.listen() for optimal socket handling and Bun.CryptoHasher for authentication.Drop-in Replacement
Drop-in Replacement
Same constructor options, callbacks, and event names as
smtp-server. Migrate with minimal code changes while gaining significant performance improvements.Full SMTP Support
Full SMTP Support
Implements the complete SMTP protocol including HELO/EHLO, MAIL FROM, RCPT TO, DATA, STARTTLS, LMTP mode, and extension commands like XCLIENT and XFORWARD.
SASL Authentication
SASL Authentication
Built-in support for PLAIN, LOGIN, CRAM-MD5, and XOAUTH2 authentication methods with configurable options for insecure auth and required authentication.
TypeScript First
TypeScript First
Fully typed API with comprehensive TypeScript definitions for all options, callbacks, session data, and authentication objects.
Quick Example
Here’s a minimal SMTP server that accepts all messages:System Requirements
bun-smtp requires Bun 1.2.0 or higher. Make sure you have Bun installed before getting started.
Community & Support
- GitHub: puiusabin/bun-smtp
- Issues: Report bugs or request features
- npm: bun-smtp on npm