From c61b6d06e5e460c94eafecff09ebc193395a9d88 Mon Sep 17 00:00:00 2001 From: Tim Abbott Date: Wed, 18 Oct 2017 21:13:03 -0700 Subject: [PATCH] email_mirror: Strip content before checking for empty emails. This may fix an exception we were getting of the form: "Error queueing internal message by emailgateway@zulip.com: Message must not be empty". --- zerver/lib/email_mirror.py | 1 + 1 file changed, 1 insertion(+) diff --git a/zerver/lib/email_mirror.py b/zerver/lib/email_mirror.py index b256f4f107..a27c81b2d8 100644 --- a/zerver/lib/email_mirror.py +++ b/zerver/lib/email_mirror.py @@ -152,6 +152,7 @@ def construct_zulip_body(message, realm): body = body.replace("\x00", "") body = filter_footer(body) body += extract_and_upload_attachments(message, realm) + body = body.strip() if not body: body = '(No email body)' return body