merged changes from default(8c4df3dd2d2c) v0.6.x
authorPascal Volk <neverseen@users.sourceforge.net>
Sun, 21 Mar 2010 09:59:05 +0000
branchv0.6.x
changeset 233 55503d63ba30
parent 232 3c766114d0b9 (current diff)
parent 231 8c4df3dd2d2c (diff)
child 234 e88ba0fb1281
merged changes from default(8c4df3dd2d2c)
VirtualMailManager/Handler.py
--- 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)