From 92f59ef94af4ce936a5ea3a4407360e558317744 Mon Sep 17 00:00:00 2001 From: Ben Fiedler Date: Fri, 24 Apr 2020 16:25:13 +0200 Subject: imap/fetch.go: report error when fetching headers fails Correct me if I'm wrong, but shouldn't this raise an error when it fails? --- worker/imap/fetch.go | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'worker') diff --git a/worker/imap/fetch.go b/worker/imap/fetch.go index bc7144c..9591ced 100644 --- a/worker/imap/fetch.go +++ b/worker/imap/fetch.go @@ -82,10 +82,11 @@ func (imapw *IMAPWorker) handleFetchMessages( case *types.FetchMessageHeaders: reader := _msg.GetBody(section) textprotoHeader, err := textproto.ReadHeader(bufio.NewReader(reader)) - var header *mail.Header - if err == nil { - header = &mail.Header{message.Header{textprotoHeader}} + if err != nil { + done <- fmt.Errorf("could not read header: %v", err) + return } + header := &mail.Header{message.Header{textprotoHeader}} imapw.worker.PostMessage(&types.MessageInfo{ Message: types.RespondTo(msg), Info: &models.MessageInfo{ -- cgit 1.4.1-2-gfad0 a> refs log blame commit diff stats
path: root/make_doc.py
blob: d59ac73bc70e0d085726ab90a1c5f6bf446b1440 (plain) (tree)
1
2
3
4
5
6
7
8