A development SMTP server that captures emails without actually sending them, with a modern web interface for viewing received messages.
- SMTP Server: Accepts emails on port 2525 (or configurable port)
- Web Interface: Modern Next.js client for viewing captured emails
- Redis Storage: Persistent email storage using Redis
- TLS Support: Supports encrypted connections
- Development Ready: Easy setup for local development and testing
- Go 1.21.3 or higher
- Node.js and pnpm
- Docker and Docker Compose (for Redis)
-
Start Redis services:
make docker-up
-
Run the SMTP server:
make run
-
Start the web client (in another terminal):
make run-client
-
Access the web interface at
http://localhost:3000
Send a test email to the SMTP server:
make test-smtp
Or manually with swaks
:
swaks --to [email protected] --from [email protected] --server localhost:2525 --body "Test email"
Go/SMTP Server:
make run
- Start SMTP server in development modemake build
- Build the binarymake test
- Run testsmake fmt
- Format Go codemake vet
- Run go vetmake check
- Run formatting and vetting
Client:
make run-client
- Start Next.js development server
Docker:
make docker-up
- Start all services (Redis, etc.)make docker-down
- Stop all servicesmake docker-build
- Build Docker image
Redis:
make redis-logs
- View Redis logsmake redis-reset
- Clear all stored emails
nullmail/
├── cmd/nullmail/ # Main application entry point
├── internal/ # Internal Go packages
│ ├── smtp/ # SMTP server implementation
│ ├── email/ # Email parsing and validation
│ └── redis/ # Redis client
├── client/ # Next.js web interface
│ ├── app/ # Next.js app router
│ ├── components/ # React components
│ └── lib/ # Client utilities
└── infra/ # Infrastructure configs
SMTP Server:
DEBUG=true
- Enable debug loggingENV=production
- Set production modeREDIS_URL
- Redis connection string (default: localhost:6379)REDIS_PASSWORD
- Redis password (default: dev123)
Client:
- Standard Next.js environment variables
- SMTP Server: 2525 (configurable via command line argument)
- Web Client: 3000 (Next.js default)
- Redis: 6379
The web client connects to the SMTP server's stored emails via:
GET /api/emails/[address]
- Retrieve emails for a specific address
This project is for development and testing purposes.