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

Adjust baseurl.go

lotk98a96c2637d8
diff --git a/core/internal/service/domains/baseurl.go b/core/internal/service/domains/baseurl.go
index 64d84a48..bacd6475 100644
--- a/core/internal/service/domains/baseurl.go
+++ b/core/internal/service/domains/baseurl.go
@@ -77,6 +77,9 @@ func UpdateBaseURL(ctx context.Context, domain ...string) {
go func(domain string) {
defer wg.Done()
url := buildBaseURL(domain)
+ if url == "" {
+ url = GetBaseURL()
+ }
baseurlMapMu.Lock()
baseurlMap[domain] = url
baseurlMapMu.Unlock()
@@ -123,7 +126,8 @@ func buildBaseURL(hostname string) (s string) {
if hostname == "" {
hostname, err = public.DockerEnv("BILLIONMAIL_HOSTNAME")
} else {
- hostname = public.FormatMX(hostname)
+ //hostname = public.FormatMX(hostname)
+ return ""
}
if err == nil {
@@ -142,6 +146,12 @@ func buildBaseURL(hostname string) (s string) {
return
}
}
+ //hostname, err = public.DockerEnv("BILLIONMAIL_HOSTNAME")
+ //if hostname != "" && hostname != "mail.example.com" {
+ // s = scheme + "://" + hostname
+ //} else {
+ // s = scheme + "://" + serverIP
+ //}
s = scheme + "://" + serverIP
if withPort {