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
1 changed files with 4 additions and 3 deletions
|
@ -82,10 +82,11 @@ func (imapw *IMAPWorker) handleFetchMessages(
|
||||||
case *types.FetchMessageHeaders:
|
case *types.FetchMessageHeaders:
|
||||||
reader := _msg.GetBody(section)
|
reader := _msg.GetBody(section)
|
||||||
textprotoHeader, err := textproto.ReadHeader(bufio.NewReader(reader))
|
textprotoHeader, err := textproto.ReadHeader(bufio.NewReader(reader))
|
||||||
var header *mail.Header
|
if err != nil {
|
||||||
if err == nil {
|
done <- fmt.Errorf("could not read header: %v", err)
|
||||||
header = &mail.Header{message.Header{textprotoHeader}}
|
return
|
||||||
}
|
}
|
||||||
|
header := &mail.Header{message.Header{textprotoHeader}}
|
||||||
imapw.worker.PostMessage(&types.MessageInfo{
|
imapw.worker.PostMessage(&types.MessageInfo{
|
||||||
Message: types.RespondTo(msg),
|
Message: types.RespondTo(msg),
|
||||||
Info: &models.MessageInfo{
|
Info: &models.MessageInfo{
|
||||||
|
|
Loading…
Reference in a new issue