Config: renamed services.managesieve to services.sieve,
authorPascal Volk <neverseen@users.sourceforge.net>
Mon, 17 Aug 2009 06:31:14 +0000
changeset 113 e35755191ff3
parent 112 d1f345f91e1c
child 114 e671210b04b8
Config: renamed services.managesieve to services.sieve, added misc.dovecotvers
VirtualMailManager/Account.py
VirtualMailManager/Config.py
VirtualMailManager/VirtualMailManager.py
man/de/man1/vmm.1
man/de/man5/vmm.cfg.5
man/man1/vmm.1
man/man5/vmm.cfg.5
vmm
vmm.cfg
--- a/VirtualMailManager/Account.py	Mon Aug 17 04:56:13 2009 +0000
+++ b/VirtualMailManager/Account.py	Mon Aug 17 06:31:14 2009 +0000
@@ -75,18 +75,20 @@
     def _switchState(self, state, service):
         if not isinstance(state, bool):
             return False
-        if not service in ['smtp', 'pop3', 'imap', 'managesieve', 'all', None]:
+        if not service in ['smtp', 'pop3', 'imap', 'sieve', 'all', None]:
             raise AccE(_(u"Unknown service »%s«.") % service,
                     ERR.UNKNOWN_SERVICE)
         if self._uid < 1:
             raise AccE(_(u"The account »%s« doesn't exists.") % self._addr,
                     ERR.NO_SUCH_ACCOUNT)
         dbc = self._dbh.cursor()
-        if service in ['smtp', 'pop3', 'imap', 'managesieve']:
+        if service in ['smtp', 'pop3', 'imap', 'sieve']:
             dbc.execute(
                     "UPDATE users SET %s=%s WHERE local_part='%s' AND gid=%s"
                     % (service, state, self._addr._localpart, self._gid))
         elif state:
+            # TODO
+            # add dovecotvers check
             dbc.execute("UPDATE users SET smtp = TRUE, pop3 = TRUE,\
  imap = TRUE, managesieve = TRUE WHERE local_part = %s AND gid = %s",
                 self._addr._localpart, self._gid)
@@ -128,15 +130,17 @@
     def disable(self, service=None):
         self._switchState(False, service)
 
-    def save(self, maillocation, smtp, pop3, imap, managesieve):
+    def save(self, maillocation, smtp, pop3, imap, sieve):
         if self._uid < 1:
             self._prepare(maillocation)
             dbc = self._dbh.cursor()
+            # TODO
+            # add dovecotvers check
             dbc.execute("""INSERT INTO users (local_part, passwd, uid, gid,\
  mid, tid, smtp, pop3, imap, managesieve)\
  VALUES (%s, %s, %s, %s, %s, %s, %s, %s, %s, %s)""",
                 self._addr._localpart, self._passwd, self._uid, self._gid,
-                self._mid, self._tid, smtp, pop3, imap, managesieve)
+                self._mid, self._tid, smtp, pop3, imap, sieve)
             self._dbh.commit()
             dbc.close()
         else:
@@ -166,6 +170,8 @@
 
     def getInfo(self):
         dbc = self._dbh.cursor()
+        # TODO
+        # add dovecotvers check
         dbc.execute("SELECT name, uid, gid, mid, tid, smtp, pop3, imap, \
  managesieve FROM users WHERE local_part=%s AND gid=%s",
             self._addr._localpart, self._gid)
@@ -176,9 +182,9 @@
                     ERR.NO_SUCH_ACCOUNT)
         else:
             keys = ['name', 'uid', 'gid', 'maildir', 'transport', 'smtp',
-                    'pop3', 'imap', 'managesieve']
+                    'pop3', 'imap', 'sieve']
             info = dict(zip(keys, info))
-            for service in ['smtp', 'pop3', 'imap', 'managesieve']:
+            for service in ['smtp', 'pop3', 'imap', 'sieve']:
                 if bool(info[service]):
                     info[service] = _('enabled')
                 else:
