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

Merge branch 'main' into dev

Jackcdb26915e2b6
diff --cc core/go.mod
index 4a8381af,9b0dcdfb..ba53afbe
--- a/core/go.mod
+++ b/core/go.mod
@@@ -14,12 -14,9 +14,13 @@@ require
github.com/gogf/gf/contrib/nosql/redis/v2 v2.9.0
github.com/gogf/gf/v2 v2.9.0
github.com/golang-jwt/jwt/v5 v5.2.1
+ github.com/mojocn/base64Captcha v1.3.8
+ github.com/google/uuid v1.6.0
+ github.com/panjf2000/ants/v2 v2.11.3
github.com/tomasen/fcgi_client v0.0.0-20180423082037-2bb3d819fd19
+ github.com/xuri/excelize/v2 v2.9.0
golang.org/x/crypto v0.33.0
+ golang.org/x/time v0.8.0
gopkg.in/yaml.v3 v3.0.1
)
@@@ -53,7 -50,9 +54,8 @@@ require
github.com/go-logr/stdr v1.2.2 // indirect
github.com/goccy/go-json v0.10.4 // indirect
github.com/gogo/protobuf v1.3.2 // indirect
+ github.com/golang/freetype v0.0.0-20170609003504-e2365dfdc4a0 // indirect
github.com/google/go-querystring v1.1.0 // indirect
- github.com/google/uuid v1.6.0 // indirect
github.com/gorilla/websocket v1.5.3 // indirect
github.com/grokify/html-strip-tags-go v0.1.0 // indirect
github.com/jmespath/go-jmespath v0.4.0 // indirect
diff --cc core/go.sum
index 7988638e,d244da08..6153fc2d
--- a/core/go.sum
+++ b/core/go.sum
@@@ -173,7 -175,8 +175,9 @@@ github.com/modern-go/concurrent v0.0.0-
github.com/modern-go/concurrent v0.0.0-20180306012644-bacd9c7ef1dd/go.mod h1:6dJC0mAP4ikYIbvyc7fijjWJddQyLn8Ig3JB5CqoB9Q=
github.com/modern-go/reflect2 v1.0.2 h1:xBagoLtFs94CBntxluKeaWgTMpvLxC4ur3nMaC9Gz0M=
github.com/modern-go/reflect2 v1.0.2/go.mod h1:yWuevngMOJpCy52FWWMvUC8ws7m/LJsjYzDa0/r8luk=
+ github.com/mojocn/base64Captcha v1.3.8 h1:rrN9BhCwXKS8ht1e21kvR3iTaMgf4qPC9sRoV52bqEg=
+ github.com/mojocn/base64Captcha v1.3.8/go.mod h1:QFZy927L8HVP3+VV5z2b1EAEiv1KxVJKZbAucVgLUy4=
+github.com/mohae/deepcopy v0.0.0-20170929034955-c48cc78d4826/go.mod h1:TaXosZuwdSHYgviHp1DAtfrULt5eUgsSMsZf+YrPgl8=
github.com/morikuni/aec v1.0.0 h1:nP9CBfwrvYnBRgY6qfDQkygYDmYwOilePFkwzv4dU8A=
github.com/morikuni/aec v1.0.0/go.mod h1:BbKIizmSmc5MMPqRYbxO4ZU0S0+P200+tUnFx7PXmsc=
github.com/niemeyer/pretty v0.0.0-20200227124842-a10e7caefd8e/go.mod h1:zD1mROLANZcx1PVRCS0qkT7pwLkGfwJo4zjcN/Tysno=
@@@ -225,11 -224,9 +229,12 @@@ github.com/uber/jaeger-client-go v2.30.
github.com/uber/jaeger-client-go v2.30.0+incompatible/go.mod h1:WVhlPFC8FDjOFMMWRy2pZqQJSXxYSwNYOkTr/Z6d3Kk=
github.com/uber/jaeger-lib v2.4.1+incompatible h1:td4jdvLcExb4cBISKIpHuGoVXh+dVKhn2Um6rjCsSsg=
github.com/uber/jaeger-lib v2.4.1+incompatible/go.mod h1:ComeNDZlWwrWnDv8aPp0Ba6+uUTzImX/AauajbLI56U=
+github.com/xuri/efp v0.0.0-20240408161823-9ad904a10d6d/go.mod h1:ybY/Jr0T0GTCnYjKqmdwxyxn2BQf2RcQIIvex5QldPI=
+github.com/xuri/excelize/v2 v2.9.0/go.mod h1:uqey4QBZ9gdMeWApPLdhm9x+9o2lq4iVmjiLfBS5hdE=
+github.com/xuri/nfp v0.0.0-20240318013403-ab9948c2c4a7/go.mod h1:WwHg+CVyzlv/TX9xqBFXEZAuxOPxn2k1GNHwG41IIUQ=
github.com/yuin/goldmark v1.1.27/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
github.com/yuin/goldmark v1.2.1/go.mod h1:3hX8gzYuyVAZsxl0MRgGTJEmQBFcNTphYh9decYSb74=
+ github.com/yuin/goldmark v1.4.13/go.mod h1:6yULJ656Px+3vBD8DxQVa3kxgyrAnzto9xy5taEt/CY=
go.opentelemetry.io/auto/sdk v1.1.0 h1:cH53jehLUN6UFLY71z+NDOiNJqDdPRaXzTel0sJySYA=
go.opentelemetry.io/auto/sdk v1.1.0/go.mod h1:3wSPjt5PWp2RhlCcmmOial7AvC4DQqZb7a7wCow3W8A=
go.opentelemetry.io/contrib/instrumentation/net/http/otelhttp v0.54.0 h1:TT4fX+nBOA/+LUkobKGW1ydGcn+G3vRw9+g5HwCphpk=
diff --cc core/internal/service/timers/timers.go
index 929103e4,1195db31..68d6ef0c
--- a/core/internal/service/timers/timers.go
+++ b/core/internal/service/timers/timers.go
@@@ -35,24 -33,11 +35,28 @@@ func Start(ctx context.Context) (err er
maillog_stat.AggregateMaillogsTask(1 * time.Minute)
})
+ // Start console panel baseurl update timer
+ gtimer.AddOnce(5*time.Second, domains.UpdateBaseURL)
+ gtimer.Add(5*time.Minute, domains.UpdateBaseURL)
+
g.Log().Debug(ctx, "Start timers complete")
- return
+ gtimer.AddOnce(5*time.Second, func() {
+ me := maillog_stat.NewMallogEventHandler("", 1*time.Second)
+ me.Start()
+ })
+
+ // ========== Mail task processing: one executor per task ==========
+ gtimer.Add(1*time.Minute, func() {
+ batch_mail.ProcessEmailTasks(ctx)
+ })
+
+ // Idle actuators are cleaned every 10 minutes
+ gtimer.Add(10*time.Minute, func() {
+ batch_mail.CleanupIdleExecutors()
+ g.Log().Debug(ctx, "Idle task executors cleanup completed")
+ })
+
+ g.Log().Debug(ctx, "All timers started successfully")
+ return nil
}