update
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user