stack.basicstack.de/apps/stalwart/README.md
CTO Agent 6640739af6 Complete Stalwart ConfigMap mount hardening: add stalwart.toml copy
Extends commit 291feb9 by adding stalwart-config (stalwart.toml) to the
copy-config initContainer. The previous fix only handled bootstrap-config
but missed stalwart-config, which was the root cause of CrashLoopBackOff
identified in DEV-426 stability testing.

Root cause: commit 693fcd3 introduced stalwart-config ConfigMap with
subPath mount. During pod restarts, Kubernetes subPath ConfigMap mounting
race leaves stalwart.toml empty/unparseable, causing:
  "Failed to parse data store settings at /etc/stalwart/stalwart.toml:
   expected value at line 1 column 1"

This completes the hardening by ensuring BOTH config files (config.json
and stalwart.toml) are atomically copied before Stalwart starts.

Fixes: DEV-433, DEV-431
Ref: stack.basicstack.de/apps/stalwart/STABILITY-VERIFICATION-2026-08-01.md

Co-Authored-By: Paperclip <noreply@paperclip.ing>
2026-08-01 09:52:26 +00:00

69 lines
2 KiB
Markdown

# Stalwart Mail Server v0.16.11
Clean deployment of Stalwart mail server with username/password authentication only.
## Architecture
- **Version**: v0.16.11
- **Authentication**: Username/password only (NO OAuth/OIDC)
- **Configuration**: API-based (stored in RocksDB)
- **Storage**: Encrypted hcloud-volumes (20Gi)
- **Backup**: Daily restic backup to S3 at 3 AM
- **Web UI**: https://mail.basicstack.de
## Files
- `stalwart-fresh-deployment.yaml` - Main deployment manifest
- `stalwart-admin-credentials-sealed.yaml` - Sealed secret for admin password
- `stalwart-s3-backup-sealed.yaml` - Sealed secret for S3 backup credentials
## Deployment
```bash
# Apply sealed secrets first
kubectl apply -f stalwart-admin-credentials-sealed.yaml
kubectl apply -f stalwart-s3-backup-sealed.yaml
# Create bootstrap config
kubectl create configmap stalwart-bootstrap-config \
--from-literal=config.json='{"@type":"RocksDb","path":"/var/lib/stalwart"}' \
-n stalwart
# Deploy Stalwart
kubectl apply -f stalwart-fresh-deployment.yaml
```
## Initial Admin Login
After deployment, log in at https://mail.basicstack.de with:
- Username: `admin`
- Password: (from stalwart-admin-credentials secret)
## Configuration
> **IMPORTANT:** The configuration is stored in the RocksDB and cannot be overwritten by a configuration file!
All configuration is done via the web UI or API. The bootstrap config only points to the RocksDB database location. NO config.toml files are used.
Check https://stalw.art/docs/ref/ for configuration possibilities.
The API access via /jmap seems to be too complex for the agent and the configruation has been done manually.
Refer to [manual configuration steps](manual_config_steps.md)
## Ports
- SMTP: 25, 587, 465
- IMAP: 143, 993
- HTTP: 8080 (web UI)
## Storage
Data is stored in `/var/lib/stalwart` using the RocksDB database format. This includes:
- Email messages
- User accounts
- Server configuration
- TLS certificates configuration
## Certificate Renewal
Refer to [Automatic Renewal TLS Certificate](CERTIFICATE-RENEWAL.md)