@@ -818,6 +818,29 @@ def install_postfix_dovecot(self):
818818 command = 'apt-get -y remove postfix'
819819 ProcessUtilities .executioner (command )
820820
821+ ### On Ubuntu 18 find if old dovecot and remove
822+
823+ if ProcessUtilities .decideDistro () == ProcessUtilities .ubuntu :
824+ try :
825+
826+ command = 'apt-get purge dovecot* -y'
827+ os .system (command )
828+
829+ command = 'apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 18A348AEED409DA1'
830+ ProcessUtilities .executioner (command )
831+
832+ writeToFile = open ('/etc/apt/sources.list.d/dovecot.list' , 'a' )
833+ writeToFile .writelines ('deb [arch=amd64] https://repo.dovecot.org/ce-2.3-latest/ubuntu/bionic bionic main\n ' )
834+ writeToFile .close ()
835+
836+ command = 'apt update'
837+ ProcessUtilities .executioner (command )
838+
839+ except :
840+ pass
841+
842+ ##
843+
821844 logging .CyberCPLogFileWriter .statusWriter (self .extraArgs ['tempStatusPath' ], 'Re-installing postfix..,10' )
822845
823846 if ProcessUtilities .decideDistro () == ProcessUtilities .centos :
@@ -834,6 +857,8 @@ def install_postfix_dovecot(self):
834857 command = 'dnf install --enablerepo=gf-plus postfix3 postfix3-mysql -y'
835858 ProcessUtilities .executioner (command )
836859 else :
860+
861+
837862 import socket
838863 command = 'apt-get install -y debconf-utils'
839864 ProcessUtilities .executioner (command )
@@ -856,12 +881,13 @@ def install_postfix_dovecot(self):
856881
857882 if ProcessUtilities .decideDistro () == ProcessUtilities .centos :
858883 command = 'yum --enablerepo=gf-plus -y install dovecot23 dovecot23-mysql'
884+ ProcessUtilities .executioner (command )
859885 elif ProcessUtilities .decideDistro () == ProcessUtilities .cent8 :
860886 command = 'dnf install --enablerepo=gf-plus dovecot23 dovecot23-mysql -y'
887+ ProcessUtilities .executioner (command )
861888 else :
862- command = 'apt-get -y install dovecot-mysql dovecot-imapd dovecot-pop3d'
863-
864- ProcessUtilities .executioner (command )
889+ command = 'DEBIAN_FRONTEND=noninteractive apt-get -y install dovecot-mysql dovecot-imapd dovecot-pop3d'
890+ os .system (command )
865891
866892 logging .CyberCPLogFileWriter .statusWriter (self .extraArgs ['tempStatusPath' ],
867893 'Postfix/dovecot reinstalled.,40' )
0 commit comments