From 30f9ef8f45cff0face1b1c6e3efb4347319fcacd Mon Sep 17 00:00:00 2001 From: Brendan Howell Date: Fri, 29 Jul 2016 18:56:50 +0200 Subject: [PATCH] start of mailroom bureau --- screenless/bureau/mailroom/mailroom.py | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/screenless/bureau/mailroom/mailroom.py b/screenless/bureau/mailroom/mailroom.py index e904e9d..4c504ed 100644 --- a/screenless/bureau/mailroom/mailroom.py +++ b/screenless/bureau/mailroom/mailroom.py @@ -37,7 +37,7 @@ class MailRoom(Bureau): """ Takes a photograph using the document camera and sends it in an E-mail. """ - self.send("PXphoto.") + photo = self.send("PXphoto.") @add_command("rd", "Print full email") def read(self, data): @@ -51,6 +51,7 @@ class MailRoom(Bureau): """ Deletes an email and moves it to the trash folder. """ + self.imapserv.delete_messages((data)) pass @add_command("s", "Mark as spam") @@ -59,6 +60,9 @@ class MailRoom(Bureau): Flags an email as spam, mark as read and move it to the configured SPAM folder. """ + self.imapserv.copy((data), self.spamfolder) + # TODO: mark as read? with self.imapserv.add_flags? + self.delete(data) pass @add_command("re", "Reply with scan") @@ -67,6 +71,9 @@ class MailRoom(Bureau): Reply to the sender of a mail with the PDF currently queued in the document scanner. """ + # look up short code to get IMAP ID + # extract the sender and title + # put together the reply pass @add_api("unread", "Get unread mails")