Your question
Hello,
I run Stalwart v0.16.x (community edition, Docker) for a client. Right now the server is reachable from the internet on port 443, and anyone who opens https:///admin sees the admin login page. I want to change that.
What I am trying to achieve:
- The admin web UI should only be reachable from the local network or over VPN, for example via the LAN IP or a local hostname
- Everything else must keep working as it does today for public users: webmail, mail clients (IMAP/SMTP/JMAP), autoconfig, autodiscover, OAuth login, health checks
I have read the access control documentation and it mentions an allowedEndpoints expression where you can filter by listener, IP, or path. I also saw an example with a private listener bound to localhost and a public listener for everything else.
My questions:
-
What is the recommended way to do this in v0.16? A second listener that is not exposed publicly, an IP based rule, or something else entirely?
-
Is it safe to have the admin UI on a different listener than the API? The WebUI talks to /api, and I do not want to break login or the dashboard.
-
If I access the admin via a local IP or internal hostname, do I need to set STALWART_PUBLIC_URL or anything similar so that login redirects and discovery documents still point at the right place?
-
Any pitfalls or known issues with this approach? I would rather use the built-in mechanism than put nginx in front just to block one path.
Setup for reference: Docker on Ubuntu, RocksDB, ports 25/465/587/993/443 published, public hostname serves the web UI today, LAN access is available at 192.168.22.48.
Thanks for your help.
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