Skip to content

Commit efcdbef

Browse files
authored
lowercase the username input for emailaddy
lowercase the username input so the email address is valid for dovecot mail delivery. Fix confirmed bug referenced: https://forums.cyberpanel.net/discussion/2345/creating-new-email-account-fail#latest
1 parent 7f37916 commit efcdbef

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

mailServer/mailserverManager.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ def submitEmailCreation(self):
8989

9090
data = json.loads(self.request.body)
9191
domainName = data['domain']
92-
userName = data['username']
92+
userName = data['username'].lower()
9393
password = data['passwordByPass']
9494

9595

@@ -102,7 +102,7 @@ def submitEmailCreation(self):
102102

103103
## Create email entry
104104

105-
result = mailUtilities.createEmailAccount(domainName, userName, password)
105+
result = mailUtilities.createEmailAccount(domainName, userName.lower(), password)
106106

107107
if result[0] == 1:
108108
data_ret = {'status': 1, 'createEmailStatus': 1, 'error_message': "None"}
@@ -679,4 +679,4 @@ def installStatusOpenDKIM(self):
679679
except BaseException, msg:
680680
final_dic = {'abort': 1, 'installed': 0, 'error_message': str(msg)}
681681
final_json = json.dumps(final_dic)
682-
return HttpResponse(final_json)
682+
return HttpResponse(final_json)

0 commit comments

Comments
 (0)