413 return '{%s}%s' % (self.__scheme, self.__pwMD5(password, user)) |
413 return '{%s}%s' % (self.__scheme, self.__pwMD5(password, user)) |
414 elif self.__scheme == 'MD4': |
414 elif self.__scheme == 'MD4': |
415 return '{%s}%s' % (self.__scheme, self.__pwMD4(password)) |
415 return '{%s}%s' % (self.__scheme, self.__pwMD4(password)) |
416 elif self.__scheme in ['SMD5', 'SSHA', 'CRAM-MD5', 'HMAC-MD5', |
416 elif self.__scheme in ['SMD5', 'SSHA', 'CRAM-MD5', 'HMAC-MD5', |
417 'LANMAN', 'NTLM', 'RPA']: |
417 'LANMAN', 'NTLM', 'RPA']: |
418 return Popen([self.__Cfg.get('bin', 'dovecotpw'), '-s', |
418 cmd_args = [self.__Cfg.get('bin', 'dovecotpw'), '-s', |
419 self.__scheme,'-p',password],stdout=PIPE).communicate()[0][:-1] |
419 self.__scheme, '-p', password] |
|
420 if self.__Cfg.getint('misc', 'dovecotvers') >= 20: |
|
421 cmd_args.insert(1, 'pw') |
|
422 return Popen(cmd_args, stdout=PIPE).communicate()[0][:-1] |
420 else: |
423 else: |
421 return '{%s}%s' % (self.__scheme, password) |
424 return '{%s}%s' % (self.__scheme, password) |
422 |
425 |
423 def hasWarnings(self): |
426 def hasWarnings(self): |
424 """Checks if warnings are present, returns bool.""" |
427 """Checks if warnings are present, returns bool.""" |