Fix bug in get_email where HTML tags sometimes included in text, reported in #565

This commit is contained in:
Garret Wassermann 2018-02-13 22:25:50 -05:00
parent 45115ba5c7
commit 55b55edb90

View File

@ -395,8 +395,9 @@ def ticket_from_message(message, queue, logger):
if not body: if not body:
mail = BeautifulSoup(part.get_payload(), "lxml") mail = BeautifulSoup(part.get_payload(), "lxml")
if ">" in mail.text: if ">" in mail.text:
message_body = mail.text.split(">")[1] body = mail.find('body')
body = message_body.encode('ascii', errors='ignore') body = body.text
body = body.encode('ascii', errors='ignore')
else: else:
body = mail.text body = mail.text