mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-05-09 12:45:36 +02:00
Fix Dovecot hard restart killing active IMAP/POP3 connections
Replace 'systemctl restart dovecot' with 'doveadm reload' in virtualHostUtilities, mailUtilities, and renew modules. The nightly backup scheduler, SSL operations, and weekly cert renewal were forcefully terminating all client sessions. doveadm reload applies config changes (including updated SSL certs) without dropping existing connections. upgrade.py is intentionally left unchanged as full restarts are appropriate during upgrades.
This commit is contained in:
@@ -690,7 +690,7 @@ milter_default_action = accept
|
||||
command = 'systemctl restart postfix'
|
||||
subprocess.call(shlex.split(command))
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
command = 'doveadm reload'
|
||||
subprocess.call(shlex.split(command))
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(str(msg) + " [restartServices]")
|
||||
@@ -2368,7 +2368,7 @@ class MailServerManagerUtils(multi.Thread):
|
||||
writeToFile.writelines(items)
|
||||
writeToFile.close()
|
||||
|
||||
command = "systemctl restart dovecot"
|
||||
command = "doveadm reload"
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
## For ubuntu 20
|
||||
@@ -2720,7 +2720,7 @@ class MailServerManagerUtils(multi.Thread):
|
||||
command = 'systemctl restart postfix'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
command = 'doveadm reload'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Completed [200].')
|
||||
|
||||
@@ -81,7 +81,7 @@ class Renew:
|
||||
commands = [
|
||||
'postmap -F hash:/etc/postfix/vmail_ssl.map',
|
||||
'systemctl restart postfix',
|
||||
'systemctl restart dovecot',
|
||||
'doveadm reload',
|
||||
'systemctl restart lscpd'
|
||||
]
|
||||
|
||||
|
||||
@@ -248,7 +248,7 @@ class virtualHostUtilities:
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, message)
|
||||
logging.CyberCPLogFileWriter.writeToFile(message)
|
||||
|
||||
command = 'postmap -F hash:/etc/postfix/vmail_ssl.map && systemctl restart postfix && systemctl restart dovecot'
|
||||
command = 'postmap -F hash:/etc/postfix/vmail_ssl.map && systemctl restart postfix && doveadm reload'
|
||||
ProcessUtilities.executioner(command, 'root', True)
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Completed. [200]')
|
||||
else:
|
||||
@@ -444,7 +444,7 @@ class virtualHostUtilities:
|
||||
admin.config = json.dumps(config)
|
||||
admin.save()
|
||||
# First update the postfix hash database, then restart services
|
||||
command = 'postmap -F hash:/etc/postfix/vmail_ssl.map && systemctl restart postfix && systemctl restart dovecot'
|
||||
command = 'postmap -F hash:/etc/postfix/vmail_ssl.map && systemctl restart postfix && doveadm reload'
|
||||
ProcessUtilities.executioner(command, 'root', True)
|
||||
logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, 'Completed. [200]')
|
||||
else:
|
||||
@@ -500,7 +500,7 @@ local_name %s {
|
||||
writeToFile.close()
|
||||
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
command = 'doveadm reload'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
### Update postfix configurations
|
||||
@@ -559,7 +559,7 @@ local_name %s {
|
||||
writeToFile.write(content)
|
||||
writeToFile.close()
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
command = 'doveadm reload'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
### Update postfix configurations
|
||||
@@ -860,7 +860,7 @@ local_name %s {
|
||||
command = 'systemctl restart postfix'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
command = 'doveadm reload'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
print("1,None")
|
||||
@@ -891,7 +891,7 @@ local_name %s {
|
||||
command = 'systemctl restart postfix'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
command = 'doveadm reload'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
print(f"1,{str(retValues[1])}")
|
||||
|
||||
Reference in New Issue
Block a user