This commit is contained in:
2026-08-10 21:15:19 +01:00
parent d7ca591b76
commit 4da942786e
97 changed files with 105039 additions and 3370 deletions
+15
View File
@@ -80,6 +80,21 @@ func (p *GoMailProvider) ListMessages(_ context.Context, folderID string, opts L
var headers []MessageHeader
for _, e := range page {
// Fast path: decrypt the small cached header blob instead of the
// full message body. Falls through to a full read for messages
// delivered before the header cache existed (header_enc is NULL)
// or if the cached blob fails to decrypt/parse for any reason.
if len(e.HeaderEnc) > 0 {
if hdr, err := p.store.DecryptHeaderCache(e.ID, e.HeaderEnc); err == nil {
h := MessageHeader{ID: strconv.Itoa(e.UID), FolderID: folderID, SizeBytes: e.SizeBytes,
From: hdr.From, To: hdr.To, Subject: hdr.Subject, Date: hdr.Date}
if e.Flags != "" {
h.Flags = strings.Fields(e.Flags)
}
headers = append(headers, h)
continue
}
}
raw, err := p.store.Read(e.EMLPath)
if err != nil {
continue