From baa9afc9454bb432d715ca50e3ad3e283ad21d79 Mon Sep 17 00:00:00 2001 From: prssanna Date: Mon, 7 Sep 2020 16:20:28 +0530 Subject: [PATCH] fix(Email): replace newline characters in In-Reply-To in email header (cherry picked from commit 3f2827bf03ecf57c20e9583bd40c43faccde16b8) --- frappe/email/email_body.py | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/frappe/email/email_body.py b/frappe/email/email_body.py index 6d0c6f8f33..001ba59e95 100755 --- a/frappe/email/email_body.py +++ b/frappe/email/email_body.py @@ -207,11 +207,7 @@ class EMail: def set_in_reply_to(self, in_reply_to): """Used to send the Message-Id of a received email back as In-Reply-To""" - try: - self.msg_root["In-Reply-To"] = in_reply_to - except ValueError: - # in_reply_to may contain line feed characters, so ignore in that case - pass + self.msg_root["In-Reply-To"] = in_reply_to.replace("\r", "").replace("\n", "") def make(self): """build into msg_root"""