updated layout for webmail and added http dns letsencrypt

This commit is contained in:
2026-08-15 12:35:44 +01:00
parent 310700407e
commit f283c90f11
49 changed files with 3359 additions and 431 deletions
+30 -1
View File
@@ -4,6 +4,7 @@ import (
"fmt"
"html/template"
"net/http"
"net/mail"
"strconv"
"strings"
"time"
@@ -50,6 +51,26 @@ func (a *App) funcMap() template.FuncMap {
"lower": strings.ToLower,
"safe": func(s string) template.HTML { return template.HTML(s) },
"filesize": humanFileSize,
// senderName shows just the display name from a "Name <addr@example.com>"
// cached_from value (the message's own From: header, cached verbatim — see
// smtpserver's fromHeader) — falls back to the bare address when there's no
// display name, or the value doesn't parse as one (e.g. an older row cached
// before this, or a plain envelope address with no header form).
"senderName": func(s string) string {
if addr, err := mail.ParseAddress(s); err == nil && addr.Name != "" {
return addr.Name
}
return s
},
// initial is the avatar-circle letter for a sender name/address — the first
// rune, uppercased; falls back to "?" for an empty value rather than an empty
// circle.
"initial": func(s string) string {
for _, r := range s {
return strings.ToUpper(string(r))
}
return "?"
},
"dotToDash": func(s string) string { return strings.ReplaceAll(s, ".", "-") },
"add": func(a, b int) int { return a + b },
"sub": func(a, b int) int { return a - b },
@@ -134,7 +155,7 @@ var pages = []string{
"ips.html", "add_ip.html", "edit_ip.html",
"blacklist.html",
"dkim.html", "edit_dkim.html",
"settings.html", "letsencrypt.html", "logs.html", "view_message_content.html", "error.html",
"settings.html", "letsencrypt.html", "logs.html", "error.html",
"account.html", "first_login.html",
"admins.html", "add_admin.html", "edit_admin.html",
}
@@ -148,6 +169,14 @@ var standalonePages = []string{
"login.html", "login_mfa.html", "mfa_setup_required.html", "totp_setup.html",
"webmail_login.html", "webmail_login_mfa.html", "webmail_account.html", "webmail_totp_setup.html", "webmail_mfa_setup_required.html",
"webmail_folder.html", "webmail_message.html", "webmail_compose.html", "webmail_rules.html", "webmail_certs.html",
// A bare HTML fragment (no <html>/base.html chrome at all), fetched via JS and
// injected into logs.html's full-screen modal — not a page anyone navigates to
// directly, so it doesn't need to look like a standalone document the way the
// other entries in this list (all real standalone pages) do.
"view_message_content.html",
// Same idea as view_message_content.html above, but for webmail_folder.html's
// reading pane instead of the admin log's modal.
"webmail_message_pane.html",
}
// pagesWithComposeWidget are the standalone pages that show a Compose/Reply/Forward