feat: add persistent inline images to email signatures - #893
Open
halcycon wants to merge 2 commits into
Open
Conversation
Store signature image binaries separately from JMAP Identity.htmlSignature and embed them at send time via the existing composer CID inline pipeline. Co-authored-by: Cursor <cursoragent@cursor.com>
Build explicit JMAP Email bodyStructure when HTML messages include inline CID parts so Thunderbird and similar clients render them without treating images as ordinary attachments. Applies to send and draft save paths. Co-authored-by: Cursor <cursoragent@cursor.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.
Summary
Adds persistent image assets to HTML email signatures.
Signature images are stored separately from JMAP
Identity.htmlSignature, avoiding server signature-size limits (notably on Stalwart). When composing, Bulwark loads the stored signature image and reuses the existing inline-image upload pipeline. At send time the HTML is rewritten to usecid:and the image is included as aContent-Disposition: inlineJMAP/MIME attachment.This avoids remote image hosting and allows signature images to display without requiring recipients to enable remote content.
Existing text and HTML signatures continue to use JMAP Identity fields and remain backwards compatible.
Implementation notes
SIGNATURE_DATA_DIR, defaultdata/signatures), keyed by account hash + identity hash + asset UUID.data-signature-assetreferences) lives in syncedextendedSignatures; binaries stay in the asset store.uploadBlob/data-cid/rewriteInlineImages— no second MIME implementation.Identity.htmlSignaturefor other clients.Test plan
cid:, inline attachment present, no public image URLbulwark-signaturesvolume; images survive container restartAutomated tests
npx vitest run lib/__tests__/signature-assets.test.ts lib/__tests__/extended-signatures.test.tsnpm run typecheck && npm run lintMade with Cursor