summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-10-06 09:44:51 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-10-06 09:44:51 +0200
commit2d4acc01fb41f0f7ba08d7c9934d9410a1d2f9a1 (patch)
tree0f4bb9ed4406b67339869197b611e3938a2a7263
parent67033c2926d7acbcf6d59eb9dbf1ecb52ae496c4 (diff)
downloadpykolab-2d4acc01fb41f0f7ba08d7c9934d9410a1d2f9a1.tar.gz
T1375: Fix setting metadata on dovecot
Summary: Fixes T1375 Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Maniphest Tasks: T1375 Differential Revision: https://git.kolab.org/D211
-rw-r--r--pykolab/imap/__init__.py2
-rw-r--r--pykolab/imap/dovecot.py8
2 files changed, 5 insertions, 5 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index fe37dfc..ce5612f 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -408,8 +408,6 @@ class IMAP(object):
if metadata_path.startswith('/shared/'):
shared = True
-
- if metadata_path.startswith('/shared/'):
metadata_path = metadata_path.replace('/shared/', '/')
elif metadata_path.startswith('/private/'):
shared = False
diff --git a/pykolab/imap/dovecot.py b/pykolab/imap/dovecot.py
index 226e6f1..8d5c0a5 100644
--- a/pykolab/imap/dovecot.py
+++ b/pykolab/imap/dovecot.py
@@ -78,20 +78,22 @@ def imap_getmetadata(self, mailbox, pattern='*', shared=None):
entries = " /private%s" % pattern
typ, dat = self._simple_command('GETMETADATA', options, mailbox, entries)
+
return self._untagged_response(typ, dat, 'METADATA')
def imap_setmetadata(self, mailbox, desc, value, shared=False):
if value:
- value = quote(value)
+ value = value.join(['"', '"'])
else:
value = "NIL"
if shared:
typ, dat = self._simple_command('SETMETADATA', mailbox,
- "(/shared/%s %s)" % (desc,value))
+ "(/shared%s %s)" % (desc,value))
else:
typ, dat = self._simple_command('SETMETADATA', mailbox,
- "(/private/%s %s)" % (desc,value))
+ "(/private%s %s)" % (desc,value))
+
return self._untagged_response(typ, dat, 'METADATA')
# Bind the new methods to the cyruslib IMAP4 and IMAP4_SSL objects