596 acc = self.__getAccount(emailaddress, password) |
596 acc = self.__getAccount(emailaddress, password) |
597 if password is None: |
597 if password is None: |
598 password = self._readpass() |
598 password = self._readpass() |
599 acc.setPassword(self.__pwhash(password)) |
599 acc.setPassword(self.__pwhash(password)) |
600 acc.save(self.__Cfg.get('maildir', 'name'), |
600 acc.save(self.__Cfg.get('maildir', 'name'), |
|
601 self.__Cfg.getint('misc', 'dovecotvers'), |
601 self.__Cfg.getboolean('services', 'smtp'), |
602 self.__Cfg.getboolean('services', 'smtp'), |
602 self.__Cfg.getboolean('services', 'pop3'), |
603 self.__Cfg.getboolean('services', 'pop3'), |
603 self.__Cfg.getboolean('services', 'imap'), |
604 self.__Cfg.getboolean('services', 'imap'), |
604 self.__Cfg.getboolean('services', 'sieve')) |
605 self.__Cfg.getboolean('services', 'sieve')) |
605 self.__mailDirMake(acc.getDir('domain'), acc.getUID(), acc.getGID()) |
606 self.__mailDirMake(acc.getDir('domain'), acc.getUID(), acc.getGID()) |
649 def userInfo(self, emailaddress, details=None): |
650 def userInfo(self, emailaddress, details=None): |
650 if details not in [None, 'du', 'aliases', 'full']: |
651 if details not in [None, 'du', 'aliases', 'full']: |
651 raise VMMException(_(u'Invalid argument: »%s«') % details, |
652 raise VMMException(_(u'Invalid argument: »%s«') % details, |
652 ERR.INVALID_AGUMENT) |
653 ERR.INVALID_AGUMENT) |
653 acc = self.__getAccount(emailaddress) |
654 acc = self.__getAccount(emailaddress) |
654 info = acc.getInfo() |
655 info = acc.getInfo(self.__Cfg.getint('misc', 'dovecotvers')) |
655 if self.__Cfg.getboolean('maildir', 'diskusage')\ |
656 if self.__Cfg.getboolean('maildir', 'diskusage')\ |
656 or details in ['du', 'full']: |
657 or details in ['du', 'full']: |
657 info['disk usage'] = self.__getDiskUsage('%(maildir)s' % info) |
658 info['disk usage'] = self.__getDiskUsage('%(maildir)s' % info) |
658 if details in [None, 'du']: |
659 if details in [None, 'du']: |
659 return info |
660 return info |
682 acc = self.__getAccount(emailaddress) |
683 acc = self.__getAccount(emailaddress) |
683 acc.modify('transport', transport) |
684 acc.modify('transport', transport) |
684 |
685 |
685 def userDisable(self, emailaddress, service=None): |
686 def userDisable(self, emailaddress, service=None): |
686 acc = self.__getAccount(emailaddress) |
687 acc = self.__getAccount(emailaddress) |
687 acc.disable(service) |
688 acc.disable(self.__Cfg.getint('misc', 'dovecotvers'), service) |
688 |
689 |
689 def userEnable(self, emailaddress, service=None): |
690 def userEnable(self, emailaddress, service=None): |
690 acc = self.__getAccount(emailaddress) |
691 acc = self.__getAccount(emailaddress) |
691 acc.enable(service) |
692 acc.enable(self.__Cfg.getint('misc', 'dovecotvers'), service) |
692 |
693 |
693 def relocatedAdd(self, emailaddress, targetaddress): |
694 def relocatedAdd(self, emailaddress, targetaddress): |
694 relocated = self.__getRelocated(emailaddress, targetaddress) |
695 relocated = self.__getRelocated(emailaddress, targetaddress) |
695 relocated.save() |
696 relocated.save() |
696 |
697 |