A deterministic, observable, enterprise-grade email system with sub-second delivery.
- Docker & Docker Compose
- Resend API key (free tier: 100 emails/day) - Get it at https://resend.com
- Clone and configure
cp .env.example .env
# Edit .env and add your RESEND_API_KEY- Start the system
docker-compose up -d- Access the application
- Frontend: http://localhost:3000
- API: http://localhost:8080
- MailHog UI: http://localhost:8025
- Email: admin@blackhole.dev
- Password: admin123
- SMTP Ingest: Custom SMTP server on port 2525
- REST API: Full CRUD on emails, inboxes, rules
- WebSocket: Real-time email delivery (SSE)
- Rules Engine: Deterministic routing with bytecode execution
- Storage: PostgreSQL + object storage simulation
- Modular UI: Drag-and-drop panels
- Real-time Updates: SSE integration
- Keyboard Navigation: Vim-style shortcuts
- Dark Mode: Default theme
- State Machine UI: Visual lifecycle tracking
- PostgreSQL 15
- Full migrations included
- Optimized indexes for performance
- SMTP ingest (TLS-ready)
- Sub-second internal delivery
- Threaded conversation view
- Attachment support
- Full-text search
- Infinite scroll
- Shared inboxes
- Email assignment
- Internal notes
- Claim/unclaim workflow
- SLA tracking
- State lifecycle (NEW β CLAIMED β RESPONDED β RESOLVED β ARCHIVED)
- Visual rule builder
- Deterministic routing
- Auto-tagging
- Webhook triggers
- Auto-replies
- Rule explainability panel
- Multi-tenant architecture
- Role-based access control
- Immutable audit logs
- Domain management
- Storage usage tracking
- Retention policies
- REST API
- Webhook system
- OAuth2 ready
- Rate limiting
- API documentation
- Deterministic Pipeline: Every email's path is traceable
- Observable: Real-time latency tracking per email
- Modular UI: Hot-swappable panels and views
- Enterprise-Ready: Multi-tenant, RBAC, audit logs
- Developer-Friendly: Full API, webhooks, CLI tools
- Internal delivery: <100ms
- UI update latency: <50ms
- Search response: <200ms
- API response: <100ms (p95)
- TLS everywhere (SMTP, HTTPS, WSS)
- DKIM/SPF/DMARC validation
- Per-tenant encryption keys
- Immutable audit trail
- Rate limiting and DDoS protection
curl -X POST http://localhost:8080/api/emails \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"to": "user@example.com",
"subject": "Hello from Blackhole",
"body": "This is a test email"
}'curl -X POST http://localhost:8080/api/rules \
-H "Authorization: Bearer YOUR_TOKEN" \
-H "Content-Type: application/json" \
-d '{
"name": "Support emails to support inbox",
"conditions": {
"to": "support@blackhole.dev"
},
"actions": {
"assign_inbox": "support",
"add_tags": ["support", "new"]
}
}'cd backend
cargo runcd frontend
npm install
npm run devcd backend
sqlx migrate rundocker-compose -f docker-compose.prod.yml up -dSee .env.example for all configuration options.
blackhole-v2/
βββ backend/ # Rust backend
β βββ src/
β β βββ main.rs
β β βββ smtp/ # SMTP server
β β βββ api/ # REST API
β β βββ rules/ # Rules engine
β β βββ models/ # Data models
β β βββ db/ # Database layer
β βββ migrations/ # SQL migrations
β βββ Cargo.toml
βββ frontend/ # React frontend
β βββ src/
β β βββ components/
β β βββ modules/
β β βββ hooks/
β β βββ App.tsx
β βββ package.json
βββ docker-compose.yml
βββ README.md
This is a production demo. For the full product roadmap, see ROADMAP.md.
MIT License