Browse Source

Fixed Postfix not connecting to local MySQL

old-stable
gau1991 10 years ago
parent
commit
26829efd37
  1. 18
      src/vendor/ee_ven_setup_vimbadmin.sh

18
src/vendor/ee_ven_setup_vimbadmin.sh

@ -2,6 +2,12 @@
function ee_ven_setup_vimbadmin() function ee_ven_setup_vimbadmin()
{ {
if [ $EE_MYSQL_HOST = "localhost" ];then
ee_vimbadmin_host="127.0.0.1"
else
ee_vimbadmin_host=$EE_MYSQL_HOST
fi
ee_lib_echo "configuring ViMbAdmin, please wait..." ee_lib_echo "configuring ViMbAdmin, please wait..."
# Random characters # Random characters
@ -25,29 +31,29 @@ function ee_ven_setup_vimbadmin()
sed -i "s'/srv/vmail/%d/%u'/var/vmail/'" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && sed -i "s'/srv/vmail/%d/%u'/var/vmail/'" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini &&
sed -i "s/pdo_mysql/mysqli/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && sed -i "s/pdo_mysql/mysqli/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini &&
sed -i "s/'xxx'/'$ee_random'/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && sed -i "s/'xxx'/'$ee_random'/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini &&
sed -i "s/resources.doctrine2.connection.options.host = 'localhost'/resources.doctrine2.connection.options.host = '$EE_MYSQL_HOST'/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && sed -i "s/resources.doctrine2.connection.options.host = 'localhost'/resources.doctrine2.connection.options.host = '$ee_vimbadmin_host'/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini &&
sed -i "s/defaults.mailbox.password_scheme = \"md5.salted\"/defaults.mailbox.password_scheme = \"md5\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini \ sed -i "s/defaults.mailbox.password_scheme = \"md5.salted\"/defaults.mailbox.password_scheme = \"md5\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini \
|| ee_lib_error "Unable to setup ViMbAdmin configuration file, exit status = " $? || ee_lib_error "Unable to setup ViMbAdmin configuration file, exit status = " $?
# Changing hosts and password of ViMbAdmin database in postfix configuration # Changing hosts and password of ViMbAdmin database in postfix configuration
sed -i "s/password = password/password = $ee_random/" /etc/postfix/mysql/virtual_alias_maps.cf && 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_MYSQL_HOST/" /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 = " $? || ee_lib_error "Unable to setup ViMbAdmin database details in virtual_alias_maps.cf file, exit status = " $?
sed -i "s/password = password/password = $ee_random/" /etc/postfix/mysql/virtual_domains_maps.cf && sed -i "s/password = password/password = $ee_random/" /etc/postfix/mysql/virtual_domains_maps.cf &&
sed -i "s/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST/" /etc/postfix/mysql/virtual_domains_maps.cf \ sed -i "s/hosts = 127.0.0.1/hosts = $ee_vimbadmin_host/" /etc/postfix/mysql/virtual_domains_maps.cf \
|| ee_lib_error "Unable to setup ViMbAdmin database details in virtual_domains_maps.cf file, exit status = " $? || ee_lib_error "Unable to setup ViMbAdmin database details in virtual_domains_maps.cf file, exit status = " $?
sed -i "s/password = password/password = $ee_random/" /etc/postfix/mysql/virtual_mailbox_maps.cf && sed -i "s/password = password/password = $ee_random/" /etc/postfix/mysql/virtual_mailbox_maps.cf &&
sed -i "s/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST/" /etc/postfix/mysql/virtual_mailbox_maps.cf \ sed -i "s/hosts = 127.0.0.1/hosts = $ee_vimbadmin_host/" /etc/postfix/mysql/virtual_mailbox_maps.cf \
|| ee_lib_error "Unable to setup ViMbAdmin database details in virtual_mailbox_maps.cf file, exit status = " $? || ee_lib_error "Unable to setup ViMbAdmin database details in virtual_mailbox_maps.cf file, exit status = " $?
sed -i "s/password=password/password=$ee_random/" /etc/dovecot/dovecot-sql.conf.ext && sed -i "s/password=password/password=$ee_random/" /etc/dovecot/dovecot-sql.conf.ext &&
sed -i "s/hosts=localhost/hosts=$EE_MYSQL_HOST/" /etc/dovecot/dovecot-sql.conf.ext \ 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 = " $? || 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 # Changing hosts and password of ViMbAdmin database in Amavis configuration
sed -i "s/127.0.0.1/$EE_MYSQL_HOST/" /etc/amavis/conf.d/50-user && 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 \ 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 = " $? || ee_lib_error "Unable to setup ViMbAdmin database details in 50-user file, exit status = " $?

Loading…
Cancel
Save