Welcome to Fumi
Fumi - means letter✉️ in Japanese - is a small, simple, and ultrafast SMTP server framework built on Bun.Key Features
Ultrafast
Runs natively on Bun. No adapter layer, no Node.js compatibility overhead.
Lightweight
Tiny core with one runtime dependency (
bun-smtp). Minimal footprint.Middleware System
Koa-style
(ctx, next) chains per SMTP phase: connect, auth, mailFrom, rcptTo, data, close.Plugin System
A plugin is just
(app: Fumi) => void. No registry, no lifecycle hooks.TypeScript First
First-class TypeScript support with complete type definitions for all contexts.
Delightful DX
Super clean APIs with intuitive phase-based middleware registration.
SMTP Phase Middleware
Fumi provides middleware hooks for every SMTP phase:- onConnect - Validate connections before accepting them
- onAuth - Implement custom authentication logic
- onMailFrom - Validate sender addresses
- onRcptTo - Validate recipient addresses
- onData - Process email message data
- onClose - Cleanup when connections close
next() function to continue the chain.
Built-in Plugins
Fumi includes several ready-to-use plugins:- logger - Logs each SMTP phase to stdout
- denylist - Blocks connections from specific IP addresses
- senderBlock - Rejects mail from blocked domains
- rcptFilter - Restricts recipients to allowed domains
- requireTls - Enforces TLS encryption
- maxSize - Rejects oversized messages
Get Started
Installation
Install Fumi with Bun and verify your setup
Quick Start
Build your first SMTP server in minutes
Middleware Guide
Learn how to use middleware to control SMTP phases
Plugin Development
Create and share your own Fumi plugins