VMM/mailbox: Use the correct mailbox hierarchy separator in v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Tue, 22 Feb 2011 22:29:58 +0000
branchv0.6.x
changeset 415 c7a963e6cf6e
parent 414 ae1a8428298c
child 416 f32b323fd347
VMM/mailbox: Use the correct mailbox hierarchy separator in Mailbox.add_boxes() for mdbox and sdbox mailbox format.
VirtualMailManager/mailbox.py
--- a/VirtualMailManager/mailbox.py	Tue Feb 22 20:41:16 2011 +0000
+++ b/VirtualMailManager/mailbox.py	Tue Feb 22 22:29:58 2011 +0000
@@ -128,7 +128,7 @@
                name.startswith('../'):
                 bad.append(name)
                 return
-        if '/' in name or '..' in name:
+        elif '/' in name or '..' in name:
             bad.append(name)
             return
         if not self.__class__._box_name_re.match(name):
@@ -155,6 +155,8 @@
         good = set()
         bad = []
         for box in mailboxes:
+            if self._sep == '/':
+                box = box.replace('.', self._sep)
             self._validate_box_name(box, good, bad)
         self._add_boxes(good, subscribe)
         return bad