--- a/VirtualMailManager/Handler.py Sun Mar 21 09:26:00 2010 +0000
+++ b/VirtualMailManager/Handler.py Sun Mar 21 09:59:05 2010 +0000
@@ -383,9 +383,11 @@
return '{%s}%s' % (self._scheme, self.__pwMD4(password))
elif self._scheme in ['SMD5', 'SSHA', 'CRAM-MD5', 'HMAC-MD5',
'LANMAN', 'NTLM', 'RPA']:
- return Popen([self._Cfg.dget('bin.dovecotpw'),
- '-s', self._scheme, '-p', password],
- stdout=PIPE).communicate()[0][:-1]
+ cmd_args = [self._Cfg.dget('bin.dovecotpw'), '-s', self._scheme,
+ '-p', password]
+ if self._Cfg.dget('misc.dovecot_version') >= 20:
+ cmd_args.insert(1, 'pw')
+ return Popen(cmd_args, stdout=PIPE).communicate()[0][:-1]
else:
return '{%s}%s' % (self._scheme, password)