bug fix: email debugger

This commit is contained in:
Usman Nasir
2021-04-24 04:57:15 +05:00
parent aa697332c5
commit 4db90f0b98
2 changed files with 8 additions and 38 deletions

View File

@@ -815,39 +815,6 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
# if self.distro != centos:
# command = 'curl https://repo.dovecot.org/DOVECOT-REPO-GPG | gpg --import'
# subprocess.call(command, shell=True)
#
# command = 'gpg --export ED409DA1 > /etc/apt/trusted.gpg.d/dovecot.gpg'
# subprocess.call(command, shell=True)
#
# debPath = '/etc/apt/sources.list.d/dovecot.list'
# writeToFile = open(debPath, 'w')
# writeToFile.write('deb https://repo.dovecot.org/ce-2.3-latest/ubuntu/bionic bionic main\n')
# writeToFile.close()
#
# try:
# command = 'apt update -y'
# subprocess.call(command, shell=True)
# except:
# pass
#
# try:
# 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'
# subprocess.call(command, shell=True)
#
# command = 'dpkg --configure -a'
# subprocess.call(command, shell=True)
#
# command = 'apt --fix-broken install -y'
# subprocess.call(command, shell=True)
#
# 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'
# subprocess.call(command, shell=True)
# except:
# pass
except BaseException as msg:
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [install_postfix_dovecot]")
return 0

View File

@@ -22,7 +22,6 @@ import bcrypt
import getpass
import smtplib
import threading as multi
import socket
try:
from mailServer.models import Domains, EUsers
@@ -757,6 +756,7 @@ class MailServerManagerUtils(multi.Thread):
postFixData = ProcessUtilities.outputExecutioner('cat %s' % (postfixPath))
if postFixData.find('myhostname = server.example.com') > -1:
self.MailSSL = 0
return 0
else:
try:
@@ -768,6 +768,7 @@ class MailServerManagerUtils(multi.Thread):
self.mailHostName = items.split('=')[1].strip(' ')
self.MailSSL = 1
except BaseException as msg:
self.MailSSL = 0
logging.CyberCPLogFileWriter.writeToFile('%s. [checkIfMailServerSSLIssued:864]' % (str(msg)))
ipFile = "/etc/cyberpanel/machineIP"
@@ -825,6 +826,7 @@ class MailServerManagerUtils(multi.Thread):
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
ProcessUtilities.executioner(command)
else:
import socket
command = 'apt-get install -y debconf-utils'
ProcessUtilities.executioner(command)
file_name = 'pf.unattend.text'
@@ -1494,7 +1496,7 @@ class MailServerManagerUtils(multi.Thread):
return 0
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
'Restoreing OpenDKIM configurations..,70')
'Restoring OpenDKIM configurations..,70')
if self.configureOpenDKIM() == 0:
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
@@ -1526,9 +1528,8 @@ class MailServerManagerUtils(multi.Thread):
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Completed [200].')
except BaseException as msg:
final_dic = {'installOpenDKIM': 0, 'error_message': str(msg)}
final_json = json.dumps(final_dic)
return HttpResponse(final_json)
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
'Failed. Error %s [404].' % str(msg))
def configureOpenDKIM(self):
try:
@@ -1590,6 +1591,8 @@ milter_default_action = accept
return 1
except BaseException as msg:
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
'configureOpenDKIM failed. Error %s [404].' % str(msg))
return 0
def debugEmailForSite(self, websiteName):