package webui import ( "archive/zip" "encoding/base64" "fmt" "html/template" "net/http" "net/mail" "net/url" "path/filepath" "strconv" "strings" "github.com/microcosm-cc/bluemonday" "mailgoserver/internal/db" "mailgoserver/internal/mailview" ) const webmailPageSize = 25 // htmlBodyPolicy sanitizes an HTML email body before it's ever embedded into a page // as template.HTML — an email body is attacker-controlled content (anyone can send a // mailbox a message), so rendering it unsanitized would be a straightforward stored // XSS vector. UGCPolicy allows the common formatting tags/attributes a real email // body uses while stripping