VirtualMailManager/AliasDomain.py
branchv0.6.x
changeset 199 0684790fff7c
parent 185 6e1ef32fbd82
child 216 0c8c053b451c
equal deleted inserted replaced
198:02d467e4fbab 199:0684790fff7c
     3 # See COPYING for distribution information.
     3 # See COPYING for distribution information.
     4 
     4 
     5 """Virtual Mail Manager's AliasDomain class to manage alias domains."""
     5 """Virtual Mail Manager's AliasDomain class to manage alias domains."""
     6 
     6 
     7 import VirtualMailManager.constants.ERROR as ERR
     7 import VirtualMailManager.constants.ERROR as ERR
     8 from VirtualMailManager import chk_domainname
     8 from VirtualMailManager import check_domainname
     9 from VirtualMailManager.Exceptions import VMMAliasDomainException as VADE
     9 from VirtualMailManager.Exceptions import VMMAliasDomainException as VADE
    10 
    10 
    11 class AliasDomain(object):
    11 class AliasDomain(object):
    12     """Class to manage e-mail alias domains."""
    12     """Class to manage e-mail alias domains."""
    13     __slots__ = ('__gid', '__name', '_domain', '_dbh')
    13     __slots__ = ('__gid', '__name', '_domain', '_dbh')
    14     def __init__(self, dbh, domainname, targetDomain=None):
    14     def __init__(self, dbh, domainname, targetDomain=None):
    15         self._dbh = dbh
    15         self._dbh = dbh
    16         self.__name = chk_domainname(domainname)
    16         self.__name = check_domainname(domainname)
    17         self.__gid = 0
    17         self.__gid = 0
    18         self._domain = targetDomain
    18         self._domain = targetDomain
    19         self._exists()
    19         self._exists()
    20 
    20 
    21     def _exists(self):
    21     def _exists(self):