* 'VirtualMailManager/Alias.py'
authorPascal Volk <neverseen@users.sourceforge.net>
Wed, 11 Jun 2008 05:07:07 +0000
changeset 38 c44ea4526546
parent 37 89f952b0f366
child 39 8dcf739fc97e
* 'VirtualMailManager/Alias.py' - replaced all »« with '' * 'VirtualMailManager/Account.py' - replaced all »« with '' - added Account.setPassword() * 'VirtualMailManager/VirtualMailManager.py' - replaced all »« with '' - added VirtualMailManager._readpass() - check if domain/account exists before prompting for password (VirtualMailManager.user_add(), VirtualMailManager.user_password()) * 'vmm' - removed _readpass() * 'UPGRADE' * 'upgrade.sh' - added to repository again * 'po/vmm.pot' * 'po/de.po' - updated
UPGRADE
VirtualMailManager/Account.py
VirtualMailManager/Alias.py
VirtualMailManager/VirtualMailManager.py
po/de.po
po/vmm.pot
upgrade.sh
vmm
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/UPGRADE	Wed Jun 11 05:07:07 2008 +0000
@@ -0,0 +1,8 @@
+If you still have installed vmm 0.3.x you have to proceed this step first:
+    * upgrade your vmm installation to version 0.4
+
+If you have installed vmm 0.4 you have to proceed this step:
+   * execute upgrade.sh
+
+else
+     * read INSTALL
--- a/VirtualMailManager/Account.py	Wed Jun 11 00:05:22 2008 +0000
+++ b/VirtualMailManager/Account.py	Wed Jun 11 05:07:07 2008 +0000
@@ -42,7 +42,7 @@
         self._exists()
         if self._isAlias():
             raise VMMAccountException(
-            (_(u'There is already an alias with address »%s«') % address,
+            (_(u"There is already an alias with address '%s'") % address,
                 ERR.ALIAS_EXISTS))
 
     def _exists(self):
@@ -74,7 +74,7 @@
         dom = Domain(self._dbh, d)
         self._gid = dom.getID()
         if self._gid == 0:
-            raise VMMAccountException((_(u"Domain »%s« doesn't exist.") % d,
+            raise VMMAccountException((_(u"Domain '%s' doesn't exist.") % d,
                 ERR.NO_SUCH_DOMAIN))
         self._base = dom.getDir()
         self._tid = dom.getTransportID()
@@ -93,7 +93,7 @@
         if not isinstance(state, bool):
             return False
         if not service in ['smtp', 'pop3', 'imap', 'managesieve', 'all', None]:
-            raise VMMAccountException((_(u"Unknown service »%s«") % service,
+            raise VMMAccountException((_(u"Unknown service '%s'") % service,
                 ERR.UNKNOWN_SERVICE))
         if self._uid < 1:
             raise VMMAccountException((_("Account doesn't exists"),
@@ -115,6 +115,9 @@
             self._dbh.commit()
         dbc.close()
 
+    def setPassword(self, password):
+        self._passwd = password
+
     def getUID(self):
         return self._uid
 
--- a/VirtualMailManager/Alias.py	Wed Jun 11 00:05:22 2008 +0000
+++ b/VirtualMailManager/Alias.py	Wed Jun 11 05:07:07 2008 +0000
@@ -41,7 +41,7 @@
             self._exists()
         if self._isAccount():
             raise VMMAliasException(
-            (_(u'There is already an account with address »%s«') % self._addr,
+            (_(u"There is already an account with address '%s'") % self._addr,
                 ERR.ACCOUNT_EXISTS))
 
     def _exists(self):
@@ -71,7 +71,7 @@
         dom = Domain(self._dbh, d)
         self._gid = dom.getID()
         if self._gid == 0:
-            raise VMMAliasException((_(u"Domain »%s« doesn't exist.") % d,
+            raise VMMAliasException((_(u"Domain '%s' doesn't exist.") % d,
                 ERR.NO_SUCH_DOMAIN))
 
     def save(self):
--- a/VirtualMailManager/VirtualMailManager.py	Wed Jun 11 00:05:22 2008 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Wed Jun 11 05:07:07 2008 +0000
@@ -18,6 +18,7 @@
 import sys
 import gettext
 from encodings.idna import ToASCII, ToUnicode
+from getpass import getpass
 from shutil import rmtree
 from subprocess import Popen, PIPE
 
@@ -72,7 +73,7 @@
     def __chkCfgFile(self):
         """Checks the configuration file, returns bool"""
         if not os.path.isfile(self.__cfgFileName):
-            raise VMMException((_(u"The file »%s« does not exists.") %
+            raise VMMException((_(u"The file '%s' does not exists.") %
                 self.__cfgFileName, ERR.CONF_NOFILE))
         fstat = os.stat(self.__cfgFileName)
         try:
@@ -139,7 +140,7 @@
                 ERR.LOCALPART_TOO_LONG))
         if re.compile(RE_LOCALPART).search(localpart):
             raise VMMException((
-                _(u'The local part »%s« contains invalid characters.') %
+                _(u"The local part '%s' contains invalid characters.") %
                 localpart, ERR.LOCALPART_INVALID))
         return localpart
 
@@ -191,10 +192,10 @@
         try:
             localpart, domain = address.split('@')
         except ValueError:
-            raise VMMException((_(u"Missing '@' sign in e-mail address »%s«.") %
+            raise VMMException((_(u"Missing '@' sign in e-mail address '%s'.") %
                 address, ERR.INVALID_ADDRESS))
         except AttributeError:
-            raise VMMException((_(u"»%s« looks not like an e-mail address.") %
+            raise VMMException((_(u"'%s' looks not like an e-mail address.") %
                 address, ERR.INVALID_ADDRESS))
         domain = self.__chkDomainname(domain)
         localpart = self.__chkLocalpart(localpart)
@@ -207,6 +208,21 @@
             password = self.__pwhash(password)
         return Account(self.__dbh, address, password)
 
+    def _readpass(self):
+        clear0 = ''
+        clear1 = '1'
+        while clear0 != clear1:
+            while len(clear0) < 1:
+                clear0 = getpass(prompt=_('Enter new password: '))
+                if len(clear0) < 1:
+                    sys.stderr.write('%s\n'
+                            % _('Sorry, empty passwords are not permitted'))
+            clear1 = getpass(prompt=_('Retype new password: '))
+            if clear0 != clear1:
+                clear0 = ''
+                sys.stderr.write('%s\n' % _('Sorry, passwords do not match'))
+        return clear0
+
     def __getAlias(self, address, destination=None):
         address = self.__chkEmailAddress(address)
         if not destination is None:
@@ -410,7 +426,7 @@
             if not section:
                 self.__Cfg.configure(self.__cfgSections)
             elif section not in self.__cfgSections:
-                raise VMMException((_(u"Invalid section: »%s«") % section,
+                raise VMMException((_(u"Invalid section: '%s'") % section,
                     ERR.INVALID_SECTION))
             else:
                 self.__Cfg.configure([section])
@@ -424,7 +440,7 @@
 
     def domain_transport(self, domainname, transport, force=None):
         if force is not None and force != 'force':
-            raise VMMDomainException((_(u'Invalid argument: »%s«') % force,
+            raise VMMDomainException((_(u"Invalid argument: '%s'") % force,
                 ERR.INVALID_OPTION))
         dom = self.__getDomain(domainname, None)
         if force is None:
@@ -434,7 +450,7 @@
 
     def domain_delete(self, domainname, force=None):
         if not force is None and force not in ['deluser','delalias','delall']:
-            raise VMMDomainException((_(u'Invalid argument: »%s«') % force,
+            raise VMMDomainException((_(u"Invalid argument: '%s'") % force,
                 ERR.INVALID_OPTION))
         dom = self.__getDomain(domainname)
         gid = dom.getID()
@@ -463,7 +479,7 @@
         elif detailed == 'detailed':
             return dominfo, dom.getAccounts(), dom.getAliases()
         else:
-            raise VMMDomainException(('%s: »%s«' % (_('Invalid argument'),
+            raise VMMDomainException(("%s: '%s'" % (_('Invalid argument'),
                 detailed),  ERR.INVALID_OPTION))
 
     def domain_list(self, pattern=None):
@@ -481,7 +497,7 @@
                 re.compile(RE_DOMAIN_SRCH)
                 if not re.match(RE_DOMAIN_SRCH, domain):
                     raise VMMException((
-                    _(u'The pattern »%s« contains invalid characters.') %
+                    _(u"The pattern '%s' contains invalid characters.") %
                     pattern, ERR.DOMAIN_INVALID))
             else:
                 pattern = self.__chkDomainname(pattern)
@@ -490,6 +506,9 @@
 
     def user_add(self, emailaddress, password):
         acc = self.__getAccount(emailaddress, password)
+        if password is None:
+            password = self._readpass()
+            acc.setPassword(self.__pwhash(password))
         acc.save(self.__Cfg.get('maildir', 'folder'),
                 self.__Cfg.getboolean('services', 'smtp'),
                 self.__Cfg.getboolean('services', 'pop3'),
@@ -531,6 +550,10 @@
 
     def user_password(self, emailaddress, password):
         acc = self.__getAccount(emailaddress)
+        if acc.getUID() == 0:
+           raise VMMException((_("Account doesn't exists"),ERR.NO_SUCH_ACCOUNT))
+        if password is None:
+            password = self._readpass()
         acc.modify('password', self.__pwhash(password))
 
     def user_name(self, emailaddress, name):
--- a/po/de.po	Wed Jun 11 00:05:22 2008 +0000
+++ b/po/de.po	Wed Jun 11 05:07:07 2008 +0000
@@ -5,8 +5,8 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: vmm 0.4\n"
-"POT-Creation-Date: 2008-05-25 04:58+CEST\n"
-"PO-Revision-Date: 2008-05-25 05:00+0200\n"
+"POT-Creation-Date: 2008-06-11 06:25+CEST\n"
+"PO-Revision-Date: 2008-06-11 06:30+0200\n"
 "Last-Translator: Pascal Volk <p.volk@veb-it.de>\n"
 "Language-Team: German\n"
 "MIME-Version: 1.0\n"
@@ -16,32 +16,33 @@
 "Plural-Forms: nplurals=2; plural=(n != 1);\n"
 
 #: VirtualMailManager/Account.py:45
-msgid "There is already an alias with address »%s«"
-msgstr "Es gibt bereits einen Alias mit der Adresse »%s«"
+msgid "There is already an alias with address '%s'"
+msgstr "Es gibt bereits einen Alias mit der Adresse '%s'"
 
 #: VirtualMailManager/Account.py:77 VirtualMailManager/Alias.py:74
-msgid "Domain »%s« doesn't exist."
-msgstr "Die Domain »%s« existiert nicht."
+msgid "Domain '%s' doesn't exist."
+msgstr "Die Domain '%s' existiert nicht."
 
 #: VirtualMailManager/Account.py:96
-msgid "Unknown service »%s«"
-msgstr "Unbekannter Service »%s«"
+msgid "Unknown service '%s'"
+msgstr "Unbekannter Service '%s'"
 
-#: VirtualMailManager/Account.py:99 VirtualMailManager/Account.py:153
-#: VirtualMailManager/Account.py:180 VirtualMailManager/Account.py:208
-#: VirtualMailManager/Account.py:227
+#: VirtualMailManager/Account.py:99 VirtualMailManager/Account.py:156
+#: VirtualMailManager/Account.py:183 VirtualMailManager/Account.py:211
+#: VirtualMailManager/Account.py:230
+#: VirtualMailManager/VirtualMailManager.py:554
 msgid "Account doesn't exists"
 msgstr "Der Account existiert nicht"
 
-#: VirtualMailManager/Account.py:148
+#: VirtualMailManager/Account.py:151
 msgid "Account already exists."
 msgstr "Der Account existiert bereits."
 
-#: VirtualMailManager/Account.py:216
+#: VirtualMailManager/Account.py:219
 msgid "uid must be an int/long."
 msgstr "Die UID muss eine Ganzzahl sein."
 
-#: VirtualMailManager/Account.py:219
+#: VirtualMailManager/Account.py:222
 msgid "uid must be greater than 0."
 msgstr "Die UID muss größer als 0 sein."
 
@@ -50,8 +51,8 @@
 msgstr "Alias- und Ziel-Adresse sind identisch."
 
 #: VirtualMailManager/Alias.py:44
-msgid "There is already an account with address »%s«"
-msgstr "Es gibt bereits einen Accounts mit der Adresse »%s«"
+msgid "There is already an account with address '%s'"
+msgstr "Es gibt bereits einen Accounts mit der Adresse '%s'"
 
 #: VirtualMailManager/Alias.py:80
 msgid "No destination address for alias denoted."
@@ -130,7 +131,7 @@
 msgid "Unknown tid specified."
 msgstr "Unbekannte tid angegeben."
 
-#: VirtualMailManager/VirtualMailManager.py:54
+#: VirtualMailManager/VirtualMailManager.py:55
 msgid ""
 "fix permissions for '%s'\n"
 "`chmod 0600 %s` would be great."
@@ -138,7 +139,7 @@
 "Bitte Zugriffsrechte für '%s' anpassen\n"
 "`chmod 0600 %s` wäre großartig"
 
-#: VirtualMailManager/VirtualMailManager.py:61
+#: VirtualMailManager/VirtualMailManager.py:62
 msgid ""
 "You are not root.\n"
 "\tGood bye!\n"
@@ -146,63 +147,79 @@
 "Sie sind nicht root\n"
 "\tAuf Wiedersehen\n"
 
-#: VirtualMailManager/VirtualMailManager.py:75
-msgid "The file »%s« does not exists."
-msgstr "Die Datei »%s« existiert nicht."
+#: VirtualMailManager/VirtualMailManager.py:76
+msgid "The file '%s' does not exists."
+msgstr "Die Datei '%s' existiert nicht."
 
-#: VirtualMailManager/VirtualMailManager.py:97
+#: VirtualMailManager/VirtualMailManager.py:98
 msgid "%s is not a directory"
 msgstr "%s ist kein Verzeichnis"
 
-#: VirtualMailManager/VirtualMailManager.py:101
+#: VirtualMailManager/VirtualMailManager.py:102
 msgid "%s doesn't exists."
 msgstr "%s existiert nicht."
 
-#: VirtualMailManager/VirtualMailManager.py:104
+#: VirtualMailManager/VirtualMailManager.py:105
 msgid "%s is not executable."
 msgstr "%s ist nicht ausführbar."
 
-#: VirtualMailManager/VirtualMailManager.py:138
+#: VirtualMailManager/VirtualMailManager.py:139
 msgid "The local part is too long"
 msgstr "Der local-part ist zu lang"
 
-#: VirtualMailManager/VirtualMailManager.py:142
-msgid "The local part »%s« contains invalid characters."
-msgstr "Der local-part »%s« enthält ungültige Zeichen."
+#: VirtualMailManager/VirtualMailManager.py:143
+msgid "The local part '%s' contains invalid characters."
+msgstr "Der local-part '%s' enthält ungültige Zeichen."
 
-#: VirtualMailManager/VirtualMailManager.py:182
+#: VirtualMailManager/VirtualMailManager.py:183
 msgid "The domain name is too long."
 msgstr "Der Domain-Name ist zu lang."
 
-#: VirtualMailManager/VirtualMailManager.py:186
+#: VirtualMailManager/VirtualMailManager.py:187
 msgid "The domain name is invalid."
 msgstr "Der Domain-Name ist ungültig."
 
-#: VirtualMailManager/VirtualMailManager.py:194
-msgid "Missing '@' sign in e-mail address »%s«."
-msgstr "In der E-Mail-Adresse »%s« fehlt das '@'-Zeichen."
+#: VirtualMailManager/VirtualMailManager.py:195
+msgid "Missing '@' sign in e-mail address '%s'."
+msgstr "In der E-Mail-Adresse '%s' fehlt das '@'-Zeichen."
+
+#: VirtualMailManager/VirtualMailManager.py:198
+msgid "'%s' looks not like an e-mail address."
+msgstr "'%s' sieht nicht wie eine E-Mail-Adresse aus."
+
+#: VirtualMailManager/VirtualMailManager.py:216
+msgid "Enter new password: "
+msgstr "Neues Passwort eingeben: "
 
-#: VirtualMailManager/VirtualMailManager.py:197
-msgid "»%s« looks not like an e-mail address."
-msgstr "»%s« sieht nicht wie eine E-Mail-Adresse aus."
+#: VirtualMailManager/VirtualMailManager.py:219
+msgid "Sorry, empty passwords are not permitted"
+msgstr "Entschuldigung, leere Passwörter sind nicht zulässig"
 
-#: VirtualMailManager/VirtualMailManager.py:292
+#: VirtualMailManager/VirtualMailManager.py:220
+msgid "Retype new password: "
+msgstr "Neues Passwort wiederholen: "
+
+#: VirtualMailManager/VirtualMailManager.py:223
+msgid "Sorry, passwords do not match"
+msgstr "Entschuldigung, die Passwörter stimmen nicht überein"
+
+#: VirtualMailManager/VirtualMailManager.py:308
 msgid "FATAL: \"..\" in maildir path detected."
 msgstr "FATAL: \"..\" im Pfad zum Maildir entdeckt."
 
-#: VirtualMailManager/VirtualMailManager.py:300
+#: VirtualMailManager/VirtualMailManager.py:316
 msgid "FATAL: owner/group mismatch in maildir detected"
 msgstr "FATAL: Maildir gehört dem/der falschen Benutzer/Gruppe."
 
-#: VirtualMailManager/VirtualMailManager.py:310
+#: VirtualMailManager/VirtualMailManager.py:326
 msgid "FATAL: \"..\" in domain directory path detected."
 msgstr "FATAL: \"..\" im Pfad zum Domain-Verzeichnis entdeckt."
 
-#: VirtualMailManager/VirtualMailManager.py:316
+#: VirtualMailManager/VirtualMailManager.py:332
 msgid "FATAL: group mismatch in domain directory detected"
 msgstr "FATAL: Domain-Verzeichnis gehört der falschen Gruppe"
 
-#: VirtualMailManager/VirtualMailManager.py:394
+#: VirtualMailManager/VirtualMailManager.py:410
 msgid ""
 "Configurtion error: \"%s\"\n"
 "(in section \"connfig\", option \"done\")'\n"
@@ -212,24 +229,24 @@
 "(im Abschnitt \"connfig\", Option \"done\")'\n"
 "Siehe auch: vmm.cfg(5)\n"
 
-#: VirtualMailManager/VirtualMailManager.py:413
-msgid "Invalid section: »%s«"
-msgstr "Ungültiger Abschnitt: »%s«"
+#: VirtualMailManager/VirtualMailManager.py:429
+msgid "Invalid section: '%s'"
+msgstr "Ungültiger Abschnitt: '%s'"
 
-#: VirtualMailManager/VirtualMailManager.py:427
-#: VirtualMailManager/VirtualMailManager.py:437
-msgid "Invalid argument: »%s«"
-msgstr "Ungültiges Argument: »%s«"
+#: VirtualMailManager/VirtualMailManager.py:443
+#: VirtualMailManager/VirtualMailManager.py:453
+msgid "Invalid argument: '%s'"
+msgstr "Ungültiges Argument: '%s'"
 
-#: VirtualMailManager/VirtualMailManager.py:466
+#: VirtualMailManager/VirtualMailManager.py:482
 msgid "Invalid argument"
 msgstr "Ungültiges Argument"
 
-#: VirtualMailManager/VirtualMailManager.py:484
-msgid "The pattern »%s« contains invalid characters."
-msgstr "Das Muster »%s« enthält ungültige Zeichen."
+#: VirtualMailManager/VirtualMailManager.py:500
+msgid "The pattern '%s' contains invalid characters."
+msgstr "Das Muster '%s' enthält ungültige Zeichen."
 
-#: vmm:34
+#: vmm:33
 msgid ""
 "Usage: %s SUBCOMMAND OBJECT ARGS*\n"
 "  short long\n"
@@ -241,111 +258,95 @@
 "  Unterbefehl           Objekt           args (* = optional)\n"
 "\n"
 
-#: vmm:62 vmm:71 vmm:321 vmm:371
+#: vmm:61 vmm:70 vmm:307 vmm:357
 msgid "Error"
 msgstr "Fehler"
 
-#: vmm:81 vmm:368
+#: vmm:80 vmm:354
 msgid "Ouch"
 msgstr "Autsch"
 
-#: vmm:93
-msgid "Enter new password: "
-msgstr "Neues Passwort eingeben: "
-
-#: vmm:96
-msgid "Sorry, empty passwords are not permitted"
-msgstr "Entschuldigung, leere Passwörter sind nicht zulässig"
-
-#: vmm:97
-msgid "Retype new password: "
-msgstr "Neues Passwort wiederholen: "
-
-#: vmm:100
-msgid "Sorry, passwords do not match"
-msgstr "Entschuldigung, die Passwörter stimmen nicht überein"
-
-#: vmm:122
+#: vmm:106
 msgid "information"
 msgstr "Informationen"
 
-#: vmm:132
+#: vmm:116
 msgid "Available"
 msgstr "Verfügbare"
 
-#: vmm:138 vmm:149 vmm:159
+#: vmm:122 vmm:133 vmm:143
 msgid "\tNone"
 msgstr "\tKeine"
 
-#: vmm:142
+#: vmm:126
 msgid "Alias information"
 msgstr "Alias Informationen"
 
-#: vmm:144
+#: vmm:128
 msgid "\tMail for %s goes to:"
 msgstr "\tE-Mails für %s gehen an:"
 
-#: vmm:154
+#: vmm:138
 msgid "Available domains"
 msgstr "Verfügbare Domains"
 
-#: vmm:156
+#: vmm:140
 msgid "Matching domains"
 msgstr "Übereinstimmende Domains"
 
-#: vmm:171 vmm:179 vmm:187
+#: vmm:155 vmm:163 vmm:171
 msgid "Missing domain name."
 msgstr "Kein Domain-Name angegeben."
 
-#: vmm:193
+#: vmm:177
 msgid "accounts"
 msgstr "Accounts"
 
-#: vmm:194
+#: vmm:178
 msgid "aliases"
 msgstr "Aliase"
 
-#: vmm:198
+#: vmm:182
 msgid "Missing domain name and new transport."
 msgstr "Domain-Name und neuer Transport fehlen."
 
-#: vmm:200
+#: vmm:184
 msgid "Missing new transport."
 msgstr "Neuer Transport fehlt."
 
-#: vmm:208 vmm:217 vmm:223 vmm:247 vmm:255 vmm:263
+#: vmm:192 vmm:202 vmm:208 vmm:232 vmm:240 vmm:248
 msgid "Missing e-mail address."
 msgstr "E-Mail-Adresse fehlt."
 
-#: vmm:231
+#: vmm:216
 msgid "Missing e-mail address and users name."
 msgstr "E-Mail-Adresse und der Name des Benutzers fehlen."
 
-#: vmm:233
+#: vmm:218
 msgid "Missing users name."
 msgstr "Name des Benutzers fehlt."
 
-#: vmm:239
+#: vmm:224
 msgid "Missing e-mail address and transport."
 msgstr "E-Mail-Adresse und Transport fehlen."
 
-#: vmm:241
+#: vmm:226
 msgid "Missing transport."
 msgstr "Transport fehlt."
 
-#: vmm:272
+#: vmm:258
 msgid "Missing alias address and destination."
 msgstr "Alias- und Ziel-Adresse fehlen."
 
-#: vmm:278 vmm:284
+#: vmm:264 vmm:270
 msgid "Missing alias address"
 msgstr "Alias-Adresse fehlt."
 
-#: vmm:292
+#: vmm:278
 msgid "Missing userid"
 msgstr "Keine UID angegeben."
 
-#: vmm:304
+#: vmm:290
 msgid ""
 "\n"
 "Warnings:"
@@ -353,6 +354,6 @@
 "\n"
 "Warnungen:"
 
-#: vmm:365
+#: vmm:351
 msgid "Unknown subcommand"
 msgstr "Unbekannter Unterbefehl"
--- a/po/vmm.pot	Wed Jun 11 00:05:22 2008 +0000
+++ b/po/vmm.pot	Wed Jun 11 05:07:07 2008 +0000
@@ -5,7 +5,7 @@
 msgid ""
 msgstr ""
 "Project-Id-Version: PACKAGE VERSION\n"
-"POT-Creation-Date: 2008-05-25 04:58+CEST\n"
+"POT-Creation-Date: 2008-06-11 06:25+CEST\n"
 "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
 "Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
 "Language-Team: LANGUAGE <LL@li.org>\n"
@@ -16,32 +16,33 @@
 
 
 #: VirtualMailManager/Account.py:45
-msgid "There is already an alias with address \302\273%s\302\253"
+msgid "There is already an alias with address '%s'"
 msgstr ""
 
 #: VirtualMailManager/Account.py:77 VirtualMailManager/Alias.py:74
-msgid "Domain \302\273%s\302\253 doesn't exist."
+msgid "Domain '%s' doesn't exist."
 msgstr ""
 
 #: VirtualMailManager/Account.py:96
-msgid "Unknown service \302\273%s\302\253"
+msgid "Unknown service '%s'"
 msgstr ""
 
-#: VirtualMailManager/Account.py:99 VirtualMailManager/Account.py:153
-#: VirtualMailManager/Account.py:180 VirtualMailManager/Account.py:208
-#: VirtualMailManager/Account.py:227
+#: VirtualMailManager/Account.py:99 VirtualMailManager/Account.py:156
+#: VirtualMailManager/Account.py:183 VirtualMailManager/Account.py:211
+#: VirtualMailManager/Account.py:230
+#: VirtualMailManager/VirtualMailManager.py:554
 msgid "Account doesn't exists"
 msgstr ""
 
-#: VirtualMailManager/Account.py:148
+#: VirtualMailManager/Account.py:151
 msgid "Account already exists."
 msgstr ""
 
-#: VirtualMailManager/Account.py:216
+#: VirtualMailManager/Account.py:219
 msgid "uid must be an int/long."
 msgstr ""
 
-#: VirtualMailManager/Account.py:219
+#: VirtualMailManager/Account.py:222
 msgid "uid must be greater than 0."
 msgstr ""
 
@@ -50,7 +51,7 @@
 msgstr ""
 
 #: VirtualMailManager/Alias.py:44
-msgid "There is already an account with address \302\273%s\302\253"
+msgid "There is already an account with address '%s'"
 msgstr ""
 
 #: VirtualMailManager/Alias.py:80
@@ -132,99 +133,115 @@
 msgid "Unknown tid specified."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:54
+#: VirtualMailManager/VirtualMailManager.py:55
 msgid ""
 "fix permissions for '%s'\n"
 "`chmod 0600 %s` would be great."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:61
+#: VirtualMailManager/VirtualMailManager.py:62
 msgid ""
 "You are not root.\n"
 "\tGood bye!\n"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:75
-msgid "The file \302\273%s\302\253 does not exists."
+#: VirtualMailManager/VirtualMailManager.py:76
+msgid "The file '%s' does not exists."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:97
+#: VirtualMailManager/VirtualMailManager.py:98
 msgid "%s is not a directory"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:101
+#: VirtualMailManager/VirtualMailManager.py:102
 msgid "%s doesn't exists."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:104
+#: VirtualMailManager/VirtualMailManager.py:105
 msgid "%s is not executable."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:138
+#: VirtualMailManager/VirtualMailManager.py:139
 msgid "The local part is too long"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:142
-msgid "The local part \302\273%s\302\253 contains invalid characters."
+#: VirtualMailManager/VirtualMailManager.py:143
+msgid "The local part '%s' contains invalid characters."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:182
+#: VirtualMailManager/VirtualMailManager.py:183
 msgid "The domain name is too long."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:186
+#: VirtualMailManager/VirtualMailManager.py:187
 msgid "The domain name is invalid."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:194
-msgid "Missing '@' sign in e-mail address \302\273%s\302\253."
+#: VirtualMailManager/VirtualMailManager.py:195
+msgid "Missing '@' sign in e-mail address '%s'."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:198
+msgid "'%s' looks not like an e-mail address."
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:216
+msgid "Enter new password: "
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:197
-msgid "\302\273%s\302\253 looks not like an e-mail address."
+#: VirtualMailManager/VirtualMailManager.py:219
+msgid "Sorry, empty passwords are not permitted"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:292
+#: VirtualMailManager/VirtualMailManager.py:220
+msgid "Retype new password: "
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:223
+msgid "Sorry, passwords do not match"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:308
 msgid "FATAL: \"..\" in maildir path detected."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:300
+#: VirtualMailManager/VirtualMailManager.py:316
 msgid "FATAL: owner/group mismatch in maildir detected"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:310
+#: VirtualMailManager/VirtualMailManager.py:326
 msgid "FATAL: \"..\" in domain directory path detected."
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:316
+#: VirtualMailManager/VirtualMailManager.py:332
 msgid "FATAL: group mismatch in domain directory detected"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:394
+#: VirtualMailManager/VirtualMailManager.py:410
 msgid ""
 "Configurtion error: \"%s\"\n"
 "(in section \"connfig\", option \"done\")'\n"
 "see also: vmm.cfg(5)\n"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:413
-msgid "Invalid section: \302\273%s\302\253"
+#: VirtualMailManager/VirtualMailManager.py:429
+msgid "Invalid section: '%s'"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:427
-#: VirtualMailManager/VirtualMailManager.py:437
-msgid "Invalid argument: \302\273%s\302\253"
+#: VirtualMailManager/VirtualMailManager.py:443
+#: VirtualMailManager/VirtualMailManager.py:453
+msgid "Invalid argument: '%s'"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:466
+#: VirtualMailManager/VirtualMailManager.py:482
 msgid "Invalid argument"
 msgstr ""
 
-#: VirtualMailManager/VirtualMailManager.py:484
-msgid "The pattern \302\273%s\302\253 contains invalid characters."
+#: VirtualMailManager/VirtualMailManager.py:500
+msgid "The pattern '%s' contains invalid characters."
 msgstr ""
 
-#: vmm:34
+#: vmm:33
 msgid ""
 "Usage: %s SUBCOMMAND OBJECT ARGS*\n"
 "  short long\n"
@@ -232,117 +249,101 @@
 "\n"
 msgstr ""
 
-#: vmm:62 vmm:71 vmm:321 vmm:371
+#: vmm:61 vmm:70 vmm:307 vmm:357
 msgid "Error"
 msgstr ""
 
-#: vmm:81 vmm:368
+#: vmm:80 vmm:354
 msgid "Ouch"
 msgstr ""
 
-#: vmm:93
-msgid "Enter new password: "
-msgstr ""
-
-#: vmm:96
-msgid "Sorry, empty passwords are not permitted"
-msgstr ""
-
-#: vmm:97
-msgid "Retype new password: "
-msgstr ""
-
-#: vmm:100
-msgid "Sorry, passwords do not match"
-msgstr ""
-
-#: vmm:122
+#: vmm:106
 msgid "information"
 msgstr ""
 
-#: vmm:132
+#: vmm:116
 msgid "Available"
 msgstr ""
 
-#: vmm:138 vmm:149 vmm:159
+#: vmm:122 vmm:133 vmm:143
 msgid "\tNone"
 msgstr ""
 
-#: vmm:142
+#: vmm:126
 msgid "Alias information"
 msgstr ""
 
-#: vmm:144
+#: vmm:128
 msgid "\tMail for %s goes to:"
 msgstr ""
 
-#: vmm:154
+#: vmm:138
 msgid "Available domains"
 msgstr ""
 
-#: vmm:156
+#: vmm:140
 msgid "Matching domains"
 msgstr ""
 
-#: vmm:171 vmm:179 vmm:187
+#: vmm:155 vmm:163 vmm:171
 msgid "Missing domain name."
 msgstr ""
 
-#: vmm:193
+#: vmm:177
 msgid "accounts"
 msgstr ""
 
-#: vmm:194
+#: vmm:178
 msgid "aliases"
 msgstr ""
 
-#: vmm:198
+#: vmm:182
 msgid "Missing domain name and new transport."
 msgstr ""
 
-#: vmm:200
+#: vmm:184
 msgid "Missing new transport."
 msgstr ""
 
-#: vmm:208 vmm:217 vmm:223 vmm:247 vmm:255 vmm:263
+#: vmm:192 vmm:202 vmm:208 vmm:232 vmm:240 vmm:248
 msgid "Missing e-mail address."
 msgstr ""
 
-#: vmm:231
+#: vmm:216
 msgid "Missing e-mail address and users name."
 msgstr ""
 
-#: vmm:233
+#: vmm:218
 msgid "Missing users name."
 msgstr ""
 
-#: vmm:239
+#: vmm:224
 msgid "Missing e-mail address and transport."
 msgstr ""
 
-#: vmm:241
+#: vmm:226
 msgid "Missing transport."
 msgstr ""
 
-#: vmm:272
+#: vmm:258
 msgid "Missing alias address and destination."
 msgstr ""
 
-#: vmm:278 vmm:284
+#: vmm:264 vmm:270
 msgid "Missing alias address"
 msgstr ""
 
-#: vmm:292
+#: vmm:278
 msgid "Missing userid"
 msgstr ""
 
-#: vmm:304
+#: vmm:290
 msgid ""
 "\n"
 "Warnings:"
 msgstr ""
 
-#: vmm:365
+#: vmm:351
 msgid "Unknown subcommand"
 msgstr ""
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/upgrade.sh	Wed Jun 11 05:07:07 2008 +0000
@@ -0,0 +1,68 @@
+#!/bin/sh
+# $Id$
+#
+# Upgrade script for the Virtual Mail Manager
+# run: ./install.sh
+
+LANG=C
+PATH=/bin:/usr/sbin:/usr/bin:/usr/local/sbin:/usr/local/bin
+PREFIX=/usr/local
+PF_CONFDIR=$(postconf -h config_directory)
+PF_GID=$(id -g $(postconf -h mail_owner))
+LOCALE_DIR=${PREFIX}/share/locale
+DOC_DIR=${PREFIX}/share/doc/vmm
+MANDIR=${PREFIX}/share/man
+DOCS="ChangeLog COPYING INSTALL README"
+
+INSTALL_OPTS="-g 0 -o 0 -p"
+INSTALL_OPTS_CF="-b -m 0640 -g ${PF_GID} -o 0 -p"
+
+if [ $(id -u) -ne 0 ]; then
+    echo "Run this script as root."
+    exit 1
+fi
+
+python setup.py install --prefix ${PREFIX}
+python setup.py clean --all >/dev/null
+
+install -m 0700 ${INSTALL_OPTS} vmm ${PREFIX}/sbin
+
+[ -d ${LOCALE_DIR} ] || mkdir -m 0755 -p ${LOCALE_DIR}
+cd po
+for po in $(ls -1 *.po); do
+    lang=$(basename ${po} .po)
+    ddir=${LOCALE_DIR}/${lang}/LC_MESSAGES
+    [ -d ${ddir}  ] || mkdir -m 0755 -p ${ddir}
+    msgfmt -o ${LOCALE_DIR}/${lang}/LC_MESSAGES/vmm.mo ${po}
+done
+cd - >/dev/null
+
+cd man
+[ -d ${MANDIR}/man1 ] || mkdir -m 0755 -p ${MANDIR}/man1
+install -m 0644 ${INSTALL_OPTS} man1/vmm.1 ${MANDIR}/man1
+
+[ -d ${MANDIR}/man5 ] || mkdir -m 0755 -p ${MANDIR}/man5
+install -m 0644 ${INSTALL_OPTS} man5/vmm.cfg.5 ${MANDIR}/man5
+
+for l in $(find . -maxdepth 1 -mindepth 1 -type d \! -name man\? \! -name .svn)
+do
+    for s in man1 man5; do
+        [ -d ${MANDIR}/${l}/${s} ] || mkdir -m 0755 -p ${MANDIR}/${l}/${s}
+    done
+    if [ -f ${l}/man1/vmm.1 ]; then
+        install -m 0644 ${INSTALL_OPTS} ${l}/man1/vmm.1 ${MANDIR}/${l}/man1
+    fi
+    if [ -f ${l}/man5/vmm.cfg.5 ]; then
+        install -m 0644 ${INSTALL_OPTS} ${l}/man5/vmm.cfg.5 ${MANDIR}/${l}/man5
+    fi
+done
+cd - >/dev/null
+
+[ -d ${DOC_DIR} ] || mkdir -m 0755 -p ${DOC_DIR}
+for DOC in ${DOCS}; do
+    install -m 0644 ${INSTALL_OPTS} ${DOC} ${DOC_DIR}
+done
+
+[ -d ${DOC_DIR}/examples ] || mkdir -m 0755 -p ${DOC_DIR}/examples
+install -m 0644 ${INSTALL_OPTS} pgsql-*.cf ${DOC_DIR}/examples
+install -m 0644 ${INSTALL_OPTS} vmm.cfg ${DOC_DIR}/examples
--- a/vmm	Wed Jun 11 00:05:22 2008 +0000
+++ b/vmm	Wed Jun 11 05:07:07 2008 +0000
@@ -16,7 +16,6 @@
 import os
 import sys
 import gettext
-from getpass import getpass
 
 from VirtualMailManager.VirtualMailManager import VirtualMailManager
 from VirtualMailManager.Config import VMMConfig
@@ -85,21 +84,6 @@
         sys.exit(ERR.CONF_ERROR)
     sys.exit(0)
 
-def _readpass():
-    clear0 = ''
-    clear1 = '1'
-    while clear0 != clear1:
-        while len(clear0) < 1:
-            clear0 = getpass(prompt=_('Enter new password: '))
-            if len(clear0) < 1:
-                sys.stderr.write('%s\n'
-                        % _('Sorry, empty passwords are not permitted'))
-        clear1 = getpass(prompt=_('Retype new password: '))
-        if clear0 != clear1:
-            clear0 = ''
-            sys.stderr.write('%s\n' % _('Sorry, passwords do not match'))
-    return clear0
-
 def _getOrder():
     order = ()
     if sys.argv[1] in ['di', 'domaininfo']:
@@ -207,7 +191,7 @@
     if argc < 3:
         usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
     elif argc < 4:
-        password = _readpass()
+        password = None
     else:
         password = sys.argv[3]
     vmm.user_add(sys.argv[2].lower(), password)
@@ -262,7 +246,7 @@
     if argc < 3:
         usage(EXIT.MISSING_ARGS, _('Missing e-mail address.'))
     elif argc < 4:
-        password = _readpass()
+        password = None
     else:
         password = sys.argv[3]
     vmm.user_password(sys.argv[2].lower(), password)
@@ -362,7 +346,7 @@
                     __revision__, __date__)
         else:
             usage(EXIT.UNKNOWN_COMMAND,
-                    '%s: »%s«' % (_('Unknown subcommand'), sys.argv[1]))
+                    "%s: '%s'" % (_('Unknown subcommand'), sys.argv[1]))
         showWarnings()
     except (EOFError, KeyboardInterrupt):
         sys.stderr.write('\n%s!\n' % _('Ouch'))