VirtualMailManager/VirtualMailManager.py
changeset 231 8c4df3dd2d2c
parent 162 0ac9ef587769
child 238 8f56166a3283
equal deleted inserted replaced
172:6526072ec709 231:8c4df3dd2d2c
   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."""