--- a/VirtualMailManager/Config.py	Mon Aug 17 04:56:13 2009 +0000
+++ b/VirtualMailManager/Config.py	Mon Aug 17 06:31:14 2009 +0000
@@ -63,7 +63,7 @@
                 ['smtp', 'true'],
                 ['pop3', 'true'],
                 ['imap', 'true'],
-                ['managesieve', 'true']
+                ['sieve', 'true']
                 ]
         self.__domdopts = [
                 ['base', '/srv/mail'],
@@ -79,7 +79,8 @@
                 ['passwdscheme', 'PLAIN'],
                 ['gid_mail', 8],
                 ['forcedel', 'false'],
-                ['transport', 'dovecot:']
+                ['transport', 'dovecot:'],
+                ['dovecotvers', '11']
                 ]
 
     def load(self):
--- a/VirtualMailManager/VirtualMailManager.py	Mon Aug 17 04:56:13 2009 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Mon Aug 17 06:31:14 2009 +0000
@@ -601,7 +601,7 @@
                 self.__Cfg.getboolean('services', 'smtp'),
                 self.__Cfg.getboolean('services', 'pop3'),
                 self.__Cfg.getboolean('services', 'imap'),
-                self.__Cfg.getboolean('services', 'managesieve'))
+                self.__Cfg.getboolean('services', 'sieve'))
         self.__mailDirMake(acc.getDir('domain'), acc.getUID(), acc.getGID())
 
     def aliasAdd(self, aliasaddress, targetaddress):
--- a/man/de/man1/vmm.1	Mon Aug 17 04:56:13 2009 +0000
+++ b/man/de/man1/vmm.1	Mon Aug 17 06:31:14 2009 +0000
@@ -1,4 +1,4 @@
-.TH "VMM" "1" "5. Okt 2008" "Pascal Volk"
+.TH "VMM" "1" "17 Aug 2009" "Pascal Volk"
 .SH NAME
 vmm \- Programm für die Kommandozeile, um E-Mail-Domains, -Konten und -Aliase zu
 verwalten.
@@ -54,11 +54,13 @@
         Beispiel:
 
         \fBvmm configure services\fP
+        Verwende Konfigurationsdatei: /usr/local/etc/vmm.cfg
+
         * Konfigurations Abschnitt: »services«
         Neuer Wert für Option pop3 [True]: 
         Neuer Wert für Option smtp [True]: 
         Neuer Wert für Option imap [True]: 
-        Neuer Wert für Option managesieve [True]: false
+        Neuer Wert für Option sieve [True]: false
 .fi
 .PP
 .TP
@@ -325,7 +327,7 @@
 Zugriff mit diesem Unterbefehl beschränkt werden.
 .br
 Wurde weder ein \fIService\fP noch das Schlüsselwort '\fIall\fP' angegeben,
-werden alle Services (\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, und \fImanagesieve\fP)
+werden alle Services (\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, und \fIsieve\fP)
 für das Konto mit der angegebenen \fIAdresse\fP deaktiviert.
 .br
 Andernfalls wird nur der Zugriff auf den angegeben \fIService\fP gesperrt.
@@ -343,7 +345,7 @@
 dieser Unterbefehl verwendet.
 .br
 Wurde weder ein \fIService\fP noch das Schlüsselwort '\fIall\fP' angegeben,
-werden alle Services (\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, und \fImanagesieve\fP)
+werden alle Services (\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, und \fIsieve\fP)
 für das Konto mit der angegebenen  \fIAdresse\fP aktiviert.
 .br
 Andernfalls wird nur der Zugriff auf den angegeben \fIService\fP gestattet.
--- a/man/de/man5/vmm.cfg.5	Mon Aug 17 04:56:13 2009 +0000
+++ b/man/de/man5/vmm.cfg.5	Mon Aug 17 06:31:14 2009 +0000
@@ -1,4 +1,4 @@
-.TH vmm.cfg 5 "08 Dez 2008" "Pascal Volk"
+.TH vmm.cfg 5 "17 Aug 2009" "Pascal Volk"
 .SH NAME
 vmm.cfg \- Konfigurationsdatei für vmm
 .SH SYNOPSIS
