Projects
Kolab:3.4
pykolab
pykolab-0.6.11-fix-shared-folder-delivery.patch
Log In
Username
Password
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File pykolab-0.6.11-fix-shared-folder-delivery.patch of Package pykolab (Revision 60)
Currently displaying revision
60
,
Show latest
commit 455e9b73874b8f58c055e331f0db2bbba1e4ef20 Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Date: Wed Feb 12 15:38:03 2014 +0100 Make sure a shared folder with an inbound address can be delivered mail to diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py index e7c4dd2..ec7e9fe 100644 --- a/pykolab/auth/ldap/__init__.py +++ b/pykolab/auth/ldap/__init__.py @@ -1265,10 +1265,6 @@ class LDAP(pykolab.base.Base): entry['kolabfoldertype'] ) - if entry.has_key(delivery_address_attribute) and \ - not entry[delivery_address_attribute] == None: - self.imap.set_acl(folder_path, 'anyone', 'p') - if entry.has_key('kolabmailfolderaclentry') and \ not entry['kolabmailfolderaclentry'] == None: @@ -1276,6 +1272,10 @@ class LDAP(pykolab.base.Base): entry['kolabmailfolderaclentry'] ) + if entry.has_key(delivery_address_attribute) and \ + not entry[delivery_address_attribute] == None: + self.imap.set_acl(folder_path, 'anyone', '+p') + #if server == None: #self.entry_set_attribute(mailserver_attribute, server) @@ -1782,12 +1782,16 @@ class LDAP(pykolab.base.Base): entry['kolabfoldertype'] ) - #if entry.has_key('kolabmailfolderaclentry') and \ - #not entry['kolabmailfolderaclentry'] == None: + if entry.has_key('kolabmailfolderaclentry') and \ + not entry['kolabmailfolderaclentry'] == None: + + self.imap._set_kolab_mailfolder_acls( + entry['kolabmailfolderaclentry'] + ) - #self.imap._set_kolab_mailfolder_acls( - #entry['kolabmailfolderaclentry'] - #) + if entry.has_key(delivery_address_attribute) and \ + not entry[delivery_address_attribute] == None: + self.imap.set_acl(folder_path, 'anyone', '+p') #if server == None: #self.entry_set_attribute(mailserver_attribute, server) diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py index 9995292..fbe515d 100644 --- a/pykolab/imap/__init__.py +++ b/pykolab/imap/__init__.py @@ -328,6 +328,36 @@ class IMAP(object): if short_rights.has_key(acl): acl = short_rights[acl] + # Special treatment for '-' and '+' characters + if '+' in acl or '-' in acl: + acl_map = { + 'set': '', + 'subtract': '', + 'add': '' + } + + mode = 'set' + for char in acl: + if char == '-': + mode = 'subtract' + continue + if char == '+': + continue + mode = 'add' + + acl_map[mode] += char + + current_acls = self.imap.lam(self.folder_utf7(folder)) + for current_acl in current_acls.keys(): + if current_acl == identifier: + _acl = current_acls[current_acl] + break + + _acl = _acl + acl_map['set'] + acl_map['add'] + + _acl = [x for x in _acl.split() if x not in acl_map['subtract'].split()] + acl = ''.join(list(set(_acl))) + self.imap.sam(self.folder_utf7(folder), identifier, acl) def set_metadata(self, folder, metadata_path, metadata_value, shared=True):
Locations
Projects
Search
Status Monitor
Help
Open Build Service
OBS Manuals
API Documentation
OBS Portal
Reporting a Bug
Contact
Mailing List
Forums
Chat (IRC)
Twitter
Open Build Service (OBS)
is an
openSUSE project
.