|
|
|
@ -91,7 +91,7 @@ class MailRoom(Bureau):
|
|
|
|
|
"""
|
|
|
|
|
internaldate = resp_obj[b'INTERNALDATE']
|
|
|
|
|
|
|
|
|
|
msg_data = resp_obj[b'RFC822'].decode('utf-8')
|
|
|
|
|
msg_data = resp_obj[imap_id][b'RFC822'].decode('utf-8')
|
|
|
|
|
msg_obj = email.message_from_string(msg_data)
|
|
|
|
|
|
|
|
|
|
# format and tidy header data
|
|
|
|
@ -168,25 +168,28 @@ class MailRoom(Bureau):
|
|
|
|
|
resp = self.imapserv.fetch([imap_id],
|
|
|
|
|
['INTERNALDATE', 'RFC822'])
|
|
|
|
|
|
|
|
|
|
print("got imap msg:", imap_id, resp)
|
|
|
|
|
|
|
|
|
|
msg = self._make_msg_object(imap_id, resp)
|
|
|
|
|
|
|
|
|
|
# TODO: switch this to inline svgs
|
|
|
|
|
# make action barcodes
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POun." + msg.shortcode + ".png")
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POun." + shortcode + ".png")
|
|
|
|
|
code128.image("POun." + shortcode).save(barcode_png)
|
|
|
|
|
msg.un_bc = str(barcode_png)
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POd." + msg.shortcode + ".png")
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POd." + shortcode + ".png")
|
|
|
|
|
code128.image("POd." + shortcode).save(barcode_png)
|
|
|
|
|
msg.d_bc = str(barcode_png)
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POsp." + msg.shortcode + ".png")
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POsp." + shortcode + ".png")
|
|
|
|
|
code128.image("POsp." + shortcode).save(barcode_png)
|
|
|
|
|
msg.sp_bc = str(barcode_png)
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POre." + msg.shortcode + ".png")
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POre." + shortcode + ".png")
|
|
|
|
|
code128.image("POre." + shortcode).save(barcode_png)
|
|
|
|
|
msg.re_bc = str(barcode_png)
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POrea." + msg.shortcode + ".png")
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POrea." + shortcode + ".png")
|
|
|
|
|
code128.image("POrea." + shortcode).save(barcode_png)
|
|
|
|
|
msg.rea_bc = str(barcode_png)
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POr." + msg.shortcode + ".png")
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POr." + shortcode + ".png")
|
|
|
|
|
code128.image("POr." + shortcode).save(barcode_png)
|
|
|
|
|
msg.r_bc = str(barcode_png)
|
|
|
|
|
|
|
|
|
|