diff --git a/debian/patches/0001-fix-email-Header-Footer-are-also-included-in-plainte.patch b/debian/patches/0001-fix-email-Header-Footer-are-also-included-in-plainte.patch new file mode 100644 index 0000000000000000000000000000000000000000..2ced6dfaa71a11a482b0b76cd83c4963e13183c1 --- /dev/null +++ b/debian/patches/0001-fix-email-Header-Footer-are-also-included-in-plainte.patch @@ -0,0 +1,40 @@ +From ae8f700cb41c4ec5d69b7a8f84fce455067796b9 Mon Sep 17 00:00:00 2001 +From: marudor <marudor@marudor.de> +Date: Fri, 10 Dec 2021 13:58:59 +0100 +Subject: [PATCH] fix(email): Header & Footer are also included in plaintext + emails + + https://github.com/RocketChat/Rocket.Chat/pull/23928 +--- + app/mailer/server/api.ts | 8 ++------ + 1 file changed, 2 insertions(+), 6 deletions(-) + +diff --git a/app/mailer/server/api.ts b/app/mailer/server/api.ts +index c59cd2151f..f97ce0823e 100644 +--- a/app/mailer/server/api.ts ++++ b/app/mailer/server/api.ts +@@ -75,10 +75,6 @@ export const replaceEscaped = (str: string, data: { [key: string]: unknown } = { + }; + + export const wrap = (html: string, data: { [key: string]: unknown } = {}): string => { +- if (settings.get('email_plain_text_only')) { +- return replace(html, data); +- } +- + if (!body) { + throw new Error('`body` is not set yet'); + } +@@ -190,8 +186,8 @@ export const send = ({ + from, + replyTo, + subject: replace(subject, data), +- text: (text && replace(text, data)) +- || (html && stripHtml(replace(html, data)).result) ++ text: (text && stripHtml(wrap(text, data)).result) ++ || (html && stripHtml(wrap(html, data)).result) + || undefined, + html: html ? wrap(html, data) : undefined, + headers, +-- +2.35.1 + diff --git a/debian/patches/series b/debian/patches/series new file mode 100644 index 0000000000000000000000000000000000000000..05b3640a10e7ab01b34f560913675c961412fd62 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-fix-email-Header-Footer-are-also-included-in-plainte.patch