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?
This commit is contained in:
parent
3102ac3680
commit
92f59ef94a
|
@ -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{
|
||||
|
|
Loading…
Reference in New Issue