mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2026-03-04 19:30:45 +01:00
bug fix: fix empty resolv.conf in al8 reset email config
This commit is contained in:
@@ -2533,6 +2533,23 @@ class MailServerManagerUtils(multi.Thread):
|
||||
command = 'touch /home/cyberpanel/postfix'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
###
|
||||
|
||||
etcResolve = '/etc/resolv.conf'
|
||||
|
||||
dataEtcResolv = open(etcResolve, 'r').read()
|
||||
|
||||
if len(dataEtcResolv) < 4:
|
||||
writeToFile = open(etcResolve, 'w')
|
||||
writeToFile.write('nameserver 8.8.8.8\n')
|
||||
writeToFile.close()
|
||||
|
||||
command = 'systemctl restart postfix'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'systemctl restart dovecot'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Completed [200].')
|
||||
|
||||
except BaseException as msg:
|
||||
|
||||
Reference in New Issue
Block a user