|
|
|
@ -76,8 +76,10 @@ class MailRoom(Bureau):
|
|
|
|
|
"""
|
|
|
|
|
try:
|
|
|
|
|
self.imapserv.select_folder("INBOX")
|
|
|
|
|
except self.imapserv.abort as err:
|
|
|
|
|
except self.imapserv.AbortError as err:
|
|
|
|
|
print("imap connection error: ", err)
|
|
|
|
|
self.imapserv.logout()
|
|
|
|
|
self.imapserv = imapclient.IMAPClient(self.host, use_uid=True, ssl=self.imap_ssl)
|
|
|
|
|
self.imapserv.login(self.login, self.password)
|
|
|
|
|
self.imapserv.select_folder("INBOX")
|
|
|
|
|
|
|
|
|
@ -228,6 +230,8 @@ class MailRoom(Bureau):
|
|
|
|
|
msg["From"] = msg_obj["To"]
|
|
|
|
|
# TODO: deal with ReplyTo headers properly
|
|
|
|
|
msg["To"] = msg_obj["From"]
|
|
|
|
|
msg["Subject"] = "Re: " + msg_obj["Subject"]
|
|
|
|
|
#TODO: add reference headers from msg id for threading
|
|
|
|
|
msg["Date"] = email.utils.formatdate(localtime=True)
|
|
|
|
|
msg.attach(email.mime.text.MIMEText(bodytext))
|
|
|
|
|
|
|
|
|
|