diff --git a/plogical/httpProc.py b/plogical/httpProc.py index 3d5548dfd..82a6f3de6 100755 --- a/plogical/httpProc.py +++ b/plogical/httpProc.py @@ -31,10 +31,6 @@ class httpProc: templateName = 'baseTemplate/error.html' return render(self.request, templateName, {'error_message': 'You are not authorized to access %s' % (self.function)}) - - - - ### if self.data == None: diff --git a/plogical/mailUtilities.py b/plogical/mailUtilities.py index 2ac72b994..bf801e7c8 100755 --- a/plogical/mailUtilities.py +++ b/plogical/mailUtilities.py @@ -1515,15 +1515,18 @@ LogFile /var/log/clamav/clamav.log @staticmethod def FetchPostfixHostname(): - PostfixPath = '/etc/postfix/main.cf' - if os.path.exists(PostfixPath): - PostFixConf = open(PostfixPath, 'r').readlines() + try: + PostfixPath = '/etc/postfix/main.cf' + if os.path.exists(PostfixPath): + PostFixConf = open(PostfixPath, 'r').readlines() - for line in PostFixConf: - if line.find('myhostname') > -1: - hostname = line.split('=')[1].strip(' ').rstrip('\n') - return hostname - else: + for line in PostFixConf: + if line.find('myhostname') > -1: + hostname = line.split('=')[1].strip(' ').rstrip('\n') + return hostname + else: + return 'localhost' + except: return 'localhost' @staticmethod diff --git a/plogical/virtualHostUtilities.py b/plogical/virtualHostUtilities.py index c199ab08a..a5a897db7 100644 --- a/plogical/virtualHostUtilities.py +++ b/plogical/virtualHostUtilities.py @@ -76,6 +76,13 @@ class virtualHostUtilities: except: CurrentHostName = '' + if not skipRDNSCheck: + if not os.path.exists('/home/cyberpanel/postfix'): + message = 'This server does not come with postfix installed. [404]' + print(message) + logging.CyberCPLogFileWriter.statusWriter(tempStatusPath, message) + logging.CyberCPLogFileWriter.writeToFile(message) + ####