VMM: VirtualMailManager.__pwhash() added support for 'doveadm pw'.
authorPascal Volk <neverseen@users.sourceforge.net>
Sun, 21 Mar 2010 09:17:26 +0000
changeset 231 8c4df3dd2d2c
parent 172 6526072ec709
child 233 55503d63ba30
child 238 8f56166a3283
VMM: VirtualMailManager.__pwhash() added support for 'doveadm pw'. dovecotpw was replaced by `doveadm pw` in Dovecot v2.0. To use doveadm instead of dovecotpw use the following settings in vmm.cfg: [bin] dovecotpw = /path/to/doveadm [misc] dovecotvers = 20
VirtualMailManager/VirtualMailManager.py
--- a/VirtualMailManager/VirtualMailManager.py	Fri Jan 22 04:22:59 2010 +0000
+++ b/VirtualMailManager/VirtualMailManager.py	Sun Mar 21 09:17:26 2010 +0000
@@ -415,8 +415,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.get('bin', 'dovecotpw'), '-s',
-                self.__scheme,'-p',password],stdout=PIPE).communicate()[0][:-1]
+            cmd_args = [self.__Cfg.get('bin', 'dovecotpw'), '-s',
+                        self.__scheme, '-p', password]
+            if self.__Cfg.getint('misc', 'dovecotvers') >= 20:
+                cmd_args.insert(1, 'pw')
+            return Popen(cmd_args, stdout=PIPE).communicate()[0][:-1]
         else:
             return '{%s}%s' % (self.__scheme, password)