I’m trying to change port 443 to 8443 cause of other applications that binding to this port. First screen with mail entry is working but the redirect to password screen is to https on 443 which isn’t stalwart. When I manually rewrite to 8443 and entering password there comes an error “failed to fetch” from Stalwart server. I’m using windows server currently
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.
The key finding is in the WebUI source: the redirect URI is constructed from window.location.origin (which includes the port the browser is currently connecting on) plus the base path. This means the WebUI correctly uses whatever origin/port you’re currently browsing from.
The problem you’re seeing – a redirect to port 443 instead of 8443 – is almost certainly because:
The listener bind address still has :443 in it (the port in the NetworkListener object wasn’t actually updated to 8443), or
A reverse proxy or some other component is intercepting on 443 and not forwarding to the correct backend, or
HSTS or a browser cached redirect is forcing the browser back to 443.
Here’s how to fix this properly:
Step 1 – Update the listener binding in the WebUI under Settings › Network › Listeners. Find the HTTPS listener and change its bind value from [::]:443 (or 0.0.0.0:443) to [::]:8443. This is a JSON object with a bind array, for example:
{
"bind": ["[::]:8443"],
"tlsImplicit": true
}
Step 2 – Restart Stalwart after saving so the new bind takes effect.
Step 3 – Access the WebUI directly at https://yourhost:8443/admin. Once you load it on port 8443, the window.location.origin the WebUI uses for its OAuth redirect URI will correctly be https://yourhost:8443, so the login flow will stay on 8443 throughout.
The “failed to fetch” error on the password step happens because the OAuth callback is being sent back to port 443 (where nothing is listening) rather than 8443. Accessing the admin panel on the correct port from the start will resolve this.
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.