Repository navigation
feat(cdp): deliver transactional email attachments from a side table #127986
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
+1,054
−57
Merged
Changes from all commits
Commits
Show all changes
102 commits
Select commit
Hold shift + click to select a range
969011f
feat(cdp): deliver a code send's content on its own transactional ema…
Silthus 920e7c9
fix(cdp): read the primary once for concurrent jobs of a missing work…
Silthus 4c7375d
Merge remote-tracking branch 'upstream/master' into email-v2/01-cdp-c…
Silthus b5889c9
Merge remote-tracking branch 'upstream/master' into email-v2/01-cdp-c…
Silthus 27bfa23
fix(cdp): mint no distinct_id in tracking codes of a capture-off send
Silthus b9b0865
test(cdp): cover the capture choice in dev/test pixel and redirect codes
Silthus aace308
feat(cdp): send cc and bcc on a transactional code send
Silthus 7cb93d9
feat(cdp): deliver transactional email attachments from a side table
Silthus f79130a
perf(cdp): sample the attachment row gauge without a table scan
Silthus 28d56e7
refactor(cdp): drop the dormant v3 tracking-code format
Silthus 0b50f42
feat(cdp): add the email attachments table to cyclotron
Silthus 86c7ab6
Merge branch 'email-v2/13b-cdp-email-attachments-table' into email-v2…
Silthus e7fc40c
fix(cdp): cache and batch confirmed primary misses
Silthus 8095678
fix(cdp): delete attachment files on every final send outcome
Silthus 6df3613
test(cdp): cover attachment cleanup for finished and rescheduled runs
Silthus b7e2f40
fix(cdp): cache primary hits during replica lag
Silthus 4255bac
fix(cdp): keep no primary result from a read a reload overtook
Silthus 38198c3
test(cdp): check attachment cleanup against stored rows
Silthus 9a9eb8d
fix(cdp): resolve email feedback for a workflow only the primary has
Silthus 4f0d3d7
fix(cdp): keep workflows found when a feedback lookup fails
Silthus ac6e18c
Merge remote-tracking branch 'origin/master' into rhs3-cdp-code-send-fix
Silthus adfb3d7
Merge commit '9a9eb8d273ba57d681252a8bdce3fdcf0b015c47' into email-v2…
Silthus f0b7f43
Merge remote-tracking branch 'origin/email-v2/13-cdp-code-send-copies…
Silthus b3d3cc0
Merge remote-tracking branch 'origin/email-v2/13b-cdp-email-attachmen…
Silthus abbf035
fix(cdp): count a failed primary lookup for email feedback
Silthus d41662a
Merge branch 'email-v2/01-cdp-code-send' into email-v2/13-cdp-code-se…
Silthus 9bfe581
Merge branch 'email-v2/13-cdp-code-send-copies' into email-v2/13b-cdp…
Silthus e79d708
Merge branch 'email-v2/13b-cdp-email-attachments-table' into email-v2…
Silthus f72b960
chore(cdp): test that attachments survive an ses throttle retry
Silthus e2fd437
chore: merge master into email-v2/01-cdp-code-send
Silthus fc855c3
fix(cdp): refuse a code send field this version does not know
Silthus f470194
Merge commit 'fc855c3e41d6f00d71db0a76e43b65e1b722a2a0' into HEAD
Silthus cf413fe
Merge commit 'f470194f9c4' into email-v2/13b-cdp-email-attachments-table
Silthus 98778c2
Merge commit 'cf413fe35efb1c3efc6fa893622b16a64b18e795' into email-v2…
Silthus 34347b2
fix(cdp): refuse unknown fields inside a code send's content, sender …
Silthus 5307e9b
Merge commit '34347b2339949240c61994107d0eb9b077fb3ef0' into HEAD
Silthus 5551b1e
Merge commit '5307e9bae1f' into email-v2/13b-cdp-email-attachments-table
Silthus e4589c9
Merge commit '5551b1ed921e42d6fa7dc74100b4de465b43ae12' into email-v2…
Silthus 474a766
chore(cdp): drop the comment on the strict send schema
Silthus ef33e2b
Merge commit '474a7662c3014855a00cf84caea7d861d7d77e41' into HEAD
Silthus 6ffe40f
Merge commit 'ef33e2b9d16' into email-v2/13b-cdp-email-attachments-table
Silthus 7762f3f
Merge commit '6ffe40fd8de749a668cdba16ffddfc102b771fc1' into email-v2…
Silthus 98d5b71
chore(cdp): drop comments from the copy recipient code
Silthus 684e036
Merge commit '98d5b71392f136f15637bd6eede263fbbc952559' into email-v2…
Silthus ddeee0d
chore(cdp): drop comments from the email attachments migration
Silthus 712800b
Merge commit 'ddeee0dfc6f' into email-v2/14-cdp-code-send-attachments
Silthus b4454f4
chore(cdp): drop comments from the email attachments code
Silthus 272024a
fix(cdp): accept only a code-send token on the code send route
Silthus 8be4b84
Merge remote-tracking branch 'origin/master' into email-v2/01-cdp-cod…
Silthus ddea17d
refactor(cdp): lay a code send over the email step in the send hand-off
Silthus 6513306
Merge remote-tracking branch 'origin/email-v2/01-cdp-code-send' into …
Silthus 5e58ffe
Merge branch 'email-v2/13-cdp-code-send-copies' into email-v2/13b-cdp…
Silthus bb6b915
Merge branch 'email-v2/13b-cdp-email-attachments-table' into email-v2…
Silthus 1be8e50
fix(cdp): replay a code send on rerun only when the request allows it
Silthus b5c9e59
refactor(cdp): read the capture choice in one place
Silthus 76243a7
fix(cdp): check a code send's copies before skipping a suppressed rec…
Silthus aa70789
Merge branch 'email-v2/13-cdp-code-send-copies' into email-v2/13b-cdp…
Silthus 0d2fa00
Merge branch 'email-v2/13b-cdp-email-attachments-table' into email-v2…
Silthus 2eac306
fix(cdp): keep a code send's choices when a step resumes from saved s…
Silthus 3ac5bf5
Merge remote-tracking branch 'origin/email-v2/01-cdp-code-send' into …
Silthus 2c9582e
Merge branch 'email-v2/13-cdp-code-send-copies' into email-v2/13b-cdp…
Silthus 36153cc
Merge branch 'email-v2/13b-cdp-email-attachments-table' into email-v2…
Silthus 0aa7884
fix(cdp): accept every dot-atom recipient the email pipeline can send to
Silthus 8766c36
Merge commit '0aa7884cfcbe10a9592a8472cf7888bcd8a8c6f9' into HEAD
Silthus db2db99
fix(cdp): check copy addresses with the recipient address pattern
Silthus c2e4535
Merge remote-tracking branch 'origin/email-v2/13-cdp-code-send-copies…
Silthus 0b84b75
Merge remote-tracking branch 'origin/email-v2/13b-cdp-email-attachmen…
Silthus 3639e5d
fix(cdp): keep dots between the characters of a recipient's local part
Silthus bc8b605
Merge remote-tracking branch 'origin/email-v2/01-cdp-code-send' into …
Silthus 9277e7e
Merge remote-tracking branch 'origin/email-v2/13-cdp-code-send-copies…
Silthus 906d90e
Merge remote-tracking branch 'origin/email-v2/13b-cdp-email-attachmen…
Silthus ccdd9ff
fix(cdp): tell the user why a sensitive run was not re-run
Silthus 75f7a34
Merge remote-tracking branch 'origin/master' into HEAD
Silthus 20fb623
fix(cdp): call a skipped sensitive run's content a message, not an email
Silthus 627b966
Merge commit '20fb6230d8525f962fe664024c457f690b5e6eab' into HEAD
Silthus ddc7ece
Merge remote-tracking branch 'origin/email-v2/13-cdp-code-send-copies…
Silthus 5f2bdbf
Merge remote-tracking branch 'origin/email-v2/13b-cdp-email-attachmen…
Silthus eb26545
chore(cdp): send the executor's email routing tests through a mocked SES
Silthus 8144a0e
Merge commit 'eb26545793431ef5b714c167b78f90775d3b4124' into HEAD
Silthus cdfdcb2
Merge commit '8144a0e1929' into email-v2/13b-cdp-email-attachments-table
Silthus b3366fa
Merge commit 'cdfdcb24897' into email-v2/14-cdp-code-send-attachments
Silthus b926744
chore(cdp): share the lazy pool between conversion watchers and attac…
Silthus a239b6b
chore(cdp): keep the conversion watcher comments where they were
Silthus 6f4136c
fix(cdp): refuse a code send token on the template send route
Silthus 52a086a
Merge #127122 6f4136c into email-v2/13-cdp-code-send-copies
Silthus b6e32d3
Merge #127985 into email-v2/13b-cdp-email-attachments-table
Silthus 66be68d
Merge #127995 into email-v2/14-cdp-code-send-attachments
Silthus 4a75f30
fix(cdp): retry an email whose attachment files fail to load
Silthus 829067d
fix(cdp): keep attachment files when the queue insert fails
Silthus 2723f32
fix(cdp): delete attachment files only after the job result is written
Silthus c3638f3
fix(cdp): refuse attachment types that SES or Gmail rejects
Silthus c3422d0
chore(cdp): size attachments with Buffer.byteLength
Silthus 2a930a2
fix(cdp): scope email attachment rows to the job's team
Silthus 53d6c26
Merge master into email-v2/13-cdp-code-send-copies
Silthus 36b3a58
Merge email-v2/13-cdp-code-send-copies into email-v2/13b-cdp-email-at…
Silthus d069769
Merge email-v2/13b-cdp-email-attachments-table into email-v2/14-cdp-c…
Silthus 8087a87
Merge master into email-v2/14-cdp-code-send-attachments
Silthus cb6469d
fix(cdp): key a code send with files on the sender the caller chose
Silthus dab7651
fix(cdp): keep the files of a send whose job another worker holds
Silthus 6f1c414
fix(cdp): refuse attachment headers SES rejects and skip locked sweep…
Silthus 900e21f
chore(cdp): cover the attachment sweep around a locked row
Silthus 3bf8a16
fix(cdp): bound attachment content before the base64 check
Silthus File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
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
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
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
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
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
Oops, something went wrong.
Oops, something went wrong.
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A sender with a code-send key can attach an executable that the blocked-extension list is supposed to refuse. The strip added here (
const { attachments: ... } = args[0]) makes theAttachmentSchemafilename check innodejs/src/cdp/services/hogflows/transactional-email.ts:151-157the sole gate on every delivered attachment's filename, and that check derives the extension from the text after the last dot with no trimming:"invoice.exe."yields an empty extension and"invoice.exe "yields"exe ", neither of which is inBLOCKED_ATTACHMENT_EXTENSIONS(transactional-email.ts:153-154). Windows strips trailing dots and spaces when the recipient saves the file, so the delivered attachment becomesinvoice.exe. The filename regexes at transactional-email.ts:148 and :140 block path separators and control characters but not a trailing space or dot.How:
send.attachments, include a file namedinvoice.exe.(orinvoice.exe) with base64 PE content.AttachmentSchemapasses:name.lastIndexOf('.')finds the trailing dot andname.slice(dot + 1)is""(or"exe "), which the blocked set does not contain, so the API stores the file and queues the send.invoice.exe.Fix: In the filename refine at transactional-email.ts:151-157, trim trailing dots and whitespace before deriving the extension (and reject the name if the trimmed result is empty).
React with 👍 if useful or 👎 if not
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Valid as a gap in this check, but no file gets past it. The public entry point is Django's code send, and #127988 refuses
invoice.exe.andinvoice.exewithblocked_file_typebefore it calls cdp-api: it strips trailing dots and spaces the way Windows does when it saves the file. cdp-api's/sendis internal, and since 2a930a2 a workflow email step can't list files. Making the cdp check agree with Django's is a follow-up for #127985's schema, so this stack doesn't need another round of proofs for it.