Bug fix to Email Policy Server.

This commit is contained in:
usmannasir
2018-10-13 18:31:47 +05:00
parent 4bb20ceade
commit 5303800112
3 changed files with 28 additions and 2 deletions

View File

@@ -1054,10 +1054,12 @@ class preFlightsChecks:
def install_postfix_davecot(self):
try:
count = 0
command = 'yum remove postfix -y'
subprocess.call(shlex.split(command))
count = 0
while(1):
command = 'yum -y --enablerepo=centosplus install postfix'
command = 'yum install -y http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64//postfix3-3.2.4-1.gf.el7.x86_64.rpm'
cmd = shlex.split(command)
@@ -1076,6 +1078,27 @@ class preFlightsChecks:
count = 0
while (1):
command = 'yum install -y http://mirror.ghettoforge.org/distributions/gf/el/7/plus/x86_64//postfix3-mysql-3.2.4-1.gf.el7.x86_64.rpm'
cmd = shlex.split(command)
res = subprocess.call(cmd)
if res == 1:
count = count + 1
preFlightsChecks.stdOut("Unable to install Postfix, trying again, try number: " + str(count))
if count == 3:
logging.InstallLog.writeToFile(
"Unable to install Postfix, you will not be able to send mails and rest should work fine! [install_postfix_davecot]")
break
else:
logging.InstallLog.writeToFile("Postfix successfully installed!")
preFlightsChecks.stdOut("Postfix successfully installed!")
break
count = 0
while(1):
command = 'yum -y install dovecot dovecot-mysql'

Binary file not shown.

View File

@@ -537,6 +537,7 @@ milter_default_action = accept
writeToFile = open(postfixPath, 'a')
writeToFile.writelines('smtpd_data_restrictions = check_policy_service unix:/var/log/policyServerSocket\n')
writeToFile.writelines('smtpd_policy_service_default_action = DUNNO\n')
writeToFile.close()
command = 'systemctl restart postfix'
@@ -549,6 +550,8 @@ milter_default_action = accept
for items in data:
if items.find('check_policy_service unix:/var/log/policyServerSocket') > -1:
continue
elif items.find('smtpd_policy_service_default_action = DUNNO') > -1:
continue
else:
writeToFile.writelines(items)