SimpleRelay
Self-hosted multi-tenant SMTP relay with web dashboard. Routes outbound email through multiple upstream SMTP providers based on sender address. Built with FastAPI, Postfix, PostgreSQL, Docker.
Demo
Try it at relay.mailtoinbox.vip - register a free account and test the full system.
Configuration (.env)
Required
Variable Description Example RELAY_ADMIN_EMAIL Admin login email (created on first start) [email protected] RELAY_ADMIN_PASSWORD Admin password strongpassword RELAY_SECRET_KEY JWT secret, generate with python3 -c "import secrets; print(secrets.token_urlsafe(32))" x7f... RELAY_HOSTNAME Public hostname of this server (used in EHLO, shown in UI) relay.example.com RELAY_PUBLIC_IP Server public IP (for SPF/PTR guidance) 203.0.113.10 RELAY_BASE_URL Full URL of the web dashboard (for verification email links) https://relay.example.com:8080
Database (PostgreSQL)
Default values work out of the box. Change passwords for production.
Variable Default POSTGRES_USER simplerelay POSTGRES_PASSWORD simplerelay POSTGRES_DB simplerelay RELAY_DATABASE_URL postgresql://simplerelay:simplerelay@db:5432/simplerelay
... continue reading