Browse Source

Addedd mailscanner install/remove/purge functions

old-stable
gau1991 10 years ago
parent
commit
4131f19ce2
  1. 42
      bin/easyengine
  2. 2
      src/modules/stack/install/mail/ee_mod_install_mailscaner.sh
  3. 4
      src/modules/stack/install/mail/ee_mod_setup_mailscaner.sh
  4. 9
      src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh
  5. 17
      src/modules/stack/remove/mail/ee_mod_remove_mailscaner.sh

42
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

2
src/modules/stack/install/mail/ee_mod_install_mailscan.sh → 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..."

4
src/modules/stack/install/mail/ee_mod_setup_mailscan.sh → 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 && \

9
src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh

@ -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 = " $?
}

17
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 = " $?
}
Loading…
Cancel
Save