diff --git a/app/courrier/page.tsx b/app/courrier/page.tsx index d9dfc7fb..f0445f92 100644 --- a/app/courrier/page.tsx +++ b/app/courrier/page.tsx @@ -258,11 +258,12 @@ function renderEmailContent(email: Email) { // If we have HTML content, display it if (parsed.html) { + const decodedHtml = decodeMIME(parsed.html, 'quoted-printable', 'utf-8'); return (
]*>[\s\S]*?<\/style>/gi, '') .replace(/]*>[\s\S]*?<\/script>/gi, '') .replace(/]*>/gi, '') @@ -281,9 +282,10 @@ function renderEmailContent(email: Email) { // If we have text content, display it if (parsed.text) { + const decodedText = decodeMIME(parsed.text, 'quoted-printable', 'utf-8'); return (
- {parsed.text.split('\n').map((line: string, i: number) => ( + {decodedText.split('\n').map((line: string, i: number) => (

{line}

))}
@@ -310,7 +312,8 @@ function renderEmailContent(email: Email) { } // If we couldn't parse the content, try to clean and display the raw body - const cleanedContent = email.body + const decodedBody = decodeMIME(email.body, 'quoted-printable', 'utf-8'); + const cleanedContent = decodedBody .replace(/Content-Type:[^\n]+/g, '') .replace(/Content-Transfer-Encoding:[^\n]+/g, '') .replace(/MIME-Version:[^\n]+/g, '')