@@ -138,7 +138,7 @@
 \fBimap\fP (\fIBoolean\fP)
 Legt fest, ob sich ein Anwender standardmäßig per IMAP einloggen kann.
 .TP
-\fBmanagesieve\fP (\fIBoolean\fP)
+\fBsieve\fP (\fIBoolean\fP)
 Legt fest, ob sich ein Anwender standardmäßig per MANAGESIEVE einloggen kann.
 .TP
 \fBBeispiel\fP:
@@ -150,7 +150,7 @@
 .br
 imap = false
 .br
-managesieve = false
+sieve = false
 .\" -----
 .SH DOMDIR ABSCHNITT
 Im \fBdomdir\fP-Abschnitt werden die Optionen der Domain-Verzeichnisse bestimmt.
@@ -221,6 +221,14 @@
 \fBtransport\fP (\fIString\fP)
 Der Standard-Transport aller Domains und Konten.
 .TP
+\fBdovecotvers\fP (\fIInt\fP)
+Die verketteten Major- und Minor-Teile der eingesetzten Dovecot-Version
+(siehe: dovecot --version).
+.br
+Diese Option beeinflusst diverse Datenbankzugriffe. Da es zwischen Dovecot
+v1.1.x und v1.2.x einige Änderungen gab. Zum Beispiel \fB11\fP, falls
+\fBdovecot --version\fP den Wert \fB1.1\fP.18 ausgibt.
+.TP
 \fBBeispiel\fP:
 [misc]
 .br
@@ -231,6 +239,8 @@
 forcedel = false
 .br
 transport = dovecot:
+.br
+dovecotvers = 11
 .\" -----
 .SH CONFIG ABSCHNITT
 Beim \fBconfig\fP-Abschnitt handelt es sich um einen internen
--- a/man/man1/vmm.1	Mon Aug 17 04:56:13 2009 +0000
+++ b/man/man1/vmm.1	Mon Aug 17 06:31:14 2009 +0000
@@ -1,4 +1,4 @@
-.TH "VMM" "1" "5 Oct 2008" "Pascal Volk"
+.TH "VMM" "1" "17 Aug 2009" "Pascal Volk"
 .SH NAME
 vmm \- command line tool to manage email domains/accounts/aliases
 .SH SYNOPSIS
@@ -52,11 +52,13 @@
         Example:
 
         \fBvmm configure services\fP
+        Using configuration file: /usr/local/etc/vmm.cfg
+
         * Config section: »services«
         Enter new value for option pop3 [True]: 
         Enter new value for option smtp [True]: 
         Enter new value for option imap [True]: 
-        Enter new value for option managesieve [True]: false
+        Enter new value for option sieve [True]: false
 .fi
 .PP
 .TP
@@ -307,8 +309,8 @@
 access with this subcommand.
 .br
 If neither a \fIservice\fP nor the keyword '\fIall\fP' is given all services
-(\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, and \fImanagesieve\fP) will be disabled
-for the account with the specified \fIaddress\fP. Otherwise only the specified
+(\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, and \fIsieve\fP) will be disabled for the
+account with the specified \fIaddress\fP. Otherwise only the specified 
 \fIservice\fP will be restricted.
 .PP
 .nf
@@ -322,8 +324,8 @@
 To allow access to one or all restricted services use this subcommand.
 .br
 If neither a \fIservice\fP nor the keyword '\fIall\fP' is given all services
-(\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, and \fImanagesieve\fP) will be enabled for
-the account with the specified \fIaddress\fP. Otherwise only the specified 
+(\fIsmtp\fP, \fIpop3\fP, \fIimap\fP, and \fIsieve\fP) will be enabled for the
+account with the specified \fIaddress\fP. Otherwise only the specified 
 \fIservice\fP will be enabled.
 .PP
 .TP
