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".
This commit is contained in:
Tim Abbott
2017-10-18 21:13:03 -07:00
parent 31afdd2ff9
commit c61b6d06e5

View File

@@ -152,6 +152,7 @@ def construct_zulip_body(message, realm):
body = body.replace("\x00", "") body = body.replace("\x00", "")
body = filter_footer(body) body = filter_footer(body)
body += extract_and_upload_attachments(message, realm) body += extract_and_upload_attachments(message, realm)
body = body.strip()
if not body: if not body:
body = '(No email body)' body = '(No email body)'
return body return body