VirtualMailManager/Handler.py
branchv0.6.x
changeset 233 55503d63ba30
parent 231 8c4df3dd2d2c
parent 223 5c7b7cbb01cd
child 236 084331dd1e4c
--- 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)