Repository navigation
Conversation
…Labs#2166) Stage 1, part 1 of the attachment-content search: a bounded, panic-free reader for OOXML containers (ECMA-376/APPNOTE: end of central directory, central directory, local headers; stored and deflate members) and the main parts of DOCX/XLSX/PPTX, with XML character data resolved through quick-xml; plain-text formats decode through mailcraft-charset. Caps on input, members, decompressed bytes and kept text; a hostile file is an error, never a stop. Fuzz target included. No PDF (stage 2), no index wiring yet (part 2).
|
Important Draft PR not reviewedDraft PRs are not automatically reviewed by default.
To automatically review draft PRs, update your CodeRabbit configuration: reviews:
auto_review:
drafts: true
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. |
guess decodes (UTF-8, else Windows-1252) and is used as such; the text cap counts characters; a document without its main part is refused; only block ends (p, tr, tc, si, row) separate words, so a run Word splits mid-word stays one; CDATA is read; an end-of-central-directory candidate is believed only when what it says holds; every offset computation is checked; the module's contract says what a malformed document part yields. Five tests cover the new behaviour.
Stage 1, part 2: a new part ATTACHMENT_TEXT next to the attachment's name; texts_full carries the extracted texts (texts and texts_with are unchanged for their callers); attachment: finds names and, where extracted, content. fingerprint_full adds the extraction's version and each attachment's content to the fingerprint when the switch is on, so exactly the messages with attachments are read again when it changes; without attachments the fingerprint is the base one. The budgeted in-step read leaves messages with attachments to the background, as it does hidden words kept on disk; the background extracts within attext's caps. Words::set_attext is the switch; the option and its backfill follow in part 3.
Stage 1, part 3: File > Options > Mail gains the switch. It is the pref indexAttachmentText (settings from before read as off), file.options takes it and starts the pass at once: the fingerprints of messages with attachments change with the switch, so exactly those are read again, bounded per file by attext's caps; everything else keeps its words. The catalogues carry the two new strings; a release-note fragment says it in a line.
f076f20 to
3d14d98
Compare
…bs#2166) The second review's two findings: a sheet's cells and their inline strings separate words like its rows do (Alpha and Beta in adjacent cells stay two words), and the end-of-directory candidate's offset is only read once it is known to lie inside the data, so a 32-bit build can't overflow on what a record claims. Two tests.
One step left: sign the Contributor Licence AgreementThank you for contributing. Before this can be merged, everyone listed below signs the CLA once. It takes one comment, and it covers every contribution you make from now on. To sign: add a new comment to this pull request with only this line in it (the copy button is on the right): This check turns green within a minute or so. Editing an older comment doesn't count, so please post a new one. Still to sign: You keep the copyright in your work, and MailCraft stays MIT OR Apache-2.0. The CLA also lets UCS Care Group release MailCraft under other terms, such as a commercial edition, without asking each contributor again. Questions are welcome here. |
|



Builds on #2395. Part 3 of 3 for #2166 — with this the stage-1 stack is complete.
The user-facing switch, off by default:
indexAttachmentText(#[serde(default)]: settings written before the option read as off; a round-trip test covers the command, the serialization, and the old-settings case).file.optionstakes the key (params documented) and, when the value changed, starts the pass at once:words_in_stephands the pref toWords::set_attexton every tick, and becausefingerprint_fullchanges with the switch for exactly the messages that have attachments, those are read again — everything else keeps its words and is not touched.cargo xtask i18n).packaging/release-notes.d/new/2166.md.cargo check/clippyclean formailcraft-engineandmailcraft-ui-egui; the new test and the existing words/options tests pass.The stack: #2394 (extractor) ← #2395 (index) ← this. Happy to squash or split differently if you prefer.