From 6ef92d07b38af74dd4cfbc8428adb58d17dcec8a Mon Sep 17 00:00:00 2001 From: Edi Septriyanto Date: Wed, 4 May 2022 09:31:49 +0700 Subject: [PATCH] Fix remove sendmail --- scripts/install_mailer.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/install_mailer.sh b/scripts/install_mailer.sh index fd13034..244aa32 100755 --- a/scripts/install_mailer.sh +++ b/scripts/install_mailer.sh @@ -39,6 +39,13 @@ function install_postfix() { if [[ ${DO_INSTALL_POSTFIX} == y* || ${DO_INSTALL_POSTFIX} == Y* ]]; then echo "Installing Postfix Mail-Transfer Agent..." + if [[ -n $(command -v sendmail) ]]; then + echo "Remove existing sendmail install..." + run service sendmail stop && \ + run update-rc.d -f sendmail remove && \ + run apt-get remove -qq -y sendmail + fi + run apt-get install -qq -y mailutils postfix # Configure Postfix.