summaryrefslogtreecommitdiffstats
path: root/pykolab
diff options
context:
space:
mode:
authorAleksander Machniak <machniak@kolabsys.com>2016-10-06 09:44:59 +0200
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2016-10-06 09:44:59 +0200
commitf57e5263ed37d61548e04e0ba7e591cfecf3edc6 (patch)
treeed0e1c829f6b44bbd0d2d892a5d578eb7c9eefec /pykolab
parent8478ac6830d0002c77ce9b23ca6e1fd35fbec464 (diff)
downloadpykolab-f57e5263ed37d61548e04e0ba7e591cfecf3edc6.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
Diffstat (limited to 'pykolab')
-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