PROJ-92: forwarded_via in Suchtreffern, Detail und Threads; Badge im Portal. PROJ-93: archivmail imap-verify gleicht Message-IDs im IMAP-Postfach mit dem Archiv ab (strikt lesend, nur Zahlen und Ordner:UID). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
28 lines
1.0 KiB
Go
28 lines
1.0 KiB
Go
package api
|
|
|
|
import "archivmail/pkg/mailparser"
|
|
|
|
type searchHit struct {
|
|
ID string `json:"id"`
|
|
Score float64 `json:"score"`
|
|
From string `json:"from,omitempty"`
|
|
To string `json:"to,omitempty"`
|
|
CC string `json:"cc,omitempty"`
|
|
BCC string `json:"bcc,omitempty"`
|
|
ForwardedVia string `json:"forwarded_via,omitempty"`
|
|
Subject string `json:"subject,omitempty"`
|
|
Date string `json:"date,omitempty"`
|
|
Size int64 `json:"size,omitempty"`
|
|
HasAttachments bool `json:"has_attachments"`
|
|
ThreadID string `json:"thread_id,omitempty"`
|
|
ThreadSize int `json:"thread_size,omitempty"`
|
|
Snippet string `json:"snippet,omitempty"` // PROJ-44: HTML excerpt with <b>match</b> tags
|
|
MatchField string `json:"match_field,omitempty"` // PROJ-44: subject|body|attachment_text|...
|
|
}
|
|
|
|
func setForwardedVia(resp map[string]interface{}, pm *mailparser.ParsedMail) {
|
|
if fv := mailparser.ForwardedVia(pm); fv != "" {
|
|
resp["forwarded_via"] = fv
|
|
}
|
|
}
|