Repository navigation
inbox: split forwarded-as-attachment emails into messages of their own; drop duplicate note copies - #13
Merged
Conversation
Every message/rfc822 part (postal-mime forceRfc822Attachments) becomes a child inbox message: own R2 prefix and parse job, the embedded From, Subject, Date and Message-ID, the parent's auth verdict and forwarded_by. The parent's .eml rows point at the child (expanded_message_id) and are kept out of consumers and knowledge. Redelivery is idempotent through a unique (tenant_id, parent_message_id, source_sha256) index; an embedded Message-ID already received is linked, not stored again. Depth cap 3, 50 children per message. Consumers gain parentMessageId, forwardedBy and forwardedMessageIds; the Inbox page links parent and children. Also removes the duplicate docs/plugins/<id>/upgrades copies that `plugin export` left inside inbox and freeagent in 3.6.0; docs/upgrades/ is the canonical home, and the README says to delete the copy after an export. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
cliftonc
added a commit
that referenced
this pull request
Oct 24, 2026
inbox splits forwarded-as-attachment email: each embedded message/rfc822 part becomes a child message with its own sender, subject and parse job, the forward's auth verdict and forwarded_by, deduplicated by Message-ID and idempotent on redelivery (#13). Needs a host migration (six columns, two FKs, one partial unique index). The duplicate docs/plugins/<id>/upgrades copies in inbox and freeagent are gone. The other five plugins are version stamps only. README install commands name the 3.7.0 tag. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
To ship in 3.7.0.
inbox: forwarded-as-attachment email is split. Gmail's "Forward as attachment" sends one email with N
message/rfc822parts. Until now they were stored as.emlattachments, so consumers never saw them and knowledge ingestion skipped them. A part with no disposition was merged into the parent body instead.inbox.parseuses postal-mime'sforceRfc822Attachments, so every embedded message is a part of its own.inbox.parse. It carries the embedded From, Subject, Date and Message-ID, and the parent's SPF/DKIM/DMARC verdict, because its own signatures can't be checked once re-wrapped.forwarded_byrecords the forward's envelope sender..emlrows, withexpanded_message_idpointing at the child. Those rows are kept out of consumerattachments, knowledge andattachment_count, so nothing processes an email twice.(tenant_id, parent_message_id, source_sha256)index stops redelivery or reprocessing from creating a second child. An embedded Message-ID the tenant already has is linked instead of stored again.errorsays how many.InboxParsedMessage), additive:parentMessageId,forwardedBy,forwardedMessageIds.parentMessageId/forwardedBy/forwardedCount, and details gainparent/forwardedMessages. The page shows "Contains N forwarded emails" and "Forwarded inside …".inbox_messagesgainsparent_message_id,forwarded_by,forward_depth,source_sha256andforwarded_count.inbox_attachmentsgainsexpanded_message_id. All columns are nullable or defaulted, and the host generates the DDL.tests/api/forwarded.test.tscovers two attached receipts becoming children with the right sender and subject, an inline rfc822 part, idempotent redelivery with consumers called once per child, Message-ID linking, the depth cap, the children cap and tenant isolation.Duplicate note copies removed.
plugins/{inbox,freeagent}/docs/plugins/<id>/upgrades/were left behind bypnpm plugin exportin 3.6.0.docs/upgrades/is canonical, because the installer maps it to the host'sdocs/plugins/<id>/upgrades/. The README now says to delete the export's copy.Run locally against kit 0.22.0: installing from this checkout,
db:generate,pnpm gateandplugin checkall pass. Generating a migration from an inbox 3.6.0 install gives sixADD COLUMNs, two FKs and one partial unique index.🤖 Generated with Claude Code