feat(infra): add Stalwart mail server, route mana-notify SMTP through it

Add self-hosted Stalwart mail server (Rust, ~50MB RAM) to replace Brevo
as SMTP provider. mana-notify now sends via stalwart:587 internally.

Ports exposed: 25 (SMTP), 587 (submission), 465 (SMTPS), 993 (IMAPS),
8443 (web admin). Requires DNS setup (MX, SPF, DKIM, DMARC) and router
port-forwarding to complete the migration.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Till JS 2026-04-03 15:20:23 +02:00
parent 18d4f84718
commit 0a6fe57a80

View file

@ -535,9 +535,9 @@ services:
DATABASE_URL: postgresql://postgres:${POSTGRES_PASSWORD:-mana123}@postgres:5432/mana_platform?sslmode=disable
SERVICE_KEY: ${MANA_CORE_SERVICE_KEY:-dev-service-key}
MANA_CORE_AUTH_URL: http://mana-auth:3001
SMTP_HOST: ${SMTP_HOST:-smtp-relay.brevo.com}
SMTP_HOST: ${SMTP_HOST:-stalwart}
SMTP_PORT: ${SMTP_PORT:-587}
SMTP_USER: ${SMTP_USER:-94cde5002@smtp-brevo.com}
SMTP_USER: ${SMTP_USER:-noreply@mana.how}
SMTP_PASSWORD: ${SMTP_PASSWORD:-}
SMTP_FROM: "ManaCore <noreply@mana.how>"
EXPO_ACCESS_TOKEN: ${EXPO_ACCESS_TOKEN:-}
@ -552,6 +552,28 @@ services:
retries: 3
start_period: 5s
stalwart:
image: stalwartlabs/mail-server:latest
container_name: mana-mail
restart: always
mem_limit: 256m
ports:
- "25:25"
- "587:587"
- "465:465"
- "993:993"
- "8443:8443"
volumes:
- stalwart_data:/opt/stalwart-mail
environment:
- STALWART_ADMIN_PASSWORD=${STALWART_ADMIN_PASSWORD:-ChangeMe123!}
healthcheck:
test: ["CMD", "curl", "-f", "http://localhost:8080/healthz"]
interval: 120s
timeout: 5s
retries: 3
start_period: 10s
mana-crawler:
build:
context: .
@ -1550,3 +1572,5 @@ volumes:
name: mana-loki-data
matrix_bots_data:
name: mana-matrix-bots-data
stalwart_data:
name: mana-stalwart-data