From e7554b212fb9006fbacd0d49838a241fad44a1c5 Mon Sep 17 00:00:00 2001 From: Tulir Asokan Date: Wed, 28 Jan 2026 17:37:34 +0200 Subject: [PATCH] msgconv/attachments: don't fail if mimeless file has less than 512 bytes --- pkg/msgconv/attachments.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pkg/msgconv/attachments.go b/pkg/msgconv/attachments.go index 72a7ae9..035b5f1 100644 --- a/pkg/msgconv/attachments.go +++ b/pkg/msgconv/attachments.go @@ -123,7 +123,7 @@ func (d *MessageConverter) ReuploadMedia( if mimeType == "" { mimeBuf := make([]byte, 512) n, err := file.(*os.File).ReadAt(mimeBuf, 0) - if err != nil { + if err != nil && !errors.Is(err, io.EOF) { return nil, fmt.Errorf("couldn't read file for mime detection: %w", err) } mimeType = http.DetectContentType(mimeBuf[:n])