VirtualMailManager/VirtualMailManager.py
changeset 20 55146c78b3fb
parent 19 bf9a03c476fc
child 24 48ea255e8a85
equal deleted inserted replaced
19:bf9a03c476fc 20:55146c78b3fb
   458             raise VMMDomainException(('Invalid argument: »%s«' % detailed,
   458             raise VMMDomainException(('Invalid argument: »%s«' % detailed,
   459                 ERR.INVALID_OPTION))
   459                 ERR.INVALID_OPTION))
   460 
   460 
   461     def user_add(self, emailaddress, password):
   461     def user_add(self, emailaddress, password):
   462         acc = self.__getAccount(emailaddress, password)
   462         acc = self.__getAccount(emailaddress, password)
   463         acc.save(self.__Cfg.get('maildir', 'folder'))
   463         acc.save(self.__Cfg.get('maildir', 'folder'),
       
   464                 self.__Cfg.getboolean('services', 'smtp'),
       
   465                 self.__Cfg.getboolean('services', 'pop3'),
       
   466                 self.__Cfg.getboolean('services', 'imap'),
       
   467                 self.__Cfg.getboolean('services', 'managesieve'))
   464         self.__maildirmake(acc.getDir('domain'), acc.getUID(), acc.getGID())
   468         self.__maildirmake(acc.getDir('domain'), acc.getUID(), acc.getGID())
   465 
   469 
   466     def alias_add(self, aliasaddress, targetaddress):
   470     def alias_add(self, aliasaddress, targetaddress):
   467         alias = self.__getAlias(aliasaddress, targetaddress)
   471         alias = self.__getAlias(aliasaddress, targetaddress)
   468         alias.save()
   472         alias.save()
   505 
   509 
   506     def user_transport(self, emailaddress, transport):
   510     def user_transport(self, emailaddress, transport):
   507         acc = self.__getAccount(emailaddress)
   511         acc = self.__getAccount(emailaddress)
   508         acc.modify('transport', transport)
   512         acc.modify('transport', transport)
   509 
   513 
   510     def user_disable(self, emailaddress):
   514     def user_disable(self, emailaddress, service=None):
   511         acc = self.__getAccount(emailaddress)
   515         acc = self.__getAccount(emailaddress)
   512         acc.disable()
   516         acc.disable(service)
   513 
   517 
   514     def user_enable(self, emailaddress):
   518     def user_enable(self, emailaddress, service=None):
   515         acc = self.__getAccount(emailaddress)
   519         acc = self.__getAccount(emailaddress)
   516         acc.enable()
   520         acc.enable(service)
   517 
   521 
   518     def __del__(self):
   522     def __del__(self):
   519         if not self.__dbh is None and self.__dbh._isOpen:
   523         if not self.__dbh is None and self.__dbh._isOpen:
   520             self.__dbh.close()
   524             self.__dbh.close()