summaryrefslogtreecommitdiffstats
path: root/wallace/module_resources.py
diff options
context:
space:
mode:
authorThomas Bruederli <bruederli@kolabsys.com>2014-03-25 13:45:42 -0400
committerThomas Bruederli <bruederli@kolabsys.com>2014-03-25 13:45:42 -0400
commitbaf122c45870ff1b182273e2ae3855d34d3a6e8e (patch)
treebfc5d7ce33b8ad20f062a64dc5f48a77298637da /wallace/module_resources.py
parentcdc894bf66bc5c66337548d6baf24483647d1c2e (diff)
downloadpykolab-baf122c45870ff1b182273e2ae3855d34d3a6e8e.tar.gz
Quote resource folder names for IMAP operations
Diffstat (limited to 'wallace/module_resources.py')
-rw-r--r--wallace/module_resources.py12
1 files changed, 7 insertions, 5 deletions
diff --git a/wallace/module_resources.py b/wallace/module_resources.py
index ebc7d38..6a9e4ba 100644
--- a/wallace/module_resources.py
+++ b/wallace/module_resources.py
@@ -447,7 +447,7 @@ def read_resource_calendar(resource_rec, itip_events):
)
# might raise an exception, let that bubble
- imap.imap.m.select(mailbox)
+ imap.imap.m.select(imap.folder_quote(mailbox))
typ, data = imap.imap.m.search(None, 'ALL')
num_messages = len(data[0].split())
@@ -579,9 +579,10 @@ def save_resource_event(itip_event, resource):
"""
try:
# Administrator login name comes from configuration.
- imap.imap.m.setacl(resource['kolabtargetfolder'], conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
+ targetfolder = imap.folder_quote(resource['kolabtargetfolder'])
+ imap.imap.m.setacl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
result = imap.imap.m.append(
- resource['kolabtargetfolder'],
+ targetfolder,
None,
None,
itip_event['xml'].to_message().as_string()
@@ -600,8 +601,9 @@ def delete_resource_event(uid, resource):
"""
Removes the IMAP object with the given UID from a resource's calendar folder
"""
- imap.imap.m.setacl(resource['kolabtargetfolder'], conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
- imap.imap.m.select(resource['kolabtargetfolder'])
+ targetfolder = imap.folder_quote(resource['kolabtargetfolder'])
+ imap.imap.m.setacl(targetfolder, conf.get(conf.get('kolab', 'imap_backend'), 'admin_login'), "lrswipkxtecda")
+ imap.imap.m.select(targetfolder)
typ, data = imap.imap.m.search(None, '(HEADER SUBJECT "%s")' % uid)