VirtualMailManager/config.py
branchv0.6.x
changeset 458 4ff0fa3ba0fa
parent 384 d3a97f7fb98a
child 481 90d69ae4f40d
equal deleted inserted replaced
457:2019aa415dcd 458:4ff0fa3ba0fa
   303                 'delete_directory': LCO(bool_t, False, self.getboolean),
   303                 'delete_directory': LCO(bool_t, False, self.getboolean),
   304                 'directory_mode': LCO(int, 448, self.getint),
   304                 'directory_mode': LCO(int, 448, self.getint),
   305                 'disk_usage': LCO(bool_t, False, self.getboolean),
   305                 'disk_usage': LCO(bool_t, False, self.getboolean),
   306                 'password_length': LCO(int, 8, self.getint),
   306                 'password_length': LCO(int, 8, self.getint),
   307                 'random_password': LCO(bool_t, False, self.getboolean),
   307                 'random_password': LCO(bool_t, False, self.getboolean),
   308                 'imap': LCO(bool_t, True, self.getboolean),
       
   309                 'pop3': LCO(bool_t, True, self.getboolean),
       
   310                 'sieve': LCO(bool_t, True, self.getboolean),
       
   311                 'smtp': LCO(bool_t, True, self.getboolean),
       
   312             },
   308             },
   313             'bin': {
   309             'bin': {
   314                 'dovecotpw': LCO(str, '/usr/sbin/dovecotpw', self.get,
   310                 'dovecotpw': LCO(str, '/usr/sbin/dovecotpw', self.get,
   315                                  exec_ok),
   311                                  exec_ok),
   316                 'du': LCO(str, '/usr/bin/du', self.get, exec_ok),
   312                 'du': LCO(str, '/usr/bin/du', self.get, exec_ok),
   328             'domain': {
   324             'domain': {
   329                 'auto_postmaster': LCO(bool_t, True, self.getboolean),
   325                 'auto_postmaster': LCO(bool_t, True, self.getboolean),
   330                 'delete_directory': LCO(bool_t, False, self.getboolean),
   326                 'delete_directory': LCO(bool_t, False, self.getboolean),
   331                 'directory_mode': LCO(int, 504, self.getint),
   327                 'directory_mode': LCO(int, 504, self.getint),
   332                 'force_deletion': LCO(bool_t, False, self.getboolean),
   328                 'force_deletion': LCO(bool_t, False, self.getboolean),
       
   329                 'imap': LCO(bool_t, True, self.getboolean),
       
   330                 'pop3': LCO(bool_t, True, self.getboolean),
       
   331                 'sieve': LCO(bool_t, True, self.getboolean),
       
   332                 'smtp': LCO(bool_t, True, self.getboolean),
       
   333                 'quota_bytes': LCO(str, '0', self.get_in_bytes,
       
   334                                    check_size_value),
       
   335                 'quota_messages': LCO(int, 0, self.getint),
       
   336                 'transport': LCO(str, 'dovecot:', self.get),
   333             },
   337             },
   334             'mailbox': {
   338             'mailbox': {
   335                 'folders': LCO(str, 'Drafts:Sent:Templates:Trash',
   339                 'folders': LCO(str, 'Drafts:Sent:Templates:Trash',
   336                                self.unicode),
   340                                self.unicode),
   337                 'format': LCO(str, 'maildir', self.get, check_mailbox_format),
   341                 'format': LCO(str, 'maildir', self.get, check_mailbox_format),
   345                 'crypt_sha512_rounds': LCO(int, 5000, self.getint),
   349                 'crypt_sha512_rounds': LCO(int, 5000, self.getint),
   346                 'dovecot_version': LCO(str, None, self.hexversion,
   350                 'dovecot_version': LCO(str, None, self.hexversion,
   347                                        check_version_format),
   351                                        check_version_format),
   348                 'password_scheme': LCO(str, 'CRAM-MD5', self.get,
   352                 'password_scheme': LCO(str, 'CRAM-MD5', self.get,
   349                                        verify_scheme),
   353                                        verify_scheme),
   350                 'quota_bytes': LCO(str, '0', self.get_in_bytes,
       
   351                                    check_size_value),
       
   352                 'quota_messages': LCO(int, 0, self.getint),
       
   353                 'transport': LCO(str, 'dovecot:', self.get),
       
   354             },
   354             },
   355         }
   355         }
   356 
   356 
   357     def load(self):
   357     def load(self):
   358         """Loads the configuration, read only.
   358         """Loads the configuration, read only.
   455         # section mailbox
   455         # section mailbox
   456         value = self.dget('mailbox.format')
   456         value = self.dget('mailbox.format')
   457         if not known_format(value):
   457         if not known_format(value):
   458             self._missing['mailbox'] = ['format: ' +\
   458             self._missing['mailbox'] = ['format: ' +\
   459                               _(u"Unsupported mailbox format: '%s'") % value]
   459                               _(u"Unsupported mailbox format: '%s'") % value]
   460         # section misc
   460         # section domain
   461         try:
   461         try:
   462             value = self.dget('misc.quota_bytes')
   462             value = self.dget('domain.quota_bytes')
   463         except (ValueError, TypeError), err:
   463         except (ValueError, TypeError), err:
   464             self._missing['misc'] = [u'quota_bytes: ' + str(err)]
   464             self._missing['domain'] = [u'quota_bytes: ' + str(err)]
   465 
   465 
   466 
   466 
   467 def is_dir(path):
   467 def is_dir(path):
   468     """Check if the expanded path is a directory.  When the expanded path
   468     """Check if the expanded path is a directory.  When the expanded path
   469     is a directory the expanded path will be returned.  Otherwise a
   469     is a directory the expanded path will be returned.  Otherwise a