diff --git a/screenless/bureau/mailroom/mailroom.py b/screenless/bureau/mailroom/mailroom.py
index 5f515e5..ba910cb 100644
--- a/screenless/bureau/mailroom/mailroom.py
+++ b/screenless/bureau/mailroom/mailroom.py
@@ -104,7 +104,7 @@ class MailRoom(Bureau):
"""
#TODO: consider replacing this whole mess with
# https://pypi.python.org/pypi/mail-parser
- internaldate = resp_obj[b'INTERNALDATE']
+ internaldate = resp_obj[imap_id][b'INTERNALDATE']
msg_data = resp_obj[imap_id][b'RFC822'].decode('utf-8')
msg_obj = email.message_from_string(msg_data,
@@ -128,6 +128,9 @@ class MailRoom(Bureau):
msg.content = msg.content.get_content()
else:
msg.content = "ERROR COULD NOT FIND EMAIL BODY!\n Big shrug."
+ msg.content = msg.content.replace("<", "<")
+ msg.content = msg.content.replace(">", ">")
+ msg.content = msg.content.replace("\n", "
")
# extract other sub-messages / attachments
#for part in msg_obj.walk():