summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-08-04 21:59:32 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-08-04 21:59:32 -0400
commit91887a0e6cecf53273fb6de85608bea0b0b5581a (patch)
treea60d54a1512e9991e070e8fcd687e9fd92677950
parenta71a8d2729c7fb5a9fc31170cb762cb100aed7ba (diff)
parent84fd219265a9c589d5031e9476677c0a3f59bab4 (diff)
downloadpykolab-91887a0e6cecf53273fb6de85608bea0b0b5581a.tar.gz
Merge branch 'master' of ssh://git.kolab.org/git/pykolab
-rw-r--r--pykolab/Makefile.am4
-rw-r--r--pykolab/auth/ldap/__init__.py17
-rw-r--r--pykolab/cli/cmd_rename_mailbox.py2
-rw-r--r--pykolab/imap/cyrus.py9
4 files changed, 29 insertions, 3 deletions
diff --git a/pykolab/Makefile.am b/pykolab/Makefile.am
index a23aa6e..f2c4cf4 100644
--- a/pykolab/Makefile.am
+++ b/pykolab/Makefile.am
@@ -42,6 +42,10 @@ pykolab_imap_PYTHON = \
imap/__init__.py \
imap/cyrus.py
+pykolab_itipdir = $(pythondir)/$(PACKAGE)/itip
+pykolab_itip_PYTHON = \
+ itip/__init__.py
+
pykolab_pluginsdir = $(pythondir)/$(PACKAGE)/plugins
pykolab_plugins_PYTHON = \
plugins/__init__.py
diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py
index 752b4fc..f15d2c8 100644
--- a/pykolab/auth/ldap/__init__.py
+++ b/pykolab/auth/ldap/__init__.py
@@ -1816,9 +1816,26 @@ class LDAP(pykolab.base.Base):
if entry.has_key('kolabfolderaclentry') and \
not entry['kolabfolderaclentry'] == None:
+ if isinstance(entry['kolabfolderaclentry'], basestring):
+ entry['kolabfolderaclentry'] = [ entry['kolabfolderaclentry'] ]
+
+ import copy
+ _acls = copy.deepcopy(entry['kolabfolderaclentry'])
+ entry['kolabfolderaclentry'] = []
+
+ for _entry in _acls:
+ if _entry[0] == "(":
+ entry['kolabfolderaclentry'].append(_entry)
+ continue
+
+ s,r = [x.strip() for x in _entry.split(',')]
+
+ entry['kolabfolderaclentry'].append("('%s', '%s', '%s')" % (folder_path, s, r))
+
self.imap._set_kolab_mailfolder_acls(
entry['kolabfolderaclentry']
)
+
elif entry['kolabfolderaclentry'] in [None,[]]:
for ace in self.imap.list_acls(folder_path):
aci_subject = ace.split()[0]
diff --git a/pykolab/cli/cmd_rename_mailbox.py b/pykolab/cli/cmd_rename_mailbox.py
index 87d41f3..4efed0d 100644
--- a/pykolab/cli/cmd_rename_mailbox.py
+++ b/pykolab/cli/cmd_rename_mailbox.py
@@ -66,7 +66,7 @@ def execute(*args, **kw):
print >> sys.stderr, _("Source folder %r does not exist") % (source_folder)
sys.exit(1)
- if imap.has_folder(target_folder):
+ if imap.has_folder(target_folder) and partition == None:
print >> sys.stderr, _("Target folder %r already exists") % (target_folder)
sys.exit(1)
diff --git a/pykolab/imap/cyrus.py b/pykolab/imap/cyrus.py
index f09e429..6f561ce 100644
--- a/pykolab/imap/cyrus.py
+++ b/pykolab/imap/cyrus.py
@@ -123,6 +123,7 @@ class Cyrus(cyruslib.CYRUS):
imap = IMAP()
imap.connect(uri=uri)
+
if not self.SEP == self.separator:
self.separator = self.SEP
@@ -236,8 +237,12 @@ class Cyrus(cyruslib.CYRUS):
server = self.find_mailfolder_server(from_mailfolder)
self.connect(self.uri.replace(self.server,server))
- log.debug(_("Moving INBOX folder %s to %s") % (from_mailfolder,to_mailfolder), level=8)
- self.m.rename(from_mailfolder, to_mailfolder, partition)
+ if not partition == None:
+ log.debug(_("Moving INBOX folder %s to %s on partition %s") % (from_mailfolder,to_mailfolder, partition), level=8)
+ else:
+ log.debug(_("Moving INBOX folder %s to %s") % (from_mailfolder,to_mailfolder), level=8)
+
+ self.m.rename(self.folder_utf7(from_mailfolder), self.folder_utf7(to_mailfolder), '"%s"' % (partition))
def _getannotation(self, *args, **kw):
return self.getannotation(*args, **kw)