Cluster Deployment (infra) #
TsubameMail deploys as an isolated Cell orchestrated by Docker Compose under infra/deploy/cell/ alongside host preparation scripts under infra/deploy/vm/ and cloud templates under infra/deploy/aws/.
Service Topology & Ports #
| Service | Internal / Edge Network | Exposed Ports | Role |
|---|---|---|---|
https-proxy (Nginx 1.27) | edge_net | 443 | Terminates TLS 1.2/1.3 for admin.<your-domain>, console.<your-domain>, mail.<your-domain> |
control-backendd | edge_net, cell_net | 127.0.0.1:8080 | Control API, Platform Identity (/v1/platform/*), Ops, Alerts, Recovery |
identityd | cell_net | 50051 (gRPC) | Password hashing (IDENTITY_PEPPER), App Passwords, Auth/Authz gRPC |
tenant-configd | cell_net | 50052 (gRPC), 8082 | Tenant directory, domain verification, DKIM keystore |
smtp-in | edge_net, cell_net | 25, 465, 587 | Inbound MX (25) + authenticated SMTP submission (465 SMTPS / 587 STARTTLS) |
imapd | edge_net, cell_net | 143, 993 | IMAP4rev1 (143 STARTTLS / 993 IMAPS) |
pop3d | edge_net, cell_net | 110, 995 | POP3 (110 STLS / 995 POP3S) |
mta-out | edge_net, cell_net | 50053 (gRPC), 8088 | Outbound DKIM-signed delivery & optional SmartHost relay |
scannerd | scanner_isolated_net | internal only | Air-gapped attachment malware scanner (no default route / no internet) |
mail-worker | cell_net, scanner_isolated_net | internal only | Queue consumer moving staged intake items to durable storage |
postgres (PG 17) | cell_net | internal only | Persistence (disabled when overriding with AWS RDS) |
Deployment Steps #
- Prepare Environment & Secrets: Copy the parameterized template and generate high-entropy secrets (
>= 32bytes) for everyGENERATE_MEfield:
bash
cd infra/deploy/cell
cp .env.cell.single-node.example .env
chmod 600 .env- Prepare Host Data Permissions & Outbound Submission Credential: Ensure
CELL_DATA_ROOT(/var/lib/tsubame/cell) andCELL_OUTBOUND_CREDENTIAL_FILEexist with0600permissions and>= 32printable bytes. - Build Images (Offline-Capable):
bash
./build-images.sh --platform linux/amd64- Validate & Launch:
bash
python3 validate-single-node-env.py .env
docker compose -f docker-compose.cell.yml -f docker-compose.cell.single-node.yml --env-file .env up -d --no-buildWARNING
smtp-in in single-node or production mode verifies that PostgreSQL has fsync=on and synchronous_commit=on before running migrations. Never disable fsync in production.