From e54a8093c07c62f745f3f8ba30de8580e66b13ea Mon Sep 17 00:00:00 2001 From: master3395 Date: Thu, 9 Apr 2026 22:49:38 +0200 Subject: [PATCH] docs: clarify Rspamd install log during long InstallRedis step; log install errors --- plogical/mailUtilities.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index b13438025..ec5f821ef 100644 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -836,7 +836,16 @@ return custom_keywords from manageServices.serviceManager import ServiceManager try: ####Frist install redis + with open(mailUtilities.RspamdInstallLogPath, 'a') as lf: + lf.write( + 'Running InstallRedis() — this often takes 5–20 minutes (system packages). ' + 'Progress from that step is not streamed here; the log continues after Redis finishes.\n' + ) + lf.flush() ServiceManager.InstallRedis() + with open(mailUtilities.RspamdInstallLogPath, 'a') as lf: + lf.write('Redis step finished. Adding Rspamd repository and installing packages...\n') + lf.flush() if ProcessUtilities.decideDistro() == ProcessUtilities.centos: @@ -1115,10 +1124,11 @@ LogFile /var/log/clamav/clamav.log return 1 except BaseException as msg: - writeToFile = open(mailUtilities.RspamdInstallLogPath, 'a') - writeToFile.writelines("Can not be installed.[404]\n") - writeToFile.close() - logging.CyberCPLogFileWriter.writeToFile(str(msg) + "[installRspamd]") + err = str(msg) + with open(mailUtilities.RspamdInstallLogPath, 'a') as writeToFile: + writeToFile.write('Install failed: %s\n' % err.replace('\r', ' ').replace('\n', ' ')[:2000]) + writeToFile.write('Can not be installed.[404]\n') + logging.CyberCPLogFileWriter.writeToFile(err + "[installRspamd]") @staticmethod def uninstallRspamd(install, rspamd):