[Bug] Relay SMTP settings not applied to webmail container + logout redirects to 404
Bug 1: Relay SMTP settings not applied to webmail container (still uses default port 465)
Description
After configuring SMTP relay (Brevo/custom) in the Emails → Sending tab, the webmail container still uses the default mail.example.com:465 instead of the configured relay settings.
Steps to Reproduce
- Install mail server via Openship
- Go to Emails → Sending
- Enable relay, set custom SMTP (e.g. Brevo
smtp-relay.brevo.com:587) - Save changes — UI shows "Relay active" ✅
- Go to Emails → Test → send test email
Expected Behavior
Test email should be sent via the configured relay (smtp-relay.brevo.com:587).
Actual Behavior
Error: SMTP submission check failed against mail.example.com:465: Connection timeout
Inspecting the webmail container environment variables confirms it still uses old defaults:
DEFAULT_SMTP_HOST=mail.example.com
DEFAULT_SMTP_PORT=465Root Cause (suspected)
The webmail container is created with hardcoded default SMTP env vars and does not get recreated or updated when relay settings are changed via the UI. The relay config appears to be saved (UI shows "Relay active") but is not propagated to the webmail container's environment.
Workaround
Sending directly via swaks using Brevo credentials works fine, confirming the relay config itself is correct:
swaks --to [email protected] \
--from [email protected] \
--server smtp-relay.brevo.com \
--port 587 \
--auth LOGIN \
--auth-user YOUR_BREVO_LOGIN \
--auth-password "YOUR_SMTP_KEY" \
--tlsOutput confirms successful delivery:
235 2.0.0 Authentication succeeded
250 2.0.0 OK: queued
221 2.0.0 ByeBug 2: Logout from webmail redirects to 404 (/mail/undefined/login)
Description
After logging out from the webmail interface, the user is redirected to an invalid URL containing undefined instead of the correct login path, resulting in a 404 Page Not Found error.
Steps to Reproduce
- Log in to the webmail interface at
https://mail.example.com/mail - Click logout
- Observe the redirect URL
Expected Behavior
User should be redirected to:
https://mail.example.com/mail/loginActual Behavior
User is redirected to:
https://mail.example.com/mail/undefined/loginThis results in a 404 Page Not Found error.
Workaround
Manually navigate to:
https://mail.example.com/mailOr clear browser cookies and access the URL directly.
Environment
- Openship version: 0.5.0
- VPS: Oracle Cloud Free Tier (ARM64, Ubuntu 24.04 Noble)
- Architecture: arm64
- Browser: Chrome 151.0.0.0 (Linux x86_64)
- Note: Oracle Cloud blocks outbound port 25 by default, hence the need for SMTP relay
- Relay provider tested: Brevo (smtp-relay.brevo.com:587)
Source: oblien/openship