VirtualMailManager/mailbox.py
branchv0.6.x
changeset 415 c7a963e6cf6e
parent 386 b7854259ad74
child 422 33a45e4c80c4
equal deleted inserted replaced
414:ae1a8428298c 415:c7a963e6cf6e
   126         if self._sep == '/':
   126         if self._sep == '/':
   127             if '//' in name or '/./' in name or '/../' in name or \
   127             if '//' in name or '/./' in name or '/../' in name or \
   128                name.startswith('../'):
   128                name.startswith('../'):
   129                 bad.append(name)
   129                 bad.append(name)
   130                 return
   130                 return
   131         if '/' in name or '..' in name:
   131         elif '/' in name or '..' in name:
   132             bad.append(name)
   132             bad.append(name)
   133             return
   133             return
   134         if not self.__class__._box_name_re.match(name):
   134         if not self.__class__._box_name_re.match(name):
   135             tmp = utf8_to_mutf7(name)
   135             tmp = utf8_to_mutf7(name)
   136             if name == mutf7_to_utf8(tmp):
   136             if name == mutf7_to_utf8(tmp):
   153         """
   153         """
   154         assert isinstance(mailboxes, list) and isinstance(subscribe, bool)
   154         assert isinstance(mailboxes, list) and isinstance(subscribe, bool)
   155         good = set()
   155         good = set()
   156         bad = []
   156         bad = []
   157         for box in mailboxes:
   157         for box in mailboxes:
       
   158             if self._sep == '/':
       
   159                 box = box.replace('.', self._sep)
   158             self._validate_box_name(box, good, bad)
   160             self._validate_box_name(box, good, bad)
   159         self._add_boxes(good, subscribe)
   161         self._add_boxes(good, subscribe)
   160         return bad
   162         return bad
   161 
   163 
   162     def create(self):
   164     def create(self):