VirtualMailManager/Handler.py
branchv0.6.x
changeset 233 55503d63ba30
parent 231 8c4df3dd2d2c
parent 223 5c7b7cbb01cd
child 236 084331dd1e4c
equal deleted inserted replaced
232:3c766114d0b9 233:55503d63ba30
   381             return '{%s}%s' % (self._scheme, self.__pwMD5(password, user))
   381             return '{%s}%s' % (self._scheme, self.__pwMD5(password, user))
   382         elif self._scheme == 'MD4':
   382         elif self._scheme == 'MD4':
   383             return '{%s}%s' % (self._scheme, self.__pwMD4(password))
   383             return '{%s}%s' % (self._scheme, self.__pwMD4(password))
   384         elif self._scheme in ['SMD5', 'SSHA', 'CRAM-MD5', 'HMAC-MD5',
   384         elif self._scheme in ['SMD5', 'SSHA', 'CRAM-MD5', 'HMAC-MD5',
   385                 'LANMAN', 'NTLM', 'RPA']:
   385                 'LANMAN', 'NTLM', 'RPA']:
   386             return Popen([self._Cfg.dget('bin.dovecotpw'),
   386             cmd_args = [self._Cfg.dget('bin.dovecotpw'), '-s', self._scheme,
   387                          '-s', self._scheme, '-p', password],
   387                         '-p', password]
   388                          stdout=PIPE).communicate()[0][:-1]
   388             if self._Cfg.dget('misc.dovecot_version') >= 20:
       
   389                 cmd_args.insert(1, 'pw')
       
   390             return Popen(cmd_args, stdout=PIPE).communicate()[0][:-1]
   389         else:
   391         else:
   390             return '{%s}%s' % (self._scheme, password)
   392             return '{%s}%s' % (self._scheme, password)
   391 
   393 
   392     def hasWarnings(self):
   394     def hasWarnings(self):
   393         """Checks if warnings are present, returns bool."""
   395         """Checks if warnings are present, returns bool."""