cleanups for mail template

workspace
Brendan Howell 4 years ago
parent 6535ac33bf
commit 756482724d

@ -19,12 +19,13 @@
width: 70%;
min-height: 12em;
padding-right: 3%;
line-height: 0.9em;
line-height: 1.2em;
}
#menu {
font-family: "CMU Sans Serif";
width: 24%;
float: left;
padding-right: 3%;
/* padding-right: 3%; */
}
.cmd {
clear: both;
@ -38,9 +39,11 @@
<div id="container">
<div id="header">
<div class="env-info">From: ${msg.fromstr}</div>
% if msg.cc:
<div class="env-info">CC: ${msg.cc}</div>
% endif
<div class="env-info">Subject: ${msg.subject}</div>
<div class="env-info">Date: ${msg.date}</div>
<div class="env-info">Date: ${msg.date.strftime("%A, %d. %B %Y %H:%M")}</div>
<div class="env-info">To: ${msg.tostr}</div>
</div>
<div id="main">

@ -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("<", "&lt;")
msg.content = msg.content.replace(">", "&gt;")
msg.content = msg.content.replace("\n", "<br />")
# extract other sub-messages / attachments
#for part in msg_obj.walk():

Loading…
Cancel
Save