summaryrefslogtreecommitdiffstats
path: root/pykolab/imap
diff options
context:
space:
mode:
authorJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-21 10:13:11 +0000
committerJeroen van Meeuwen (Kolab Systems) <vanmeeuwen@kolabsys.com>2012-11-21 10:13:11 +0000
commit645a66f8700e011f966905a66beac48bf8734c91 (patch)
treef5347ef053928a00a408b171edf6ba0102198488 /pykolab/imap
parentbf04f0b8c40843b92b709efaf5bb041996b7cb16 (diff)
downloadpykolab-645a66f8700e011f966905a66beac48bf8734c91.tar.gz
Ensure the mailbox name is lower-cased upon creation
Diffstat (limited to 'pykolab/imap')
-rw-r--r--pykolab/imap/__init__.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/pykolab/imap/__init__.py b/pykolab/imap/__init__.py
index 391714d..68f0c78 100644
--- a/pykolab/imap/__init__.py
+++ b/pykolab/imap/__init__.py
@@ -347,6 +347,13 @@ class IMAP(object):
Returns the full path to the new mailbox folder.
"""
+ # TODO: Whether or not to lowercase the mailbox name is really up to the
+ # IMAP server setting username_tolower (normalize_uid, lmtp_downcase_rcpt).
+
+ if not mailbox_base_name == mailbox_base_name.lower():
+ log.warning(_("Downcasing mailbox name %r") % (mailbox_base_name))
+ mailbox_base_name = mailbox_base_name.lower()
+
folder_name = "user%s%s" % (self.imap.separator, mailbox_base_name)
log.info(_("Creating new mailbox for user %s") %(mailbox_base_name))