diff --git a/install/install.py b/install/install.py index 55d88804f..8f24f563f 100755 --- a/install/install.py +++ b/install/install.py @@ -1276,6 +1276,11 @@ enabled=1""" try: if self.distro == centos: + + command = 'yum -y install http://cyberpanel.sh/gf-release-latest.gf.el7.noarch.rpm' + subprocess.call(shlex.split(command)) + + command = 'yum remove postfix -y' else: command = 'apt-get -y remove postfix' @@ -1286,7 +1291,7 @@ enabled=1""" count = 0 while (1): if self.distro == centos: - command = 'yum install -y postfix' + command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre' else: command = 'apt-get -y debconf-utils' subprocess.call(shlex.split(command)) diff --git a/plogical/processUtilities.py b/plogical/processUtilities.py index ac7085653..8216a6307 100755 --- a/plogical/processUtilities.py +++ b/plogical/processUtilities.py @@ -5,7 +5,6 @@ import os import socket import threading as multi import time -from pipes import quote class ProcessUtilities(multi.Thread): litespeedProcess = "litespeed" @@ -198,8 +197,6 @@ class ProcessUtilities(multi.Thread): command = command.replace('sudo', '') sock.sendall(command) - logging.writeToFile(command) - data = "" while (1): diff --git a/plogical/upgrade.py b/plogical/upgrade.py index dd3ba377f..cda86c5c7 100755 --- a/plogical/upgrade.py +++ b/plogical/upgrade.py @@ -1595,6 +1595,71 @@ enabled=1""" command = "systemctl restart dovecot" Upgrade.executioner(command, 0) + + + + ### Postfix Upgrade + + try: + shutil.copy('/etc/postfix/master.cf', '/etc/master.cf') + except: + pass + + try: + shutil.copy('/etc/postfix/main.cf', '/etc/main.cf') + except: + pass + + gf = '/etc/yum.repos.d/gf.repo' + + gfContent = """[gf] +name=Ghettoforge packages that won't overwrite core distro packages. +mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/$basearch/mirrorlist +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7 +failovermethod=priority + +[gf-plus] +name=Ghettoforge packages that will overwrite core distro packages. +mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/$basearch/mirrorlist +# Please read http://ghettoforge.org/index.php/Usage *before* enabling this repository! +enabled=1 +gpgcheck=1 +gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7 +failovermethod=priority +""" + writeToFile = open(gf, 'w') + writeToFile.write(gfContent) + writeToFile.close() + + command = 'yum remove postfix -y' + Upgrade.executioner(command, 0) + + command = 'rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm' + Upgrade.executioner(command, 0) + + command = 'yum clean all' + Upgrade.executioner(command, 0) + + command = 'yum makecache fast' + Upgrade.executioner(command, 0) + + command = 'yum install -y postfix3 postfix3-mysql' + Upgrade.executioner(command, 0) + + try: + shutil.move('/etc/master.cf', '/etc/postfix/master.cf') + except: + pass + try: + shutil.move('/etc/main.cf', '/etc/postfix/main.cf') + except: + pass + + command = 'systemctl restart postfix' + Upgrade.executioner(command, 0) + else: command = 'curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import' subprocess.call(command, shell=True) diff --git a/postfixSenderPolicy/startServer.py b/postfixSenderPolicy/startServer.py index 7a9ea5fb0..ab68fb6ca 100755 --- a/postfixSenderPolicy/startServer.py +++ b/postfixSenderPolicy/startServer.py @@ -66,7 +66,6 @@ class SetupConn: except BaseException, msg: logging.writeToFile(str(msg) + ' [SetupConn.start_listening]') - def __del__(self): self.sock.close() logging.writeToFile('Closing open connections!')