diff -r 4cd9d0a9f42f -r df1e3b67882a VirtualMailManager/catchall.py --- a/VirtualMailManager/catchall.py Sun Nov 11 16:53:52 2012 +0000 +++ b/VirtualMailManager/catchall.py Tue Nov 20 13:40:32 2012 +0000 @@ -40,7 +40,7 @@ self._dbh = dbh self._gid = get_gid(self._dbh, self.domain) if not self._gid: - raise AErr(_(u"The domain '%s' does not exist.") % + raise AErr(_("The domain '%s' does not exist.") % self.domain, NO_SUCH_DOMAIN) self._dests = [] @@ -59,13 +59,13 @@ def _check_expansion(self, count_new): """Checks the current expansion limit of the alias.""" postconf = Postconf(cfg_dget('bin.postconf')) - limit = long(postconf.read('virtual_alias_expansion_limit')) + limit = int(postconf.read('virtual_alias_expansion_limit')) dcount = len(self._dests) failed = False if dcount == limit or dcount + count_new > limit: failed = True errmsg = _( -u"""Cannot add %(count_new)i new destination(s) to catch-all alias for +"""Cannot add %(count_new)i new destination(s) to catch-all alias for domain '%(domain)s'. Currently this alias expands into %(count)i/%(limit)i recipients. %(count_new)i additional destination(s) will render this alias unusable. @@ -73,7 +73,7 @@ elif dcount > limit: failed = True errmsg = _( -u"""Cannot add %(count_new)i new destination(s) to catch-all alias for domain +"""Cannot add %(count_new)i new destination(s) to catch-all alias for domain '%(domain)s'. This alias already exceeds its expansion limit \ (%(count)i/%(limit)i). So its unusable, all messages addressed to this alias will be bounced. @@ -147,16 +147,16 @@ if not warnings is None: assert isinstance(warnings, list) if not self._dests: - raise AErr(_(u"There are no catch-all aliases defined for " - u"domain '%s'.") % self._domain, NO_SUCH_ALIAS) + raise AErr(_("There are no catch-all aliases defined for " + "domain '%s'.") % self._domain, NO_SUCH_ALIAS) unknown = destinations.difference(set(self._dests)) if unknown: destinations.intersection_update(set(self._dests)) if not warnings is None: warnings.extend(unknown) if not destinations: - raise AErr(_(u"No suitable destinations left to remove from the " - u"catch-all alias of domain '%s'.") % self._domain, + raise AErr(_("No suitable destinations left to remove from the " + "catch-all alias of domain '%s'.") % self._domain, NO_SUCH_ALIAS) self._delete(destinations) for destination in destinations: @@ -165,15 +165,15 @@ def get_destinations(self): """Returns an iterator for all destinations of the catchall alias.""" if not self._dests: - raise AErr(_(u"There are no catch-all aliases defined for " - u"domain '%s'.") % self._domain, NO_SUCH_ALIAS) + raise AErr(_("There are no catch-all aliases defined for " + "domain '%s'.") % self._domain, NO_SUCH_ALIAS) return iter(self._dests) def delete(self): """Deletes all catchall destinations for the domain.""" if not self._dests: - raise AErr(_(u"There are no catch-all aliases defined for " - u"domain '%s'.") % self._domain, NO_SUCH_ALIAS) + raise AErr(_("There are no catch-all aliases defined for " + "domain '%s'.") % self._domain, NO_SUCH_ALIAS) self._delete() del self._dests[:]