Deployment and Operations
Runtime Components
- FastAPI app (HTTP)
- SMTP inbound listener (port 25)
- Outbox worker for direct SMTP send
- SQLite database on persistent volume (
/data/zmail.db)
Fly.io Deployment
fly deploy --now
fly status --app zmail-zergai
fly checks list --app zmail-zergai
fly logs --app zmail-zergai
Required Secrets and Config
ZMAIL_API_KEY- Mail domain and SMTP-related environment from
config.py
DNS Requirements
At minimum for domain mail flow:
Arecord for mail host to Fly IPv4MXrecord pointing to mail hostTXTSPF record allowing mail host- DKIM/DMARC records when enabled
See also: DNS_DELIVERABILITY.md.
Health Verification
- API check:
GET /health - SMTP check: Fly service check on TCP 25
- App surface check:
GET /,GET /login,GET /admin/login
Post-Deploy Smoke Checklist
- Open
/and/loginin browser. - Login with test user and verify
/apploads. GET /app/api/sessionwith session token succeeds.- Create webhook and send test event.
- Confirm webhook delivery record is written.
- Send test email and confirm message arrives in inbox.
Incident Triage
Site unreachable
fly status --app zmail-zergaifly checks list --app zmail-zergaifly logs --app zmail-zergai --no-tail
Domain resolves to parked page
- Verify DNS
A/CNAMErecords in registrar. - Remove parked/forwarding records.
- Confirm cert and app mapping in Fly.
SMTP send failures
- Inspect outbox errors in logs.
- Verify outbound DNS and recipient MX reachability.
- Validate SPF/DKIM/DMARC alignment.
Webhook failures
- Check
/app/api/webhooks/{id}/deliveries. - Validate endpoint TLS and 2xx responses.
- Verify secret/signature handling in receiver.