Projects
Kolab:3.4
pykolab
Log In
Username
Password
We truncated the diff of some files because they were too big. If you want to see the full diff for every file,
click here
.
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
Expand all
Collapse all
Changes of Revision 64
View file
pykolab.spec
Changed
@@ -23,7 +23,7 @@ Summary: Kolab Groupware Solution Name: pykolab -Version: 0.6.11 +Version: 0.6.12 Release: 1%{?dist} License: GPLv3+ Group: Applications/System @@ -489,6 +489,9 @@ %attr(0700,%{kolab_user},%{kolab_group}) %dir %{_var}/spool/pykolab/wallace %changelog +* Sat Feb 15 2013 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 0.6.12-1 +- New upstream bug-fix release + * Tue Jan 28 2014 Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> - 0.6.11-1 - New upstream release
View file
pykolab-0.6.11-apt-ldap-fixes-concat.patch
Deleted
@@ -1,106 +0,0 @@ -diff -ur pykolab-0.6.11.orig/pykolab/auth/ldap/__init__.py pykolab-0.6.11/pykolab/auth/ldap/__init__.py ---- pykolab-0.6.11.orig/pykolab/auth/ldap/__init__.py 2014-01-28 12:33:07.000000000 +0100 -+++ pykolab-0.6.11/pykolab/auth/ldap/__init__.py 2014-02-12 15:40:16.837527961 +0100 -@@ -1150,7 +1150,7 @@ - foldertype_attribute = self.config_get('sharedfolder_type_attribute') - if not foldertype_attribute == None: - if not entry.has_key(foldertype_attribute): -- entry[foldertype_attribute] = self.get_user_attribute( -+ entry[foldertype_attribute] = self.get_entry_attribute( - entry['id'], - foldertype_attribute - ) -@@ -1252,10 +1252,6 @@ - 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: - -@@ -1263,6 +1259,10 @@ - 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) - -@@ -1519,7 +1519,7 @@ - foldertype_attribute = self.config_get('sharedfolder_type_attribute') - if not foldertype_attribute == None: - if not entry.has_key(foldertype_attribute): -- entry[foldertype_attribute] = self.get_user_attribute( -+ entry[foldertype_attribute] = self.get_entry_attribute( - entry['id'], - foldertype_attribute - ) -@@ -1769,12 +1769,16 @@ - 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) -Only in pykolab-0.6.11/pykolab/auth/ldap: __init__.py.orig -diff -ur pykolab-0.6.11.orig/pykolab/imap/__init__.py pykolab-0.6.11/pykolab/imap/__init__.py ---- pykolab-0.6.11.orig/pykolab/imap/__init__.py 2014-01-28 12:33:07.000000000 +0100 -+++ pykolab-0.6.11/pykolab/imap/__init__.py 2014-02-12 15:40:16.838527957 +0100 -@@ -328,6 +328,36 @@ - 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):
View file
pykolab-0.6.11-apt-sieve-fixes-concat.patch
Deleted
@@ -1,46 +0,0 @@ -diff -ur pykolab-0.6.11.orig/pykolab/cli/sieve/cmd_refresh.py pykolab-0.6.11/pykolab/cli/sieve/cmd_refresh.py ---- pykolab-0.6.11.orig/pykolab/cli/sieve/cmd_refresh.py 2014-01-28 12:33:07.000000000 +0100 -+++ pykolab-0.6.11/pykolab/cli/sieve/cmd_refresh.py 2014-02-12 17:18:05.049219845 +0100 -@@ -97,7 +97,7 @@ - active, scripts = result - - log.debug(_("Found the following scripts for user %s: %s") % (address, ','.join(scripts)), level=8) -- log.deubg(_("And the following script is active for user %s: %s") % (address, active), level=8) -+ log.debug(_("And the following script is active for user %s: %s") % (address, active), level=8) - - mgmt_required_extensions = [] - -@@ -344,7 +344,9 @@ - mgmt_script.addfilter(rule_name, ['true'], forward_rules) - - else: -- mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules) -+ # NOTE: Messages with no X-Spam-Status header need to be matched -+ # too, and this does exactly that. -+ mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules) - - if sdf_filter: - mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")]) -diff -ur pykolab-0.6.11.orig/pykolab/plugins/sievemgmt/__init__.py pykolab-0.6.11/pykolab/plugins/sievemgmt/__init__.py ---- pykolab-0.6.11.orig/pykolab/plugins/sievemgmt/__init__.py 2014-01-28 12:33:07.000000000 +0100 -+++ pykolab-0.6.11/pykolab/plugins/sievemgmt/__init__.py 2014-02-12 17:18:05.049219845 +0100 -@@ -109,7 +109,7 @@ - active, scripts = result - - log.debug(_("Found the following scripts for user %s: %s") % (address, ','.join(scripts)), level=8) -- log.deubg(_("And the following script is active for user %s: %s") % (address, active), level=8) -+ log.debug(_("And the following script is active for user %s: %s") % (address, active), level=8) - - mgmt_required_extensions = [] - -@@ -356,7 +356,9 @@ - mgmt_script.addfilter(rule_name, ['true'], forward_rules) - - else: -- mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules) -+ # NOTE: Messages with no X-Spam-Status header need to be matched -+ # too, and this does exactly that. -+ mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules) - - if sdf_filter: - mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")])
View file
pykolab-0.6.11-fix-shared-folder-delivery.patch
Deleted
@@ -1,95 +0,0 @@ -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):
View file
pykolab-0.6.11-match-messages-with-no-xspamheader-too.patch
Deleted
@@ -1,36 +0,0 @@ -commit 4aa15736969edcf354155f36d99cd53f17be66c1 -Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> -Date: Wed Feb 12 17:06:08 2014 +0100 - - Match messages without an X-Spam-Status header set, too - -diff --git a/pykolab/cli/sieve/cmd_refresh.py b/pykolab/cli/sieve/cmd_refresh.py -index 6c10dfa..b610e2d 100644 ---- a/pykolab/cli/sieve/cmd_refresh.py -+++ b/pykolab/cli/sieve/cmd_refresh.py -@@ -344,7 +344,9 @@ def execute(*args, **kw): - mgmt_script.addfilter(rule_name, ['true'], forward_rules) - - else: -- mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules) -+ # NOTE: Messages with no X-Spam-Status header need to be matched -+ # too, and this does exactly that. -+ mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules) - - if sdf_filter: - mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")]) -diff --git a/pykolab/plugins/sievemgmt/__init__.py b/pykolab/plugins/sievemgmt/__init__.py -index 42297a4..ade829d 100644 ---- a/pykolab/plugins/sievemgmt/__init__.py -+++ b/pykolab/plugins/sievemgmt/__init__.py -@@ -356,7 +356,9 @@ class KolabSievemgmt(object): - mgmt_script.addfilter(rule_name, ['true'], forward_rules) - - else: -- mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules) -+ # NOTE: Messages with no X-Spam-Status header need to be matched -+ # too, and this does exactly that. -+ mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules) - - if sdf_filter: - mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")])
View file
pykolab-0.6.11-saslauthd-logger-permissions.patch
Deleted
@@ -1,239 +0,0 @@ -diff -ur pykolab-0.6.11.orig/pykolab/logger.py pykolab-0.6.11/pykolab/logger.py ---- pykolab-0.6.11.orig/pykolab/logger.py 2014-01-28 12:33:07.000000000 +0100 -+++ pykolab-0.6.11/pykolab/logger.py 2014-02-14 15:49:34.519321952 +0100 -@@ -37,6 +37,8 @@ - debuglevel = 0 - fork = False - loglevel = logging.CRITICAL -+ process_username = 'kolab' -+ process_groupname = 'kolab-n' - - if hasattr(sys, 'argv'): - for arg in sys.argv: -@@ -66,6 +68,26 @@ - else: - loglevel = logging.DEBUG - -+ if '-u' == arg or '--user' == arg: -+ process_username = -1 -+ continue -+ -+ if arg.startswith('--user='): -+ process_username = arg.split('=')[1] -+ -+ if process_username == -1: -+ process_username = arg -+ -+ if '-g' == arg or '--group' == arg: -+ process_groupname = -1 -+ continue -+ -+ if arg.startswith('--group='): -+ process_groupname = arg.split('=')[1] -+ -+ if process_groupname == -1: -+ process_groupname = arg -+ - def __init__(self, *args, **kw): - if kw.has_key('name'): - name = kw['name'] -@@ -89,25 +111,86 @@ - else: - self.logfile = '/var/log/kolab/pykolab.log' - -+ group_gid = 0 -+ user_uid = 0 -+ - # Make sure (read: attempt to change) the permissions - try: -- (ruid, euid, suid) = os.getresuid() -- (rgid, egid, sgid) = os.getresgid() -- except AttributeError, errmsg: -- ruid = os.getuid() -- rgid = os.getgid() -+ try: -+ (ruid, euid, suid) = os.getresuid() -+ (rgid, egid, sgid) = os.getresgid() -+ except AttributeError, errmsg: -+ ruid = os.getuid() -+ rgid = os.getgid() -+ -+ if ruid == 0: -+ # Means we can setreuid() / setregid() / setgroups() -+ if rgid == 0: -+ # Get group entry details -+ try: -+ ( -+ group_name, -+ group_password, -+ group_gid, -+ group_members -+ ) = grp.getgrnam(self.process_groupname) -+ -+ except KeyError: -+ print >> sys.stderr, _("Group %s does not exist") % ( -+ self.process_groupname -+ ) -+ -+ sys.exit(1) -+ -+ # Set real and effective group if not the same as current. -+ if not group_gid == rgid: -+ self.debug( -+ _("Switching real and effective group id to %d") % ( -+ group_gid -+ ), -+ level=8 -+ ) -+ -+ os.setregid(group_gid, group_gid) -+ -+ if ruid == 0: -+ # Means we haven't switched yet. -+ try: -+ ( -+ user_name, -+ user_password, -+ user_uid, -+ user_gid, -+ user_gecos, -+ user_homedir, -+ user_shell -+ ) = pwd.getpwnam(self.process_username) -+ -+ except KeyError: -+ print >> sys.stderr, _("User %s does not exist") % ( -+ self.process_username -+ ) -+ -+ sys.exit(1) - -- if ruid == 0 or rgid == 0: -- if os.path.isfile(self.logfile): - try: - os.chown( - self.logfile, -- pwd.getpwnam('kolab')[2], -- grp.getgrnam('kolab-n')[2] -+ user_uid, -+ group_gid - ) - os.chmod(self.logfile, 0660) -- except: -- pass -+ except Exception, errmsg: -+ self.error(_("Could not change permissions on %s: %r") % (self.logfile, errmsg)) -+ if self.debuglevel > 8: -+ import traceback -+ traceback.print_exc() -+ -+ except Exception, errmsg: -+ self.error(_("Could not change permissions on %s: %r") % (self.logfile, errmsg)) -+ if self.debuglevel > 8: -+ import traceback -+ traceback.print_exc() - - # Make sure the log file exists - try: -@@ -137,7 +220,7 @@ - self.console_stdout.close() - self.removeHandler(self.console_stdout) - -- def debug(self, msg, level=1): -+ def debug(self, msg, level=1, *args, **kw): - self.setLevel(self.loglevel) - # Work around other applications not using various levels of debugging - if not self.name.startswith('pykolab') and not self.debuglevel == 9: -diff -ur pykolab-0.6.11.orig/saslauthd/__init__.py pykolab-0.6.11/saslauthd/__init__.py ---- pykolab-0.6.11.orig/saslauthd/__init__.py 2014-01-28 12:33:07.000000000 +0100 -+++ pykolab-0.6.11/saslauthd/__init__.py 2014-02-14 15:49:27.407336108 +0100 -@@ -28,7 +28,9 @@ - from optparse import OptionParser - from ConfigParser import SafeConfigParser - -+import grp - import os -+import pwd - import shutil - import sys - import time -@@ -107,6 +109,79 @@ - exitcode = 0 - - try: -+ try: -+ (ruid, euid, suid) = os.getresuid() -+ (rgid, egid, sgid) = os.getresgid() -+ except AttributeError, errmsg: -+ ruid = os.getuid() -+ rgid = os.getgid() -+ -+ if ruid == 0: -+ # Means we can setreuid() / setregid() / setgroups() -+ if rgid == 0: -+ # Get group entry details -+ try: -+ ( -+ group_name, -+ group_password, -+ group_gid, -+ group_members -+ ) = grp.getgrnam(conf.process_groupname) -+ -+ except KeyError: -+ print >> sys.stderr, _("Group %s does not exist") % ( -+ conf.process_groupname -+ ) -+ -+ sys.exit(1) -+ -+ # Set real and effective group if not the same as current. -+ if not group_gid == rgid: -+ log.debug( -+ _("Switching real and effective group id to %d") % ( -+ group_gid -+ ), -+ level=8 -+ ) -+ -+ os.setregid(group_gid, group_gid)
View file
pykolab-0.6.11-sieve-typos.patch
Deleted
@@ -1,32 +0,0 @@ -commit 147a035a95ea05afbdebbe473b66449587a8ff99 -Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> -Date: Tue Feb 11 09:53:14 2014 +0100 - - Fix typos - -diff --git a/pykolab/cli/sieve/cmd_refresh.py b/pykolab/cli/sieve/cmd_refresh.py -index 496f31f..6c10dfa 100644 ---- a/pykolab/cli/sieve/cmd_refresh.py -+++ b/pykolab/cli/sieve/cmd_refresh.py -@@ -97,7 +97,7 @@ def execute(*args, **kw): - active, scripts = result - - log.debug(_("Found the following scripts for user %s: %s") % (address, ','.join(scripts)), level=8) -- log.deubg(_("And the following script is active for user %s: %s") % (address, active), level=8) -+ log.debug(_("And the following script is active for user %s: %s") % (address, active), level=8) - - mgmt_required_extensions = [] - -diff --git a/pykolab/plugins/sievemgmt/__init__.py b/pykolab/plugins/sievemgmt/__init__.py -index 32dbdf5..42297a4 100644 ---- a/pykolab/plugins/sievemgmt/__init__.py -+++ b/pykolab/plugins/sievemgmt/__init__.py -@@ -109,7 +109,7 @@ class KolabSievemgmt(object): - active, scripts = result - - log.debug(_("Found the following scripts for user %s: %s") % (address, ','.join(scripts)), level=8) -- log.deubg(_("And the following script is active for user %s: %s") % (address, active), level=8) -+ log.debug(_("And the following script is active for user %s: %s") % (address, active), level=8) - - mgmt_required_extensions = [] -
View file
pykolab-0.6.11-unlink-cache-on-failure-to-get_entry.patch
Deleted
@@ -1,46 +0,0 @@ -diff --git a/pykolab/auth/ldap/cache.py b/pykolab/auth/ldap/cache.py -index 55a47c3..ad50e9b 100644 ---- a/pykolab/auth/ldap/cache.py -+++ b/pykolab/auth/ldap/cache.py -@@ -107,8 +107,17 @@ def delete_entry(domain, entry): - def get_entry(domain, entry, update=True): - result_attribute = conf.get('cyrus-sasl', 'result_attribute') - -+ _entry = None -+ - db = init_db(domain) -- _entry = db.query(Entry).filter_by(uniqueid=entry['id']).first() -+ try: -+ _entry = db.query(Entry).filter_by(uniqueid=entry['id']).first() -+ except sqlalchemy.exc.OperationalError, errmsg: -+ db = init_db(domain,reinit=True) -+ except sqlalchemy.exc.InvalidRequestError, errmsg: -+ db = init_db(domain,reinit=True) -+ finally: -+ _entry = db.query(Entry).filter_by(uniqueid=entry['id']).first() - - if not update: - return _entry -@@ -149,15 +158,20 @@ def get_entry(domain, entry, update=True): - - return _entry - --def init_db(domain): -+def init_db(domain,reinit=False): - """ - Returns a SQLAlchemy Session() instance. - """ - global db - -- if not db == None: -+ if not db == None and not reinit: - return db - -+ if reinit: -+ import os -+ if os.path.isfile('sqlite:///%s/%s.db' % (KOLAB_LIB_PATH, domain)): -+ os.unlink('sqlite:///%s/%s.db' % (KOLAB_LIB_PATH, domain)) -+ - db_uri = 'sqlite:///%s/%s.db' % (KOLAB_LIB_PATH, domain) - echo = conf.debuglevel > 8 - engine = create_engine(db_uri, echo=echo)
View file
pykolab-0.6.11-void-deprecated-function-use.patch
Deleted
@@ -1,28 +0,0 @@ -commit 0c9a2496db76e7f68a05d08b66cd88f9a109dcff -Author: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> -Date: Wed Feb 12 14:32:12 2014 +0100 - - Replace get_user_attribute call with the appropriate get_entry_attribute call - -diff --git a/pykolab/auth/ldap/__init__.py b/pykolab/auth/ldap/__init__.py -index 1ba0f3d..e7c4dd2 100644 ---- a/pykolab/auth/ldap/__init__.py -+++ b/pykolab/auth/ldap/__init__.py -@@ -1163,7 +1163,7 @@ class LDAP(pykolab.base.Base): - foldertype_attribute = self.config_get('sharedfolder_type_attribute') - if not foldertype_attribute == None: - if not entry.has_key(foldertype_attribute): -- entry[foldertype_attribute] = self.get_user_attribute( -+ entry[foldertype_attribute] = self.get_entry_attribute( - entry['id'], - foldertype_attribute - ) -@@ -1532,7 +1532,7 @@ class LDAP(pykolab.base.Base): - foldertype_attribute = self.config_get('sharedfolder_type_attribute') - if not foldertype_attribute == None: - if not entry.has_key(foldertype_attribute): -- entry[foldertype_attribute] = self.get_user_attribute( -+ entry[foldertype_attribute] = self.get_entry_attribute( - entry['id'], - foldertype_attribute - )
View file
debian.changelog
Changed
@@ -1,3 +1,9 @@ +pykolab (0.6.12-0~kolab1) unstable; urgency=low + + * New upstream release + + -- Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Sat, 15 Feb 2014 20:00:00 +0100 + pykolab (0.6.11-0~kolab12) unstable; urgency=low * Fix logger
View file
debian.series
Changed
@@ -1,7 +1,3 @@ enable-kolabd.patch -p1 cyrus-imapd.conf-cert-paths.patch -p1 enable-wallace.patch -p1 -pykolab-0.6.11-unlink-cache-on-failure-to-get_entry.patch -p1 -pykolab-0.6.11-apt-ldap-fixes-concat.patch -p1 -pykolab-0.6.11-apt-sieve-fixes-concat.patch -p1 -pykolab-0.6.11-saslauthd-logger-permissions.patch -p1
View file
pykolab-0.6.11.tar.gz/bin/kolab_smtp_access_policy.py -> pykolab-0.6.12.tar.gz/bin/kolab_smtp_access_policy.py
Changed
@@ -1333,14 +1333,124 @@ def permit(message, policy_request=None): log.info(_("Returning action PERMIT: %s") % (message)) - if hasattr(policy_request, 'sasl_username'): - sender = conf.get('kolab_smtp_access_policy', 'sender_header') - if utils.true_or_false(sender): - print "action=PREPEND Sender: %s" % (policy_request.sasl_username) - - xsender = conf.get('kolab_smtp_access_policy', 'xsender_header') - if utils.true_or_false(xsender): - print "action=PREPEND X-Sender: %s" % (policy_request.sasl_username) + # If we have no policy request, we have been called for a reason, + # and everything relevant has been figured out already. + if policy_request == None: + print "action=PERMIT\n\n" + sys.exit(0) + + # If the user is not authenticated, there's no reason to do + # extra checks here -- to have been performed already. + if not hasattr(policy_request, 'sasl_username'): + print "action=PERMIT\n\n" + sys.exit(0) + + # Same here. + if policy_request.sasl_username == None: + print "action=PERMIT\n\n" + sys.exit(0) + + delegate_sender_header = None + alias_sender_header = None + + # If the sender is a delegate of the envelope sender address, take into + # account the preferred domain policy for appending the Sender and/or + # X-Sender headers. + # + # Note that a delegatee by very definition is not using an alias. + # + if policy_request.sasl_user_is_delegate: + # Domain-specific setting? + if not policy_request.sender_domain == None: + delegate_sender_header = conf.get(policy_request.sender_domain, 'delegate_sender_header') + + # Global setting? + if delegate_sender_header == None: + delegate_sender_header = conf.get('kolab_smtp_access_policy', 'delegate_sender_header') + + # Default + if delegate_sender_header == None: + delegate_sender_header = True + + # If the sender is using an alias as the envelope sender address, take + # into account the preferred domain policy for appending the Sender + # and/or X-Sender headers. + elif policy_requiest.sasl_user_uses_alias: + # Domain-specific setting? + if not policy_request.sender_domain == None: + alias_sender_header = conf.get(policy_request.sender_domain, 'alias_sender_header') + + # Global setting? + if alias_sender_header == None: + alias_sender_header = conf.get('kolab_smtp_access_policy', 'alias_sender_header') + + # Default + if alias_sender_header == None: + alias_sender_header = True + + # Make the values booleans + delegate_sender_header = utils.true_or_false(delegate_sender_header) + alias_sender_header = utils.true_or_false(alias_sender_header) + + # Do we use a (simple) encryption key to obscure the headers' contents? + # Note that using an encryption key voids the actual use of proper Sender + # and X-Sender headers such as they could be interpreted by a client + # application. + enc_key = conf.get(policy_request.sender_domain, 'sender_header_enc_key') + if enc_key == None: + enc_key = conf.get('kolab_smtp_access_policy', 'sender_header_enc_key') + + sender_header = None + xsender_header = None + + if delegate_sender_header or alias_sender_header: + # Domain specific? + sender_header = conf.get(policy_request.sender_domain, 'sender_header') + + # Global setting? + if sender_header == None: + sender_header = conf.get('kolab_smtp_access_policy', 'sender_header') + + # Default + if sender_header == None: + sender_header = True + + # Domain specific? + xsender_header = conf.get(policy_request.sender_domain, 'xsender_header') + + # Global setting? + if xsender_header == None: + xsender_header = conf.get('kolab_smtp_access_policy', 'xsender_header') + + # Default + if xsender_header == None: + xsender_header = True + + # Note that if the user is not a delegatee, and not using an alias, the sender + # address is the envelope sender address, and the defaults for sender_header + # and xsender_header being None, ultimately evaluating to False seems + # appropriate. + + # Make the values booleans + sender_header = utils.true_or_false(sender_header) + xsender_header = utils.true_or_false(xsender_header) + + if sender_header or xsender_header: + # Do the encoding, if any + if not enc_key == None: + header = 'X-Authenticated-As' + xheader = None + sender = utils.encode(enc_key, policy_request.sasl_username) + else: + header = 'Sender' + xheader = 'X-Sender' + sender = policy_request.sasl_username + + if sender_header: + print "action=PREPEND %s: %s" % (header, sender) + + if xsender_header and not xheader == None: + print "action=PREPEND %s: %s" % (xheader, sender) print "action=PERMIT\n\n" sys.exit(0)
View file
pykolab-0.6.11.tar.gz/conf/kolab.conf -> pykolab-0.6.12.tar.gz/conf/kolab.conf
Changed
@@ -279,12 +279,31 @@ ; list. address_search_attrs = mail, alias -; Prepend the Sender: header? +; Prepend the Sender: and/or X-Sender header(s) if the user authenticated is a +; designated delegatee of the envelope sender address? +delegate_sender_header = True + +; Prepend the Sender: and/or X-Sender header(s) if the user authenticated +; is using an envelope sender address that is a secondary recipient email +; address (attached to the object entry) of the user authenticated? +alias_sender_header = True + +; Prepend the Sender: header? Only relevant if delegate_sender_header or +; alias_sender_header is set to True. sender_header = True -; Prepend the X-Sender: header? +; Prepend the X-Sender: header? Only relevant if delegate_sender_header or +; alias_sender_header is set to True. xsender_header = True +; "Encrypt" -- read, "obscure" -- the contents of the 'Sender:' and/or +; 'X-Sender:' header(s). Note that this invalidates client's use of the header +; value, and therefore replaces both headers with 'X-Authenticated-As'. +; +; Example: 'vanmeeuwen@kolabsys.com' becomes '6crb3dHK6ODS3qzQ4tXO0t_e5pfQ39k=' +; +; sender_header_enc_key = 'simple' + ; Allow hosts in these networks to submit messages with empty envelope senders, ; such as web-clients responding to MDN requests. empty_sender_hosts = 3.2.1.0/24, 6.6.6.0/24
View file
pykolab-0.6.11.tar.gz/configure.ac -> pykolab-0.6.12.tar.gz/configure.ac
Changed
@@ -1,4 +1,4 @@ -AC_INIT([pykolab], 0.6.11) +AC_INIT([pykolab], 0.6.12) AC_SUBST([RELEASE], 1) AC_CONFIG_SRCDIR(pykolab/constants.py.in)
View file
pykolab-0.6.11.tar.gz/kolabd/__init__.py -> pykolab-0.6.12.tar.gz/kolabd/__init__.py
Changed
@@ -220,6 +220,15 @@ while 1: primary_auth = Auth(primary_domain) + connected = False + while not connected: + try: + connected = primary_auth.connect() + except Exception, errmsg: + connected = False + log.error(_("Could not connect to LDAP, is it running?")) + time.sleep(5) + log.debug(_("Listing domains..."), level=5) start = time.time() @@ -230,6 +239,11 @@ time.sleep(60) continue + if isinstance(domains, list) and len(domains) < 1: + log.error(_("No domains. Not syncing")) + time.sleep(5) + continue + # domains now is a list of tuples, we want the primary_domains primary_domains = [] for primary_domain in list(set(domains.values())):
View file
pykolab-0.6.11.tar.gz/pykolab/auth/ldap/__init__.py -> pykolab-0.6.12.tar.gz/pykolab/auth/ldap/__init__.py
Changed
@@ -243,8 +243,21 @@ # Needs to be synchronous or succeeds and continues setting retval # to True!! self.ldap.simple_bind_s(entry_dn, login[1]) + auth_cache.set_entry(_filter, entry_dn) retval = True - except: + except ldap.NO_SUCH_OBJECT, errmsg: + log.debug(_("Error occured, there is no such object: %r") % (errmsg), level=8) + self.bind = False + try: + auth_cache.del_entry(_filter) + except: + log.error(_("Authentication cache failed to clear entry")) + pass + + return self.authenticate(login, realm) + + except Exception, errmsg: + log.debug(_("Exception occured: %r") %(errmsg)) try: log.debug( _("Failed to authenticate as user %s") % (login[0]), @@ -1150,7 +1163,7 @@ foldertype_attribute = self.config_get('sharedfolder_type_attribute') if not foldertype_attribute == None: if not entry.has_key(foldertype_attribute): - entry[foldertype_attribute] = self.get_user_attribute( + entry[foldertype_attribute] = self.get_entry_attribute( entry['id'], foldertype_attribute ) @@ -1252,10 +1265,6 @@ 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: @@ -1263,6 +1272,10 @@ 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) @@ -1519,7 +1532,7 @@ foldertype_attribute = self.config_get('sharedfolder_type_attribute') if not foldertype_attribute == None: if not entry.has_key(foldertype_attribute): - entry[foldertype_attribute] = self.get_user_attribute( + entry[foldertype_attribute] = self.get_entry_attribute( entry['id'], foldertype_attribute ) @@ -1769,12 +1782,16 @@ 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)
View file
pykolab-0.6.11.tar.gz/pykolab/auth/ldap/auth_cache.py -> pykolab-0.6.12.tar.gz/pykolab/auth/ldap/auth_cache.py
Changed
@@ -86,6 +86,11 @@ ## Functions ## +def del_entry(key): + db = init_db() + _entries = db.query(Entry).filter_by(key=key).delete() + db.commit() + def get_entry(key): db = init_db() _entries = db.query(Entry).filter_by(key=key).all() @@ -113,9 +118,16 @@ ) db.commit() + elif len(_entries) == 1: + if not _entries[0].value == value: + _entries[0].value = value + + _entries[0].last_change = datetime.datetime.now() + db.commit() def purge_entries(db): db.query(Entry).filter(Entry.last_change <= (datetime.datetime.now() - datetime.timedelta(1))).delete() + db.commit() def init_db(): """
View file
pykolab-0.6.11.tar.gz/pykolab/auth/ldap/cache.py -> pykolab-0.6.12.tar.gz/pykolab/auth/ldap/cache.py
Changed
@@ -107,8 +107,17 @@ def get_entry(domain, entry, update=True): result_attribute = conf.get('cyrus-sasl', 'result_attribute') + _entry = None + db = init_db(domain) - _entry = db.query(Entry).filter_by(uniqueid=entry['id']).first() + try: + _entry = db.query(Entry).filter_by(uniqueid=entry['id']).first() + except sqlalchemy.exc.OperationalError, errmsg: + db = init_db(domain,reinit=True) + except sqlalchemy.exc.InvalidRequestError, errmsg: + db = init_db(domain,reinit=True) + finally: + _entry = db.query(Entry).filter_by(uniqueid=entry['id']).first() if not update: return _entry @@ -149,15 +158,20 @@ return _entry -def init_db(domain): +def init_db(domain,reinit=False): """ Returns a SQLAlchemy Session() instance. """ global db - if not db == None: + if not db == None and not reinit: return db + if reinit: + import os + if os.path.isfile('sqlite:///%s/%s.db' % (KOLAB_LIB_PATH, domain)): + os.unlink('sqlite:///%s/%s.db' % (KOLAB_LIB_PATH, domain)) + db_uri = 'sqlite:///%s/%s.db' % (KOLAB_LIB_PATH, domain) echo = conf.debuglevel > 8 engine = create_engine(db_uri, echo=echo)
View file
pykolab-0.6.12.tar.gz/pykolab/cli/cmd_set_quota.py
Added
@@ -0,0 +1,67 @@ +# -*- coding: utf-8 -*- +# Copyright 2010-2012 Kolab Systems AG (http://www.kolabsys.com) +# +# Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen a kolabsys.com> +# +# This program is free software; you can redistribute it and/or modify +# it under the terms of the GNU General Public License as published by +# the Free Software Foundation; version 3 or, at your option, any later version +# +# This program is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the +# GNU Library General Public License for more details. +# +# You should have received a copy of the GNU General Public License +# along with this program; if not, write to the Free Software +# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. +# + +import commands + +import pykolab + +from pykolab.imap import IMAP +from pykolab.translate import _ +from pykolab import utils + +log = pykolab.getLogger('pykolab.cli') +conf = pykolab.getConf() + +def __init__(): + commands.register('set_quota', execute, description=description(), aliases=['sq']) + +def description(): + return """Configure quota for a folder.""" + +def execute(*args, **kw): + try: + folder = conf.cli_args.pop(0) + try: + quota = conf.cli_args.pop(0) + except IndexError, errmsg: + quota = utils.ask_question(_("New quota")) + + except IndexError, errmsg: + folder = utils.ask_question(_("Folder name")) + quota = utils.ask_question(_("New quota")) + + if len(folder.split('@')) > 1: + domain = folder.split('@')[1] + else: + domain = conf.get('kolab', 'primary_domain') + + imap = IMAP() + imap.connect(domain=domain) + + if not imap.has_folder(folder): + print >> sys.stderr, _("No such folder %r") % (folder) + + else: + imap.set_quota(folder, quota) + + # See if the folder is an INBOX folder + # If yes, edit LDAP (through WAP client) + # If no, edit IMAP + + # Verify the folder actually exists in IMAP
View file
pykolab-0.6.11.tar.gz/pykolab/cli/sieve/cmd_refresh.py -> pykolab-0.6.12.tar.gz/pykolab/cli/sieve/cmd_refresh.py
Changed
@@ -97,7 +97,7 @@ active, scripts = result log.debug(_("Found the following scripts for user %s: %s") % (address, ','.join(scripts)), level=8) - log.deubg(_("And the following script is active for user %s: %s") % (address, active), level=8) + log.debug(_("And the following script is active for user %s: %s") % (address, active), level=8) mgmt_required_extensions = [] @@ -344,7 +344,9 @@ mgmt_script.addfilter(rule_name, ['true'], forward_rules) else: - mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules) + # NOTE: Messages with no X-Spam-Status header need to be matched + # too, and this does exactly that. + mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules) if sdf_filter: mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")])
View file
pykolab-0.6.11.tar.gz/pykolab/imap/__init__.py -> pykolab-0.6.12.tar.gz/pykolab/imap/__init__.py
Changed
@@ -328,6 +328,36 @@ 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):
View file
pykolab-0.6.11.tar.gz/pykolab/logger.py -> pykolab-0.6.12.tar.gz/pykolab/logger.py
Changed
@@ -37,6 +37,8 @@ debuglevel = 0 fork = False loglevel = logging.CRITICAL + process_username = 'kolab' + process_groupname = 'kolab-n' if hasattr(sys, 'argv'): for arg in sys.argv: @@ -66,6 +68,26 @@ else: loglevel = logging.DEBUG + if '-u' == arg or '--user' == arg: + process_username = -1 + continue + + if arg.startswith('--user='): + process_username = arg.split('=')[1] + + if process_username == -1: + process_username = arg + + if '-g' == arg or '--group' == arg: + process_groupname = -1 + continue + + if arg.startswith('--group='): + process_groupname = arg.split('=')[1] + + if process_groupname == -1: + process_groupname = arg + def __init__(self, *args, **kw): if kw.has_key('name'): name = kw['name'] @@ -89,25 +111,86 @@ else: self.logfile = '/var/log/kolab/pykolab.log' + group_gid = 0 + user_uid = 0 + # Make sure (read: attempt to change) the permissions try: - (ruid, euid, suid) = os.getresuid() - (rgid, egid, sgid) = os.getresgid() - except AttributeError, errmsg: - ruid = os.getuid() - rgid = os.getgid() - - if ruid == 0 or rgid == 0: - if os.path.isfile(self.logfile): + try: + (ruid, euid, suid) = os.getresuid() + (rgid, egid, sgid) = os.getresgid() + except AttributeError, errmsg: + ruid = os.getuid() + rgid = os.getgid() + + if ruid == 0: + # Means we can setreuid() / setregid() / setgroups() + if rgid == 0: + # Get group entry details + try: + ( + group_name, + group_password, + group_gid, + group_members + ) = grp.getgrnam(self.process_groupname) + + except KeyError: + print >> sys.stderr, _("Group %s does not exist") % ( + self.process_groupname + ) + + sys.exit(1) + + # Set real and effective group if not the same as current. + if not group_gid == rgid: + self.debug( + _("Switching real and effective group id to %d") % ( + group_gid + ), + level=8 + ) + + os.setregid(group_gid, group_gid) + + if ruid == 0: + # Means we haven't switched yet. + try: + ( + user_name, + user_password, + user_uid, + user_gid, + user_gecos, + user_homedir, + user_shell + ) = pwd.getpwnam(self.process_username) + + except KeyError: + print >> sys.stderr, _("User %s does not exist") % ( + self.process_username + ) + + sys.exit(1) + try: os.chown( self.logfile, - pwd.getpwnam('kolab')[2], - grp.getgrnam('kolab-n')[2] + user_uid, + group_gid ) os.chmod(self.logfile, 0660) - except: - pass + except Exception, errmsg: + self.error(_("Could not change permissions on %s: %r") % (self.logfile, errmsg)) + if self.debuglevel > 8: + import traceback + traceback.print_exc() + + except Exception, errmsg: + self.error(_("Could not change permissions on %s: %r") % (self.logfile, errmsg)) + if self.debuglevel > 8: + import traceback + traceback.print_exc() # Make sure the log file exists try: @@ -137,7 +220,7 @@ self.console_stdout.close() self.removeHandler(self.console_stdout) - def debug(self, msg, level=1): + def debug(self, msg, level=1, *args, **kw): self.setLevel(self.loglevel) # Work around other applications not using various levels of debugging if not self.name.startswith('pykolab') and not self.debuglevel == 9:
View file
pykolab-0.6.11.tar.gz/pykolab/plugins/sievemgmt/__init__.py -> pykolab-0.6.12.tar.gz/pykolab/plugins/sievemgmt/__init__.py
Changed
@@ -109,7 +109,7 @@ active, scripts = result log.debug(_("Found the following scripts for user %s: %s") % (address, ','.join(scripts)), level=8) - log.deubg(_("And the following script is active for user %s: %s") % (address, active), level=8) + log.debug(_("And the following script is active for user %s: %s") % (address, active), level=8) mgmt_required_extensions = [] @@ -356,7 +356,9 @@ mgmt_script.addfilter(rule_name, ['true'], forward_rules) else: - mgmt_script.addfilter(rule_name, [("X-Spam-Status", ":matches", "No,*")], forward_rules) + # NOTE: Messages with no X-Spam-Status header need to be matched + # too, and this does exactly that. + mgmt_script.addfilter(rule_name, [("not", ("X-Spam-Status", ":matches", "Yes,*"))], forward_rules) if sdf_filter: mgmt_script.addfilter('spam_delivery_folder', [("X-Spam-Status", ":matches", "Yes,*")], [("fileinto", "INBOX/Spam"), ("stop")])
View file
pykolab-0.6.11.tar.gz/pykolab/setup/setup_imap.py -> pykolab-0.6.12.tar.gz/pykolab/setup/setup_imap.py
Changed
@@ -111,7 +111,7 @@ fp.close() else: - log.error(_("Could not write out Cyrus IMAP configuration file /etc/imapd.conf")) + log.error(_("Could not write out Cyrus IMAP configuration file /etc/cyrus.conf")) return annotations = [
View file
pykolab-0.6.11.tar.gz/pykolab/setup/setup_mta.py -> pykolab-0.6.12.tar.gz/pykolab/setup/setup_mta.py
Changed
@@ -192,6 +192,26 @@ "service_bind_dn": conf.get('ldap', 'service_bind_dn'), "service_bind_pw": conf.get('ldap', 'service_bind_pw'), }, + "/etc/postfix/ldap/virtual_alias_maps_mailforwarding.cf": """ +server_host = %(server_host)s +server_port = 389 +version = 3 +search_base = %(base_dn)s +scope = sub + +domain = ldap:/etc/postfix/ldap/mydestination.cf + +bind_dn = %(service_bind_dn)s +bind_pw = %(service_bind_pw)s + +query_filter = (&(|(mail=%%s)(alias=%%s))(objectclass=mailrecipient)(objectclass=inetorgperson)(mailforwardingaddress=*)) +result_attribute = mailForwardingAddress +""" % { + "base_dn": conf.get('ldap', 'base_dn'), + "server_host": server_host, + "service_bind_dn": conf.get('ldap', 'service_bind_dn'), + "service_bind_pw": conf.get('ldap', 'service_bind_pw'), + }, "/etc/postfix/ldap/virtual_alias_maps_sharedfolders.cf": """ server_host = %(server_host)s server_port = 389 @@ -235,7 +255,7 @@ "local_recipient_maps": "ldap:/etc/postfix/ldap/local_recipient_maps.cf", "mydestination": "ldap:/etc/postfix/ldap/mydestination.cf", "transport_maps": "ldap:/etc/postfix/ldap/transport_maps.cf, hash:/etc/postfix/transport", - "virtual_alias_maps": "$alias_maps, ldap:/etc/postfix/ldap/virtual_alias_maps.cf, ldap:/etc/postfix/ldap/virtual_alias_maps_sharedfolders.cf, ldap:/etc/postfix/ldap/mailenabled_distgroups.cf, ldap:/etc/postfix/ldap/mailenabled_dynamic_distgroups.cf", + "virtual_alias_maps": "$alias_maps, ldap:/etc/postfix/ldap/virtual_alias_maps.cf, ldap:/etc/postfix/ldap/virtual_alias_maps_mailforwarding.cf, ldap:/etc/postfix/ldap/virtual_alias_maps_sharedfolders.cf, ldap:/etc/postfix/ldap/mailenabled_distgroups.cf, ldap:/etc/postfix/ldap/mailenabled_dynamic_distgroups.cf", "smtpd_tls_auth_only": "yes", "smtpd_tls_security_level": "may", "smtp_tls_security_level": "may", @@ -348,7 +368,7 @@ template_file = None # On RPM installations, Amavis configuration is contained within a single file. - if os.path.isfile("/etc/amavsid/amavisd.conf"): + if os.path.isfile("/etc/amavisd/amavisd.conf"): if os.path.isfile('/etc/kolab/templates/amavisd.conf.tpl'): template_file = '/etc/kolab/templates/amavisd.conf.tpl' elif os.path.isfile('/usr/share/kolab/templates/amavisd.conf.tpl'):
View file
pykolab-0.6.11.tar.gz/pykolab/setup/setup_roundcube.py -> pykolab-0.6.12.tar.gz/pykolab/setup/setup_roundcube.py
Changed
@@ -92,6 +92,7 @@ 'calendar.inc.php', 'config.inc.php', 'kolab_auth.inc.php', + 'kolab_delegation.inc.php', 'kolab_files.inc.php', 'kolab_folders.inc.php', 'libkolab.inc.php',
View file
pykolab-0.6.11.tar.gz/pykolab/utils.py -> pykolab-0.6.12.tar.gz/pykolab/utils.py
Changed
@@ -17,6 +17,7 @@ # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # +import base64 import getpass import grp import os @@ -182,6 +183,29 @@ return answer +def decode(key, enc): + if key == None: + return enc + + dec = [] + enc = base64.urlsafe_b64decode(enc) + for i in range(len(enc)): + key_c = key[i % len(key)] + dec_c = chr((256 + ord(enc[i]) - ord(key_c)) % 256) + dec.append(dec_c) + return "".join(dec) + +def encode(key, clear): + if key == None: + return clear + + enc = [] + for i in range(len(clear)): + key_c = key[i % len(key)] + enc_c = chr((ord(clear[i]) + ord(key_c)) % 256) + enc.append(enc_c) + return base64.urlsafe_b64encode("".join(enc)) + def ensure_directory(_dir, _user='root', _group='root'): if not os.path.isdir(_dir): os.makedirs(_dir)
View file
pykolab-0.6.11.tar.gz/saslauthd/__init__.py -> pykolab-0.6.12.tar.gz/saslauthd/__init__.py
Changed
@@ -28,7 +28,9 @@ from optparse import OptionParser from ConfigParser import SafeConfigParser +import grp import os +import pwd import shutil import sys import time @@ -107,6 +109,79 @@ exitcode = 0 try: + try: + (ruid, euid, suid) = os.getresuid() + (rgid, egid, sgid) = os.getresgid() + except AttributeError, errmsg: + ruid = os.getuid() + rgid = os.getgid() + + if ruid == 0: + # Means we can setreuid() / setregid() / setgroups() + if rgid == 0: + # Get group entry details + try: + ( + group_name, + group_password, + group_gid, + group_members + ) = grp.getgrnam(conf.process_groupname) + + except KeyError: + print >> sys.stderr, _("Group %s does not exist") % ( + conf.process_groupname + ) + + sys.exit(1) + + # Set real and effective group if not the same as current. + if not group_gid == rgid: + log.debug( + _("Switching real and effective group id to %d") % ( + group_gid + ), + level=8 + ) + + os.setregid(group_gid, group_gid) + + if ruid == 0: + # Means we haven't switched yet. + try: + ( + user_name, + user_password, + user_uid, + user_gid, + user_gecos, + user_homedir, + user_shell + ) = pwd.getpwnam(conf.process_username) + + except KeyError: + print >> sys.stderr, _("User %s does not exist") % ( + conf.process_username + ) + + sys.exit(1) + + + # Set real and effective user if not the same as current. + if not user_uid == ruid: + log.debug( + _("Switching real and effective user id to %d") % ( + user_uid + ), + level=8 + ) + + os.setreuid(user_uid, user_uid) + + except: + log.error(_("Could not change real and effective uid and/or gid")) + + try: pid = 1 if conf.fork_mode: pid = os.fork()
View file
pykolab-0.6.11.tar.gz/share/templates/roundcubemail/config.inc.php.tpl -> pykolab-0.6.12.tar.gz/share/templates/roundcubemail/config.inc.php.tpl
Changed
@@ -45,14 +45,15 @@ // Plugins \$config['plugins'] = array( + 'kolab_auth', 'acl', 'archive', 'calendar', 'jqueryui', 'kolab_activesync', 'kolab_addressbook', - 'kolab_auth', 'kolab_config', + 'kolab_delegation', 'kolab_files', 'kolab_folders', 'libkolab',
View file
pykolab-0.6.12.tar.gz/share/templates/roundcubemail/kolab_delegation.inc.php.tpl
Added
@@ -0,0 +1,26 @@ +<?php + // This will overwrite defined LDAP filter + // Note: LDAP addressbook defined for kolab_auth plugin is used + \$config['kolab_delegation_filter'] = '(|(objectClass=kolabInetOrgPerson)(objectclass=kolabsharedfolder))'; + + // Delegates field (from fieldmap configuration) to get delegates list + // Note: This is a field name, not LDAP attribute name + // Note: LDAP addressbook defined for kolab_auth plugin is used + \$config['kolab_delegation_delegate_field'] = 'kolabDelegate'; + + // User authentication ID field (from fieldmap configuration) + // See kolab_auth plugin config + \$config['kolab_delegation_login_field'] = 'email'; + + // Use this fields (from fieldmap configuration) for identities + // If the value array contains more than one field, first non-empty will be used + // Note: These are not LDAP attributes, but field names in config + // Note: If there are more than one email address, as many identities will be created + // See kolab_auth plugin config + \$config['kolab_delegation_name_field'] = array('name', 'cn'); + \$config['kolab_delegation_email_field'] = array('email'); + + // Remove all user identities which do not match the users primary or alias + // addresses and delegators addresses + \$config['kolab_delegation_purge_identities'] = false; +?>
View file
pykolab.dsc
Changed
@@ -2,7 +2,7 @@ Source: pykolab Binary: pykolab, kolab-cli, kolab-conf, kolab-saslauthd, kolab-server, kolab-telemetry, kolab-xml, wallace Architecture: all -Version: 0.6.11-0~kolab12 +Version: 0.6.12-0~kolab1 Maintainer: Jeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com> Uploaders: Paul Klos <kolab@klos2day.nl> Homepage: http://www.kolab.org @@ -40,5 +40,5 @@ pykolab deb python optional wallace deb python optional Files: - 00000000000000000000000000000000 0 pykolab-0.6.11.tar.gz + 00000000000000000000000000000000 0 pykolab-0.6.12.tar.gz 00000000000000000000000000000000 0 debian.tar.gz
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
.