mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-07 22:06:05 +01:00
bug fix: fix opendkim on config rest
This commit is contained in:
@@ -1380,6 +1380,39 @@ class MailServerManager(multi.Thread):
|
||||
|
||||
return 1
|
||||
|
||||
def installOpenDKIMNew(self):
|
||||
try:
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||
'Installing opendkim..,40')
|
||||
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.centos:
|
||||
command = 'yum -y install opendkim'
|
||||
elif ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
command = 'dnf install opendkim -y'
|
||||
else:
|
||||
command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install opendkim'
|
||||
|
||||
os.system(command)
|
||||
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.cent8:
|
||||
command = 'dnf install opendkim-tools -y'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
if ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu or ProcessUtilities.decideDistro() == ProcessUtilities.ubuntu20:
|
||||
command = 'apt install opendkim-tools -y'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
command = 'mkdir -p /etc/opendkim/keys/'
|
||||
ProcessUtilities.executioner(command)
|
||||
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||
'%s [installOpenDKIM][404]' % (str(msg)), 10)
|
||||
return 0
|
||||
|
||||
return 1
|
||||
|
||||
def configureOpenDKIM(self):
|
||||
try:
|
||||
|
||||
@@ -1440,6 +1473,7 @@ milter_default_action = accept
|
||||
return 1
|
||||
|
||||
except BaseException as msg:
|
||||
logging.CyberCPLogFileWriter.writeToFile(f'Error in configureOpenDKIM {str(msg)}')
|
||||
return 0
|
||||
|
||||
def fixCyberPanelPermissions(self):
|
||||
@@ -1652,6 +1686,11 @@ milter_default_action = accept
|
||||
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Restoreing OpenDKIM configurations..,70')
|
||||
|
||||
if self.installOpenDKIMNew() == 0:
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||
'Install OpenDKIM failed. [404].')
|
||||
return 0
|
||||
|
||||
if self.configureOpenDKIM() == 0:
|
||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'configureOpenDKIM failed. [404].')
|
||||
return 0
|
||||
|
||||
Reference in New Issue
Block a user