Skip to content

Commit 4db90f0

Browse files
committed
bug fix: email debugger
1 parent aa69733 commit 4db90f0

File tree

2 files changed

+8
-38
lines changed

2 files changed

+8
-38
lines changed

install/install.py

Lines changed: 0 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -815,39 +815,6 @@ def install_postfix_dovecot(self):
815815

816816
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
817817

818-
# if self.distro != centos:
819-
# command = 'curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import'
820-
# subprocess.call(command, shell=True)
821-
#
822-
# command = 'gpg --export ED409DA1 > /etc/apt/trusted.gpg.d/dovecot.gpg'
823-
# subprocess.call(command, shell=True)
824-
#
825-
# debPath = '/etc/apt/sources.list.d/dovecot.list'
826-
# writeToFile = open(debPath, 'w')
827-
# writeToFile.write('deb https://repo.dovecot.org/ce-2.3-latest/ubuntu/bionic bionic main\n')
828-
# writeToFile.close()
829-
#
830-
# try:
831-
# command = 'apt update -y'
832-
# subprocess.call(command, shell=True)
833-
# except:
834-
# pass
835-
#
836-
# try:
837-
# command = 'DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical sudo apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" --only-upgrade install dovecot-mysql -y'
838-
# subprocess.call(command, shell=True)
839-
#
840-
# command = 'dpkg --configure -a'
841-
# subprocess.call(command, shell=True)
842-
#
843-
# command = 'apt --fix-broken install -y'
844-
# subprocess.call(command, shell=True)
845-
#
846-
# command = 'DEBIAN_FRONTEND=noninteractive DEBIAN_PRIORITY=critical sudo apt-get -q -y -o "Dpkg::Options::=--force-confdef" -o "Dpkg::Options::=--force-confold" --only-upgrade install dovecot-mysql -y'
847-
# subprocess.call(command, shell=True)
848-
# except:
849-
# pass
850-
851818
except BaseException as msg:
852819
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [install_postfix_dovecot]")
853820
return 0

plogical/mailUtilities.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,6 @@
2222
import getpass
2323
import smtplib
2424
import threading as multi
25-
import socket
2625

2726
try:
2827
from mailServer.models import Domains, EUsers
@@ -757,6 +756,7 @@ def checkIfMailServerSSLIssued(self):
757756
postFixData = ProcessUtilities.outputExecutioner('cat %s' % (postfixPath))
758757

759758
if postFixData.find('myhostname = server.example.com') > -1:
759+
self.MailSSL = 0
760760
return 0
761761
else:
762762
try:
@@ -768,6 +768,7 @@ def checkIfMailServerSSLIssued(self):
768768
self.mailHostName = items.split('=')[1].strip(' ')
769769
self.MailSSL = 1
770770
except BaseException as msg:
771+
self.MailSSL = 0
771772
logging.CyberCPLogFileWriter.writeToFile('%s. [checkIfMailServerSSLIssued:864]' % (str(msg)))
772773

773774
ipFile = "/etc/cyberpanel/machineIP"
@@ -825,6 +826,7 @@ def install_postfix_dovecot(self):
825826
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
826827
ProcessUtilities.executioner(command)
827828
else:
829+
import socket
828830
command = 'apt-get install -y debconf-utils'
829831
ProcessUtilities.executioner(command)
830832
file_name = 'pf.unattend.text'
@@ -1494,7 +1496,7 @@ def ResetEmailConfigurations(self):
14941496
return 0
14951497

14961498
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
1497-
'Restoreing OpenDKIM configurations..,70')
1499+
'Restoring OpenDKIM configurations..,70')
14981500

14991501
if self.configureOpenDKIM() == 0:
15001502
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
@@ -1526,9 +1528,8 @@ def ResetEmailConfigurations(self):
15261528
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Completed [200].')
15271529

15281530
except BaseException as msg:
1529-
final_dic = {'installOpenDKIM': 0, 'error_message': str(msg)}
1530-
final_json = json.dumps(final_dic)
1531-
return HttpResponse(final_json)
1531+
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
1532+
'Failed. Error %s [404].' % str(msg))
15321533

15331534
def configureOpenDKIM(self):
15341535
try:
@@ -1590,6 +1591,8 @@ def configureOpenDKIM(self):
15901591
return 1
15911592

15921593
except BaseException as msg:
1594+
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
1595+
'configureOpenDKIM failed. Error %s [404].' % str(msg))
15931596
return 0
15941597

15951598
def debugEmailForSite(self, websiteName):

0 commit comments

Comments
 (0)