--- a/man/man5/vmm.cfg.5	Mon Aug 17 04:56:13 2009 +0000
+++ b/man/man5/vmm.cfg.5	Mon Aug 17 06:31:14 2009 +0000
@@ -1,4 +1,4 @@
-.TH vmm.cfg 5 "08 Dec 2008" "Pascal Volk"
+.TH vmm.cfg 5 "17 Aug 2009" "Pascal Volk"
 .SH NAME
 vmm.cfg \- configuration file for vmm
 .SH SYNOPSIS
@@ -127,7 +127,7 @@
 \fBimap\fP (\fIBoolean\fP)
 Decides if users can login via imap by default. 
 .TP
-\fBmanagesieve\fP (\fIBoolean\fP)
+\fBsieve\fP (\fIBoolean\fP)
 Decides if users can login via managesieve by default. 
 .TP
 \fBExample\fP:
@@ -139,7 +139,7 @@
 .br
 imap = false
 .br
-managesieve = false
+sieve = false
 .\" -----
 .SH DOMDIR SECTION
 The \fBdomdir\fP section is used to specify options for the directories of the
@@ -208,6 +208,14 @@
 \fBtransport\fP (\fIString\fP)
 Default transport for domains and accounts.
 .TP
+\fBdovecotvers\fP (\fIInt\fP)
+The concatenated major and minor version number of the currently used Dovecot
+version. (see: dovecot --version).
+.br
+This option affects various database operations. There are some differences
+between Dovecot v1.1.x and v1.2.x. For example, when the command \fBdovecot
+--version\fP shows \fB1.1\fP.18, set the value of this option to \fB11\fP.
+.TP
 \fBExample\fP:
 [misc]
 .br
@@ -218,6 +226,8 @@
 forcedel = false
 .br
 transport = dovecot:
+.br
+dovecotvers = 11
 .\" -----
 .SH CONFIG SECTION
 The \fBconfig\fP section is a internal used control section.
--- a/vmm	Mon Aug 17 04:56:13 2009 +0000
+++ b/vmm	Mon Aug 17 06:31:14 2009 +0000
@@ -94,11 +94,11 @@
         or vmm.cfgGetBoolean('maildir', 'diskusage'):
             order = (('address', 0), ('name', 0), ('uid', 1), ('gid', 1),
                     ('transport', 0), ('maildir', 0), ('disk usage', 0),
-                    ('smtp', 1), ('pop3', 1), ('imap', 1), ('managesieve', 1))
+                    ('smtp', 1), ('pop3', 1), ('imap', 1), ('sieve', 1))
         else:
             order = (('address', 0), ('name', 0), ('uid', 1), ('gid', 1),
                     ('transport', 0), ('maildir', 0), ('smtp', 1), ('pop3', 1),
-                    ('imap', 1), ('managesieve', 1))
+                    ('imap', 1), ('sieve', 1))
     elif argv[1] in ['gu', 'getuser']:
         order = (('uid', 1), ('gid', 1), ('address', 0))
     return order
--- a/vmm.cfg	Mon Aug 17 04:56:13 2009 +0000
+++ b/vmm.cfg	Mon Aug 17 06:31:14 2009 +0000
@@ -1,5 +1,5 @@
-# This is the Virtual Mail Manager (vmm) configuration file.
-# location: /usr/local/etc/vmm.cfg
+# This is the vmm (a virtual mail manager) configuration file.
+# default location: /usr/local/etc/vmm.cfg
 #
 
 #
@@ -43,7 +43,7 @@
 ; allow imap by default? (Boolean)
 imap = true
 ; allow managesieve by default? (Boolean)
-managesieve = true
+sieve = true
 
 #
 # domain directory settings
@@ -65,7 +65,7 @@
 dovecotpw = /usr/sbin/dovecotpw
 ; location of disk usage (String)
 du = /usr/bin/du
-; location of postconf
+; location of postconf (String)
 postconf = /usr/sbin/postconf
 
 #
@@ -80,6 +80,9 @@
 forcedel = false
 ; default transport for domains and accounts
 transport = dovecot:
+; the concatenated major and minor version number from `dovecot --version` (Int)
+; e.g. 1.0.15 -> 10; 1.1.18 -> 11; 1.2.3 -> 12
+dovecotvers = 11
 
 #
 # Configuration state