Skip to content
Permalink
Browse files

Bug fix: dont update email passwords on upgrade if crypt detected

  • Loading branch information...
usmannasir committed Aug 25, 2019
1 parent a5bf6ca commit dde0ab908e08be58781118af3b148b534ddeb1c7
Showing with 15 additions and 11 deletions.
  1. +15 −11 plogical/upgrade.py
@@ -1583,11 +1583,13 @@ def upgradeDovecot():

writeToFile.close()

if updatePasswords:
for items in EUsers.objects.all():
command = 'doveadm pw -p %s' % (items.password)
items.password = subprocess.check_output(shlex.split(command)).strip('\n')
items.save()
Upgrade.stdOut("Upgrading passwords...")
for items in EUsers.objects.all():
if items.password.find('CRYPT') > -1:
continue
command = 'doveadm pw -p %s' % (items.password)
items.password = subprocess.check_output(shlex.split(command)).strip('\n')
items.save()

command = "systemctl restart dovecot"
Upgrade.executioner(command, 0)
@@ -1642,12 +1644,14 @@ def upgradeDovecot():

writeToFile.close()

if updatePasswords:
Upgrade.stdOut("Upgrading passwords...")
for items in EUsers.objects.all():
command = 'doveadm pw -p %s' % (items.password)
items.password = subprocess.check_output(shlex.split(command)).strip('\n')
items.save()
Upgrade.stdOut("Upgrading passwords...")
for items in EUsers.objects.all():
if items.password.find('CRYPT') > -1:
continue
command = 'doveadm pw -p %s' % (items.password)
items.password = subprocess.check_output(shlex.split(command)).strip('\n')
items.save()


command = "systemctl restart dovecot"
Upgrade.executioner(command, 0)

0 comments on commit dde0ab9

Please sign in to comment.
You can’t perform that action at this time.