Skip to content
Permalink
Browse files

bug fix: email password

  • Loading branch information
usmannasir committed Dec 16, 2019
1 parent baad2d6 commit 719066b329294be7cbf5c4a1dbe7f0ccd2e1fcba
Showing with 9 additions and 9 deletions.
  1. +4 −4 mailServer/mailserverManager.py
  2. +4 −4 plogical/mailUtilities.py
  3. +1 −1 plogical/virtualHostUtilities.py
@@ -548,12 +548,12 @@ def submitPasswordChange(self):

CentOSPath = '/etc/redhat-release'
if os.path.exists(CentOSPath):
password = bcrypt.hashpw(str(password), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
password = '{CRYPT}%s' % (password.decode())
emailDB.password = password
else:
password = bcrypt.hashpw(str(password), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
password = '{CRYPT}%s' % (password.decode())
emailDB.password = password

emailDB.save()
@@ -140,13 +140,13 @@ def createEmailAccount(domain, userName, password):

if os.path.exists(CentOSPath):
password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
password = '{CRYPT}%s' % (password.decode())
emailAcct = EUsers(emailOwner=emailDomain, email=finalEmailUsername, password=password)
emailAcct.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (domain, userName)
emailAcct.save()
else:
password = bcrypt.hashpw(password.encode('utf-8'), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
password = '{CRYPT}%s' % (password.decode())
emailAcct = EUsers(emailOwner=emailDomain, email=finalEmailUsername, password=password)
emailAcct.mail = 'maildir:/home/vmail/%s/%s/Maildir' % (domain, userName)
emailAcct.save()
@@ -192,8 +192,8 @@ def changeEmailPassword(email, newPassword, encrypt = None):
CentOSPath = '/etc/redhat-release'
changePass = EUsers.objects.get(email=email)
if os.path.exists(CentOSPath):
password = bcrypt.hashpw(str(newPassword), bcrypt.gensalt())
password = '{CRYPT}%s' % (password)
password = bcrypt.hashpw(newPassword.encode('utf-8'), bcrypt.gensalt())
password = '{CRYPT}%s' % (password.decode())
changePass.password = password
else:
changePass.password = newPassword
@@ -246,7 +246,7 @@ def createVirtualHost(virtualHostName, administratorEmail, phpVersion, virtualHo
'Default', '100%', '1G', '1024', '50', '1024', '1G', '20')
ProcessUtilities.normalExecutioner(command)

command = 'sudo lvectl apply all'
command = 'lvectl apply all'
ProcessUtilities.normalExecutioner(command)
else:
try:

0 comments on commit 719066b

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