VirtualMailManager/VirtualMailManager.py
changeset 88 b3debcfea7bc
parent 87 f9090d1a0730
child 90 1734eb5101c6
equal deleted inserted replaced
87:f9090d1a0730 88:b3debcfea7bc
    61             self.__Cfg = Cfg(self.__cfgFileName)
    61             self.__Cfg = Cfg(self.__cfgFileName)
    62             self.__Cfg.load()
    62             self.__Cfg.load()
    63             self.__Cfg.check()
    63             self.__Cfg.check()
    64             self.__cfgSections = self.__Cfg.getsections()
    64             self.__cfgSections = self.__Cfg.getsections()
    65             self.__scheme = self.__Cfg.get('misc', 'passwdscheme')
    65             self.__scheme = self.__Cfg.get('misc', 'passwdscheme')
       
    66             self._postconf = Postconf(self.__Cfg.get('bin', 'postconf'))
    66         if not sys.argv[1] in ['cf', 'configure']:
    67         if not sys.argv[1] in ['cf', 'configure']:
    67             self.__chkenv()
    68             self.__chkenv()
    68 
    69 
    69     def __chkCfgFile(self):
    70     def __chkCfgFile(self):
    70         """Checks the configuration file, returns bool"""
    71         """Checks the configuration file, returns bool"""
   599                 self.__Cfg.getboolean('services', 'managesieve'))
   600                 self.__Cfg.getboolean('services', 'managesieve'))
   600         self.__mailDirMake(acc.getDir('domain'), acc.getUID(), acc.getGID())
   601         self.__mailDirMake(acc.getDir('domain'), acc.getUID(), acc.getGID())
   601 
   602 
   602     def aliasAdd(self, aliasaddress, targetaddress):
   603     def aliasAdd(self, aliasaddress, targetaddress):
   603         alias = self.__getAlias(aliasaddress, targetaddress)
   604         alias = self.__getAlias(aliasaddress, targetaddress)
   604         alias.save()
   605         alias.save(long(self._postconf.read('virtual_alias_expansion_limit')))
   605         gid = self.__getDomain(alias._dest._domainname).getID()
   606         gid = self.__getDomain(alias._dest._domainname).getID()
   606         if gid > 0 and not VirtualMailManager.accountExists(self.__dbh,
   607         if gid > 0 and not VirtualMailManager.accountExists(self.__dbh,
   607         alias._dest) and not VirtualMailManager.aliasExists(self.__dbh, 
   608         alias._dest) and not VirtualMailManager.aliasExists(self.__dbh, 
   608         alias._dest):
   609         alias._dest):
   609             self.__warnings.append(
   610             self.__warnings.append(