From 641ab4bbe8d122f0e80b5f2579f7639efd3be935 Mon Sep 17 00:00:00 2001 From: Lucas Rayan Date: Thu, 22 Oct 2026 14:45:34 -0300 Subject: [PATCH] feat(webmail): keep a message's own stylesheet so designed mail renders as sent Co-Authored-By: Claude Sonnet 5.5 --- services/webmail/src/lib/emailBody.ts | 9 +++--- services/webmail/src/lib/sanitizer.ts | 42 +++++++++++++++++++++++--- services/webmail/src/sanitizer.test.ts | 8 +++-- 3 files changed, 49 insertions(+), 10 deletions(-) diff --git a/services/webmail/src/lib/emailBody.ts b/services/webmail/src/lib/emailBody.ts index 70d73b2..7a4f19c 100644 --- a/services/webmail/src/lib/emailBody.ts +++ b/services/webmail/src/lib/emailBody.ts @@ -55,9 +55,9 @@ export function buildReaderDocument(bodyHtml: string): string {

x

`)).not.toContain("@import url(https://evil.test/x.css);.a{color:red}p{behavior:url(x)}

x

`); + expect(out).toContain("

x

`)).not.toContain("