From e3ee3612bcfc5e906a82e1ad258443020e9e1d25 Mon Sep 17 00:00:00 2001 From: nd <git@notandy.de> Date: Fri, 18 Mar 2022 13:28:09 +0000 Subject: [PATCH] add support for custom patches --- ...-Footer-are-also-included-in-plainte.patch | 40 +++++++++++++++++++ debian/patches/series | 1 + 2 files changed, 41 insertions(+) create mode 100644 debian/patches/0001-fix-email-Header-Footer-are-also-included-in-plainte.patch create mode 100644 debian/patches/series 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 0000000..2ced6df --- /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 0000000..05b3640 --- /dev/null +++ b/debian/patches/series @@ -0,0 +1 @@ +0001-fix-email-Header-Footer-are-also-included-in-plainte.patch -- GitLab