From 3426d5ad3d798bca5b38b7a878606ae9ada49da2 Mon Sep 17 00:00:00 2001 From: Harry Culpan Date: Tue, 30 Jun 2026 18:44:33 -0400 Subject: [PATCH] Log partial email body read errors instead of silently ignoring io.ReadAll errors are unlikely for short yes/no replies but worth logging for diagnosability. Processing continues with whatever bytes were read to remain resilient. Co-Authored-By: Claude Sonnet 4.6 --- pkg/email/fetch.go | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/pkg/email/fetch.go b/pkg/email/fetch.go index ba3e9b5..b2e1bec 100644 --- a/pkg/email/fetch.go +++ b/pkg/email/fetch.go @@ -3,6 +3,7 @@ package email import ( "fmt" "io" + "log" "net/mail" "strings" @@ -92,6 +93,9 @@ func fetchEmails(imapClient *client.Client) ([]Email, error) { return result, err } body, err := io.ReadAll(m.Body) + if err != nil { + log.Printf("Warning: partial read of email body from %s: %s", fromAddress, err) + } email := NewEmail( []string{toAddress},