summaryrefslogtreecommitdiffstats
path: root/pykolab
Commit message (Collapse)AuthorAgeFilesLines
* [Python 3]exec to eval where exec(" var = ...")HEADmasterChristoph Erhardt6 days6-13/+13
| | | | | | | | | | | | | Summary: All exec() with (var = ...) exec() with (import ... ) or with (self.var = ..) or just with (function()) should work out of the box. If not worked as expected, they could be grouped and put into other diff s. Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3638
* [Python 3]no debug output for ldap and sqlChristoph Erhardt2022-06-171-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | Summary: Error: no debug output in Python3 for ldap and sql var conf.debuglevel = 9 not set within "-d 9" checked in pykolab/auth/ldap/__init__.py line 414 so trace_level is not set main cause: retval is in all cases set as False, as it is not set within exec() to True. this don't throw any Python Error, but could be seen in debug output, as debuglevel is 0 also it is set on cli to 9 exec is statement in 2.7, changed to function in 3.x It doesn't need a code block execution here, so eval() does the job, too. eval() will lower the risk of a code injection. Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3620
* cli - direct dam implementationChristoph Erhardt2022-06-172-1/+13
| | | | | | | | | | | | | | | | | | | | | | | Summary: This is an extended imaplib def deleteacl function def deleteacl(self, mailbox, who): """Delete the ACLs (remove any rights) set for who on mailbox. (typ, [data]) = <instance>.deleteacl(mailbox, who) """ return self._simple_command('DELETEACL', mailbox, who) This is more direct without sam workaround Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3572
* [Python 3] bytes-like strings decoding for saslauthd.pyChristoph Erhardt2022-06-151-6/+6
| | | | | | | | | | | | | | | | | | | | | Summary: byte-like strings needed to be decoded as text strings debugging with 2.7 origin code returned unicode strings, but returned in python 3 bytse-like string variables. Optparse gets text strings from shell. configparse uses internally text strings. From version 3.0, python-ldap uses text where appropriate. On Python 2, the bytes mode setting influences how text is handled. socket.streams and db including bytes-like string code, which will be decoded with this diff, for python-ldap operations. Reviewers: #pykolab_developers, vanmeeuwen, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha, vanmeeuwen Differential Revision: https://git.kolab.org/D3469
* [cli - dam] wrong variable usedChristoph Erhardt2022-05-221-1/+1
| | | | | | | | | | | Summary: ACI subject should be "identifier" not "quota" Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3569
* [Python 3] some more function and module names changedChristoph Erhardt2022-05-082-2/+9
| | | | | | | | | | | | Summary: some more functions, modules are renamed and some internal functions were moved into other modules Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3481
* [Python 3] relative imports fixes (dynamic imports) Part 2Christoph Erhardt2022-05-082-5/+5
| | | | | | | | | | Summary: some more dynamic imports of relative path's found and dotted Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3484
* [Python 3] imap4-utf-7 codec implementation to Python 3Christoph Erhardt2022-05-081-20/+32
| | | | | | | | | | | | | | | | | | | Summary: Implementation of accepted twistedmatrix Python3 patch #6289 to pykolab/imap_utf7.py https://twistedmatrix.com/trac/attachment/ticket/6289/imap4.patch #6289 enhancement closed fixed (fixed) Port imap4-utf-7 codec implementation to Python 3 Tested with Debian 10 Python versions 2.7, 3.7 Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3508
* [Python 3]rfc822 module has been removedChristoph Erhardt2022-03-161-1/+1
| | | | | | | | | | | | | | | Summary: python 2.7 -3 ./kolab-cli.py -d 9 lm DeprecationWarning: in 3.x, rfc822 has been removed in favor of the email package Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3457
* [Python 3] changed get syntax in ConfigParser moduleChristoph Erhardt2022-03-131-1/+1
| | | | | | | | | | | | Summary: "ConfigParser.get(section, option[, raw[, vars]])" in 2.7 "parser.get(section, option, **kwargs)" in 3.x Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3436
* [Python 3] dropped module anydbmChristoph Erhardt2022-03-131-1/+4
| | | | | | | | | | | | | | | | | | | Summary: like D3355, Note: The anydbm module has been renamed to dbm in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3. https://docs.python.org/2.7/library/anydbm.html dbm linked to https://docs.python.org/2.7/library/dbm.html#module-dbm Note: The dbm module has been renamed to dbm.ndbm in Python 3. The 2to3 tool will automatically adapt imports when converting your sources to Python 3. so I tested db file, created with 2.7 and used with dbm.ndbm in 3.7 Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3430
* [Python 3] relative imports fixes (dynamic imports)Christoph Erhardt2022-03-131-3/+3
| | | | | | | | | | Summary: similar to D3391, but with variables Reviewers: #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Differential Revision: https://git.kolab.org/D3427
* [Python 3] Implicit relative imports fixesChristoph Erhardt2022-03-1359-92/+93
| | | | | | | | | | Reviewers: #pykolab, #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3391
* [Python 3]basestring to six string_typesChristoph Erhardt2022-03-139-12/+22
| | | | | | | | | | | | | | | | | Summary: Using for compatibility from six import string_types and "string_types" for "basestring" as it is still used in pykolab/utils.py Reviewers: #pykolab, #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: sicherha Differential Revision: https://git.kolab.org/D3403
* [Python3] changed module namesChristoph Erhardt2022-03-1313-14/+56
| | | | | | | | | | | | | | | | | Summary: ConfigParser -> configparser urlparse -> urllib.parse Test Plan: todo: test with python2 Reviewers: #pykolab, #pykolab_developers, sicherha Reviewed By: #pykolab_developers, sicherha Subscribers: ghane, sicherha Differential Revision: https://git.kolab.org/D3355
* Omit explicit disconnectJeroen van Meeuwen (Kolab Systems)2022-02-081-3/+0
|
* Revert "Same as previous commit"Christian Mollekopf2022-02-081-1/+1
| | | | This reverts commit 00085039f31f965b539a62f37b36106394ce6fe2.
* Same as previous commitChristian Mollekopf2022-02-081-1/+1
|
* Fix "RuntimeError: dictionary changed size during iteration" regressionAleksander Machniak2022-02-081-1/+1
|
* import print_functionpykolab-0.8.21Jeroen van Meeuwen (Kolab Systems)2022-02-041-0/+2
|
* self.error -> printJeroen van Meeuwen (Kolab Systems)2022-02-041-2/+2
|
* Shorten the window of entries considered valid stillJeroen van Meeuwen (Kolab Systems)2022-02-031-5/+13
|
* Address stale cache entriesJeroen van Meeuwen (Kolab Systems)2022-02-031-7/+29
| | | | | | | | | | | | Summary: Avoid stale cache entries from making the cut, as well as allow an explicit auth_cache_uri=null Test Plan: None Reviewers: #pykolab_developers Subscribers: #pykolab_developers Differential Revision: https://git.kolab.org/D1690
* [Python 3] Use .items() instead of .iteritems()Christoph Erhardt2022-01-109-28/+28
| | | | | | | | | | | | | | | | | | Summary: .iteritems() was dropped in Python 3.0. This commit may have a negative performance impact on Python 2 since .items() returns a copy of the dictionary's item list. In Python 3, .items() returns a view object, so no performance drop should be noticeable there. Reviewers: machniak, mollekopf Reviewed By: mollekopf Subscribers: mollekopf Differential Revision: https://git.kolab.org/D3244
* [Python 3] Get rid of .has_key()Christoph Erhardt2022-01-1024-121/+121
| | | | | | | | | | | | Summary: `dict.has_key(key)` was dropped in Python 3.0. Use `key in dict` instead. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3241
* [Python 3] Remove unnecessary occurrences of .keys()Christoph Erhardt2022-01-1030-81/+81
| | | | | | | | | | | | | | | | Summary: The following cases are covered: * for key in dict * if key in dict * len(dict) This will make life easier for futurize. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3235
* [Python 3] Use new exception syntaxChristoph Erhardt2022-01-1034-105/+105
| | | | | | | | | | | | Summary: The new syntax was introduced in Python 2.6; the old syntax was deprecated in Python 3.0. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3232
* [Python 3] Use print() as function instead of statementChristoph Erhardt2022-01-1045-199/+242
| | | | | | | | | | | | | | | Summary: print() has been a function since Python 2.6; the old behaviour was dropped in Python 3.0. To use the named file argument in Python 2, we need to import print_function from the __future__ module. Reviewers: machniak, mollekopf Reviewed By: mollekopf Differential Revision: https://git.kolab.org/D3229
* [Python 3] Use 0o prefix for octal numbersChristoph Erhardt2022-01-106-6/+6
| | | | | | | | | | | | | | Summary: The new 0o prefix was introduced in Python 2.6; the old 0 prefix was deprecated in Python 3.0. Reviewers: machniak, mollekopf Reviewed By: mollekopf Subscribers: mollekopf Differential Revision: https://git.kolab.org/D3226
* Allow mailbox-cleanup to run without ACLs checksJeroen van Meeuwen (Kolab Systems)2022-01-081-46/+69
|
* SyntaxJeroen van Meeuwen (Kolab Systems)2022-01-083-12/+21
|
* Silence warnings in production, make it debugJeroen van Meeuwen (Kolab Systems)2022-01-081-2/+3
|
* Implement ACT_STORE_AND_NOTIFY policy for resources, add webmail url to the ↵dev/resourcemanagement3Aleksander Machniak2021-12-161-0/+3
| | | | | | | | | | notification body Summary: Set the status to NEEDS_ACTION and don't send out an immediate reply to the organizer. Differential Revision: https://git.kolab.org/D3077
* Make iTip messages outlook compatibleChristian Mollekopf2021-11-301-2/+1
| | | | | | Summary: Use multipart/alternative and loose the Content-Disposition header Differential Revision: https://git.kolab.org/D3056
* Resolve %base_dn in kolab_user_base_dn, user_base_dn and resource_base_dnAleksander Machniak2021-10-011-17/+23
| | | | | | | | | | Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: #pykolab_developers Differential Revision: https://git.kolab.org/D2900
* A typoLiutauras Adomaitis2021-03-181-1/+1
|
* An initial version of the Plesk auth driverJeroen van Meeuwen (Kolab Systems)2020-12-153-0/+170
| | | | | | | | Summary: It implements just enough to get the kolab_smpt_access_policy going on plesk. Differential Revision: https://git.kolab.org/D1672
* compare namingtext with basedn always in lowercaseDaniel Hoffend2020-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Summary: When the hosted_domain_rootdn contains uppercase letters (only happens when crafting our own ldap naming context, or connecting with an existing ldap directory) kolabd doesn't match the namespace and therefore doesn't track changes and kolabd doesn't create or delete the mailboxes. Test Plan: Initial Situation mgmt_root_dn = dc=mgmt,dc=dotlan,dc=info hosted_root_dn = o=Hosting Starting kolabd via cli with debug enabled /usr/sbin/kolabd -l DEBUG -d 9 --user kolab --pid-file /run/kolabd/kolabd.pid Log messages about which domains / naming contexts to watch: 2020-01-17 23:29:35,260 pykolab.daemon DEBUG [8525] Domain 'mgmt.dotlan.info' naming context: 'dc=mgmt,dc=dotlan,dc=info', root dn: 'dc=mgmt,dc=dotlan,dc=info' 2020-01-17 23:29:35,268 pykolab.daemon DEBUG [8525] Domain 'hosting.com' naming context: None, root dn: 'o=Hosting' 2020-01-17 23:29:35,268 pykolab.daemon DEBUG [8525] Naming contexts to synchronize: [None, 'dc=mgmt,dc=dotlan,dc=info'] 2020-01-17 23:29:35,268 pykolab.daemon DEBUG [8525] Result set of domains: ['mgmt.dotlan.info'] Adding a Child domain (testdomain.com): 2020-01-17 23:36:16,505 pykolab.daemon DEBUG [9149] Domain 'mgmt.dotlan.info' naming context: 'dc=mgmt,dc=dotlan,dc=info', root dn: 'dc=mgmt,dc=dotlan,dc=info' 2020-01-17 23:36:16,513 pykolab.daemon DEBUG [9149] Domain 'hosting.com' naming context: None, root dn: 'o=Hosting' 2020-01-17 23:36:16,522 pykolab.daemon DEBUG [9149] Domain 'testdomain.com' naming context: None, root dn: 'ou=testdomain.com,o=Hosting' 2020-01-17 23:36:16,522 pykolab.daemon DEBUG [9149] Naming contexts to synchronize: [None, 'dc=mgmt,dc=dotlan,dc=info'] 2020-01-17 23:36:16,523 pykolab.daemon DEBUG [9149] Result set of domains: ['mgmt.dotlan.info'] Adding a user doesn't create the mailbox because kolabd isn't watching the naming context of o=Hosting After applying the patch: 2020-01-17 23:38:36,633 pykolab.daemon DEBUG [9499] Domain 'mgmt.dotlan.info' naming context: 'dc=mgmt,dc=dotlan,dc=info', root dn: 'dc=mgmt,dc=dotlan,dc=info' 2020-01-17 23:38:36,646 pykolab.daemon DEBUG [9499] Domain 'hosting.com' naming context: 'o=hosting', root dn: 'o=Hosting' 2020-01-17 23:38:36,655 pykolab.daemon DEBUG [9499] Domain 'testdomain.com' naming context: 'o=hosting', root dn: 'ou=testdomain.com,o=Hosting' 2020-01-17 23:38:36,656 pykolab.daemon DEBUG [9499] Naming contexts to synchronize: ['o=hosting', 'dc=mgmt,dc=dotlan,dc=info'] 2020-01-17 23:38:36,656 pykolab.daemon DEBUG [9499] Result set of domains: ['mgmt.dotlan.info', 'hosting.com'] Creating a user (to prove the patch works) 2020-01-17 23:41:13,756 pykolab.auth DEBUG [9502] LDAP Search Result Data Entry: 2020-01-17 23:41:13,756 pykolab.auth DEBUG [9502] DN: 'uid=jdoe,ou=People,ou=testdomain.com,o=Hosting' 2020-01-17 23:41:13,756 pykolab.auth DEBUG [9502] Entry: {'displayName': ['Doe, John'], 'cn': ['John Doe'], 'mailQuota': ['1048576'], 'preferredLanguage': ['de_DE'], 'userPassword': ['{PBKDF2_SHA256}AAAIABAeq5TwN6vcCAtBi+jspdlAXeGX5v5FV76uVIWxC5cQ4+23wbfR40aYr+SPzT2AP+Pg17N2hFxXDh3OI9qe/j5bE3A4Nz5utCJahvmorowGTIUA0DJrT6kz8Hy2X7PA8wjeZzedKvjdsqODIYDMdDm4DMNMbwU0pVFKgqWYBf7pNCAa/ZZ7lPPIxVXBC3z7Xhmi0mhxzVbY3TjNptxT9lGJ1Z4JCjID8B+BEqpPSKPJzW5sozgqTUYC8EH37bIn+JsmyMbukepz/0DU3oAKcda0j3VOdnfNE3lQ4tBS9e1CrjRVhzx+7H2ehAdu3olq7xHBRW9Po59hP3+X7nvU9C1lwt5stfv7hnEJ15jyy1JXDzoABUUIYxTxGz+uhP1oyuMHAxqxPDrJikdbCBx4ucGLnTnfFXwtAeuMefRsctMl'], 'nsuniqueid': ['6f0ae601-397a11ea-9892ad7b-e428d0cf'], 'objectClass': ['inetorgperson', 'inetuser', 'kolabinetorgperson', 'mailrecipient', 'organizationalperson', 'person', 'top'], 'sn': ['Doe'], 'mail': ['john.doe@testdomain.com'], 'givenName': ['John'], 'modifytimestamp': ['20200117224113Z'], 'uid': ['jdoe']} 2020-01-17 23:41:13,756 pykolab.auth DEBUG [9502] Entry Change Notification attributes: 2020-01-17 23:41:13,757 pykolab.auth DEBUG [9502] Change Type: 1 ('add') 2020-01-17 23:41:13,757 pykolab.auth DEBUG [9502] Previous DN: None Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Differential Revision: https://git.kolab.org/D913
* chmod: set correct umask as octalDaniel Hoffend2020-02-232-2/+2
| | | | | | | | | | | | | | Summary: Fixes T5686 Reviewers: sicherha Reviewed By: sicherha Subscribers: sicherha Maniphest Tasks: T5686 Differential Revision: https://git.kolab.org/D877
* Add --server to list-deleted-mailboxesJeroen van Meeuwen (Kolab Systems)2020-02-231-22/+56
|
* Fix lint issuesJeroen van Meeuwen (Kolab Systems)2020-02-231-13/+22
|
* Fix moddn on shared folder entries (Bifrost TT324146)Jeroen van Meeuwen (Kolab Systems)2020-02-232-7/+50
|
* Turns out os.chmod creates files with weird permissions '--w--w-r-T 1 kolab ↵Liutauras Adomaitis2020-02-061-1/+1
| | | | kolab-n 0 6. Feb 12:20 pykolab.log', this fixes the problem
* Fix AttributeError: Cyrus instance has no attribute 'has_folder' in ↵Aleksander Machniak2020-01-131-17/+9
| | | | | | | | | | | | | | cleanup_acls() Summary: Also improve performance by removing has_folder() check, and removed redundant debug code Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D823
* encode_page_control() must have a 2nd argument T5734Daniel Hoffend2020-01-131-2/+2
| | | | | | | | | | | | | Summary: As reported in T5734 kolab sync and kolabd are crashing with a trackback that encode_page_control must have 2 arguments. Adding the empty cookie attribute to the server_page_controls removed the error. Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Differential Revision: https://git.kolab.org/D895
* removed owncloud.inc.php from setup want_filesDaniel Hoffend2019-11-261-1/+0
| | | | | | | | | | | | Summary: removed owncloud.inc.php from setup want_files[] Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D859
* setup: add support my unix_socket authenticated mysql serverDaniel Hoffend2019-11-263-9/+85
| | | | | | | | | | | | | | | | | Summary: This patch adds support support for unix_socket based authentication against mariadb servers. Unix_socket support was also edit to the setup dial when calling `setup-kolab (roundcube|syncrotron|mysql)` Test Plan: Use `--mysqlserver=unix_socket` or `--mysqlserver=existing --mysqlrootpw=unix_socket`. Reviewers: #pykolab_developers, vanmeeuwen Reviewed By: #pykolab_developers, vanmeeuwen Subscribers: vanmeeuwen Differential Revision: https://git.kolab.org/D865
* ldap/timeout: always convert to float, fix argumentsDaniel Hoffend2019-11-261-3/+3
| | | | | | | | | | | | | | Summary: Fixes issue T5692 Reviewers: #pykolab_developers, sicherha Reviewed By: sicherha Subscribers: sicherha Maniphest Tasks: T5692 Differential Revision: https://git.kolab.org/D871
* Ignore changes to objects with an nstombstone objectclass (Bifrost #T252995)Jeroen van Meeuwen (Kolab Systems)2019-11-181-0/+11
|
* T5641: Support CUTYPE=ROOM and CUTYPE=UNKNOWNAleksander Machniak2019-11-081-0/+2
|