Skip to content

Commit 1ef69f9

Browse files
committed
upgrade: postfix3
1 parent 7b7549d commit 1ef69f9

File tree

4 files changed

+71
-5
lines changed

4 files changed

+71
-5
lines changed

install/install.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1276,6 +1276,11 @@ def install_postfix_davecot(self):
12761276

12771277
try:
12781278
if self.distro == centos:
1279+
1280+
command = 'yum -y install http://cyberpanel.sh/gf-release-latest.gf.el7.noarch.rpm'
1281+
subprocess.call(shlex.split(command))
1282+
1283+
12791284
command = 'yum remove postfix -y'
12801285
else:
12811286
command = 'apt-get -y remove postfix'
@@ -1286,7 +1291,7 @@ def install_postfix_davecot(self):
12861291
count = 0
12871292
while (1):
12881293
if self.distro == centos:
1289-
command = 'yum install -y postfix'
1294+
command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
12901295
else:
12911296
command = 'apt-get -y debconf-utils'
12921297
subprocess.call(shlex.split(command))

plogical/processUtilities.py

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import socket
66
import threading as multi
77
import time
8-
from pipes import quote
98

109
class ProcessUtilities(multi.Thread):
1110
litespeedProcess = "litespeed"
@@ -198,8 +197,6 @@ def sendCommand(command, user=None):
198197
command = command.replace('sudo', '')
199198
sock.sendall(command)
200199

201-
logging.writeToFile(command)
202-
203200
data = ""
204201

205202
while (1):

plogical/upgrade.py

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1595,6 +1595,71 @@ def upgradeDovecot():
15951595

15961596
command = "systemctl restart dovecot"
15971597
Upgrade.executioner(command, 0)
1598+
1599+
1600+
1601+
### Postfix Upgrade
1602+
1603+
try:
1604+
shutil.copy('/etc/postfix/master.cf', '/etc/master.cf')
1605+
except:
1606+
pass
1607+
1608+
try:
1609+
shutil.copy('/etc/postfix/main.cf', '/etc/main.cf')
1610+
except:
1611+
pass
1612+
1613+
gf = '/etc/yum.repos.d/gf.repo'
1614+
1615+
gfContent = """[gf]
1616+
name=Ghettoforge packages that won't overwrite core distro packages.
1617+
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/gf/$basearch/mirrorlist
1618+
enabled=1
1619+
gpgcheck=1
1620+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
1621+
failovermethod=priority
1622+
1623+
[gf-plus]
1624+
name=Ghettoforge packages that will overwrite core distro packages.
1625+
mirrorlist=http://mirrorlist.ghettoforge.org/el/7/plus/$basearch/mirrorlist
1626+
# Please read http://ghettoforge.org/index.php/Usage *before* enabling this repository!
1627+
enabled=1
1628+
gpgcheck=1
1629+
gpgkey=file:///etc/pki/rpm-gpg/RPM-GPG-KEY-gf.el7
1630+
failovermethod=priority
1631+
"""
1632+
writeToFile = open(gf, 'w')
1633+
writeToFile.write(gfContent)
1634+
writeToFile.close()
1635+
1636+
command = 'yum remove postfix -y'
1637+
Upgrade.executioner(command, 0)
1638+
1639+
command = 'rpm -Uvh http://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el7.noarch.rpm'
1640+
Upgrade.executioner(command, 0)
1641+
1642+
command = 'yum clean all'
1643+
Upgrade.executioner(command, 0)
1644+
1645+
command = 'yum makecache fast'
1646+
Upgrade.executioner(command, 0)
1647+
1648+
command = 'yum install -y postfix3 postfix3-mysql'
1649+
Upgrade.executioner(command, 0)
1650+
1651+
try:
1652+
shutil.move('/etc/master.cf', '/etc/postfix/master.cf')
1653+
except:
1654+
pass
1655+
try:
1656+
shutil.move('/etc/main.cf', '/etc/postfix/main.cf')
1657+
except:
1658+
pass
1659+
1660+
command = 'systemctl restart postfix'
1661+
Upgrade.executioner(command, 0)
1662+
15981663
else:
15991664
command = 'curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import'
16001665
subprocess.call(command, shell=True)

postfixSenderPolicy/startServer.py

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,6 @@ def start_listening(self):
6666
except BaseException, msg:
6767
logging.writeToFile(str(msg) + ' [SetupConn.start_listening]')
6868

69-
7069
def __del__(self):
7170
self.sock.close()
7271
logging.writeToFile('Closing open connections!')

0 commit comments

Comments
 (0)