Your question
I run a mail server and its webmail on the same address - mail.myserver.com.
Is it possible to configure another hostname for Stalwart’s http service, so that I can keep using my roundcube with the same hostname as the stalwart server?
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
Yes, this is straightforward. Stalwart’s HTTP service is bound to a NetworkListener, and you can bind that listener to a specific IP address (instead of all interfaces) or a non-standard port. You then point a different DNS hostname at that address, or put a reverse proxy in front, so Roundcube and Stalwart’s HTTP service each answer on their own hostnames without conflicting.
The two practical approaches are:
-
Bind Stalwart’s HTTP listener to a specific IP or port. In the WebUI under Settings > Network > Listeners, edit (or create) the http listener and set its bind field to, for example, ["203.0.113.5:443"] (a secondary IP) or ["[::]:8443"] (a different port). DNS for webmail.myserver.com points to that IP/port, while mail.myserver.com can remain Roundcube’s.
-
Put a reverse proxy (nginx, Caddy, etc.) in front. Stalwart listens on an internal port (e.g. 127.0.0.1:8080), and the reverse proxy routes traffic by virtual host: mail.myserver.com → Roundcube, jmap.myserver.com or another hostname → Stalwart. Stalwart’s docs cover nginx and other proxies, and note that useXForwarded should be enabled on the Http settings object so Stalwart sees real client IPs.
The listener protocol value for HTTP is simply "http", and a single listener can bind multiple host:port entries. There is no hostname-based vhost routing built into Stalwart’s listener itself, so the reverse-proxy approach is the cleanest way to serve two different hostnames on the same IP and port 443.
Relevant docs:
This is an automated reply from the Stalwart Help Bot. Other community members may follow up if this answer is incomplete or wrong. If you found it useful, mention @helpbot in any reply to ask follow-up questions and the bot will respond again.
Yes, but you will need a reverse proxy such as nginx to route the requests internally.