Documentation
¶
Overview ¶
Package mail contains provider-neutral email normalization and safety rules.
Index ¶
- func FormatAddresses(addresses []model.Address) string
- func IsAllowedRecipient(addresses []model.Address, allowed map[string]struct{}) bool
- func NormalizeSubject(subject string) string
- func ParseAddresses(input string) ([]model.Address, error)
- func ParseOne(input string) (model.Address, error)
- func ReduceDelivery(current string, currentAt time.Time, event string, eventAt time.Time) string
- func References(existing, messageID string) string
- func ReplyAll(replyTo, from model.Address, originalTo, originalCC []model.Address, ...) []model.Address
- func ReplySubject(subject string) string
- func SanitizeHTML(input string, resolveCID CIDResolver) (sanitized string, remoteImagesBlocked bool)
- func TextFromHTML(input string) string
- type CIDResolver
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FormatAddresses ¶
FormatAddresses returns conventional human-readable mailbox syntax.
func IsAllowedRecipient ¶
IsAllowedRecipient checks all envelope-visible recipients against an allow-list.
func NormalizeSubject ¶
NormalizeSubject removes repeated reply/forward prefixes and normalizes whitespace.
func ParseAddresses ¶
ParseAddresses parses RFC-compatible comma-separated mailbox input and deduplicates it.
func ReduceDelivery ¶
ReduceDelivery applies explicit precedence while retaining an existing terminal state.
func References ¶
References appends a message identifier once while preserving order.
func ReplyAll ¶
func ReplyAll(replyTo, from model.Address, originalTo, originalCC []model.Address, own map[string]struct{}) []model.Address
ReplyAll builds a stable deduplicated recipient set while excluding the mailbox itself.
func ReplySubject ¶
ReplySubject returns a display subject with exactly one Re: prefix.
func SanitizeHTML ¶
func SanitizeHTML(input string, resolveCID CIDResolver) (sanitized string, remoteImagesBlocked bool)
SanitizeHTML removes executable/active content and blocks remote image requests.
func TextFromHTML ¶
TextFromHTML extracts bounded readable text without exposing markup.
Types ¶
type CIDResolver ¶
CIDResolver maps an inline content identifier to an authenticated local URL.