Skip to content
Permalink
Browse files

upgrade: postfix3

  • Loading branch information...
usmannasir committed Aug 30, 2019
1 parent 7b7549d commit 1ef69f9e361e9b9c4c095f405bbae3419a2e71ae
Showing with 71 additions and 5 deletions.
  1. +6 −1 install/install.py
  2. +0 −3 plogical/processUtilities.py
  3. +65 −0 plogical/upgrade.py
  4. +0 −1 postfixSenderPolicy/startServer.py
@@ -1276,6 +1276,11 @@ def install_postfix_davecot(self):

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 @@ def install_postfix_davecot(self):
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))
@@ -5,7 +5,6 @@
import socket
import threading as multi
import time
from pipes import quote

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

logging.writeToFile(command)

data = ""

while (1):
@@ -1595,6 +1595,71 @@ def upgradeDovecot():

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)
@@ -66,7 +66,6 @@ def start_listening(self):
except BaseException, msg:
logging.writeToFile(str(msg) + ' [SetupConn.start_listening]')


def __del__(self):
self.sock.close()
logging.writeToFile('Closing open connections!')

2 comments on commit 1ef69f9

@hennaboy

This comment has been minimized.

Copy link
Collaborator

hennaboy replied Aug 31, 2019

This works but mail is not arriving in the maildir.

status=sent (delivered to maildir)

But is not found by either webmail or by accessing by external email client.

@usmannasir

This comment has been minimized.

Copy link
Owner Author

usmannasir replied Aug 31, 2019

I can send and receive email, not sure what are you talking about?

Please sign in to comment.
You can’t perform that action at this time.