Skip to content

Commit

Permalink
bug fix: fix empty resolv.conf in al8 reset email config
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 19, 2024
1 parent c6285c3 commit edebc8b
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions plogical/mailUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -2533,6 +2533,23 @@ def ResetEmailConfigurations(self):
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:
Expand Down

0 comments on commit edebc8b

Please sign in to comment.