
SimpleRelay - 自主托管的 SMTP 中继服务,具有 Web 控制面板、DNS 验证和针对每个发送者的访问权限
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.
Try it at relay.mailtoinbox.vip - register a free account and test the full system.
| 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 |
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 |
Used for sending verification and password reset emails to users. If left empty, these emails are logged to console only (dev mode).
| Variable | Description | Example |
|---|---|---|
RELAY_SMTP_HOST |
SMTP server | smtp.gmail.com |
RELAY_SMTP_PORT |
Port | 587 |
RELAY_SMTP_USER |
Username | [email protected] |
RELAY_SMTP_PASSWORD |
Password | |
RELAY_SMTP_FROM |
From address | [email protected] |
RELAY_SMTP_TLS |
Use STARTTLS | true |
| Port | Service |
|---|---|
8080 |
Web dashboard |
2525 |
SMTP relay (your apps connect here) |
Remap in docker-compose.yml if needed.
git clone https://github.com/toinbox/simplerelay.git
cd simplerelay
cp env.example .env
nano .env
docker compose up --build -dDashboard: http://your-server:8080
SMTP relay endpoint: your-server:2525
Every registered user gets access to:
Dashboard - overview of today's sent count, errors, provider health status with response times, and recent mail log entries.
Setup Wizard - guided first-time setup: enter email, auto-detect provider and SMTP settings, test connection, run DNS check (SPF/DKIM/DMARC), configure access control (IP whitelist, optionally SMTP AUTH), send test email.
Providers - manage SMTP providers (upstream accounts used for sending). Each provider has:
Mail Logs - searchable log of all sent, failed, and bounced messages with sender, recipient, subject, status, client IP, and timestamp.
Admin users see additional sections:
User Management - list all registered users, activate/deactivate accounts (deactivation auto-suspends all user's relays), change user roles (user/admin), set maximum number of relays per user, set relay expiry period (auto-expire after N days), delete users with cascade.
Proxy Management - manage outbound IPs and SOCKS5/HTTP proxies. Each proxy entry has:
Provider Type Limits - set global daily sending limits per provider type (Gmail, Outlook, Seznam, custom, etc.) applied across all users.
Admin Dashboard - global stats: total/active users, total/active/locked relays, total/active proxies, sent and errors today.
Provider Oversight - view any user's relay list, lock/unlock individual providers with reason.
SimpleRelay works great as a central SMTP relay on your home network. Instead of configuring Gmail credentials in every device separately, you point everything at SimpleRelay on your LAN and manage credentials in one place.
…0.0.0.0/0 as allowed subnet and every device on your network can send.See COMPATIBILITY.md for the full list of 50+ compatible devices with setup instructions - servers, firewalls, cameras, monitoring tools, backup software, UPS, printers and more.
FastAPI (Python 3.12), Postfix, PostgreSQL 16, React + Vite, Docker Compose
MIT
暂无开放 Issues,或尚未同步最近议题。