VirtualMailManager/VirtualMailManager.py
changeset 66 995d538a6eb5
parent 62 869de537a020
child 68 7ae95b9938c4
equal deleted inserted replaced
65:5506433db9a3 66:995d538a6eb5
   569 
   569 
   570     def aliasAdd(self, aliasaddress, targetaddress):
   570     def aliasAdd(self, aliasaddress, targetaddress):
   571         alias = self.__getAlias(aliasaddress, targetaddress)
   571         alias = self.__getAlias(aliasaddress, targetaddress)
   572         alias.save()
   572         alias.save()
   573 
   573 
   574     def userDelete(self, emailaddress):
   574     def userDelete(self, emailaddress, force=None):
       
   575         if force not in [None, 'delalias']:
       
   576             raise VMMException(_(u"Invalid argument: »%s«") % force,
       
   577                     ERR.INVALID_AGUMENT)
   575         acc = self.__getAccount(emailaddress)
   578         acc = self.__getAccount(emailaddress)
   576         uid = acc.getUID()
   579         uid = acc.getUID()
   577         gid = acc.getGID()
   580         gid = acc.getGID()
   578         acc.delete()
   581         acc.delete(force)
   579         if self.__Cfg.getboolean('maildir', 'delete'):
   582         if self.__Cfg.getboolean('maildir', 'delete'):
   580             try:
   583             try:
   581                 self.__userDirDelete(acc.getDir('domain'), uid, gid)
   584                 self.__userDirDelete(acc.getDir('domain'), uid, gid)
   582             except VMMException, e:
   585             except VMMException, e:
   583                 if e.code() in [ERR.FOUND_DOTS_IN_PATH,
   586                 if e.code() in [ERR.FOUND_DOTS_IN_PATH,