Skip to content

BillionMail gives you open-source MailServer, NewsLetter, Email Marketing — fully self-hosted, dev-friendly, and free from monthly fees. Join the discord: https://discord.gg/asfXzBUhZr

fixed listening unexpected ports.

Jack76ff41b78078
diff --git a/core/internal/cmd/cmd.go b/core/internal/cmd/cmd.go
index a3dfa67f..c2032c21 100644
--- a/core/internal/cmd/cmd.go
+++ b/core/internal/cmd/cmd.go
@@ -279,13 +279,13 @@ var (
s.EnableHTTPS(public.AbsPath(filepath.Join(consts.SSL_PATH, "cert.pem")), public.AbsPath(filepath.Join(consts.SSL_PATH, "key.pem")))
// attempt add http port
- if httpPort, err := public.DockerEnv("HTTP_PORT"); err == nil {
+ if httpPort, err := public.DockerEnv("HTTP_PORT"); err == nil && httpPort != "" {
s.SetPort(gconv.Int(httpPort))
}
// Set HTTPS ports
s.SetHTTPSPort(g.Cfg().MustGet(ctx, "server.httpsPort", 443).Int())
- if httpsPort, err := public.DockerEnv("HTTPS_PORT"); err == nil {
+ if httpsPort, err := public.DockerEnv("HTTPS_PORT"); err == nil && httpsPort != "" {
s.SetHTTPSPort(gconv.Int(httpsPort))
}