Issue Description
Just upgraded from 0.15.5 to 0.16.4. The upgrade process went smoothly, but then I configured the proxy (stalwart http running behind caddy reverse proxy, but SMTP/IMAP ports are exposed directly). I cannot access the admin neither through browser or through stalwart-cli, both report errors:
2026-05-10T17:24:26Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 50740
2026-05-10T17:24:44Z WARN Proxy protocol error (network.proxy-error) listenerId = “http”, localIp = ::, localPort = 8080, tls = false, reason = “invalid proxy header”
2026-05-10T17:24:44Z WARN Proxy protocol error (network.proxy-error) listenerId = “http”, localIp = ::, localPort = 8080, tls = false, reason = “invalid proxy header”
The system is using RocksDB as a backend.
Is there a way to revert configuration and enable the admin on port 8080?
Expected Behavior
The x-forwarded-for feature should be optional and the system should work without it, IMO.
At the very least, there should be a way to reconfigure a misconfigured system without web ui.
Actual Behavior
I can not access the admin UI; the stalwart-cli does not work (produces the same error). When accessing through caddy reverse proxy, the proxy return 502 because stalwart resets the connection (read: connection reset by peer).
Reproduction Steps
- Start stalwart with configured trusted network for reverse proxy (172.18.0.0/24 in my case)
- Observe the error and inability to connect to server.
Relevant Log Output
2026-05-10T17:29:27Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 51490
2026-05-10T17:29:57Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 33042
2026-05-10T17:30:02Z WARN Proxy protocol error (network.proxy-error) listenerId = “https”, localIp = ::, localPort = 443, tls = true, reason = “invalid proxy header”
2026-05-10T17:30:02Z WARN Proxy protocol error (network.proxy-error) listenerId = “https”, localIp = ::, localPort = 443, tls = true, reason = “invalid proxy header”
2026-05-10T17:30:27Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 59846
2026-05-10T17:30:57Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 54750
2026-05-10T17:31:27Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 36364
2026-05-10T17:31:57Z WARN X-Forwarded-For header is missing (http.x-forwarded-missing) listenerId = “https”, localPort = 443, remoteIp = 127.0.0.1, remotePort = 47418
Stalwart Version
v0.16.x
Installation Method
Docker
Database Backend
RocksDB
Blob Storage
RocksDB
Search Engine
Internal
Directory Backend
Internal
Additional Context
Stalwart running behind caddy reverse proxy, which proxies to port 443, volumes are bind-mounted:
volumes:
- ./data:/var/lib/stalwart
- ./config:/etc/stalwart
- ./logs:/var/log/stalwart
I have reviewed the documentation and FAQ and confirm that my issue is NOT addressed there.
on
I have searched this support forum (open and closed topics) and confirm this is not a duplicate.
on
I understand that topics in this category are triaged by a bot first but a human reply will follow up. If I’d prefer a human-only reply, I’ll add the no-ai tag to my topic.
on