Update mailserverManager.py

Fix syntax and wrong method called from this file.
This commit is contained in:
WhatTheServer
2021-04-16 22:44:13 -04:00
committed by GitHub
parent 53ca15f833
commit 1a448fe190

View File

@@ -920,15 +920,16 @@ class MailServerManager(multi.Thread):
import socket import socket
# We are going to leverage postconfig -e to edit the settings for hostname # We are going to leverage postconfig -e to edit the settings for hostname
command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn()) command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn()))
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) ProcessUtilities.executioner(command)
command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn()) command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn()))
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) ProcessUtilities.executioner(command)
# We are explicitly going to use sed to set the hostname default from "myhostname = server.example.com" to the fqdn from socket if the default is still found # We are explicitly going to use sed to set the hostname default from "myhostname = server.example.com"
# to the fqdn from socket if the default is still found
postfix_main = '/etc/postfix/main.cf' postfix_main = '/etc/postfix/main.cf'
command = "sed -i 's|server.example.com|%s|g' %s" % (str(socket.getfqdn(), postfix_main) command = "sed -i 's|server.example.com|%s|g' %s" % (str(socket.getfqdn()), postfix_main)
preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) ProcessUtilities.executioner(command)
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Re-installing Dovecot..,15') logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Re-installing Dovecot..,15')