* 'VirtualMailManager/DomainAlias.py'
- Implemented:
+ DomainAlias.__init__()
+ DomainAlias._exists()
+ DomainAlias.save()
+ DomainAlias.info()
+ DomainAlias.delete()
* 'VirtualMailManager/VirtualMailManager.py'
- Updated the following methods to use the DomainAlias class:
+ VirtualMailManager.domain_alias_add()
+ VirtualMailManager.domain_alias_delete()
- Implemented VirtualMailManager.domain_alias_info()
* 'VirtualMailManager/Domain.py'
- Deleted methods:
+ Domain._aliasExists()
+ Domain.saveAlias()
- Deleted module function deleteAlias()
* 'vmm'
- Replaced some print statements with w_std() function calls
This eliminates the ugly UnicodeEncodeErrors if the preferred encoding is
'outdated' (encodings like 'ascii' ;-) )
* 'po/de.po'
* 'po/vmm.pot'
- updated
--- a/VirtualMailManager/Config.py Thu Aug 21 01:23:31 2008 +0000
+++ b/VirtualMailManager/Config.py Fri Aug 22 03:07:53 2008 +0000
@@ -116,7 +116,7 @@
sections -- list of strings
"""
if not isinstance(sections, list):
- raise TypeError(_(u"Argument 'sections' is not a list."))
+ raise TypeError("Argument 'sections' is not a list.")
# if [config] done = false (default at 1st run),
# then set changes true
try:
--- a/VirtualMailManager/Domain.py Thu Aug 21 01:23:31 2008 +0000
+++ b/VirtualMailManager/Domain.py Fri Aug 22 03:07:53 2008 +0000
@@ -62,22 +62,6 @@
else:
return False
- def _aliasExists(self, aliasname):
- aliasname = VMM.VirtualMailManager.chkDomainname(aliasname)
- dbc = self._dbh.cursor()
- dbc.execute("SELECT gid, is_primary FROM domain_name\
- WHERE domainname = %s", aliasname)
- result = dbc.fetchone()
- dbc.close()
- if result is None:
- return False
- elif result[1]:
- raise VMMDE(_(u'The domain »%s« already exists.') % self._name,
- ERR.DOMAIN_EXISTS)
- else:
- raise VMMDE(_(u'The domain alias »%s« already exists.') % aliasname,
- ERR.DOMAIN_ALIAS_EXISTS)
-
def _setID(self):
"""Sets the ID of the domain."""
dbc = self._dbh.cursor()
@@ -195,24 +179,6 @@
raise VMMDE(_(u"The domain »%s« doesn't exist yet.") % self._name,
ERR.NO_SUCH_DOMAIN)
- def saveAlias(self, aliasname):
- """Stores the alias name for the domain in the database.
-
- Keyword arguments:
- aliasname -- the alias name of the domain (str)
- """
- aliasname = VMM.VirtualMailManager.chkDomainname(aliasname)
- if self._id > 0 and not self._aliasExists(aliasname):
- dbc = self._dbh.cursor()
- dbc.execute('INSERT INTO domain_name VALUES (%s, %s, %s)',
- aliasname, self._id, False)
- if dbc.rowcount == 1:
- self._dbh.commit()
- dbc.close()
- else:
- raise VMMDE(_(u"The domain »%s« doesn't exist yet.") % self._name,
- ERR.NO_SUCH_DOMAIN)
-
def getID(self):
"""Returns the ID of the domain."""
return self._id
@@ -319,11 +285,3 @@
del doms
return order, domdict
-def deleteAlias(dbh, aliasname):
- aliasname = VMM.VirtualMailManager.chkDomainname(aliasname)
- dbc = dbh.cursor()
- dbc.execute('DELETE FROM domain_name WHERE domainname = %s', aliasname)
- if dbc.rowcount > 0:
- dbh.commit()
- dbc.close()
-
--- a/VirtualMailManager/DomainAlias.py Thu Aug 21 01:23:31 2008 +0000
+++ b/VirtualMailManager/DomainAlias.py Fri Aug 22 03:07:53 2008 +0000
@@ -15,20 +15,74 @@
from Exceptions import VMMDomainAliasException as VDAE
import constants.ERROR as ERR
+import VirtualMailManager as VMM
class DomainAlias:
"""Class to manage e-mail alias domains."""
- def __init__(self, dbh, domainname, targetDomain):
+ def __init__(self, dbh, domainname, targetDomain=None):
self._dbh = dbh
+ self.__name = VMM.VirtualMailManager.chkDomainname(domainname)
+ self.__gid = 0
+ self._domain = targetDomain
+ self._exists()
def _exists(self):
- pass
+ dbc = self._dbh.cursor()
+ dbc.execute('SELECT gid, is_primary FROM domain_name WHERE domainname\
+ = %s', self.__name)
+ alias = dbc.fetchone()
+ dbc.close()
+ if alias is not None:
+ self.__gid, primary = alias
+ if primary:
+ raise VDAE(_(u"The domain »%s« is a primary domain.") %
+ self.__name, ERR.DOMAIN_ALIAS_ISDOMAIN)
def save(self):
- pass
+ if self.__gid > 0:
+ raise VDAE(_(u'The domain alias »%s« already exists.') %self.__name,
+ ERR.DOMAIN_ALIAS_EXISTS)
+ if self._domain is None:
+ raise VDAE(_(u'No destination domain for alias domain denoted.'),
+ ERR.DOMAIN_ALIAS_NO_DOMDEST)
+ if self._domain._id < 1:
+ raise VDAE (_(u"The target domain »%s« doesn't exist yet.") %
+ self._domain._name, ERR.NO_SUCH_DOMAIN)
+ dbc = self._dbh.cursor()
+ dbc.execute('INSERT INTO domain_name (domainname, gid, is_primary)\
+ VALUES (%s, %s, FALSE)', self.__name, self._domain._id)
+ self._dbh.commit()
+ dbc.close()
+
def info(self):
- pass
+ if self.__gid > 0:
+ dbc = self._dbh.cursor()
+ dbc.execute('SELECT domainname FROM domain_name WHERE gid = %s\
+ AND is_primary', self.__gid)
+ domain = dbc.fetchone()
+ dbc.close()
+ if domain is not None:
+ return _(u"The domain alias »%(alias)s« belongs to »%(dom)s«.")\
+ % {'alias': self.__name, 'dom': domain[0]}
+ else:# an almost unlikely case, isn't it?
+ raise VDAE(
+ _(u'There is no primary domain for the domain alias »%s«.')\
+ % self.__name, ERR.NO_SUCH_DOMAIN)
+ else:
+ raise VDAE(
+ _(u"The domain alias »%s« doesn't exist yet.") % self.__name,
+ ERR.NO_SUCH_DOMAIN_ALIAS)
def delete(self):
- pass
+ if self.__gid > 0:
+ dbc = self._dbh.cursor()
+ dbc.execute('DELETE FROM domain_name WHERE domainname = %s \
+ AND NOT is_primary', self.__name)
+ if dbc.rowcount > 0:
+ self._dbh.commit()
+ else:
+ raise VDAE(
+ _(u"The domain alias »%s« doesn't exist yet.") % self.__name,
+ ERR.NO_SUCH_DOMAIN_ALIAS)
+
--- a/VirtualMailManager/VirtualMailManager.py Thu Aug 21 01:23:31 2008 +0000
+++ b/VirtualMailManager/VirtualMailManager.py Fri Aug 22 03:07:53 2008 +0000
@@ -29,6 +29,7 @@
from Account import Account
from Alias import Alias
from Domain import Domain
+from DomainAlias import DomainAlias
SALTCHARS = './0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
RE_ASCII_CHARS = """^[\x20-\x7E]*$"""
@@ -497,23 +498,29 @@
def domain_alias_add(self, aliasname, domainname):
"""Adds an alias name to the domain.
-
+
Keyword arguments:
aliasname -- the alias name of the domain (str)
domainname -- name of the target domain (str)
"""
dom = self.__getDomain(domainname)
- dom.saveAlias(aliasname)
+ domAlias = DomainAlias(self.__dbh, aliasname, dom)
+ domAlias.save()
+
+ def domain_alias_info(self, aliasname):
+ self.__dbConnect()
+ domAlias = DomainAlias(self.__dbh, aliasname, None)
+ return domAlias.info()
def domain_alias_delete(self, aliasname):
"""Deletes the specified alias name.
-
+
Keyword arguments:
aliasname -- the alias name of the domain (str)
"""
- from Domain import deleteAlias
self.__dbConnect()
- deleteAlias(self.__dbh, aliasname)
+ domAlias = DomainAlias(self.__dbh, aliasname, None)
+ domAlias.delete()
def domain_list(self, pattern=None):
from Domain import search
--- a/VirtualMailManager/constants/ERROR.py Thu Aug 21 01:23:31 2008 +0000
+++ b/VirtualMailManager/constants/ERROR.py Fri Aug 22 03:07:53 2008 +0000
@@ -18,27 +18,30 @@
DATABASE_ERROR = 31
DOMAINDIR_GROUP_MISMATCH = 32
DOMAIN_ALIAS_EXISTS = 33
-DOMAIN_EXISTS = 34
-DOMAIN_INVALID = 35
-DOMAIN_NO_NAME = 36
-DOMAIN_TOO_LONG = 37
-FOUND_DOTS_IN_PATH = 38
-INVALID_ADDRESS = 39
-INVALID_AGUMENT = 40
-INVALID_OPTION = 41
-INVALID_SECTION = 42
-LOCALPART_INVALID = 43
-LOCALPART_TOO_LONG = 44
-MAILDIR_PERM_MISMATCH = 45
-MAILLOCATION_INIT = 46
-NOT_EXECUTABLE = 47
-NO_SUCH_ACCOUNT = 48
-NO_SUCH_ALIAS = 49
-NO_SUCH_BINARY = 50
-NO_SUCH_DIRECTORY = 51
-NO_SUCH_DOMAIN = 52
-NO_SUCH_DOMAIN_ALIAS = 53
-TRANSPORT_INIT = 54
-UNKNOWN_MAILLOCATION_ID = 55
-UNKNOWN_SERVICE = 56
-UNKNOWN_TRANSPORT_ID = 57
+DOMAIN_ALIAS_INIT = 34
+DOMAIN_ALIAS_ISDOMAIN = 35
+DOMAIN_ALIAS_NO_DOMDEST = 36
+DOMAIN_EXISTS = 37
+DOMAIN_INVALID = 38
+DOMAIN_NO_NAME = 39
+DOMAIN_TOO_LONG = 40
+FOUND_DOTS_IN_PATH = 41
+INVALID_ADDRESS = 42
+INVALID_AGUMENT = 43
+INVALID_OPTION = 44
+INVALID_SECTION = 45
+LOCALPART_INVALID = 46
+LOCALPART_TOO_LONG = 47
+MAILDIR_PERM_MISMATCH = 48
+MAILLOCATION_INIT = 49
+NOT_EXECUTABLE = 50
+NO_SUCH_ACCOUNT = 51
+NO_SUCH_ALIAS = 52
+NO_SUCH_BINARY = 53
+NO_SUCH_DIRECTORY = 54
+NO_SUCH_DOMAIN = 55
+NO_SUCH_DOMAIN_ALIAS = 56
+TRANSPORT_INIT = 57
+UNKNOWN_MAILLOCATION_ID = 58
+UNKNOWN_SERVICE = 59
+UNKNOWN_TRANSPORT_ID = 60
--- a/po/de.po Thu Aug 21 01:23:31 2008 +0000
+++ b/po/de.po Fri Aug 22 03:07:53 2008 +0000
@@ -6,8 +6,8 @@
msgstr ""
"Project-Id-Version: vmm 0.5\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-21 03:05+0200\n"
-"PO-Revision-Date: 2008-08-21 03:12+0200\n"
+"POT-Creation-Date: 2008-08-22 03:32+0200\n"
+"PO-Revision-Date: 2008-08-22 03:33+0200\n"
"Last-Translator: Pascal Volk <p.volk@veb-it.de>\n"
"Language-Team: German\n"
"MIME-Version: 1.0\n"
@@ -71,9 +71,8 @@
msgid "There is already an account with address »%s«."
msgstr "Es gibt bereits einen Account mit der Adresse »%s«."
-#: VirtualMailManager/Alias.py:72 VirtualMailManager/Domain.py:171
-#: VirtualMailManager/Domain.py:195 VirtualMailManager/Domain.py:213
-#: VirtualMailManager/Domain.py:243
+#: VirtualMailManager/Alias.py:72 VirtualMailManager/Domain.py:155
+#: VirtualMailManager/Domain.py:179 VirtualMailManager/Domain.py:209
#, python-format
msgid "The domain »%s« doesn't exist yet."
msgstr "Die Domain »%s« existiert noch nicht."
@@ -102,10 +101,6 @@
msgid "missing options in section %s:\n"
msgstr "Fehlende Optionen im Abschnitt %s:\n"
-#: VirtualMailManager/Config.py:119
-msgid "Argument 'sections' is not a list."
-msgstr "Argument 'section' ist nicht vom Typ List."
-
#: VirtualMailManager/Config.py:130
#, python-format
msgid "* Config section: »%s«"
@@ -116,27 +111,56 @@
msgid "Enter new value for option %(opt)s [%(val)s]: "
msgstr "Neuer Wert für Option %(opt)s [%(val)s]: "
-#: VirtualMailManager/Domain.py:75 VirtualMailManager/Domain.py:153
+#: VirtualMailManager/Domain.py:116
+msgid "There are accounts and aliases."
+msgstr "Es sind noch Accounts und Aliase vorhanden."
+
+#: VirtualMailManager/Domain.py:119
+msgid "There are accounts."
+msgstr "Es sind noch Accounts vorhanden."
+
+#: VirtualMailManager/Domain.py:122
+msgid "There are aliases."
+msgstr "Es sind noch Aliase vorhanden."
+
+#: VirtualMailManager/Domain.py:137
#, python-format
msgid "The domain »%s« already exists."
msgstr "Die Domain »%s« existiert bereits."
-#: VirtualMailManager/Domain.py:78
+#: VirtualMailManager/DomainAlias.py:38
+#, python-format
+msgid "The domain »%s« is a primary domain."
+msgstr "Die Domain »%s« ist eine primäre Domain."
+
+#: VirtualMailManager/DomainAlias.py:43
#, python-format
msgid "The domain alias »%s« already exists."
msgstr "Der Domain-Alias »%s« existiert bereits."
-#: VirtualMailManager/Domain.py:132
-msgid "There are accounts and aliases."
-msgstr "Es sind noch Accounts und Aliase vorhanden."
+#: VirtualMailManager/DomainAlias.py:46
+msgid "No destination domain for alias domain denoted."
+msgstr "Keine Ziel-Domain für die Alias-Domain angegeben."
+
+#: VirtualMailManager/DomainAlias.py:49
+#, python-format
+msgid "The target domain »%s« doesn't exist yet."
+msgstr "Die Ziel-Domain »%s« existiert noch nicht."
-#: VirtualMailManager/Domain.py:135
-msgid "There are accounts."
-msgstr "Es sind noch Accounts vorhanden."
+#: VirtualMailManager/DomainAlias.py:66
+#, python-format
+msgid "The domain alias »%(alias)s« belongs to »%(dom)s«."
+msgstr "Der Domain-Alias »%(alias)s« gehört zu »%(dom)s«."
-#: VirtualMailManager/Domain.py:138
-msgid "There are aliases."
-msgstr "Es sind noch Aliase vorhanden."
+#: VirtualMailManager/DomainAlias.py:70
+#, python-format
+msgid "There is no primary domain for the domain alias »%s«."
+msgstr "Es gibt keine primäre Domain für den Domain-Alias »%s«."
+
+#: VirtualMailManager/DomainAlias.py:74 VirtualMailManager/DomainAlias.py:86
+#, python-format
+msgid "The domain alias »%s« doesn't exist yet."
+msgstr "Der Domain-Alias »%s« existiert noch nicht."
#: VirtualMailManager/MailLocation.py:34
msgid "Either mid or maillocation must be specified."
@@ -162,7 +186,7 @@
msgid "Unknown tid specified."
msgstr "Unbekannte tid angegeben."
-#: VirtualMailManager/VirtualMailManager.py:47
+#: VirtualMailManager/VirtualMailManager.py:48
#, python-format
msgid ""
"fix permissions for »%(cfgFileName)s«\n"
@@ -171,7 +195,7 @@
"Bitte Zugriffsrechte für »%(cfgFileName)s« anpassen\n"
"`chmod 0600 %(cfgFileName)s` wäre großartig."
-#: VirtualMailManager/VirtualMailManager.py:55
+#: VirtualMailManager/VirtualMailManager.py:56
msgid ""
"You are not root.\n"
"\tGood bye!\n"
@@ -179,12 +203,12 @@
"Sie sind nicht root.\n"
"\tAuf Wiedersehen.\n"
-#: VirtualMailManager/VirtualMailManager.py:69
+#: VirtualMailManager/VirtualMailManager.py:70
#, python-format
msgid "The file »%s« does not exists."
msgstr "Die Datei »%s« existiert nicht."
-#: VirtualMailManager/VirtualMailManager.py:88
+#: VirtualMailManager/VirtualMailManager.py:89
#, python-format
msgid ""
"»%s« is not a directory.\n"
@@ -193,7 +217,7 @@
"»%s« ist kein Verzeichnis.\n"
"(vmm.cfg: Abschnitt \"domdir\", Option \"base\")"
-#: VirtualMailManager/VirtualMailManager.py:93
+#: VirtualMailManager/VirtualMailManager.py:94
#, python-format
msgid ""
"»%(binary)s« doesn't exists.\n"
@@ -202,7 +226,7 @@
"»%(binary)s« existiert nicht.\n"
"(vmm.cfg: Abschnitt \"bin\", Option \"%(option)s\")"
-#: VirtualMailManager/VirtualMailManager.py:97
+#: VirtualMailManager/VirtualMailManager.py:98
#, python-format
msgid ""
"»%(binary)s« is not executable.\n"
@@ -211,82 +235,82 @@
"»%(binary)s« ist nicht ausführbar.\n"
"(vmm.cfg: Abschnitt \"bin\", Option \"%(option)s\")"
-#: VirtualMailManager/VirtualMailManager.py:123
+#: VirtualMailManager/VirtualMailManager.py:124
msgid "No localpart specified."
msgstr "Kein local-part angegeben."
-#: VirtualMailManager/VirtualMailManager.py:126
+#: VirtualMailManager/VirtualMailManager.py:127
#, python-format
msgid "The local part »%s« is too long"
msgstr "Der local-part »%s« ist zu lang"
-#: VirtualMailManager/VirtualMailManager.py:133
+#: VirtualMailManager/VirtualMailManager.py:134
#, python-format
msgid "The local part »%(lpart)s« contains invalid characters: %(ichrs)s"
msgstr "Der local-part »%(lpart)s« enthält ungültige Zeichen: %(ichrs)s"
-#: VirtualMailManager/VirtualMailManager.py:177
+#: VirtualMailManager/VirtualMailManager.py:178
msgid "The domain name is too long."
msgstr "Der Domain-Name ist zu lang."
-#: VirtualMailManager/VirtualMailManager.py:181
+#: VirtualMailManager/VirtualMailManager.py:182
msgid "The domain name is invalid."
msgstr "Der Domain-Name ist ungültig."
-#: VirtualMailManager/VirtualMailManager.py:190
+#: VirtualMailManager/VirtualMailManager.py:191
#, python-format
msgid "Missing '@' sign in e-mail address »%s«."
msgstr "In der E-Mail-Adresse »%s« fehlt das '@'-Zeichen."
-#: VirtualMailManager/VirtualMailManager.py:193
+#: VirtualMailManager/VirtualMailManager.py:194
#, python-format
msgid "»%s« looks not like an e-mail address."
msgstr "»%s« sieht nicht wie eine E-Mail-Adresse aus."
-#: VirtualMailManager/VirtualMailManager.py:198
+#: VirtualMailManager/VirtualMailManager.py:199
#, python-format
msgid "Missing domain name after »%s@«."
msgstr "Der Domain-Name nach »%s@« fehlt."
-#: VirtualMailManager/VirtualMailManager.py:215
+#: VirtualMailManager/VirtualMailManager.py:216
msgid "Enter new password: "
msgstr "Neues Passwort eingeben: "
-#: VirtualMailManager/VirtualMailManager.py:218
+#: VirtualMailManager/VirtualMailManager.py:219
msgid "Sorry, empty passwords are not permitted"
msgstr "Entschuldigung, leere Passwörter sind nicht zulässig"
-#: VirtualMailManager/VirtualMailManager.py:219
+#: VirtualMailManager/VirtualMailManager.py:220
msgid "Retype new password: "
msgstr "Neues Passwort wiederholen: "
-#: VirtualMailManager/VirtualMailManager.py:222
+#: VirtualMailManager/VirtualMailManager.py:223
msgid "Sorry, passwords do not match"
msgstr "Entschuldigung, die Passwörter stimmen nicht überein"
-#: VirtualMailManager/VirtualMailManager.py:251
-#: VirtualMailManager/VirtualMailManager.py:321
+#: VirtualMailManager/VirtualMailManager.py:252
+#: VirtualMailManager/VirtualMailManager.py:322
#, python-format
msgid "No such directory: %s"
msgstr "Verzeichnis nicht gefunden: %s"
-#: VirtualMailManager/VirtualMailManager.py:309
+#: VirtualMailManager/VirtualMailManager.py:310
msgid "Found \"..\" in home directory path."
msgstr "\"..\" im Pfad zum Benutzerverzeichnis entdeckt."
-#: VirtualMailManager/VirtualMailManager.py:317
+#: VirtualMailManager/VirtualMailManager.py:318
msgid "Owner/group mismatch in home directory detected."
msgstr "Benutzerverzeichnis gehört dem/der falschen Benutzer/Gruppe."
-#: VirtualMailManager/VirtualMailManager.py:332
+#: VirtualMailManager/VirtualMailManager.py:333
msgid "FATAL: \"..\" in domain directory path detected."
msgstr "FATAL: \"..\" im Pfad zum Domain-Verzeichnis entdeckt."
-#: VirtualMailManager/VirtualMailManager.py:338
+#: VirtualMailManager/VirtualMailManager.py:339
msgid "FATAL: group mismatch in domain directory detected"
msgstr "FATAL: Domain-Verzeichnis gehört der falschen Gruppe"
-#: VirtualMailManager/VirtualMailManager.py:425
+#: VirtualMailManager/VirtualMailManager.py:426
#, python-format
msgid ""
"Configurtion error: \"%s\"\n"
@@ -295,28 +319,28 @@
"Konfigurations Fehler: \"%s\"\n"
"(im Abschnitt \"connfig\", Option \"done\") Siehe auch: vmm.cfg(5)\n"
-#: VirtualMailManager/VirtualMailManager.py:445
+#: VirtualMailManager/VirtualMailManager.py:446
#, python-format
msgid "Invalid section: '%s'"
msgstr "Ungültiger Abschnitt: '%s'"
-#: VirtualMailManager/VirtualMailManager.py:455
+#: VirtualMailManager/VirtualMailManager.py:456
#, python-format
msgid "Invalid argument: '%s'"
msgstr "Ungültiges Argument: '%s'"
-#: VirtualMailManager/VirtualMailManager.py:465
-#: VirtualMailManager/VirtualMailManager.py:495
+#: VirtualMailManager/VirtualMailManager.py:466
+#: VirtualMailManager/VirtualMailManager.py:496
#, python-format
msgid "Invalid argument: »%s«"
msgstr "Ungültiges Argument: »%s«"
-#: VirtualMailManager/VirtualMailManager.py:533
+#: VirtualMailManager/VirtualMailManager.py:540
#, python-format
msgid "The pattern »%s« contains invalid characters."
msgstr "Das Muster »%s« enthält ungültige Zeichen."
-#: VirtualMailManager/VirtualMailManager.py:565
+#: VirtualMailManager/VirtualMailManager.py:572
#, python-format
msgid ""
"The account has been successfully deleted from the database.\n"
@@ -329,7 +353,7 @@
" »%(directory)s«\n"
" Grund: %(raeson)s"
-#: VirtualMailManager/VirtualMailManager.py:597
+#: VirtualMailManager/VirtualMailManager.py:604
msgid "Account doesn't exists"
msgstr "Der Account existiert nicht"
@@ -413,7 +437,7 @@
msgid "Missing target domain name."
msgstr "Keine Ziel-Domain angegeben."
-#: vmm:226 vmm:232
+#: vmm:225 vmm:232
msgid "Missing alias domain name."
msgstr "Keine Alias-Domain angegeben."
--- a/po/vmm.pot Thu Aug 21 01:23:31 2008 +0000
+++ b/po/vmm.pot Fri Aug 22 03:07:53 2008 +0000
@@ -8,7 +8,7 @@
msgstr ""
"Project-Id-Version: vmm 0.5\n"
"Report-Msgid-Bugs-To: \n"
-"POT-Creation-Date: 2008-08-21 03:05+0200\n"
+"POT-Creation-Date: 2008-08-22 03:32+0200\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"
@@ -72,9 +72,8 @@
msgid "There is already an account with address »%s«."
msgstr ""
-#: VirtualMailManager/Alias.py:72 VirtualMailManager/Domain.py:171
-#: VirtualMailManager/Domain.py:195 VirtualMailManager/Domain.py:213
-#: VirtualMailManager/Domain.py:243
+#: VirtualMailManager/Alias.py:72 VirtualMailManager/Domain.py:155
+#: VirtualMailManager/Domain.py:179 VirtualMailManager/Domain.py:209
#, python-format
msgid "The domain »%s« doesn't exist yet."
msgstr ""
@@ -103,10 +102,6 @@
msgid "missing options in section %s:\n"
msgstr ""
-#: VirtualMailManager/Config.py:119
-msgid "Argument 'sections' is not a list."
-msgstr ""
-
#: VirtualMailManager/Config.py:130
#, python-format
msgid "* Config section: »%s«"
@@ -117,26 +112,55 @@
msgid "Enter new value for option %(opt)s [%(val)s]: "
msgstr ""
-#: VirtualMailManager/Domain.py:75 VirtualMailManager/Domain.py:153
+#: VirtualMailManager/Domain.py:116
+msgid "There are accounts and aliases."
+msgstr ""
+
+#: VirtualMailManager/Domain.py:119
+msgid "There are accounts."
+msgstr ""
+
+#: VirtualMailManager/Domain.py:122
+msgid "There are aliases."
+msgstr ""
+
+#: VirtualMailManager/Domain.py:137
#, python-format
msgid "The domain »%s« already exists."
msgstr ""
-#: VirtualMailManager/Domain.py:78
+#: VirtualMailManager/DomainAlias.py:38
+#, python-format
+msgid "The domain »%s« is a primary domain."
+msgstr ""
+
+#: VirtualMailManager/DomainAlias.py:43
#, python-format
msgid "The domain alias »%s« already exists."
msgstr ""
-#: VirtualMailManager/Domain.py:132
-msgid "There are accounts and aliases."
+#: VirtualMailManager/DomainAlias.py:46
+msgid "No destination domain for alias domain denoted."
+msgstr ""
+
+#: VirtualMailManager/DomainAlias.py:49
+#, python-format
+msgid "The target domain »%s« doesn't exist yet."
msgstr ""
-#: VirtualMailManager/Domain.py:135
-msgid "There are accounts."
+#: VirtualMailManager/DomainAlias.py:66
+#, python-format
+msgid "The domain alias »%(alias)s« belongs to »%(dom)s«."
msgstr ""
-#: VirtualMailManager/Domain.py:138
-msgid "There are aliases."
+#: VirtualMailManager/DomainAlias.py:70
+#, python-format
+msgid "There is no primary domain for the domain alias »%s«."
+msgstr ""
+
+#: VirtualMailManager/DomainAlias.py:74 VirtualMailManager/DomainAlias.py:86
+#, python-format
+msgid "The domain alias »%s« doesn't exist yet."
msgstr ""
#: VirtualMailManager/MailLocation.py:34
@@ -163,149 +187,149 @@
msgid "Unknown tid specified."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:47
+#: VirtualMailManager/VirtualMailManager.py:48
#, python-format
msgid ""
"fix permissions for »%(cfgFileName)s«\n"
"`chmod 0600 %(cfgFileName)s` would be great."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:55
+#: VirtualMailManager/VirtualMailManager.py:56
msgid ""
"You are not root.\n"
"\tGood bye!\n"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:69
+#: VirtualMailManager/VirtualMailManager.py:70
#, python-format
msgid "The file »%s« does not exists."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:88
+#: VirtualMailManager/VirtualMailManager.py:89
#, python-format
msgid ""
"»%s« is not a directory.\n"
"(vmm.cfg: section \"domdir\", option \"base\")"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:93
+#: VirtualMailManager/VirtualMailManager.py:94
#, python-format
msgid ""
"»%(binary)s« doesn't exists.\n"
"(vmm.cfg: section \"bin\", option \"%(option)s\")"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:97
+#: VirtualMailManager/VirtualMailManager.py:98
#, python-format
msgid ""
"»%(binary)s« is not executable.\n"
"(vmm.cfg: section \"bin\", option \"%(option)s\")"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:123
+#: VirtualMailManager/VirtualMailManager.py:124
msgid "No localpart specified."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:126
+#: VirtualMailManager/VirtualMailManager.py:127
#, python-format
msgid "The local part »%s« is too long"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:133
+#: VirtualMailManager/VirtualMailManager.py:134
#, python-format
msgid "The local part »%(lpart)s« contains invalid characters: %(ichrs)s"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:177
+#: VirtualMailManager/VirtualMailManager.py:178
msgid "The domain name is too long."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:181
+#: VirtualMailManager/VirtualMailManager.py:182
msgid "The domain name is invalid."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:190
+#: VirtualMailManager/VirtualMailManager.py:191
#, python-format
msgid "Missing '@' sign in e-mail address »%s«."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:193
+#: VirtualMailManager/VirtualMailManager.py:194
#, python-format
msgid "»%s« looks not like an e-mail address."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:198
+#: VirtualMailManager/VirtualMailManager.py:199
#, python-format
msgid "Missing domain name after »%s@«."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:215
+#: VirtualMailManager/VirtualMailManager.py:216
msgid "Enter new password: "
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:218
-msgid "Sorry, empty passwords are not permitted"
-msgstr ""
-
#: VirtualMailManager/VirtualMailManager.py:219
+msgid "Sorry, empty passwords are not permitted"
+msgstr ""
+
+#: VirtualMailManager/VirtualMailManager.py:220
msgid "Retype new password: "
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:222
+#: VirtualMailManager/VirtualMailManager.py:223
msgid "Sorry, passwords do not match"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:251
-#: VirtualMailManager/VirtualMailManager.py:321
+#: VirtualMailManager/VirtualMailManager.py:252
+#: VirtualMailManager/VirtualMailManager.py:322
#, python-format
msgid "No such directory: %s"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:309
+#: VirtualMailManager/VirtualMailManager.py:310
msgid "Found \"..\" in home directory path."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:317
+#: VirtualMailManager/VirtualMailManager.py:318
msgid "Owner/group mismatch in home directory detected."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:332
+#: VirtualMailManager/VirtualMailManager.py:333
msgid "FATAL: \"..\" in domain directory path detected."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:338
+#: VirtualMailManager/VirtualMailManager.py:339
msgid "FATAL: group mismatch in domain directory detected"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:425
+#: VirtualMailManager/VirtualMailManager.py:426
#, python-format
msgid ""
"Configurtion error: \"%s\"\n"
"(in section \"connfig\", option \"done\") see also: vmm.cfg(5)\n"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:445
+#: VirtualMailManager/VirtualMailManager.py:446
#, python-format
msgid "Invalid section: '%s'"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:455
+#: VirtualMailManager/VirtualMailManager.py:456
#, python-format
msgid "Invalid argument: '%s'"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:465
-#: VirtualMailManager/VirtualMailManager.py:495
+#: VirtualMailManager/VirtualMailManager.py:466
+#: VirtualMailManager/VirtualMailManager.py:496
#, python-format
msgid "Invalid argument: »%s«"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:533
+#: VirtualMailManager/VirtualMailManager.py:540
#, python-format
msgid "The pattern »%s« contains invalid characters."
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:565
+#: VirtualMailManager/VirtualMailManager.py:572
#, python-format
msgid ""
"The account has been successfully deleted from the database.\n"
@@ -314,7 +338,7 @@
" Reason: %(raeson)s"
msgstr ""
-#: VirtualMailManager/VirtualMailManager.py:597
+#: VirtualMailManager/VirtualMailManager.py:604
msgid "Account doesn't exists"
msgstr ""
@@ -395,7 +419,7 @@
msgid "Missing target domain name."
msgstr ""
-#: vmm:226 vmm:232
+#: vmm:225 vmm:232
msgid "Missing alias domain name."
msgstr ""
--- a/vmm Thu Aug 21 01:23:31 2008 +0000
+++ b/vmm Fri Aug 22 03:07:53 2008 +0000
@@ -116,30 +116,30 @@
def _printList(alist, title):
msg = '%s %s' % (_('Available'), title)
- print '%s\n%s' % (msg, '-'*len(msg))
+ w_std('%s\n%s' % (msg, '-'*len(msg)))
if len(alist) > 0:
if title != _('alias domains'):
for val in alist:
- print '\t%s' % val
+ w_std('\t%s' % val)
else:
for dom in alist:
if not dom.startswith('xn--'):
- print '\t%s' % dom
+ w_std('\t%s' % dom)
else:
- print '\t%s (%s)' % (dom, vmm.ace2idna(dom))
+ w_std('\t%s (%s)' % (dom, vmm.ace2idna(dom)))
else:
- print _('\tNone')
+ w_std(_('\tNone'))
print
def _printAliases(alias, targets):
msg = _('Alias information')
- print '%s\n%s' % (msg, '-'*len(msg))
- print _('\tMail for %s goes to:') % alias
+ w_std('%s\n%s' % (msg, '-'*len(msg)))
+ w_std(_('\tMail for %s goes to:') % alias)
if len(targets) > 0:
for target in targets:
- print '\t -> %s' % target
+ w_std('\t -> %s' % target)
else:
- print _('\tNone')
+ w_std(_('\tNone'))
print
def _formatDom(domain, main=True):
@@ -155,16 +155,16 @@
msg = _('Available domains')
else:
msg = _('Matching domains')
- print '%s\n%s' % (msg, '-'*len(msg))
+ w_std('%s\n%s' % (msg, '-'*len(msg)))
if not len(domains):
- print _('\tNone')
+ w_std(_('\tNone'))
else:
for id in dids:
if domains[id][0] is not None:
- print _formatDom(domains[id][0])
+ w_std(_formatDom(domains[id][0]))
if len(domains[id]) > 1:
for alias in domains[id][1:]:
- print _formatDom(alias, main=False)
+ w_std(_formatDom(alias, main=False))
print
def configure():
@@ -221,11 +221,11 @@
vmm.domain_alias_add(argv[2].lower(), argv[3].lower())
def domain_alias_info():
- raise NotImplementedError('Sorry not implemented yet. ;-)')
if argc < 3:
usage(EXIT.MISSING_ARGS, _(u'Missing alias domain name.'))
else:
- vmm.domain_alias_delete(argv[2].lower())
+ info = vmm.domain_alias_info(argv[2].lower())
+ w_std(info+'\n')
def domain_alias_delete():
if argc < 3:
@@ -332,9 +332,9 @@
def show_warnings():
if vmm.hasWarnings():
- print _(u'Warnings:')
- for w in vmm.getWarnings():
- print " * ",w
+ w_std(_(u'Warnings:'))
+ for warning in vmm.getWarnings():
+ w_std( " * %s" % warning)
def show_version():
w_std("%s, %s %s (%s %s %s)\n" % (__prog__, _('version'), __version__,