MFA fix, added IP blacklist, update webmail client

This commit is contained in:
2026-08-14 13:04:55 +01:00
parent 6063f95504
commit 892f366a16
122 changed files with 13362 additions and 251 deletions
+13 -2
View File
@@ -1,12 +1,15 @@
package webui
import "net/http"
import (
"net/http"
"time"
)
// navCounts are the small per-resource counts shown as sidebar badges on every page
// (and reused by the dashboard's own stat tiles, which use the same numbers) — scoped
// to the current admin exactly like every list page already is.
type navCounts struct {
DomainCount, SenderCount, MailboxCount, IPCount, DKIMCount int
DomainCount, SenderCount, MailboxCount, IPCount, DKIMCount, BlacklistCount int
}
func (a *App) computeNavCounts(r *http.Request) navCounts {
@@ -17,6 +20,14 @@ func (a *App) computeNavCounts(r *http.Request) navCounts {
c.DomainCount, _ = a.DB.CountActiveDomains()
c.SenderCount, _ = a.DB.CountActiveSenders()
c.DKIMCount, _ = a.DB.CountActiveDKIMKeys()
if entries, err := a.DB.ListBlacklist(); err == nil {
now := time.Now()
for _, e := range entries {
if e.ExpiresAt.After(now) {
c.BlacklistCount++
}
}
}
} else {
domains, _ := a.DB.ListDomains()
for _, d := range domains {