feat(protocols): trusted senders are not filed as spam, when the message proves its sender
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
b536ed13e7
commit
d7f9659b5e
7 files changed
+226
No files matched your search
@@ -18,6 +18,8 @@ const snippetLength = 200
|
||||
type MessageHeaders struct {
|
||||
Subject string
|
||||
FromDisplayName string
|
||||
// FromAddress is the address in From, lowercased, or empty when it does not parse.
|
||||
FromAddress string
|
||||
MessageID string
|
||||
Snippet string
|
||||
HasAttachments bool
|
||||
@@ -58,6 +60,7 @@ func ExtractMessageHeaders(payload []byte) MessageHeaders {
|
||||
|
||||
if from := msg.Header.Get("From"); from != "" {
|
||||
if addr, err := mail.ParseAddress(from); err == nil {
|
||||
out.FromAddress = strings.ToLower(addr.Address)
|
||||
out.FromDisplayName = truncateUTF8(decodeHeader(addr.Name), 255)
|
||||
} else {
|
||||
// A From that does not parse still often carries a usable name
|
||||
|
||||
Reference in new issue
Block a user