From d94a1313f068b48a1f76759822aa07400cff572d Mon Sep 17 00:00:00 2001 From: prssanna Date: Sat, 5 Sep 2020 13:14:12 +0530 Subject: [PATCH] fix: catch exception while setting In-Reply-To in email header --- frappe/email/email_body.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/frappe/email/email_body.py b/frappe/email/email_body.py index d545190c47..6d0c6f8f33 100755 --- a/frappe/email/email_body.py +++ b/frappe/email/email_body.py @@ -207,7 +207,11 @@ 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""" - self.msg_root["In-Reply-To"] = 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 def make(self): """build into msg_root"""