Browse Source

Fixed Amvis ViMbAdmin password issue, Fixed RAM based installation of Mail scanner

bugfixes
gau1991 10 years ago
parent
commit
93aca8ca10
  1. 19
      bin/easyengine
  2. 9
      src/modules/stack/install/mail/ee_mod_setup_mailscaner.sh
  3. 6
      src/vendor/ee_ven_setup_vimbadmin.sh

19
bin/easyengine

@ -45,6 +45,8 @@ elif [ "$EE_FIRST" = "info" ];then
elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then
# EasyEngine install
if [ "$EE_SECOND" = "install" ]; then
# Detect RAM of system and initialize the variables.
ee_lib_ram
if [ "$EE_THIRD" = "nginx" ] || [ "$EE_THIRD" = "php" ] || [ "$EE_THIRD" = "mysql" ] || [ "$EE_THIRD" = "postfix" ] || [ "$EE_THIRD" = "adminer" ] || [ "$EE_THIRD" = "phpmyadmin" ] || [ "$EE_THIRD" = "wpcli" ] || [ "$EE_THIRD" = "utils" ]; then
if [ "$EE_THIRD" = "nginx" ] || [ "$EE_THIRD" = "php" ]; then
# Setup NGINX/PHP repository
@ -154,8 +156,6 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then
# Install Dovecot
ee_mod_install_dovecot
# Install mail scanner packages
ee_mod_install_mailscaner
# Install ViMbAdmin
ee_ven_install_vimbadmin
@ -169,9 +169,6 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then
# Configure Dovecot
ee_mod_setup_dovecot
# Setup Amavis
ee_mod_setup_mailscaner
# Setup ViMbAdmin
ee_ven_setup_vimbadmin
@ -180,7 +177,17 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then
# Setup Sieve Rules
ee_mod_setup_sieve
if [ "$EE_SETUP_MAILSCANNER" != "no" ]; then
# Install mail scanner packages
ee_mod_install_mailscaner
# Setup Amavis
ee_mod_setup_mailscaner
else
ee_lib_echo "Found RAM less than 512MB, not installing Mail Scanner packages"
fi
ee_lib_service nginx postfix dovecot amavis restart
ee_lib_git /etc/nginx /etc/postfix /etc/dovecot /etc/amavis "Initialize Git"

9
src/modules/stack/install/mail/ee_mod_setup_mailscaner.sh

@ -25,6 +25,15 @@ function ee_mod_setup_mailscaner()
|| ee_lib_error "Unable to setup Amavis, exit status = " $?
cat /usr/share/easyengine/mail/amavis-master.cf >> /etc/postfix/master.cf
# Grep ViMbAdmin host and Password from Postfix Configuration
ee_vimbadmin_host=$(grep password /etc/postfix/mysql/virtual_alias_maps.cf | awk '{ print $3 }')
ee_vimbadmin_password=$(grep hosts /etc/postfix/mysql/virtual_alias_maps.cf | awk '{ print $3 }')
# Changing hosts and password of ViMbAdmin database in Amavis configuration
sed -i "s/127.0.0.1/$ee_vimbadmin_host/" /etc/amavis/conf.d/50-user &&
sed -i "s/password/$ee_vimbadmin_password/" /etc/amavis/conf.d/50-user \
|| ee_lib_error "Unable to setup ViMbAdmin database details in Amavis configuration, exit status = " $?
# Configure ClamAv and Amavis to each other files
adduser clamav amavis &>> $EE_COMMAND_LOG
adduser amavis clamav &>> $EE_COMMAND_LOG

6
src/vendor/ee_ven_setup_vimbadmin.sh

@ -36,6 +36,7 @@ function ee_ven_setup_vimbadmin()
|| ee_lib_error "Unable to setup ViMbAdmin configuration file, exit status = " $?
# Changing hosts and password of ViMbAdmin database in postfix configuration
# Note: As Amavis is optional, Amavis ViMbAdmin settings are present is ee_mod_setup_mailscaner function
sed -i "s/password = password/password = $ee_random/" /etc/postfix/mysql/virtual_alias_maps.cf &&
sed -i "s/hosts = 127.0.0.1/hosts = $ee_vimbadmin_host/" /etc/postfix/mysql/virtual_alias_maps.cf \
|| ee_lib_error "Unable to setup ViMbAdmin database details in virtual_alias_maps.cf file, exit status = " $?
@ -52,11 +53,6 @@ function ee_ven_setup_vimbadmin()
sed -i "s/hosts=localhost/hosts=$ee_vimbadmin_host/" /etc/dovecot/dovecot-sql.conf.ext \
|| ee_lib_error "Unable to setup ViMbAdmin database details in dovecot-sql.conf.ext file, exit status = " $?
# Changing hosts and password of ViMbAdmin database in Amavis configuration
sed -i "s/127.0.0.1/$ee_vimbadmin_host/" /etc/amavis/conf.d/50-user &&
sed -i "s/password/$ee_random/" /etc/amavis/conf.d/50-user \
|| ee_lib_error "Unable to setup ViMbAdmin database details in 50-user file, exit status = " $?
# Copying HTACCESS
cp -av /var/www/22222/htdocs/vimbadmin/public/.htaccess.dist /var/www/22222/htdocs/vimbadmin/public/.htaccess &>> $EE_COMMAND_LOG

Loading…
Cancel
Save