summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--conf/kolab.conf3
-rw-r--r--wallace/module_resources.py9
2 files changed, 8 insertions, 4 deletions
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")