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

Check the hostname tag file

lotk4190a10db0bf
diff --git a/core/internal/service/settings/billionmail_hostname.go b/core/internal/service/settings/billionmail_hostname.go
index 91711c06..db155c0f 100644
--- a/core/internal/service/settings/billionmail_hostname.go
+++ b/core/internal/service/settings/billionmail_hostname.go
@@ -14,29 +14,29 @@ import (
// Check whether the A record of BILLIONMAIL_HOSTNAME is consistent with the local public network IP and write or delete the tag file
func CheckHostname() {
ctx := context.Background()
- g.Log().Info(ctx, "billionmail_hostname start 111111111")
+ g.Log().Warning(ctx, "billionmail_hostname start 111111111")
hostname := public.MustGetDockerEnv("BILLIONMAIL_HOSTNAME", "")
flagFile := public.AbsPath("../core/data/billionmail_hostname.txt")
// ----------------------------------------------------------------------
if gfile.Exists(flagFile) {
content := gfile.GetContents(flagFile)
- g.Log().Info(ctx, "flagFile content 111111111: ", content)
+ g.Log().Warning(ctx, "flagFile content 111111111: ", content)
} else {
- g.Log().Info(ctx, "flagFile not exists 111111111")
+ g.Log().Warning(ctx, "flagFile not exists 111111111")
}
// ----------------------------------------------------------------------
if hostname == "" || hostname == "mail.example.com" {
_ = os.Remove(flagFile)
- g.Log().Info(ctx, "No hostname 111111111")
+ g.Log().Warning(ctx, "No hostname 111111111")
return
}
serverIP, err := public.GetServerIP()
if err != nil {
- g.Log().Info(ctx, "No serverIP 111111111")
+ g.Log().Warning(ctx, "No serverIP 111111111")
return
}
@@ -52,7 +52,7 @@ func CheckHostname() {
}
Valid := domains.ValidateARecord(record)
- g.Log().Info(ctx, "Valid 111111111", Valid)
+ g.Log().Warning(ctx, "Valid 111111111", Valid)
if Valid {
_ = os.WriteFile(flagFile, []byte(hostname), 0644)
}
diff --git a/core/internal/service/timers/timers.go b/core/internal/service/timers/timers.go
index 322a97c1..b1064c0f 100644
--- a/core/internal/service/timers/timers.go
+++ b/core/internal/service/timers/timers.go
@@ -145,6 +145,7 @@ func Start(ctx context.Context) (err error) {
//gtimer.AddOnce(500*time.Millisecond, func() {
gtimer.Add(1*time.Minute, func() {
+ g.Log().Warning(ctx, "billionmail_hostname start 0000000")
settings.CheckHostname()
})
gtimer.Add(24*time.Hour, func() {