What to build
Every stored inbound message carries a kind, and only ordinary messages continue into attachment processing.
A mailbox that sends mail also receives what comes back from it: non-delivery reports, automatic absence replies, and human answers. Today all three are indistinguishable from an ordinary message, so any consumer downstream treats them as one — which is how a delivery report, carrying the original message and its attachments back, ends up feeding an attachment pipeline built for something else entirely.
Four kinds, detected from what the message itself declares rather than from the transport that fetched it:
| Kind | Detected by |
| Delivery report | Content-Type: multipart/report with report-type=delivery-status |
| Auto-reply | Auto-Submitted present and not no (RFC 3834) |
| Ordinary | neither |
A delivery report additionally carries a status class — permanent or transient, from the per-recipient status field of the report (RFC 3463: 5.x.x versus 4.x.x). The distinction is recorded here because it is in the message; what to do about it is not this package's business.
Detection must sit above the driver, not inside one: the headers it reads are properties of the message, and a second transport must not need its own copy of the rules. The raw headers are already stored, so no re-fetch is required.
This package classifies and stops. It does not interpret a report's meaning, correlate it to anything, or act on it.
Acceptance criteria
Blocked by
None — can start immediately.
What to build
Every stored inbound message carries a kind, and only ordinary messages continue into attachment processing.
A mailbox that sends mail also receives what comes back from it: non-delivery reports, automatic absence replies, and human answers. Today all three are indistinguishable from an ordinary message, so any consumer downstream treats them as one — which is how a delivery report, carrying the original message and its attachments back, ends up feeding an attachment pipeline built for something else entirely.
Four kinds, detected from what the message itself declares rather than from the transport that fetched it:
| Kind | Detected by |
| Delivery report |
Content-Type: multipart/reportwithreport-type=delivery-status|| Auto-reply |
Auto-Submittedpresent and notno(RFC 3834) || Ordinary | neither |
A delivery report additionally carries a status class — permanent or transient, from the per-recipient status field of the report (RFC 3463:
5.x.xversus4.x.x). The distinction is recorded here because it is in the message; what to do about it is not this package's business.Detection must sit above the driver, not inside one: the headers it reads are properties of the message, and a second transport must not need its own copy of the rules. The raw headers are already stored, so no re-fetch is required.
This package classifies and stops. It does not interpret a report's meaning, correlate it to anything, or act on it.
Acceptance criteria
multipart/report; report-type=delivery-statusmessage is classified as a delivery report, and its permanent/transient class is recordedAuto-Submitted: auto-replied(and other values that are notno) is classified as an auto-replyBlocked by
None — can start immediately.