aboutsummaryrefslogtreecommitdiffstats
path: root/worker/maildir/worker.go
diff options
context:
space:
mode:
Diffstat (limited to 'worker/maildir/worker.go')
-rw-r--r--worker/maildir/worker.go14
1 files changed, 13 insertions, 1 deletions
diff --git a/worker/maildir/worker.go b/worker/maildir/worker.go
index 30faddac..de7e8e89 100644
--- a/worker/maildir/worker.go
+++ b/worker/maildir/worker.go
@@ -448,7 +448,7 @@ func (w *Worker) sort(uids []uint32, criteria []*types.SortCriterion) ([]uint32,
wg.Add(1)
go func(uid uint32) {
defer wg.Done()
- info, err := w.msgInfoFromUid(uid)
+ info, err := w.msgHeadersFromUid(uid)
if err != nil {
logging.Errorf("could not get message info: %v", err)
return
@@ -729,6 +729,18 @@ func (w *Worker) msgInfoFromUid(uid uint32) (*models.MessageInfo, error) {
return info, nil
}
+func (w *Worker) msgHeadersFromUid(uid uint32) (*models.MessageInfo, error) {
+ m, err := w.c.Message(*w.selected, uid)
+ if err != nil {
+ return nil, err
+ }
+ info, err := m.MessageHeaders()
+ if err != nil {
+ return nil, err
+ }
+ return info, nil
+}
+
func (w *Worker) handleCheckMail(msg *types.CheckMail) {
if msg.Command == "" {
w.err(msg, fmt.Errorf("checkmail: no command specified"))