diff --git a/bin/easyengine b/bin/easyengine index aac8dd6f..6dc1805d 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -155,7 +155,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_mod_install_dovecot # Install mail scanner packages - ee_mod_install_mailscan + ee_mod_install_mailscaner # Install ViMbAdmin ee_ven_install_vimbadmin @@ -170,7 +170,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_mod_setup_dovecot # Setup Amavis - ee_mod_setup_mailscan + ee_mod_setup_mailscaner # Setup ViMbAdmin ee_ven_setup_vimbadmin @@ -190,6 +190,18 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo_escape "Security Salt:\t\t${ee_security_salt}\n" ee_lib_echo "Successfully installed mail server packages" + elif [ "$EE_THIRD" = "mailscanner"]; then + + # Install Mail Scanner + ee_mod_install_mailscaner + + # Setup Mail Scanner + ee_mod_setup_mailscaner + + ee_lib_service nginx postfix dovecot amavis restart + + ee_lib_git /etc/nginx /etc/postfix /etc/dovecot /etc/amavis "Installed Mail Scanner" + ee_lib_echo "Successfully installed mail scanner packages" fi # EasyEngine remove/purge @@ -242,8 +254,8 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Remove Dovecot ee_mod_remove_dovecot - # Remove Amavis - ee_mod_remove_mailscan + # Remove Mail Scanner + ee_mod_remove_mailscaner # Remove ViMbAdmin ee_ven_remove_vimbadmin @@ -254,12 +266,34 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Execute: apt-get autoremove ee_lib_autoremove + # Restart Nginx + ee_lib_service nginx + + ee_lib_git /etc/nginx "Removed Mail Server" + # Display success message if [ "$EE_SECOND" = "remove" ];then ee_lib_echo "Successfully removed mail server packages" elif [ "$EE_SECOND" = "purge" ];then ee_lib_echo "Successfully purged mail server packages" fi + elif [ "$EE_THIRD" = "mailscanner"]; then + # Remove Amavis + ee_mod_remove_mailscaner + + # Execute: apt-get autoremove + ee_lib_autoremove + + ee_lib_service nginx postfix dovecot restart + + ee_lib_git /etc/postfix "Removed mailscanner" + + # Display success message + if [ "$EE_SECOND" = "remove" ];then + ee_lib_echo "Successfully removed Mail Scanner packages" + elif [ "$EE_SECOND" = "purge" ];then + ee_lib_echo "Successfully purged Mail Scanner packages" + fi fi elif [ "$EE_SECOND" = "status" ]; then diff --git a/src/modules/stack/install/mail/ee_mod_install_mailscan.sh b/src/modules/stack/install/mail/ee_mod_install_mailscaner.sh similarity index 90% rename from src/modules/stack/install/mail/ee_mod_install_mailscan.sh rename to src/modules/stack/install/mail/ee_mod_install_mailscaner.sh index 18559f74..4c3c5b7b 100644 --- a/src/modules/stack/install/mail/ee_mod_install_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_install_mailscaner.sh @@ -1,6 +1,6 @@ # Install Amavis package -function ee_mod_install_mailscan() +function ee_mod_install_mailscaner() { # Install Amavis ee_lib_echo "Installing Amavis, SpamAssassin and ClamAV, please wait..." diff --git a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh b/src/modules/stack/install/mail/ee_mod_setup_mailscaner.sh similarity index 97% rename from src/modules/stack/install/mail/ee_mod_setup_mailscan.sh rename to src/modules/stack/install/mail/ee_mod_setup_mailscaner.sh index 8fe08a1f..59c17249 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_mailscaner.sh @@ -1,8 +1,8 @@ # Install mail scanner packages -function ee_mod_setup_mailscan() +function ee_mod_setup_mailscaner() { - # Confiure Amavis + # Configure Amavis ee_lib_echo "Setting up Amavis, please wait..." sed -i "s'#@'@'" /etc/amavis/conf.d/15-content_filter_mode && \ diff --git a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh deleted file mode 100644 index d893959f..00000000 --- a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Remove MailScan package - -function ee_mod_remove_mailscan() -{ - ee_lib_echo "$EE_SECOND Amavis, SpamAssassin and ClamAV package, please wait..." - $EE_APT_GET $EE_SECOND amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch lzop cabextract p7zip rpm unrar-free \ - || ee_lib_error "Unable to $EE_SECOND Amavis, SpamAssassin and ClamAV,, exit status = " $? - -} diff --git a/src/modules/stack/remove/mail/ee_mod_remove_mailscaner.sh b/src/modules/stack/remove/mail/ee_mod_remove_mailscaner.sh new file mode 100644 index 00000000..e26dd16e --- /dev/null +++ b/src/modules/stack/remove/mail/ee_mod_remove_mailscaner.sh @@ -0,0 +1,17 @@ +# Remove MailScan package + +function ee_mod_remove_mailscaner() +{ + + # Remove Amavis configuration from Postfix configuration + sed -i '/content_filter/d' /etc/postfix/main.cf + sed -i '/content_filter/d' /etc/postfix/master.cf + sed -i '/receive_override_options/d' /etc/postfix/master.cf + sed -i '/smtp-amavis/,$d' /etc/postfix/master.cf + + #Remove/Purge mailscan packages + ee_lib_echo "$EE_SECOND Amavis, SpamAssassin and ClamAV package, please wait..." + $EE_APT_GET $EE_SECOND amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch lzop cabextract p7zip rpm unrar-free \ + || ee_lib_error "Unable to $EE_SECOND Amavis, SpamAssassin and ClamAV,, exit status = " $? + +}