From 84ded63fe5fad94ed94fbc0fb2541289d399b11c Mon Sep 17 00:00:00 2001 From: Gilles BOUVIER Date: Sat, 26 Dec 2020 14:15:24 -0800 Subject: [PATCH 1/6] =?UTF-8?q?=E2=80=A2=20Add=20From=20header=20to=20emai?= =?UTF-8?q?l=20message=20if=20missing.=20=20=20Gmail=20rejects=20messages?= =?UTF-8?q?=20without=20a=20From=20header,=20with=20this=20error:=20=20=20?= =?UTF-8?q?"Our=20system=20has=20detected=20that=20this=20message=20is=205?= =?UTF-8?q?.7.1=20not=20RFC=205322=20=20=20=20compliant:=205.7.1=20'From'?= =?UTF-8?q?=20header=20is=20missing."?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plogical/CyberCPLogFileWriter.py | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/plogical/CyberCPLogFileWriter.py b/plogical/CyberCPLogFileWriter.py index 46bcacf8e..a3ff8acde 100755 --- a/plogical/CyberCPLogFileWriter.py +++ b/plogical/CyberCPLogFileWriter.py @@ -7,6 +7,18 @@ import smtplib class CyberCPLogFileWriter: fileName = "/home/cyberpanel/error-logs.txt" + @staticmethod + def AddFromHeader(sender, message): + try: + import re + + if not re.search('^From: ', message, re.MULTILINE): + message = 'From: {}\n{}'.format(sender, message) + + return message + except BaseException as msg: + return "Can not add From header to message." + @staticmethod def SendEmail(sender, receivers, message, subject=None, type=None): try: @@ -29,9 +41,12 @@ class CyberCPLogFileWriter: if subject != None: message = 'Subject: {}\n\n{}'.format(subject, message) + message = CyberCPLogFileWriter.AddFromHeader(sender, message) smtpServer.sendmail(smtpUserName, receivers, message) else: smtpObj = smtplib.SMTP('localhost') + + message = CyberCPLogFileWriter.AddFromHeader(sender, message) smtpObj.sendmail(sender, receivers, message) except BaseException as msg: CyberCPLogFileWriter.writeToFile(str(msg)) @@ -107,4 +122,4 @@ Subject: %s statusFile.writelines(mesg + '\n') statusFile.close() except BaseException as msg: - CyberCPLogFileWriter.writeToFile(str(msg) + ' [statusWriter]') \ No newline at end of file + CyberCPLogFileWriter.writeToFile(str(msg) + ' [statusWriter]') From bfc57ec036bb58f67e8c05b44572edc1e39fbc22 Mon Sep 17 00:00:00 2001 From: Gilles BOUVIER Date: Sun, 27 Dec 2020 11:34:59 -0800 Subject: [PATCH 2/6] =?UTF-8?q?=E2=80=A2=20Use=20writeToFile=20in=20except?= =?UTF-8?q?ion=20clause=20(suggestion=20from=20@furkansandal).?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- plogical/CyberCPLogFileWriter.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/CyberCPLogFileWriter.py b/plogical/CyberCPLogFileWriter.py index a3ff8acde..18410e788 100755 --- a/plogical/CyberCPLogFileWriter.py +++ b/plogical/CyberCPLogFileWriter.py @@ -17,7 +17,7 @@ class CyberCPLogFileWriter: return message except BaseException as msg: - return "Can not add From header to message." + CyberCPLogFileWriter.writeToFile(str(msg) + ' [AddFromHeader]') @staticmethod def SendEmail(sender, receivers, message, subject=None, type=None): From 11969008f9496406218690449bba74b53cde79ab Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Thu, 15 Apr 2021 16:25:44 +0500 Subject: [PATCH 3/6] bug fix: cluster path for centos --- plogical/ClusterManager.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/ClusterManager.py b/plogical/ClusterManager.py index d91bfc119..e3c83ad66 100644 --- a/plogical/ClusterManager.py +++ b/plogical/ClusterManager.py @@ -48,7 +48,7 @@ class ClusterManager: def FetchMySQLConfigFile(self): if ProcessUtilities.decideDistro() == ProcessUtilities.centos: - return '/etc/mysql/conf.d/cluster.cnf' + return '/etc/my.cnf.d/cluster.cnf' else: return '/etc/mysql/conf.d/cluster.cnf' From 5b8b64bd7a88eaf4ec2bf6339286037f4eefd0e6 Mon Sep 17 00:00:00 2001 From: WhatTheServer Date: Fri, 16 Apr 2021 08:41:14 -0400 Subject: [PATCH 4/6] Update csf.py Add Litespeed/Openlitespeed Admin port to default opened as suggested in. https://feedback.cyberpanel.net/b/requests/p/openlitespeed-port-in-cyberpanel-from-core-install --- plogical/csf.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plogical/csf.py b/plogical/csf.py index cb4a1d9f7..2e7d38b6c 100755 --- a/plogical/csf.py +++ b/plogical/csf.py @@ -91,7 +91,7 @@ class CSF(multi.Thread): for items in data: if items.find('TCP_IN') > -1 and items.find('=') > -1 and (items[0] != '#'): writeToConf.writelines( - 'TCP_IN = "20,21,22,25,53,80,110,995,143,443,465,587,993,995,1025,8090,40110:40210"\n') + 'TCP_IN = "20,21,22,25,53,80,110,995,143,443,465,587,993,995,1025,7080,8090,40110:40210"\n') elif items.find('TCP_OUT') > -1 and items.find('=') > -1 and (items[0] != '#'): writeToConf.writelines( 'TCP_OUT = "20,21,22,25,43,53,80,110,113,443,587,993,995,8090,40110:40210"\n') From 611a04f975683fce524e78875ea4c9c90be67055 Mon Sep 17 00:00:00 2001 From: WhatTheServer Date: Fri, 16 Apr 2021 08:46:51 -0400 Subject: [PATCH 5/6] Add Litespeed/OLS admin port to default allowed Add Litespeed/OLS admin port to default allowed https://feedback.cyberpanel.net/b/requests/p/openlitespeed-port-in-cyberpanel-from-core-install --- install/install.py | 1 + 1 file changed, 1 insertion(+) diff --git a/install/install.py b/install/install.py index fde5d9a59..5750c2304 100755 --- a/install/install.py +++ b/install/install.py @@ -1336,6 +1336,7 @@ imap_folder_list_limit = 0 preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) FirewallUtilities.addRule("tcp", "8090") + FirewallUtilities.addRule("tcp", "7080") FirewallUtilities.addRule("tcp", "80") FirewallUtilities.addRule("tcp", "443") FirewallUtilities.addRule("tcp", "21") From f865d0cb027bf2e325be46c882e6ffc9f37896f7 Mon Sep 17 00:00:00 2001 From: WhatTheServer Date: Fri, 16 Apr 2021 19:16:50 -0400 Subject: [PATCH 6/6] Update install.py Added missing install to apt-get and also calls to ensure the commands were getting executed vs just the last one command mentioned. --- install/install.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/install/install.py b/install/install.py index 5750c2304..d457fb59b 100755 --- a/install/install.py +++ b/install/install.py @@ -759,16 +759,17 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout'; if self.distro == centos: command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre' - + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) elif self.distro == cent8: command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/el/8/gf/x86_64/gf-release-8-11.gf.el8.noarch.rpm' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y' + preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR) else: - command = 'apt-get -y debconf-utils' + command = 'apt-get -y install debconf-utils' preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) file_name = self.cwd + '/pf.unattend.text' pf = open(file_name, 'w')