conf/kolab.conf wallace/module_resources.py

Thomas Brüderli bruederli at kolabsys.com
Thu Oct 30 14:46:39 CET 2014


 conf/kolab.conf             |    3 +++
 wallace/module_resources.py |    9 +++++----
 2 files changed, 8 insertions(+), 4 deletions(-)

New commits:
commit 9fc5eee035ec418937556f36971ceb7c5f1cd375
Author: Thomas Bruederli <bruederli at kolabsys.com>
Date:   Fri Oct 24 10:56:30 2014 -0400

    Make resource calendar expiry days configurable (#3843)

diff --git a/conf/kolab.conf b/conf/kolab.conf
index 654c38e..ea10029 100644
--- a/conf/kolab.conf
+++ b/conf/kolab.conf
@@ -382,6 +382,9 @@ footer_html = /etc/kolab/footer.html
 ; default settings for kolabInvitationPolicy
 kolab_invitation_policy = ACT_ACCEPT_IF_NO_CONFLICT:example.org, ACT_MANUAL
 
+; number of days past their end resource calendar events should be kept
+resource_calendar_expire_days = 100
+
 ; This is a domain name space specific section, that enables us to override
 ; all settings, for example, the LDAP URI, base and bind DNs, scopes, filters,
 ; etc. Note that overriding the LDAP settings for the primary domain name space
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index 9376749..89b5544 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -442,14 +442,15 @@ def expunge_resource_calendar(mailbox):
     """
     global imap
 
+    days = int(conf.get('wallace', 'resource_calendar_expire_days', 100))
+    now = datetime.datetime.now(tzlocal())
+    expire_date = now - datetime.timedelta(days=days)
+
     log.debug(
-        _("Expunge events in resource folder %r") % (mailbox),
+        _("Expunge events in resource folder %r older than %d days") % (mailbox, days),
         level=8
     )
 
-    now = datetime.datetime.now(tzlocal())
-    expire_date = now - datetime.timedelta(days=100)
-
     # might raise an exception, let that bubble
     targetfolder = imap.folder_quote(mailbox)
     imap.set_acl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")




More information about the commits mailing list