# Local mail resilience lab

This is a deliberately isolated experiment, not a production mail configuration.
It has plaintext IMAP, synthetic credentials lab / lab-only and trusted internal SMTP senders.
NO ports are published. The Compose network is internal and has no public delivery route.
Do not publish this setup, use real credentials or send real personal messages through it.

## Native probe
Run from source/:
docker compose build single
python run_native.py --outage-seconds 30 --output ../native-results.json

The controller RESETs ONLY the named tutorijali-mail-resilience Compose project before each run.
It uses Docker exec to run a standard-library SMTP/IMAP probe inside the isolated sink container.
Actual Postfix and Dovecot services exchange messages over TCP. The primary-site interruption is
a short real-time experiment, not 24 hours. MX fallback is explicitly attempted by the harness.
After saving results, use docker compose down to stop and remove ONLY this named lab.
No volumes are configured: synthetic mail disappears on removal.

## Accelerated model
python simulate_24h.py --output ../model-results.json
This is a separate discrete-time calculation, NOT a native mail-server execution.
See the JSON assumptions and the bilingual article. 48 h horizon, failure h6-h30, 5 min tick,
one incoming and one outgoing item per 10 min, retry 30 min, 12/48 h deadlines.
The idealized HA row assumes synchronous storage and a 15-minute failover, not a tested cluster.
Shared DNS/identity failure assumes cold caches and disables all routes and mailbox access.
Recovery capacity is unlimited in a tick. Backup spool retention exceeds the 48 h horizon.

The reference/ files are SEPARATE educational Stalwart/DNS/preflight examples.
They are not the Docker experiment config, and they are not a deployment recommendation by themselves.
No production deployment, public deliverability, TLS, DKIM, DNS failover, disk-loss restore or
replication benchmark was performed.
