Scan inline XML/PDF MIME parts, not only attachment disposition #11

Closed
opened 2026-05-11 18:52:27 +02:00 by heiko · 3 comments
Owner

Problem

internal/scanner/attachment.go only processes parts where Content-Disposition is exactly attachment.

Reference: internal/scanner/attachment.go:55.

Invoice mail can contain XML/PDF parts with inline disposition or no disposition at all, especially when the part still has a filename or an invoice content type. Those messages are currently skipped.

Expected

Process MIME parts when they have a filename or an interesting content type (application/xml, text/xml, application/pdf), regardless of whether the disposition is attachment.

Suggested fix

Treat disposition as a hint rather than a hard gate, and add tests for inline/no-disposition XML and PDF parts.

## Problem `internal/scanner/attachment.go` only processes parts where `Content-Disposition` is exactly `attachment`. Reference: `internal/scanner/attachment.go:55`. Invoice mail can contain XML/PDF parts with `inline` disposition or no disposition at all, especially when the part still has a filename or an invoice content type. Those messages are currently skipped. ## Expected Process MIME parts when they have a filename or an interesting content type (`application/xml`, `text/xml`, `application/pdf`), regardless of whether the disposition is `attachment`. ## Suggested fix Treat disposition as a hint rather than a hard gate, and add tests for inline/no-disposition XML and PDF parts.
Author
Owner

Branch renamed per convention:

Old: regression/issue-11-inline-mime
New: fix/11-inline-mime-parts

The old remote branch has been deleted.

Branch renamed per convention: Old: regression/issue-11-inline-mime New: fix/11-inline-mime-parts The old remote branch has been deleted.
Author
Owner

Fix branch pushed: fix/11-inline-mime-parts-claude

Relaxes the Walk disposition guard to also process parts with inline or missing disposition when they have an invoice-relevant content-type or filename. Also extracts filename from Content-Type name param. Regression test passes.

Fix branch pushed: [fix/11-inline-mime-parts-claude](https://forgejo.schlittermann.de/IUS/xr-invoiced/src/branch/fix/11-inline-mime-parts-claude) Relaxes the Walk disposition guard to also process parts with inline or missing disposition when they have an invoice-relevant content-type or filename. Also extracts filename from Content-Type name param. Regression test passes.
Author
Owner

Implementation branch: fix/11-inline-mime-parts-codex

Implementation branch: [fix/11-inline-mime-parts-codex](https://forgejo.schlittermann.de/IUS/xr-invoiced/src/branch/fix/11-inline-mime-parts-codex)
heiko closed this issue 2026-05-11 22:25:58 +02:00
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
IUS/xr-invoiced#11
No description provided.