Skip to content

Commit

Permalink
bug fix: mail debugger on al9
Browse files Browse the repository at this point in the history
  • Loading branch information
usmannasir committed Sep 19, 2024
1 parent 2df62ef commit c6285c3
Showing 1 changed file with 37 additions and 2 deletions.
39 changes: 37 additions & 2 deletions plogical/mailUtilities.py
Original file line number Diff line number Diff line change
Expand Up @@ -1709,6 +1709,32 @@ def RunServerLevelEmailChecks(self):
final_json = json.dumps(final_dic)
return HttpResponse(final_json)


def FetchCloudLinuxAlmaVersionVersion(self):
if os.path.exists('/etc/os-release'):
data = open('/etc/os-release', 'r').read()
if (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (
data.find('8.9') > -1 or data.find('Anatoly Levchenko') > -1 or data.find('VERSION="8.') > -1):
return 'cl-89'
elif (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (
data.find('8.8') > -1 or data.find('Anatoly Filipchenko') > -1):
return 'cl-88'
elif (data.find('CloudLinux') > -1 or data.find('cloudlinux') > -1) and (
data.find('9.4') > -1 or data.find('VERSION="9.') > -1):
return 'cl-88'
elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (
data.find('8.9') > -1 or data.find('Midnight Oncilla') > -1 or data.find('VERSION="8.') > -1):
return 'al-88'
elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (
data.find('8.7') > -1 or data.find('Stone Smilodon') > -1):
return 'al-87'
elif (data.find('AlmaLinux') > -1 or data.find('almalinux') > -1) and (
data.find('9.4') > -1 or data.find('9.3') > -1 or data.find('Shamrock Pampas') > -1 or data.find(
'Seafoam Ocelot') > -1 or data.find('VERSION="9.') > -1):
return 'al-93'
else:
return -1

def install_postfix_dovecot(self):
try:

Expand Down Expand Up @@ -1752,8 +1778,17 @@ def install_postfix_dovecot(self):
command = 'yum install --enablerepo=gf-plus -y postfix3 postfix3-ldap postfix3-mysql postfix3-pcre'
elif ProcessUtilities.decideDistro() == ProcessUtilities.cent8:

command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm'
ProcessUtilities.executioner(command)
clAPVersion = self.FetchCloudLinuxAlmaVersionVersion()
type = clAPVersion.split('-')[0]
version = int(clAPVersion.split('-')[1])

if type == 'al' and version >= 90:
command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el9.noarch.rpm'
ProcessUtilities.executioner(command)

else:
command = 'dnf --nogpg install -y https://mirror.ghettoforge.org/distributions/gf/gf-release-latest.gf.el8.noarch.rpm'
ProcessUtilities.executioner(command)

command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
else:
Expand Down

0 comments on commit c6285c3

Please sign in to comment.