2222import getpass
2323import smtplib
2424import threading as multi
25- import socket
2625
2726try :
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