|
|
@ -1,7 +1,9 @@
|
|
|
|
import email
|
|
|
|
import email
|
|
|
|
from email.header import decode_header, make_header
|
|
|
|
from email.header import decode_header, make_header
|
|
|
|
import imaplib
|
|
|
|
import imaplib
|
|
|
|
|
|
|
|
import os.path
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import code128
|
|
|
|
import imapclient
|
|
|
|
import imapclient
|
|
|
|
|
|
|
|
|
|
|
|
from bureau import Bureau, add_command, add_api
|
|
|
|
from bureau import Bureau, add_command, add_api
|
|
|
@ -129,6 +131,26 @@ class MailRoom(Bureau):
|
|
|
|
msg.content = msg.content.replace(">", ">")
|
|
|
|
msg.content = msg.content.replace(">", ">")
|
|
|
|
msg.content = msg.content.replace("\n", "<br />")
|
|
|
|
msg.content = msg.content.replace("\n", "<br />")
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# make action barcodes
|
|
|
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POun." + msg.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")
|
|
|
|
|
|
|
|
code128.image("POd." + shortcode).save(barcode_png)
|
|
|
|
|
|
|
|
msg.d_bc = str(barcode_png)
|
|
|
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POsp." + msg.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")
|
|
|
|
|
|
|
|
code128.image("POre." + shortcode).save(barcode_png)
|
|
|
|
|
|
|
|
msg.re_bc = str(barcode_png)
|
|
|
|
|
|
|
|
barcode_png = os.path.join("/tmp", "POrea." + msg.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")
|
|
|
|
|
|
|
|
code128.image("POr." + shortcode).save(barcode_png)
|
|
|
|
|
|
|
|
msg.r_bc = str(barcode_png)
|
|
|
|
|
|
|
|
|
|
|
|
self.print_full("email.html", msg=msg, shortcode=shortcode)
|
|
|
|
self.print_full("email.html", msg=msg, shortcode=shortcode)
|
|
|
|
|
|
|
|
|
|
|
|
@add_command("d", "Delete email")
|
|
|
|
@add_command("d", "Delete email")
|
|
|
|