From 1a448fe19063f8711422f45874360953643d6ec7 Mon Sep 17 00:00:00 2001 From: WhatTheServer Date: Fri, 16 Apr 2021 22:44:13 -0400 Subject: [PATCH] Update mailserverManager.py Fix syntax and wrong method called from this file. --- mailServer/mailserverManager.py | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/mailServer/mailserverManager.py b/mailServer/mailserverManager.py index b8538e39d..927a8f43d 100755 --- a/mailServer/mailserverManager.py +++ b/mailServer/mailserverManager.py @@ -920,15 +920,16 @@ class MailServerManager(multi.Thread): import socket # We are going to leverage postconfig -e to edit the settings for hostname - command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn()) - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn()) - preFlightsChecks.call(command, self.distro, command, command, 1, 0, os.EX_OSERR) - - # 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 + command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn())) + ProcessUtilities.executioner(command) + command = '"postconf -e "myhostname = %s"' % (str(socket.getfqdn())) + 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 postfix_main = '/etc/postfix/main.cf' - 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) + command = "sed -i 's|server.example.com|%s|g' %s" % (str(socket.getfqdn()), postfix_main) + ProcessUtilities.executioner(command) logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Re-installing Dovecot..,15')