Skip to content

attachextract: don't extract text from zero-byte attachments - #6311

Open
brong wants to merge 1 commit into
cyrusimap:masterfrom
brong:cyr-2534-tike-empty-file
Open

attachextract: don't extract text from zero-byte attachments#6311
brong wants to merge 1 commit into
cyrusimap:masterfrom
brong:cyr-2534-tike-empty-file

Conversation

@brong

@brong brong commented Aug 30, 2026

Copy link
Copy Markdown
Member

An attachment whose decoded content is empty has nothing to extract, but we sent it to the extractor anyway, which rejected it and left an IOERROR in the log for every such body part:

IOERROR index: can't extract attachment
da39a3ee5e6b4b0d3255bfef95601890afd80709 (APPLICATION/PDF):
Item does not exist

Bail out early when the part's content guid is the SHA1 of zero bytes, before any cache lookup or HTTP request. Matching on the guid rather than the raw data length also catches encoded parts, since the content guid hashes the decoded content.

An attachment whose decoded content is empty has nothing to extract, but
we sent it to the extractor anyway, which rejected it and left an
IOERROR in the log for every such body part:

  IOERROR index: can't extract attachment
    da39a3ee5e6b4b0d3255bfef95601890afd80709 (APPLICATION/PDF):
    Item does not exist

Bail out early when the part's content guid is the SHA1 of zero bytes,
before any cache lookup or HTTP request.  Matching on the guid rather
than the raw data length also catches encoded parts, since the content
guid hashes the decoded content.

Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
@brong
brong requested a review from rsto August 30, 2026 00:22
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant