VMM/config: Moved some options to section `domain': v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Sat, 05 Nov 2011 21:44:23 +0000
branchv0.6.x
changeset 458 4ff0fa3ba0fa
parent 457 2019aa415dcd
child 459 033a0436894f
VMM/config: Moved some options to section `domain': old new ------------------------------------------------------------ account.imap -> domain.imap account.pop3 -> domain.pop3 account.sieve -> domain.sieve account.smtp -> domain.account misc.quota_bytes -> domain.quota_bytes misc.quota_messages -> domain.quota_messages misc.transport -> domain.transport
VirtualMailManager/cli/subcommands.py
VirtualMailManager/config.py
VirtualMailManager/handler.py
vmm.cfg
--- a/VirtualMailManager/cli/subcommands.py	Sat Nov 05 19:04:07 2011 +0000
+++ b/VirtualMailManager/cli/subcommands.py	Sat Nov 05 21:44:23 2011 +0000
@@ -180,7 +180,7 @@
     noop = lambda option: option
     opt_formater = {
         'misc.dovecot_version': version_str,
-        'misc.quota_bytes': human_size,
+        'domain.quota_bytes': human_size,
     }
 
     option = ctx.args[2].lower()
--- a/VirtualMailManager/config.py	Sat Nov 05 19:04:07 2011 +0000
+++ b/VirtualMailManager/config.py	Sat Nov 05 21:44:23 2011 +0000
@@ -305,10 +305,6 @@
                 'disk_usage': LCO(bool_t, False, self.getboolean),
                 'password_length': LCO(int, 8, self.getint),
                 'random_password': LCO(bool_t, False, self.getboolean),
-                'imap': LCO(bool_t, True, self.getboolean),
-                'pop3': LCO(bool_t, True, self.getboolean),
-                'sieve': LCO(bool_t, True, self.getboolean),
-                'smtp': LCO(bool_t, True, self.getboolean),
             },
             'bin': {
                 'dovecotpw': LCO(str, '/usr/sbin/dovecotpw', self.get,
@@ -330,6 +326,14 @@
                 'delete_directory': LCO(bool_t, False, self.getboolean),
                 'directory_mode': LCO(int, 504, self.getint),
                 'force_deletion': LCO(bool_t, False, self.getboolean),
+                'imap': LCO(bool_t, True, self.getboolean),
+                'pop3': LCO(bool_t, True, self.getboolean),
+                'sieve': LCO(bool_t, True, self.getboolean),
+                'smtp': LCO(bool_t, True, self.getboolean),
+                'quota_bytes': LCO(str, '0', self.get_in_bytes,
+                                   check_size_value),
+                'quota_messages': LCO(int, 0, self.getint),
+                'transport': LCO(str, 'dovecot:', self.get),
             },
             'mailbox': {
                 'folders': LCO(str, 'Drafts:Sent:Templates:Trash',
@@ -347,10 +351,6 @@
                                        check_version_format),
                 'password_scheme': LCO(str, 'CRAM-MD5', self.get,
                                        verify_scheme),
-                'quota_bytes': LCO(str, '0', self.get_in_bytes,
-                                   check_size_value),
-                'quota_messages': LCO(int, 0, self.getint),
-                'transport': LCO(str, 'dovecot:', self.get),
             },
         }
 
@@ -457,11 +457,11 @@
         if not known_format(value):
             self._missing['mailbox'] = ['format: ' +\
                               _(u"Unsupported mailbox format: '%s'") % value]
-        # section misc
+        # section domain
         try:
-            value = self.dget('misc.quota_bytes')
+            value = self.dget('domain.quota_bytes')
         except (ValueError, TypeError), err:
-            self._missing['misc'] = [u'quota_bytes: ' + str(err)]
+            self._missing['domain'] = [u'quota_bytes: ' + str(err)]
 
 
 def is_dir(path):
--- a/VirtualMailManager/handler.py	Sat Nov 05 19:04:07 2011 +0000
+++ b/VirtualMailManager/handler.py	Sat Nov 05 21:44:23 2011 +0000
@@ -429,17 +429,17 @@
         dom = self._get_domain(domainname)
         if transport is None:
             dom.set_transport(Transport(self._dbh,
-                              transport=self._cfg.dget('misc.transport')))
+                              transport=self._cfg.dget('domain.transport')))
         else:
             dom.set_transport(Transport(self._dbh, transport=transport))
         dom.set_quotalimit(QuotaLimit(self._dbh,
-                           bytes=long(self._cfg.dget('misc.quota_bytes')),
-                           messages=self._cfg.dget('misc.quota_messages')))
+                           bytes=long(self._cfg.dget('domain.quota_bytes')),
+                           messages=self._cfg.dget('domain.quota_messages')))
         dom.set_serviceset(ServiceSet(self._dbh,
-                                      imap=self._cfg.dget('account.imap'),
-                                      pop3=self._cfg.dget('account.pop3'),
-                                      sieve=self._cfg.dget('account.sieve'),
-                                      smtp=self._cfg.dget('account.smtp')))
+                                      imap=self._cfg.dget('domain.imap'),
+                                      pop3=self._cfg.dget('domain.pop3'),
+                                      sieve=self._cfg.dget('domain.sieve'),
+                                      smtp=self._cfg.dget('domain.smtp')))
         dom.set_directory(self._cfg.dget('misc.base_directory'))
         dom.save()
         self._make_domain_dir(dom)
--- a/vmm.cfg	Sat Nov 05 19:04:07 2011 +0000
+++ b/vmm.cfg	Sat Nov 05 21:44:23 2011 +0000
@@ -68,6 +68,44 @@
 directory_mode = 504
 ; Force deletion of accounts and aliases when deleting a domain (Boolean)
 force_deletion = false
+;
+; The service settings will be evaluated and applied when a domain is
+; created. The service settings of the domain will be applied when you
+; create a new account.
+; Use the subcommand domainservices to modify a domain's service settings.
+; Or userservices in order to update the service setting of an account.
+; Allow smtp by default? (Boolean)
+smtp = true
+; Allow pop3 by default? (Boolean)
+pop3 = true
+; Allow imap by default? (Boolean)
+imap = true
+; Allow managesieve by default? (Boolean)
+sieve = true
+;
+; The quota_* settings will be evaluated and applied when a domain is
+; created. The domain's quota_* settings will be applied when an account
+; is added to a domain.
+; Use the subcommand domainquota to modify a domain's quota limits.
+; Or userquota in order to update an account's quota limits.
+; Quota limit in bytes. 0 means unlimited (String)
+; The value can have one of the suffixes:
+;    * b: bytes
+;    * k: kilobytes
+;    * M: megabytes
+;    * G: gigabytes
+; 1024 is the same as 1024b or 1k
+quota_bytes = 0
+; Quota limit in number of messages. 0 means unlimited (Int)
+quota_messages = 0
+;
+; The transport setting will be evaluated and applied when a domain is
+; created. The domain's transport setting will be applied when an account
+; is added to a domain.
+; Use the subcommand domaintransport to modify the transport of a domain.
+; Or usertransport in order to update an account's transport setting.
+; default transport for domains and accounts (String)
+transport = dovecot:
 
 #
 # Account settings
@@ -85,14 +123,6 @@
 random_password = false
 ; How many characters to include in the generated passwords? (Int)
 password_length = 8
-; Allow smtp by default? (Boolean)
-smtp = true
-; Allow pop3 by default? (Boolean)
-pop3 = true
-; Allow imap by default? (Boolean)
-imap = true
-; Allow managesieve by default? (Boolean)
-sieve = true
 
 #
 # external binaries
@@ -122,16 +152,4 @@
 dovecot_version = 1.2.11
 ; Password scheme to use (see also: dovecotpw -l) (String)
 password_scheme = CRAM-MD5
-; Quota limit in bytes. 0 means unlimited (String)
-; The value can have one of the suffixes:
-;    * b: bytes
-;    * k: kilobytes
-;    * M: megabytes
-;    * G: gigabytes
-; 1024 is the same as 1024b or 1k
-quota_bytes = 0
-; Quota limit in number of messages. 0 means unlimited (Int)
-quota_messages = 0
-; default transport for domains and accounts (String)
-transport = dovecot: