Skip to content

馃敥 Render threaded EML correspondence as polished document pages - #9

Open
JFWooten4 wants to merge 1 commit into
serve-documentsfrom
render-threaded-eml-20261017
Open

JFWooten4 wants to merge 1 commit into
serve-documentsfrom
render-threaded-eml-20261017

Conversation

@JFWooten4

Copy link
Copy Markdown
Member

Summary

Add first-class, readable, inline EML correspondence pages to the existing read-only WhyDRS document host, with clean filename-derived public slugs and full conversation-thread views.

This is stacked on the interim Nginx document-hosting changes in #8, rather than targeting main directly. Merge that hosting PR first, then this one.

Reader experience

  • Adding Board Letter.eml publishes /board-letter/; nested documents retain directory-based URL prefixes, with deterministic disambiguation for filename collisions.
  • Each source email gets a permanent, human-readable public URL, but raw EML source files are never served.
  • Messages linked by Message-ID, In-Reply-To, and References render as a chronological, inline conversation, with per-message permalinks, a thread navigator, and a consolidated correspondence index at /_mail/. Sibling replies can still group if the original message is missing.
  • Responsive layout with sender, recipients, date, subject, and readable HTML or plaintext. Quoted plaintext histories are collapsible.
  • Embedded cid: PNG, JPEG, GIF, and WebP images render inline. Other MIME attachments are downloadable with original filenames shown.

Build and security

  • A Python standard-library generator produces static HTML and CSS at Docker build time; no runtime backend, frontend framework, JavaScript, or mail-sending system.
  • Conservative HTML and CSS allowlists remove active content and network-loaded images; CSP blocks scripts and outbound resource requests. Generated attachments use opaque .bin names with a forced attachment disposition and nosniff.
  • Existing Markdown and PDFs remain served unchanged through Nginx, and .dockerignore now admits EML files for conversion without publishing their originals.

Verification

  • Five local Python unit tests passed: reply grouping, missing-root sibling threads, HTML sanitization, CID images/attachment output, permalink slugs, collisions, and escaping.
  • Local nginx -t syntax validation passed.
  • Branch is one commit ahead of serve-documents with seven intended files changed; existing repository documents remain untouched.
  • Not verified: full Docker image build or deployment. The repository currently has no .eml document fixtures, so production content rendering still needs an end-to-end check after adding a real EML.

Notes

Thread grouping relies on actual RFC email reference headers, not subject similarity; separate emails that lack reply headers remain separate. HTML style blocks and remote images are deliberately dropped to prevent untrusted email content from controlling the site or tracking visitors.

Generate responsive, sanitized HTML pages from EML filenames, group related messages by reply headers, preserve inline CID images and safe attachment downloads, and document the read-only correspondence workflow. Add regression tests and keep the existing Markdown and PDF hosting intact.

Co-authored-by: Codex Web <noreply@openai.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant