aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason Gunthorpe <jgg@mellanox.com>2020-03-27 19:50:09 -0300
committerJason Gunthorpe <jgg@mellanox.com>2020-03-27 19:50:09 -0300
commit88c8cdb534716a163c28ec13e12c2877cef19e1f (patch)
tree2f624d42a548d7bf9dce03a9a362749e60a33a55
parent87f34026e85dfd73b68568bc46db555c173be1f4 (diff)
downloadcloud_mdir_sync-88c8cdb534716a163c28ec13e12c2877cef19e1f.tar.gz
cloud_mdir_sync-88c8cdb534716a163c28ec13e12c2877cef19e1f.tar.bz2
cloud_mdir_sync-88c8cdb534716a163c28ec13e12c2877cef19e1f.zip
o365: Support delete_action in O365
If set to "delete" the deleted messages will go to Deleted Items by default things go to Archive, just like gmail. Signed-off-by: Jason Gunthorpe <jgg@mellanox.com>
-rw-r--r--cloud_mdir_sync/office365.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/cloud_mdir_sync/office365.py b/cloud_mdir_sync/office365.py
index 5c52228..3f9ddc7 100644
--- a/cloud_mdir_sync/office365.py
+++ b/cloud_mdir_sync/office365.py
@@ -364,6 +364,7 @@ class O365Mailbox(mailbox.Mailbox):
timer = None
use_owa_subscribe = True
graph: GraphAPI
+ delete_action = "archive" # or delete
def __init__(self,
cfg: config.Config,
@@ -651,7 +652,11 @@ class O365Mailbox(mailbox.Mailbox):
self.graph.post_json(
"v1.0",
f"/me/mailFolders/{self.mailbox}/messages/{cmsg.storage_id}/move",
- body={"destinationId": "deleteditems"}))
+ body={
+ "destinationId":
+ "deleteditems"
+ if self.delete_action == "delete" else "archive"
+ }))
del self.messages[ch]
await asyncio_complete(*todo_flags)