From 143289bbd0736d72553a3c2a080aa3d125366b38 Mon Sep 17 00:00:00 2001 From: Drew DeVault Date: Sun, 31 Mar 2019 11:29:57 -0400 Subject: Don't parse mail in worker; send a reader instead --- worker/imap/fetch.go | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'worker/imap') diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go index d229126..8052e13 100644 --- a/worker/imap/fetch.go +++ b/worker/imap/fetch.go @@ -2,7 +2,6 @@ package imap import ( "github.com/emersion/go-imap" - "github.com/mohamedattahri/mail" "git.sr.ht/~sircmpwn/aerc2/worker/types" ) @@ -45,16 +44,9 @@ func (imapw *IMAPWorker) handleFetchMessages( for _msg := range messages { imapw.seqMap[_msg.SeqNum-1] = _msg.Uid if reader := _msg.GetBody(section); reader != nil { - email, err := mail.ReadMessage(reader) - if err != nil { - imapw.worker.PostMessage(&types.Error{ - Message: types.RespondTo(msg), - Error: err, - }, nil) - } imapw.worker.PostMessage(&types.MessageBody{ - Mail: email, - Uid: _msg.Uid, + Reader: reader, + Uid: _msg.Uid, }, nil) } else { imapw.worker.PostMessage(&types.MessageInfo{ -- cgit 1.4.1-2-gfad0