From 33bda477516c29b086f42bd215083090a3d113d4 Mon Sep 17 00:00:00 2001 From: Karim Hamidou Date: Tue, 1 Nov 2016 12:11:29 -0700 Subject: [PATCH] Add support for the MOVE command. See RFC 6851 (https://tools.ietf.org/html/rfc6851) for more details. --- imapclient/imapclient.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/imapclient/imapclient.py b/imapclient/imapclient.py index 969b605..aad37ec 100644 --- a/imapclient/imapclient.py +++ b/imapclient/imapclient.py @@ -1029,6 +1029,18 @@ class IMAPClient(object): self._normalise_folder(folder), uid=True, unpack=True) + + def move(self, messages, folder): + """Move one or more messages from the current folder to + *folder*. Returns the MOVE response string returned by the + server. + """ + return self._command_and_check('move', + join_message_ids(messages), + self._normalise_folder(folder), + uid=True, unpack=True) + + def expunge(self): """Remove any messages from the currently selected folder that have the ``\\Deleted`` flag set. -- 2.43.0