mirror of
https://github.com/usmannasir/cyberpanel.git
synced 2025-11-06 21:35:55 +01:00
bug fix: email debugger
This commit is contained in:
@@ -815,39 +815,6 @@ $cfg['Servers'][$i]['LogoutURL'] = 'phpmyadminsignin.php?logout';
|
|||||||
|
|
||||||
preFlightsChecks.call(command, self.distro, command, command, 1, 1, os.EX_OSERR)
|
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:
|
except BaseException as msg:
|
||||||
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [install_postfix_dovecot]")
|
logging.InstallLog.writeToFile('[ERROR] ' + str(msg) + " [install_postfix_dovecot]")
|
||||||
return 0
|
return 0
|
||||||
|
|||||||
@@ -22,7 +22,6 @@ import bcrypt
|
|||||||
import getpass
|
import getpass
|
||||||
import smtplib
|
import smtplib
|
||||||
import threading as multi
|
import threading as multi
|
||||||
import socket
|
|
||||||
|
|
||||||
try:
|
try:
|
||||||
from mailServer.models import Domains, EUsers
|
from mailServer.models import Domains, EUsers
|
||||||
@@ -757,6 +756,7 @@ class MailServerManagerUtils(multi.Thread):
|
|||||||
postFixData = ProcessUtilities.outputExecutioner('cat %s' % (postfixPath))
|
postFixData = ProcessUtilities.outputExecutioner('cat %s' % (postfixPath))
|
||||||
|
|
||||||
if postFixData.find('myhostname = server.example.com') > -1:
|
if postFixData.find('myhostname = server.example.com') > -1:
|
||||||
|
self.MailSSL = 0
|
||||||
return 0
|
return 0
|
||||||
else:
|
else:
|
||||||
try:
|
try:
|
||||||
@@ -768,6 +768,7 @@ class MailServerManagerUtils(multi.Thread):
|
|||||||
self.mailHostName = items.split('=')[1].strip(' ')
|
self.mailHostName = items.split('=')[1].strip(' ')
|
||||||
self.MailSSL = 1
|
self.MailSSL = 1
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
self.MailSSL = 0
|
||||||
logging.CyberCPLogFileWriter.writeToFile('%s. [checkIfMailServerSSLIssued:864]' % (str(msg)))
|
logging.CyberCPLogFileWriter.writeToFile('%s. [checkIfMailServerSSLIssued:864]' % (str(msg)))
|
||||||
|
|
||||||
ipFile = "/etc/cyberpanel/machineIP"
|
ipFile = "/etc/cyberpanel/machineIP"
|
||||||
@@ -825,6 +826,7 @@ class MailServerManagerUtils(multi.Thread):
|
|||||||
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
|
command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
else:
|
else:
|
||||||
|
import socket
|
||||||
command = 'apt-get install -y debconf-utils'
|
command = 'apt-get install -y debconf-utils'
|
||||||
ProcessUtilities.executioner(command)
|
ProcessUtilities.executioner(command)
|
||||||
file_name = 'pf.unattend.text'
|
file_name = 'pf.unattend.text'
|
||||||
@@ -1494,7 +1496,7 @@ class MailServerManagerUtils(multi.Thread):
|
|||||||
return 0
|
return 0
|
||||||
|
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
'Restoreing OpenDKIM configurations..,70')
|
'Restoring OpenDKIM configurations..,70')
|
||||||
|
|
||||||
if self.configureOpenDKIM() == 0:
|
if self.configureOpenDKIM() == 0:
|
||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
@@ -1526,9 +1528,8 @@ class MailServerManagerUtils(multi.Thread):
|
|||||||
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Completed [200].')
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'], 'Completed [200].')
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
final_dic = {'installOpenDKIM': 0, 'error_message': str(msg)}
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
final_json = json.dumps(final_dic)
|
'Failed. Error %s [404].' % str(msg))
|
||||||
return HttpResponse(final_json)
|
|
||||||
|
|
||||||
def configureOpenDKIM(self):
|
def configureOpenDKIM(self):
|
||||||
try:
|
try:
|
||||||
@@ -1590,6 +1591,8 @@ milter_default_action = accept
|
|||||||
return 1
|
return 1
|
||||||
|
|
||||||
except BaseException as msg:
|
except BaseException as msg:
|
||||||
|
logging.CyberCPLogFileWriter.statusWriter(self.extraArgs['tempStatusPath'],
|
||||||
|
'configureOpenDKIM failed. Error %s [404].' % str(msg))
|
||||||
return 0
|
return 0
|
||||||
|
|
||||||
def debugEmailForSite(self, websiteName):
|
def debugEmailForSite(self, websiteName):
|
||||||
|
|||||||
Reference in New Issue
Block a user