From 26c9ffeed46948c8b7a5d935061f5d3dd0db365f Mon Sep 17 00:00:00 2001 From: Usman Nasir Date: Fri, 20 May 2022 15:54:07 +0500 Subject: [PATCH] fix snappymail issues in upgrade --- install/install.py | 3 +++ plogical/upgrade.py | 16 +++++++++++++++- 2 files changed, 18 insertions(+), 1 deletion(-) diff --git a/install/install.py b/install/install.py index c5c01e334..15c722d44 100755 --- a/install/install.py +++ b/install/install.py @@ -1315,6 +1315,9 @@ imap_folder_list_limit = 0 command = 'mv %s %s' % (includeFileOldPath, includeFileNewPath) preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + command = "sed -i 's|autocreate_system_folders = Off|autocreate_system_folders = On|g' %s" % (labsPath) + preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) + except BaseException as msg: logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [downoad_and_install_snappymail]") return 0 diff --git a/plogical/upgrade.py b/plogical/upgrade.py index cebf1ff39..65d5584e3 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -500,6 +500,20 @@ imap_folder_list_limit = 0 writeToFile.write(labsData) writeToFile.close() + includeFileOldPath = '/usr/local/CyberCP/public/snappymail/_include.php' + includeFileNewPath = '/usr/local/CyberCP/public/snappymail/include.php' + + if os.path.exists(includeFileOldPath): + writeToFile = open(includeFileOldPath, 'a') + writeToFile.write("\ndefine('APP_DATA_FOLDER_PATH', '/usr/local/lscp/cyberpanel/rainloop/data/');\n") + writeToFile.close() + + command = 'mv %s %s' % (includeFileOldPath, includeFileNewPath) + Upgrade.executioner(command, 'mkdir snappymail configs', 0) + + command = "sed -i 's|autocreate_system_folders = Off|autocreate_system_folders = On|g' %s" % (labsPath) + Upgrade.executioner(command, 'mkdir snappymail configs', 0) + os.chdir(cwd) except BaseException as msg: @@ -1977,7 +1991,7 @@ echo $oConfig->Save() ? 'Done' : 'Error'; command = "chown -R root:root /usr/local/lscp" Upgrade.executioner(command, 'chown core code', 0) - command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop/data" + command = "chown -R lscpd:lscpd /usr/local/lscp/cyberpanel/rainloop" Upgrade.executioner(command, 'chown core code', 0) command = "chmod 700 /usr/local/CyberCP/cli/cyberPanel.py"