From ae5df8883d6d6d7b3319d924790298c188aa1044 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 22 Jul 2014 18:31:28 +0530 Subject: [PATCH 001/131] Postfix/Dovecot install Done. Postfix Configuration done --- .../install/mail/ee_mod_install_dovecot.sh | 11 ++++++ .../install/mail/ee_mod_setup_dovecot.sh | 7 ++++ .../install/mail/ee_mod_setup_postfix.sh | 35 +++++++++++++++++++ templates/mail/virtual_alias_maps.cf | 5 +++ templates/mail/virtual_domains_maps.cf | 5 +++ templates/mail/virtual_mailbox_maps.cf | 7 ++++ 6 files changed, 70 insertions(+) create mode 100644 src/modules/stack/install/mail/ee_mod_install_dovecot.sh create mode 100644 src/modules/stack/install/mail/ee_mod_setup_dovecot.sh create mode 100644 src/modules/stack/install/mail/ee_mod_setup_postfix.sh create mode 100644 templates/mail/virtual_alias_maps.cf create mode 100644 templates/mail/virtual_domains_maps.cf create mode 100644 templates/mail/virtual_mailbox_maps.cf diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh new file mode 100644 index 00000000..44c2b8c1 --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -0,0 +1,11 @@ +# Install Dovecot package + +function ee_mod_install_dovecot() +{ + # Install Dovecot + ee_lib_echo "Installing Dovecot, please wait..." + debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" + debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" + $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ + || ee_lib_error "Unable to install Dovecot, exit status = " $? +} diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh new file mode 100644 index 00000000..f9d684da --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -0,0 +1,7 @@ +# Setup Postfix + +function ee_mod_setup_dovecot() +{ + groupadd -g 5000 vmail + useradd -g vmail -u 5000 vmail -d /var/vmail -m +} diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh new file mode 100644 index 00000000..107911aa --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -0,0 +1,35 @@ +# Setup Postfix + +function ee_mod_setup_postfix() +{ + #Configure Master.cf + sed -i 's/#submission/submission/' /etc/postfix/master.cf + sed -i 's/#smtps/smtps/' /etc/postfix/master.cf + + #Configure main.cf + #postconf "#smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache" + #postconf "#smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache" + #postconf "#smtpd_tls_cert_file=/etc/ssl/certs/dovecot.pem" + #postconf "#smtpd_use_tls=yes" + #postconf "#smtpd_tls_auth_only = yes" + + #Handle SMTP authentication using Dovecot" + postconf "smtpd_sasl_type = dovecot" + postconf "smtpd_sasl_path = private/auth" + postconf "smtpd_sasl_auth_enable = yes" + + postconf "smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination" + + # other destination domains should be handled using virtual domains + postconf "mydestination = localhost" + + # using Dovecot's LMTP for mail delivery and giving it path to store mail + postconf "virtual_transport = lmtp:unix:private/dovecot-lmtp" + + # virtual mailbox setups + postconf "virtual_uid_maps = static:5000" + postconf "virtual_gid_maps = static:5000" + postconf "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf" + postconf "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf" + #postconf "message_size_limit = 20971520" +} diff --git a/templates/mail/virtual_alias_maps.cf b/templates/mail/virtual_alias_maps.cf new file mode 100644 index 00000000..92d179ef --- /dev/null +++ b/templates/mail/virtual_alias_maps.cf @@ -0,0 +1,5 @@ +user = vimbadmin +password = password +hosts = 127.0.0.1 +dbname = vimbadmin +query = SELECT goto FROM alias WHERE address = '%s' AND active = '1' \ No newline at end of file diff --git a/templates/mail/virtual_domains_maps.cf b/templates/mail/virtual_domains_maps.cf new file mode 100644 index 00000000..0efd5e41 --- /dev/null +++ b/templates/mail/virtual_domains_maps.cf @@ -0,0 +1,5 @@ +user = vimbadmin +password = password +hosts = 127.0.0.1 +dbname = vimbadmin +query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '0' AND active = '1' \ No newline at end of file diff --git a/templates/mail/virtual_mailbox_maps.cf b/templates/mail/virtual_mailbox_maps.cf new file mode 100644 index 00000000..623e1d67 --- /dev/null +++ b/templates/mail/virtual_mailbox_maps.cf @@ -0,0 +1,7 @@ +user = vimbadmin +password = password +hosts = 127.0.0.1 +dbname = vimbadmin +table = mailbox +select_field = maildir +where_field = username \ No newline at end of file From 2491058db2dfce4a2c50165d6e0906719a1694e3 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 23 Jul 2014 13:12:32 +0530 Subject: [PATCH 002/131] Dovecot configuration done --- .../install/mail/ee_mod_setup_dovecot.sh | 30 ++++++++++++++++++- .../install/mail/ee_mod_setup_postfix.sh | 8 +++++ templates/mail/10-master.conf | 26 ++++++++++++++++ templates/mail/dovecot-sql.conf.ext | 15 ++++++++++ templates/mail/virtual_alias_maps.cf | 2 +- templates/mail/virtual_domains_maps.cf | 2 +- templates/mail/virtual_mailbox_maps.cf | 2 +- 7 files changed, 81 insertions(+), 4 deletions(-) create mode 100644 templates/mail/10-master.conf create mode 100644 templates/mail/dovecot-sql.conf.ext diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index f9d684da..fdf4cf3e 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -1,7 +1,35 @@ -# Setup Postfix +# Setup Dovecot function ee_mod_setup_dovecot() { + ee_lib_echo "Configuring Dovecot, please wait..." + # Adding mail user with GID 5000 and UID 5000 groupadd -g 5000 vmail useradd -g vmail -u 5000 vmail -d /var/vmail -m + + # Configuring dovecot.conf + sed -i "s/*.protocol/*.protocol\\nprotocols = imap pop3 lmtp sieve/" /etc/dovecot/dovecot.conf + + # Configuring 10-mail.conf + sed -i "s/mail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u/mail_location = maildir:\/var\/vmail\/%d\/%n/" /etc/dovecot/conf.d/10-mail.conf + + # Configuring 10-auth.conf + sed -i "s/auth_mechanisms = plain/auth_mechanisms = plain login/" /etc/dovecot/conf.d/10-auth.conf + sed -i "s/\!include auth-system.conf.ext/#\!include auth-system.conf.ext/" /etc/dovecot/conf.d/10-auth.conf + sed -i "s/#\!include auth-sql.conf.ext/\!include auth-sql.conf.ext/" /etc/dovecot/conf.d/10-auth.conf + + # Configuring dovecot-sql.conf.ext + cat /usr/share/easyengine/mail/dovecot-sql.conf.ext >> /etc/dovecot/dovecot-sql.conf.ext + + # Configuring auth-sql.conf.ext + sed -i "s/#userdb {/userdb {/" /etc/dovecot/conf.d/auth-sql.conf.ext + sed -i "s/# driver = prefetch/ driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext + + + # Configuring 10-master.conf + cp -av /etc/dovecot/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf.bak + cp -av /usr/share/easyengine/mail/10-master.conf /etc/dovecot/conf.d/10-master.conf + + # Change Dovecot log location + sed -i "s/#log_path = syslog/log_path = \/var\/log\/dovecot.log/" /etc/dovecot/conf.d/10-logging.conf } diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index 107911aa..ef0e5091 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -2,6 +2,7 @@ function ee_mod_setup_postfix() { + ee_lib_echo "Configuring Postfix, please wait..." #Configure Master.cf sed -i 's/#submission/submission/' /etc/postfix/master.cf sed -i 's/#smtps/smtps/' /etc/postfix/master.cf @@ -32,4 +33,11 @@ function ee_mod_setup_postfix() postconf "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf" postconf "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf" #postconf "message_size_limit = 20971520" + + + # Setting up Postfix MySQL configuration + mkdir -p /etc/postfix/mysql + cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf + cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf + cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf } diff --git a/templates/mail/10-master.conf b/templates/mail/10-master.conf new file mode 100644 index 00000000..1c46e384 --- /dev/null +++ b/templates/mail/10-master.conf @@ -0,0 +1,26 @@ +service lmtp { + unix_listener /var/spool/postfix/private/dovecot-lmtp { + mode = 0600 + user = postfix + group = postfix + } +} + +service auth { + unix_listener /var/spool/postfix/private/auth { + mode = 0666 + user = postfix + group = postfix + } + + unix_listener auth-userdb { + mode = 0600 + user = vmail + } + + user = dovecot +} + +service auth-worker { + user = vmail +} diff --git a/templates/mail/dovecot-sql.conf.ext b/templates/mail/dovecot-sql.conf.ext new file mode 100644 index 00000000..03d413fb --- /dev/null +++ b/templates/mail/dovecot-sql.conf.ext @@ -0,0 +1,15 @@ +driver = mysql + +connect = host=localhost user=vimbadmin password=password dbname=vimbadmin +default_pass_scheme = MD5 + +password_query = SELECT username as user, password as password, \ +homedir AS home, maildir AS mail, \ +concat('*:bytes=', quota) as quota_rule, uid, gid \ +FROM mailbox \ +WHERE username = '%Lu' AND active = '1' \ +AND ( access_restriction = 'ALL' OR LOCATE( access_restriction, '%Us' ) > 0 ) + +user_query = SELECT homedir AS home, maildir AS mail, \ +concat('*:bytes=', quota) as quota_rule, uid, gid \ +FROM mailbox WHERE username = '%u' diff --git a/templates/mail/virtual_alias_maps.cf b/templates/mail/virtual_alias_maps.cf index 92d179ef..2b312477 100644 --- a/templates/mail/virtual_alias_maps.cf +++ b/templates/mail/virtual_alias_maps.cf @@ -2,4 +2,4 @@ user = vimbadmin password = password hosts = 127.0.0.1 dbname = vimbadmin -query = SELECT goto FROM alias WHERE address = '%s' AND active = '1' \ No newline at end of file +query = SELECT goto FROM alias WHERE address = '%s' AND active = '1' diff --git a/templates/mail/virtual_domains_maps.cf b/templates/mail/virtual_domains_maps.cf index 0efd5e41..a7c11133 100644 --- a/templates/mail/virtual_domains_maps.cf +++ b/templates/mail/virtual_domains_maps.cf @@ -2,4 +2,4 @@ user = vimbadmin password = password hosts = 127.0.0.1 dbname = vimbadmin -query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '0' AND active = '1' \ No newline at end of file +query = SELECT domain FROM domain WHERE domain = '%s' AND backupmx = '0' AND active = '1' diff --git a/templates/mail/virtual_mailbox_maps.cf b/templates/mail/virtual_mailbox_maps.cf index 623e1d67..e777f79d 100644 --- a/templates/mail/virtual_mailbox_maps.cf +++ b/templates/mail/virtual_mailbox_maps.cf @@ -4,4 +4,4 @@ hosts = 127.0.0.1 dbname = vimbadmin table = mailbox select_field = maildir -where_field = username \ No newline at end of file +where_field = username From 330af0ee272dcb6cc1ea041fa001687663e38695 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Thu, 24 Jul 2014 16:10:40 +0530 Subject: [PATCH 003/131] Remove hardcoded wp-cli version for autocompletion --- src/vendor/ee_ven_install_wpcli.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_install_wpcli.sh b/src/vendor/ee_ven_install_wpcli.sh index b78667b2..0a1f5a07 100644 --- a/src/vendor/ee_ven_install_wpcli.sh +++ b/src/vendor/ee_ven_install_wpcli.sh @@ -12,6 +12,6 @@ function ee_ven_install_wpcli() || ee_lib_error "Unable to set executable permission for wp-cli, exit status = " $? # Download auto completion - wget -qO /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/v0.16.0/utils/wp-completion.bash + wget -qO /etc/bash_completion.d/wp-completion.bash https://raw.githubusercontent.com/wp-cli/wp-cli/v${EE_WP_CLI_VERSION}/utils/wp-completion.bash fi } From c3a835d5296100b17ede23a8be5516f26d658bb4 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 24 Jul 2014 18:32:04 +0530 Subject: [PATCH 004/131] Added Vimbadmin Installation and Configuration --- src/vendor/ee_ven_install_vimbadmin.sh | 23 ++++++++++++++++++++ src/vendor/ee_ven_setup_vimbadmin.sh | 29 ++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 src/vendor/ee_ven_install_vimbadmin.sh create mode 100644 src/vendor/ee_ven_setup_vimbadmin.sh diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh new file mode 100644 index 00000000..b833be11 --- /dev/null +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -0,0 +1,23 @@ +# Install ViMbAdmin + +function ee_mod_install_vimbadmin() +{ + # Install ViMbAdmin + ee_lib_echo "Downloading ViMbAdmin, please wait..." + wget -cqO /var/www/22222/htdocs/vimbadmin.tar.gz https://github.com/opensolutions/ViMbAdmin/archive/3.0.10.tar.gz \ + || ee_lib_error "Unable to download ViMbAdmin, exit status = " $? + + ee_lib_echo "Installing ViMbAdmin, please wait..." + tar -zxf /var/www/22222/htdocs/vimbadmin.tar.gz + mv /var/www/22222/htdocs/ViMbAdmin-3.0.10 /var/www/22222/htdocs/vimbadmin + + # Install Composer + cd /var/www/22222/htdocs/vimbadmin + curl -sS https://getcomposer.org/installer | php \ + || ee_lib_error "Unable to install Composer, exit status = " $? + php composer.phar install --prefer-dist --no-dev \ + || ee_lib_error "Unable to install ViMbAdmin, exit status = " $? + + # Remove unwanted files + rm -rf /var/www/22222/htdocs/vimbadmin.tar.gz /var/www/22222/htdocs/vimbadmin/composer.phar +} diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh new file mode 100644 index 00000000..73845774 --- /dev/null +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -0,0 +1,29 @@ +# Setup ViMbAdmin + +function ee_mod_setup_vimbadmin() +{ + # Random characters + local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) + + # Setting up database for ViMbAdmin + mysql -e "create database \`vimbadmin\`" \ + || ee_lib_error "Unable to create ViMbAdmin database, exit status = " $? + + # Create MySQL User + mysql -e "create user 'vimbadmin'@'$EE_MYSQL_HOST' identified by '$ee_random'" \ + || ee_lib_error "Unable to create ViMbAdmin database user, exit status = " $? + mysql -e "flush privileges" + + # Setup configuration for ViMbAdmin + cp -v /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + + sed -i "s/defaults.mailbox.uid = 2000/defaults.mailbox.uid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + sed -i "s/defaults.mailbox.gid = 2000/defaults.mailbox.gid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + sed -i "s/maildir:\/srv\/vmail\/%d\/%u\/mail:LAYOUT=fs/maildir:\/var\/vmail\/%d\/%u/" /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/'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/defaults.mailbox.password_scheme = \"md5.salted\"/defaults.mailbox.password_scheme = \"md5\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + + From fcc188a46fc774952c56aab593c5e3a411926528 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 11:51:00 +0530 Subject: [PATCH 005/131] Added ViMbAdmin password/host change from postfix configuration --- src/vendor/ee_ven_setup_vimbadmin.sh | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index 73845774..09ed2a97 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -10,8 +10,8 @@ function ee_mod_setup_vimbadmin() || ee_lib_error "Unable to create ViMbAdmin database, exit status = " $? # Create MySQL User - mysql -e "create user 'vimbadmin'@'$EE_MYSQL_HOST' identified by '$ee_random'" \ - || ee_lib_error "Unable to create ViMbAdmin database user, exit status = " $? + mysql -e "grant all privileges on vimbadmin.* to vimbadmin@'$EE_MYSQL_HOST' IDENTIFIED BY '$ee_random'" \ + || ee_lib_error "Unable to grant privileges for ViMbAdmin database user, exit status = " $? mysql -e "flush privileges" # Setup configuration for ViMbAdmin @@ -26,4 +26,17 @@ function ee_mod_setup_vimbadmin() 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/defaults.mailbox.password_scheme = \"md5.salted\"/defaults.mailbox.password_scheme = \"md5\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini - + # 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /etc/postfix/mysql/virtual_alias_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/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/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 + +} From 7270097fc75ef3f7697d2b9ba061bb969dc1ce60 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 12:29:06 +0530 Subject: [PATCH 006/131] Added Roundcube installation --- src/vendor/ee_ven_install_roundcube.sh | 32 ++++++++++++++++++++++++++ src/vendor/ee_ven_install_vimbadmin.sh | 4 ++++ src/vendor/ee_ven_setup_vimbadmin.sh | 4 +++- 3 files changed, 39 insertions(+), 1 deletion(-) create mode 100644 src/vendor/ee_ven_install_roundcube.sh diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh new file mode 100644 index 00000000..1fb4b82f --- /dev/null +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -0,0 +1,32 @@ +# Install Roundcube + +function ee_mod_install_roundcube() +{ + # Install Roundcube dependencies + ee_lib_echo "Installing Roundcube dependencies, please wait..." + $EE_APT_GET install php-pear \ + || ee_lib_error "Unable to install php-pear, exit status = " $? + pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2 Auth_SASL Net_Sieve Crypt_GPG \ + || ee_lib_error "Unable to install pear packages, exit status = " $? + + # Setup Roundcube directory + mkdir -p /var/www/roundcubemail/htdocs && mkdir -p /var/www/roundcubemail/logs + ee_lib_symbolic_link /var/log/nginx/roundcubemail.access.log /var/www/roundcubemail/logs/access.log + ee_lib_symbolic_link /var/log/nginx/roundcubemail.error.log /var/www/roundcubemail/logs/error.log + + # Install Roundcube + ee_lib_echo "Downloading Roundcube, please wait..." + wget -cqO /var/www/roundcube.tar.gz https://github.com/roundcube/roundcubemail/releases/download/1.0.2/roundcubemail-1.0.2.tar.gz \ + || ee_lib_error "Unable to download Roundcube, exit status = " $? + + ee_lib_echo "Installing Roundcube, please wait..." + tar -zxf /var/www/roundcube.tar.gz + mv /var/www/roundcubemail-1.0.1/* /var/www/roundcubemail/htdocs/ + + # Fix permissions + chown -R $EE_PHP_USER:$EE_PHP_USER /var/www/roundcubemail \ + || ee_lib_error "Unable to change ownership for ViMbAdmin, exit status = " $? + + # Remove unwanted files + rm -rf /var/www/roundcube.tar.gz /var/www/roundcubemail-1.0.1 +} diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index b833be11..a5ba1b61 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -18,6 +18,10 @@ function ee_mod_install_vimbadmin() php composer.phar install --prefer-dist --no-dev \ || ee_lib_error "Unable to install ViMbAdmin, exit status = " $? + # Fix permissions + chown -R $EE_PHP_USER:$EE_PHP_USER /var/www/22222/htdocs/vimbadmin \ + || ee_lib_error "Unable to change ownership for ViMbAdmin, exit status = " $? + # Remove unwanted files rm -rf /var/www/22222/htdocs/vimbadmin.tar.gz /var/www/22222/htdocs/vimbadmin/composer.phar } diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index 09ed2a97..cf471ca6 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -2,6 +2,8 @@ function ee_mod_setup_vimbadmin() { + ee_lib_echo "configuring ViMbAdmin, please wait..." + # Random characters local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) @@ -15,7 +17,7 @@ function ee_mod_setup_vimbadmin() mysql -e "flush privileges" # Setup configuration for ViMbAdmin - cp -v /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + cp -av /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini sed -i "s/defaults.mailbox.uid = 2000/defaults.mailbox.uid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini sed -i "s/defaults.mailbox.gid = 2000/defaults.mailbox.gid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini From fd00ae39b97d2ea526524adffc733a65403333fa Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 13:51:11 +0530 Subject: [PATCH 007/131] Added roundcube setup --- src/vendor/ee_ven_setup_roundcube.sh | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 src/vendor/ee_ven_setup_roundcube.sh diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh new file mode 100644 index 00000000..1fcea8d8 --- /dev/null +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -0,0 +1,26 @@ +# Setup Roundcube + +function ee_mod_setup_roundcube() +{ + ee_lib_echo "configuring Roundcube, please wait..." + + # Random characters + local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) + + # Setting up database for Roundcube + mysql -e "create database \`roundcubemail\`" \ + || ee_lib_error "Unable to create Roundcube database, exit status = " $? + + # Create MySQL User + mysql -e "grant all privileges on roundcubemail.* to roundcube@'$EE_MYSQL_HOST' IDENTIFIED BY '$ee_random'" \ + || ee_lib_error "Unable to grant privileges for Roundcube database user, exit status = " $? + mysql -e "flush privileges" + + # Import Roundcube intial database + mysql roundcubemail < /var/www/roundcubemail/htdocs/SQL/mysql.initial.sql \ + || ee_lib_error "Unable to import database for Roundcube, exit status = " $? + + # Setup configuration for Roundcube + cp -av /var/www/roundcubemail/htdocs/config/config.inc.php.sample /var/www/roundcubemail/htdocs/config/config.inc.php + sed -i "s'mysql://roundcube:password@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php +} From ccb81af8ba900975c467e3b974b9397c23e6adb8 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 15:39:01 +0530 Subject: [PATCH 008/131] Otimised roundcube installation code --- src/vendor/ee_ven_install_roundcube.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh index 1fb4b82f..a55f363f 100644 --- a/src/vendor/ee_ven_install_roundcube.sh +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -10,7 +10,7 @@ function ee_mod_install_roundcube() || ee_lib_error "Unable to install pear packages, exit status = " $? # Setup Roundcube directory - mkdir -p /var/www/roundcubemail/htdocs && mkdir -p /var/www/roundcubemail/logs + mkdir -p /var/www/roundcubemail/{htdocs,logs} ee_lib_symbolic_link /var/log/nginx/roundcubemail.access.log /var/www/roundcubemail/logs/access.log ee_lib_symbolic_link /var/log/nginx/roundcubemail.error.log /var/www/roundcubemail/logs/error.log @@ -20,8 +20,8 @@ function ee_mod_install_roundcube() || ee_lib_error "Unable to download Roundcube, exit status = " $? ee_lib_echo "Installing Roundcube, please wait..." - tar -zxf /var/www/roundcube.tar.gz - mv /var/www/roundcubemail-1.0.1/* /var/www/roundcubemail/htdocs/ + tar -zxf /var/www/roundcube.tar.gz -C /var/www/roundcubemail/htdocs/ --strip-components=1 \ + || ee_lib_error "Unable to extract Roundcube, exit status = " $? # Fix permissions chown -R $EE_PHP_USER:$EE_PHP_USER /var/www/roundcubemail \ From b70f76b523ef9c574b274a4d58e06ced73be6f08 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Fri, 25 Jul 2014 16:33:17 +0530 Subject: [PATCH 009/131] Add error handling --- .../install/mail/ee_mod_setup_dovecot.sh | 35 +++++++++++-------- 1 file changed, 21 insertions(+), 14 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index fdf4cf3e..7bf54af4 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -2,34 +2,41 @@ function ee_mod_setup_dovecot() { - ee_lib_echo "Configuring Dovecot, please wait..." + ee_lib_echo "Setting up Dovecot, please wait..." # Adding mail user with GID 5000 and UID 5000 - groupadd -g 5000 vmail - useradd -g vmail -u 5000 vmail -d /var/vmail -m + groupadd -g 5000 vmail && useradd -g vmail -u 5000 vmail -d /var/vmail -m \ + || ee_lib_error "Unable to setup vmail user/group = " $? # Configuring dovecot.conf - sed -i "s/*.protocol/*.protocol\\nprotocols = imap pop3 lmtp sieve/" /etc/dovecot/dovecot.conf + sed -i "s/*.protocol/*.protocol\\nprotocols = imap pop3 lmtp sieve/" /etc/dovecot/dovecot.conf \ + || ee_lib_error "Unable to configure Dovecot protocol, exit status = " $? # Configuring 10-mail.conf - sed -i "s/mail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u/mail_location = maildir:\/var\/vmail\/%d\/%n/" /etc/dovecot/conf.d/10-mail.conf + sed -i "s/mail_location = mbox:~\/mail:INBOX=\/var\/mail\/%u/mail_location = maildir:\/var\/vmail\/%d\/%n/" /etc/dovecot/conf.d/10-mail.conf \ + || ee_lib_error "Unable to configure Dovecot mail_location, exit status = " $? # Configuring 10-auth.conf - sed -i "s/auth_mechanisms = plain/auth_mechanisms = plain login/" /etc/dovecot/conf.d/10-auth.conf - sed -i "s/\!include auth-system.conf.ext/#\!include auth-system.conf.ext/" /etc/dovecot/conf.d/10-auth.conf - sed -i "s/#\!include auth-sql.conf.ext/\!include auth-sql.conf.ext/" /etc/dovecot/conf.d/10-auth.conf + sed -i "s/auth_mechanisms = plain/auth_mechanisms = plain login/" /etc/dovecot/conf.d/10-auth.conf && \ + sed -i "s/\!include auth-system.conf.ext/#\!include auth-system.conf.ext/" /etc/dovecot/conf.d/10-auth.conf && \ + sed -i "s/#\!include auth-sql.conf.ext/\!include auth-sql.conf.ext/" /etc/dovecot/conf.d/10-auth.conf \ + || ee_lib_error "Unable to setup 10-auth.conf file, exit status = " $? # Configuring dovecot-sql.conf.ext - cat /usr/share/easyengine/mail/dovecot-sql.conf.ext >> /etc/dovecot/dovecot-sql.conf.ext + cp -v /usr/share/easyengine/mail/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext \ + || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? # Configuring auth-sql.conf.ext - sed -i "s/#userdb {/userdb {/" /etc/dovecot/conf.d/auth-sql.conf.ext - sed -i "s/# driver = prefetch/ driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext + sed -i "s/#userdb {/userdb {/" /etc/dovecot/conf.d/auth-sql.conf.ext && \ + sed -i "s/# driver = prefetch/ driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ + || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? # Configuring 10-master.conf - cp -av /etc/dovecot/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf.bak - cp -av /usr/share/easyengine/mail/10-master.conf /etc/dovecot/conf.d/10-master.conf + cp -v /etc/dovecot/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf.bak + cp -v /usr/share/easyengine/mail/10-master.conf /etc/dovecot/conf.d/10-master.conf \ + || ee_lib_error "Unable to setup 10-master.conf, exit status = " $? # Change Dovecot log location - sed -i "s/#log_path = syslog/log_path = \/var\/log\/dovecot.log/" /etc/dovecot/conf.d/10-logging.conf + sed -i "s/#log_path = syslog/log_path = \/var\/log\/dovecot.log/" /etc/dovecot/conf.d/10-logging.conf \ + || ee_lib_error "Unable to setup Dovecot log_path, exit status = " $? } From 0818155f8310d742fb4a51c208022124d2cef3a5 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 17:01:59 +0530 Subject: [PATCH 010/131] Added error handling --- src/vendor/ee_ven_setup_vimbadmin.sh | 37 ++++++++++++++++------------ 1 file changed, 21 insertions(+), 16 deletions(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index cf471ca6..c175a6b0 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -19,26 +19,31 @@ function ee_mod_setup_vimbadmin() # Setup configuration for ViMbAdmin cp -av /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini - sed -i "s/defaults.mailbox.uid = 2000/defaults.mailbox.uid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini - sed -i "s/defaults.mailbox.gid = 2000/defaults.mailbox.gid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini - sed -i "s/maildir:\/srv\/vmail\/%d\/%u\/mail:LAYOUT=fs/maildir:\/var\/vmail\/%d\/%u/" /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/'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/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.uid = 2000/defaults.mailbox.uid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && + sed -i "s/defaults.mailbox.gid = 2000/defaults.mailbox.gid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && + sed -i "s'maildir:/srv/vmail/%d/%u/mail:LAYOUT=fs'maildir:/var/vmail/%d/%u'" /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/'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/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 = " $? # 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /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 \ + || 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /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 \ + || 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /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 && + || 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/hosts=localhost/hosts=$EE_MYSQL_HOST" /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 \ + || ee_lib_error "Unable to setup ViMbAdmin database details in dovecot-sql.conf.ext file, exit status = " $? } From b2d85db41fe8d4e609361921c037576d0c4aba73 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 17:04:51 +0530 Subject: [PATCH 011/131] Added error handling --- src/vendor/ee_ven_setup_roundcube.sh | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index 1fcea8d8..eeddaa20 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -11,16 +11,18 @@ function ee_mod_setup_roundcube() mysql -e "create database \`roundcubemail\`" \ || ee_lib_error "Unable to create Roundcube database, exit status = " $? - # Create MySQL User + # Create MySQL user mysql -e "grant all privileges on roundcubemail.* to roundcube@'$EE_MYSQL_HOST' IDENTIFIED BY '$ee_random'" \ || ee_lib_error "Unable to grant privileges for Roundcube database user, exit status = " $? mysql -e "flush privileges" - # Import Roundcube intial database + # Import Roundcube initial database mysql roundcubemail < /var/www/roundcubemail/htdocs/SQL/mysql.initial.sql \ || ee_lib_error "Unable to import database for Roundcube, exit status = " $? # Setup configuration for Roundcube cp -av /var/www/roundcubemail/htdocs/config/config.inc.php.sample /var/www/roundcubemail/htdocs/config/config.inc.php - sed -i "s'mysql://roundcube:password@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php + sed -i "s'mysql://roundcube:password@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php \ + || ee_lib_error "Unable to setup Roundcube database details in config.inc.php file, exit status = " $? + } From 14f7ea255ebf0fdb7b9683fb1f7209571656d091 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 25 Jul 2014 17:08:40 +0530 Subject: [PATCH 012/131] Added error handling --- .../stack/install/mail/ee_mod_setup_postfix.sh | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index ef0e5091..4ddc5f35 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -4,8 +4,9 @@ function ee_mod_setup_postfix() { ee_lib_echo "Configuring Postfix, please wait..." #Configure Master.cf - sed -i 's/#submission/submission/' /etc/postfix/master.cf - sed -i 's/#smtps/smtps/' /etc/postfix/master.cf + sed -i 's/#submission/submission/' /etc/postfix/master.cf && + sed -i 's/#smtps/smtps/' /etc/postfix/master.cf \ + || ee_lib_error "Unable to setup details in master.cf file, exit status = " $? #Configure main.cf #postconf "#smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache" @@ -37,7 +38,9 @@ function ee_mod_setup_postfix() # Setting up Postfix MySQL configuration mkdir -p /etc/postfix/mysql - cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf - cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf - cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf + cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf && + cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf && + cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf \ + ee_lib_error "Unable to copy Postfix MySQL configuration files, exit status = " $? + } From 0827287ec6814c58032bb5e4e1b9792ebdbab4f4 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 13:18:14 +0530 Subject: [PATCH 013/131] Added ViMbAdmin and Roundcube remove fuctions --- src/vendor/ee_ven_remove_roundcube.sh | 8 ++++++++ src/vendor/ee_ven_remove_vimbadmin.sh | 8 ++++++++ 2 files changed, 16 insertions(+) create mode 100644 src/vendor/ee_ven_remove_roundcube.sh create mode 100644 src/vendor/ee_ven_remove_vimbadmin.sh diff --git a/src/vendor/ee_ven_remove_roundcube.sh b/src/vendor/ee_ven_remove_roundcube.sh new file mode 100644 index 00000000..b8e38be7 --- /dev/null +++ b/src/vendor/ee_ven_remove_roundcube.sh @@ -0,0 +1,8 @@ +# Remove Roundcube + +function ee_ven_remove_vimbadmin() +{ + ee_lib_echo "Removing Roundcube, please wait..." + rm -rf /var/www/22222/htdocs/vimbadmin \ + || ee_lib_error "Unable to remove Roundcube, exit status = " $? +} diff --git a/src/vendor/ee_ven_remove_vimbadmin.sh b/src/vendor/ee_ven_remove_vimbadmin.sh new file mode 100644 index 00000000..f7090e86 --- /dev/null +++ b/src/vendor/ee_ven_remove_vimbadmin.sh @@ -0,0 +1,8 @@ +# Remove ViMbAdmin + +function ee_ven_remove_vimbadmin() +{ + ee_lib_echo "Removing ViMbAdmin, please wait..." + rm -rf /var/www/22222/htdocs/vimbadmin \ + || ee_lib_error "Unable to remove ViMbAdmin, exit status = " $? +} From 05cff73cc22de61cf64f83fb0786721c952402e0 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 15:18:31 +0530 Subject: [PATCH 014/131] Fixed ViMbAdmin install issue --- src/vendor/ee_ven_install_vimbadmin.sh | 4 ++-- src/vendor/ee_ven_setup_vimbadmin.sh | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index a5ba1b61..a9988d64 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -8,8 +8,8 @@ function ee_mod_install_vimbadmin() || ee_lib_error "Unable to download ViMbAdmin, exit status = " $? ee_lib_echo "Installing ViMbAdmin, please wait..." - tar -zxf /var/www/22222/htdocs/vimbadmin.tar.gz - mv /var/www/22222/htdocs/ViMbAdmin-3.0.10 /var/www/22222/htdocs/vimbadmin + mkdir -p /var/www/22222/htdocs/vimbadmin + tar -zxf /var/www/22222/htdocs/vimbadmin.tar.gz -C /var/www/22222/htdocs/vimbadmin --strip-components=1 # Install Composer cd /var/www/22222/htdocs/vimbadmin diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index c175a6b0..07ede27b 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -39,7 +39,7 @@ function ee_mod_setup_vimbadmin() || 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/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_MYSQL_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 = " $? sed -i "s/password=password/password=$ee_random" /etc/dovecot/dovecot-sql.conf.ext && From c59b150465297423116e81caf5918c1ba10f770e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 15:25:52 +0530 Subject: [PATCH 015/131] Fixed function name issue --- src/vendor/ee_ven_remove_roundcube.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_remove_roundcube.sh b/src/vendor/ee_ven_remove_roundcube.sh index b8e38be7..4c8e6fb9 100644 --- a/src/vendor/ee_ven_remove_roundcube.sh +++ b/src/vendor/ee_ven_remove_roundcube.sh @@ -1,6 +1,6 @@ # Remove Roundcube -function ee_ven_remove_vimbadmin() +function ee_ven_remove_roundcube() { ee_lib_echo "Removing Roundcube, please wait..." rm -rf /var/www/22222/htdocs/vimbadmin \ From 4a2117d480367e002c6dc86006b266ddebbddb71 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 15:39:32 +0530 Subject: [PATCH 016/131] Fixed function name issue --- src/vendor/ee_ven_install_vimbadmin.sh | 2 +- src/vendor/ee_ven_remove_roundcube.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index a9988d64..892839f4 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -1,6 +1,6 @@ # Install ViMbAdmin -function ee_mod_install_vimbadmin() +function ee_ven_install_vimbadmin() { # Install ViMbAdmin ee_lib_echo "Downloading ViMbAdmin, please wait..." diff --git a/src/vendor/ee_ven_remove_roundcube.sh b/src/vendor/ee_ven_remove_roundcube.sh index 4c8e6fb9..fe9e4cda 100644 --- a/src/vendor/ee_ven_remove_roundcube.sh +++ b/src/vendor/ee_ven_remove_roundcube.sh @@ -3,6 +3,6 @@ function ee_ven_remove_roundcube() { ee_lib_echo "Removing Roundcube, please wait..." - rm -rf /var/www/22222/htdocs/vimbadmin \ + rm -rf /var/www/roundcubemail \ || ee_lib_error "Unable to remove Roundcube, exit status = " $? } From dcfeaa89f567d91e1dc6d4cc2987c2260c409a1c Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 16:14:52 +0530 Subject: [PATCH 017/131] Fixed sed commnad --- src/vendor/ee_ven_setup_vimbadmin.sh | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index 07ede27b..5e2f9e22 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -30,20 +30,20 @@ function ee_mod_setup_vimbadmin() || ee_lib_error "Unable to setup ViMbAdmin configuration file, exit status = " $? # 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /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 \ || 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /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 \ || 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/hosts = 127.0.0.1/hosts = $EE_MYSQL_HOST" /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 \ || 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/hosts=localhost/hosts=$EE_MYSQL_HOST" /etc/dovecot/dovecot-sql.conf.ext \ - || ee_lib_error "Unable to setup ViMbAdmin database details in dovecot-sql.conf.ext file, exit status = " $? + 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 \ + || ee_lib_error "Unable to setup ViMbAdmin database details in dovecot-sql.conf.ext file, exit status = " $? } From f5f0fe9ba0a8c96d05d973c988a96ecb6497aaed Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 16:24:41 +0530 Subject: [PATCH 018/131] Fixed Net_IDNA2-beta installation --- src/vendor/ee_ven_install_roundcube.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh index a55f363f..60b76e44 100644 --- a/src/vendor/ee_ven_install_roundcube.sh +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -6,7 +6,7 @@ function ee_mod_install_roundcube() ee_lib_echo "Installing Roundcube dependencies, please wait..." $EE_APT_GET install php-pear \ || ee_lib_error "Unable to install php-pear, exit status = " $? - pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2 Auth_SASL Net_Sieve Crypt_GPG \ + pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG \ || ee_lib_error "Unable to install pear packages, exit status = " $? # Setup Roundcube directory From 0e6ecc5e165c89618e9333e6653d78a9336c7d00 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 16:28:32 +0530 Subject: [PATCH 019/131] Fixed RoundCube setup issue --- src/vendor/ee_ven_setup_roundcube.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index eeddaa20..a8b2fc91 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -22,7 +22,7 @@ function ee_mod_setup_roundcube() # Setup configuration for Roundcube cp -av /var/www/roundcubemail/htdocs/config/config.inc.php.sample /var/www/roundcubemail/htdocs/config/config.inc.php - sed -i "s'mysql://roundcube:password@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php \ + sed -i "s'mysql://roundcube:pass@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php \ || ee_lib_error "Unable to setup Roundcube database details in config.inc.php file, exit status = " $? } From d36d01ed89c2c390a82eee1831e88a318b25bdef Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 16:33:40 +0530 Subject: [PATCH 020/131] Fixed wrong function names --- src/vendor/ee_ven_install_roundcube.sh | 2 +- src/vendor/ee_ven_setup_roundcube.sh | 2 +- src/vendor/ee_ven_setup_vimbadmin.sh | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh index 60b76e44..b6a0cf24 100644 --- a/src/vendor/ee_ven_install_roundcube.sh +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -1,6 +1,6 @@ # Install Roundcube -function ee_mod_install_roundcube() +function ee_ven_install_roundcube() { # Install Roundcube dependencies ee_lib_echo "Installing Roundcube dependencies, please wait..." diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index a8b2fc91..77290d9f 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -1,6 +1,6 @@ # Setup Roundcube -function ee_mod_setup_roundcube() +function ee_ven_setup_roundcube() { ee_lib_echo "configuring Roundcube, please wait..." diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index 5e2f9e22..c082d6a6 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -1,6 +1,6 @@ # Setup ViMbAdmin -function ee_mod_setup_vimbadmin() +function ee_ven_setup_vimbadmin() { ee_lib_echo "configuring ViMbAdmin, please wait..." From ccbc6a1fd25c417f45ffa4f897c4f93bd54c5b62 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 17:06:00 +0530 Subject: [PATCH 021/131] Fixed plai text auth --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 7bf54af4..995ed2e4 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -16,6 +16,7 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to configure Dovecot mail_location, exit status = " $? # Configuring 10-auth.conf + sed -i "s/#disable_plaintext_auth = yes/disable_plaintext_auth = no/" /etc/dovecot/conf.d/10-auth.conf && \ sed -i "s/auth_mechanisms = plain/auth_mechanisms = plain login/" /etc/dovecot/conf.d/10-auth.conf && \ sed -i "s/\!include auth-system.conf.ext/#\!include auth-system.conf.ext/" /etc/dovecot/conf.d/10-auth.conf && \ sed -i "s/#\!include auth-sql.conf.ext/\!include auth-sql.conf.ext/" /etc/dovecot/conf.d/10-auth.conf \ From a54631791d90bf6215d3dc5f4810f9342a941527 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 17:38:08 +0530 Subject: [PATCH 022/131] Fixed dovecot configuration issue --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 995ed2e4..8c04282a 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -27,7 +27,7 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? # Configuring auth-sql.conf.ext - sed -i "s/#userdb {/userdb {/" /etc/dovecot/conf.d/auth-sql.conf.ext && \ + sed -i "1s/#userdb {/userdb {/" /etc/dovecot/conf.d/auth-sql.conf.ext && \ sed -i "s/# driver = prefetch/ driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? From 6cecc83e5a0b49636952506af59b3bb0ba225356 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 17:50:41 +0530 Subject: [PATCH 023/131] Fixed dovecot configuration issue --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 8c04282a..9d49a533 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -27,8 +27,7 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? # Configuring auth-sql.conf.ext - sed -i "1s/#userdb {/userdb {/" /etc/dovecot/conf.d/auth-sql.conf.ext && \ - sed -i "s/# driver = prefetch/ driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ + sed "s/# driver = prefetch/userdb {\n driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? From d389d50e8d9961fdd414ce4af6461cd352352c11 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 17:53:33 +0530 Subject: [PATCH 024/131] Added -i --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 9d49a533..387209cf 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -27,7 +27,7 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? # Configuring auth-sql.conf.ext - sed "s/# driver = prefetch/userdb {\n driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ + sed -i "s/# driver = prefetch/userdb {\n driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? From 178725033fe31686d5539daf342c7f2c15a4dfb3 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 18:05:29 +0530 Subject: [PATCH 025/131] Added dovecot service start/stop/restart --- src/lib/ee_lib_service.sh | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/lib/ee_lib_service.sh b/src/lib/ee_lib_service.sh index 70efefe7..6bafda2d 100644 --- a/src/lib/ee_lib_service.sh +++ b/src/lib/ee_lib_service.sh @@ -28,6 +28,11 @@ function ee_lib_service() $ee_service_name -t &>> $EE_COMMAND_LOG \ && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? + elif [ $ee_service_name = "dovecot" ]; then + # Test and start/stop/restart/reload php5-fpm service + $ee_service_name -n &>> $EE_COMMAND_LOG \ + && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ + || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? else # start/stop/restart/reload services service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG \ From 10180a51e153fc5f7733307e3984d12155f7b0ae Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 18:36:00 +0530 Subject: [PATCH 026/131] Fixed: target 0 is not a directory error --- src/modules/stack/install/mail/ee_mod_setup_postfix.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index 4ddc5f35..43eb9068 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -38,9 +38,9 @@ function ee_mod_setup_postfix() # Setting up Postfix MySQL configuration mkdir -p /etc/postfix/mysql - cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf && - cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf && + cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf && \ + cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf && \ cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf \ - ee_lib_error "Unable to copy Postfix MySQL configuration files, exit status = " $? + || ee_lib_error "Unable to copy Postfix MySQL configuration files, exit status = " $? } From ddf49610bf05c976b5b5e20848d3d986a235c50f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 28 Jul 2014 18:58:28 +0530 Subject: [PATCH 027/131] Logs goto $EE_COMMAND_LOG --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 6 +++--- src/modules/stack/install/mail/ee_mod_setup_postfix.sh | 8 ++++---- src/vendor/ee_ven_install_roundcube.sh | 2 +- src/vendor/ee_ven_install_vimbadmin.sh | 4 ++-- src/vendor/ee_ven_setup_roundcube.sh | 2 +- src/vendor/ee_ven_setup_vimbadmin.sh | 2 +- 6 files changed, 12 insertions(+), 12 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 387209cf..ca77fc4a 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -23,7 +23,7 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to setup 10-auth.conf file, exit status = " $? # Configuring dovecot-sql.conf.ext - cp -v /usr/share/easyengine/mail/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext \ + cp -v /usr/share/easyengine/mail/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? # Configuring auth-sql.conf.ext @@ -32,8 +32,8 @@ function ee_mod_setup_dovecot() # Configuring 10-master.conf - cp -v /etc/dovecot/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf.bak - cp -v /usr/share/easyengine/mail/10-master.conf /etc/dovecot/conf.d/10-master.conf \ + cp -v /etc/dovecot/conf.d/10-master.conf /etc/dovecot/conf.d/10-master.conf.bak &>> $EE_COMMAND_LOG + cp -v /usr/share/easyengine/mail/10-master.conf /etc/dovecot/conf.d/10-master.conf &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to setup 10-master.conf, exit status = " $? # Change Dovecot log location diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index 43eb9068..a8d19fa5 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -2,7 +2,7 @@ function ee_mod_setup_postfix() { - ee_lib_echo "Configuring Postfix, please wait..." + ee_lib_echo "Setting up Postfix, please wait..." #Configure Master.cf sed -i 's/#submission/submission/' /etc/postfix/master.cf && sed -i 's/#smtps/smtps/' /etc/postfix/master.cf \ @@ -38,9 +38,9 @@ function ee_mod_setup_postfix() # Setting up Postfix MySQL configuration mkdir -p /etc/postfix/mysql - cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf && \ - cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf && \ - cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf \ + cp -av /usr/share/easyengine/mail/virtual_alias_maps.cf /etc/postfix/mysql/virtual_alias_maps.cf &>> $EE_COMMAND_LOG && \ + cp -av /usr/share/easyengine/mail/virtual_domains_maps.cf /etc/postfix/mysql/virtual_domains_maps.cf &>> $EE_COMMAND_LOG && \ + cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to copy Postfix MySQL configuration files, exit status = " $? } diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh index b6a0cf24..1bafe87e 100644 --- a/src/vendor/ee_ven_install_roundcube.sh +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -6,7 +6,7 @@ function ee_ven_install_roundcube() ee_lib_echo "Installing Roundcube dependencies, please wait..." $EE_APT_GET install php-pear \ || ee_lib_error "Unable to install php-pear, exit status = " $? - pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG \ + pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to install pear packages, exit status = " $? # Setup Roundcube directory diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index 892839f4..8055ee9d 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -13,9 +13,9 @@ function ee_ven_install_vimbadmin() # Install Composer cd /var/www/22222/htdocs/vimbadmin - curl -sS https://getcomposer.org/installer | php \ + curl -sS https://getcomposer.org/installer | php &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to install Composer, exit status = " $? - php composer.phar install --prefer-dist --no-dev \ + php composer.phar install --prefer-dist --no-dev &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to install ViMbAdmin, exit status = " $? # Fix permissions diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index 77290d9f..620f79c6 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -21,7 +21,7 @@ function ee_ven_setup_roundcube() || ee_lib_error "Unable to import database for Roundcube, exit status = " $? # Setup configuration for Roundcube - cp -av /var/www/roundcubemail/htdocs/config/config.inc.php.sample /var/www/roundcubemail/htdocs/config/config.inc.php + cp -av /var/www/roundcubemail/htdocs/config/config.inc.php.sample /var/www/roundcubemail/htdocs/config/config.inc.php &>> $EE_COMMAND_LOG sed -i "s'mysql://roundcube:pass@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php \ || ee_lib_error "Unable to setup Roundcube database details in config.inc.php file, exit status = " $? diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index c082d6a6..de307cc6 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -17,7 +17,7 @@ function ee_ven_setup_vimbadmin() mysql -e "flush privileges" # Setup configuration for ViMbAdmin - cp -av /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + cp -av /var/www/22222/htdocs/vimbadmin/application/configs/application.ini.dist /var/www/22222/htdocs/vimbadmin/application/configs/application.ini &>> $EE_COMMAND_LOG sed -i "s/defaults.mailbox.uid = 2000/defaults.mailbox.uid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && sed -i "s/defaults.mailbox.gid = 2000/defaults.mailbox.gid = 5000/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini && From 7a8b40f25c0eb55af6f2497917e1b3a9afd252df Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Wed, 30 Jul 2014 15:20:38 +0530 Subject: [PATCH 028/131] Fix ee site list command --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index c7dd012e..5735fad8 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -201,7 +201,7 @@ elif [ "$EE_FIRST" = "site" ]; then || ee_lib_error "Unable to display list of sites-available websites, exit status = " $? else ee_lib_echo "List of sites-enabled websites:" - ls /etc/nginx/sites-available/ \ + ls /etc/nginx/sites-enabled/ \ || ee_lib_error "Unable to display list of sites-enabled websites, exit status = " $? fi elif [ "$EE_SECOND" = "info" ] || [ "$EE_SECOND" = "show" ]; then From d0a35c54435742768ba048ef6ecd04e0921a91c3 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 4 Aug 2014 19:28:39 +0530 Subject: [PATCH 029/131] Added ViMbAdmin default database configuration --- src/vendor/ee_ven_setup_vimbadmin.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index de307cc6..fad62321 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -46,4 +46,11 @@ function ee_ven_setup_vimbadmin() sed -i "s/hosts=localhost/hosts=$EE_MYSQL_HOST/" /etc/dovecot/dovecot-sql.conf.ext \ || ee_lib_error "Unable to setup ViMbAdmin database details in dovecot-sql.conf.ext 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 + + # Setting default database + /var/www/22222/htdocs/vimbadmin/bin/doctrine2-cli.php orm:schema-tool:create \ + || ee_lib_error "Unable to setup ViMbAdmin default database , exit status = " $? + } From c224e52a098f38d2a7a49ca718ea1d1562238190 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Wed, 6 Aug 2014 14:18:46 +0530 Subject: [PATCH 030/131] Fixed firefox font issue --- config/nginx/common/locations.conf | 1 + 1 file changed, 1 insertion(+) diff --git a/config/nginx/common/locations.conf b/config/nginx/common/locations.conf index 4667565c..c506f2bc 100644 --- a/config/nginx/common/locations.conf +++ b/config/nginx/common/locations.conf @@ -15,6 +15,7 @@ location = /robots.txt { # Cache static files location ~* \.(ogg|ogv|svg|svgz|eot|otf|woff|mp4|ttf|css|rss|atom|js|jpg|jpeg|gif|png|ico|zip|tgz|gz|rar|bz2|doc|xls|exe|ppt|tar|mid|midi|wav|bmp|rtf|swf)$ { + add_header "Access-Control-Allow-Origin" "*"; access_log off; log_not_found off; expires max; From f3bdc92413f7a20540967cd688a44d41b610009f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 8 Aug 2014 11:55:09 +0530 Subject: [PATCH 031/131] Added Amavis configuration --- .../install/mail/ee_mod_install_amavis.sh | 9 +++++++ .../stack/install/mail/ee_mod_setup_amavis.sh | 16 +++++++++++++ templates/mail/amavis-master.cf | 24 +++++++++++++++++++ 3 files changed, 49 insertions(+) create mode 100644 src/modules/stack/install/mail/ee_mod_install_amavis.sh create mode 100644 src/modules/stack/install/mail/ee_mod_setup_amavis.sh create mode 100644 templates/mail/amavis-master.cf diff --git a/src/modules/stack/install/mail/ee_mod_install_amavis.sh b/src/modules/stack/install/mail/ee_mod_install_amavis.sh new file mode 100644 index 00000000..c2804cb1 --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_install_amavis.sh @@ -0,0 +1,9 @@ +# Install Amavis package + +function ee_mod_install_dovecot() +{ + # Install Amavis + ee_lib_echo "Installing Amavis, please wait..." + $EE_APT_GET amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + || ee_lib_error "Unable to install Amavis, exit status = " $? +} diff --git a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh new file mode 100644 index 00000000..f545e0c9 --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh @@ -0,0 +1,16 @@ +# Setup Amavis + +function ee_mod_setup_amavis() +{ + # Confiure Amavis + sed -i "s'#@'@'" /etc/amavis/conf.d/15-content_filter_mode + sed -i "s'# ' '" /etc/amavis/conf.d/15-content_filter_mode + + # Add mail filtering rules + sed -i "s/use strict;/use strict;\n\$sa_spam_subject_tag = undef;\n\$spam_quarantine_to = undef;\n\$sa_tag_level_deflt = undef;\n\n# Prevent spams from automatically rejected by mail-server\n\$final_spam_destiny = D_PASS;\n# We need to provide list of domains for which filtering need to be done\n@lookup_sql_dsn = (\n ['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',\n 'vimbadmin',\n 'password']);\n\n\$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';/" /etc/amavis/conf.d/50-user + + # Configure Postfix to use Amavis + sed -i "s/1 pickup/1 pickup\n -o content_filter=\n -o receive_override_options=no_header_body_checks/" /etc/postfix/master.cf + cat /usr/share/easyengine/mail/amavis-master.cf >> /etc/postfix/master.cf + +} diff --git a/templates/mail/amavis-master.cf b/templates/mail/amavis-master.cf new file mode 100644 index 00000000..1ffae842 --- /dev/null +++ b/templates/mail/amavis-master.cf @@ -0,0 +1,24 @@ +smtp-amavis unix - - n - 2 smtp + -o smtp_data_done_timeout=1200 + -o smtp_send_xforward_command=yes + -o disable_dns_lookups=yes + -o max_use=20 + +127.0.0.1:10025 inet n - n - - smtpd + -o content_filter= + -o smtpd_delay_reject=no + -o smtpd_client_restrictions=permit_mynetworks,reject + -o smtpd_helo_restrictions= + -o smtpd_sender_restrictions= + -o smtpd_recipient_restrictions=permit_mynetworks,reject + -o smtpd_data_restrictions=reject_unauth_pipelining + -o smtpd_end_of_data_restrictions= + -o smtpd_restriction_classes= + -o mynetworks=127.0.0.0/8 + -o smtpd_error_sleep_time=0 + -o smtpd_soft_error_limit=1001 + -o smtpd_hard_error_limit=1000 + -o smtpd_client_connection_count_limit=0 + -o smtpd_client_connection_rate_limit=0 + -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks + -o local_header_rewrite_clients= \ No newline at end of file From 6daa9801c6f044c26b4033edf646c5369593e9b7 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 8 Aug 2014 12:07:37 +0530 Subject: [PATCH 032/131] Added Amavis postfix configuration --- src/modules/stack/install/mail/ee_mod_setup_amavis.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh index f545e0c9..fa4d4b46 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh @@ -10,6 +10,10 @@ function ee_mod_setup_amavis() sed -i "s/use strict;/use strict;\n\$sa_spam_subject_tag = undef;\n\$spam_quarantine_to = undef;\n\$sa_tag_level_deflt = undef;\n\n# Prevent spams from automatically rejected by mail-server\n\$final_spam_destiny = D_PASS;\n# We need to provide list of domains for which filtering need to be done\n@lookup_sql_dsn = (\n ['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',\n 'vimbadmin',\n 'password']);\n\n\$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';/" /etc/amavis/conf.d/50-user # Configure Postfix to use Amavis + # For postfix main.cf + postconf -e "content_filter = smtp-amavis:[127.0.0.1]:10024" + + # For postfix master.cf sed -i "s/1 pickup/1 pickup\n -o content_filter=\n -o receive_override_options=no_header_body_checks/" /etc/postfix/master.cf cat /usr/share/easyengine/mail/amavis-master.cf >> /etc/postfix/master.cf From 39d7889d10355939e08f7332680ca52b9201510b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 8 Aug 2014 16:19:01 +0530 Subject: [PATCH 033/131] Added Sieve Installation --- src/modules/stack/install/mail/ee_mod_install_sieve.sh | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 src/modules/stack/install/mail/ee_mod_install_sieve.sh diff --git a/src/modules/stack/install/mail/ee_mod_install_sieve.sh b/src/modules/stack/install/mail/ee_mod_install_sieve.sh new file mode 100644 index 00000000..423c91a2 --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_install_sieve.sh @@ -0,0 +1,9 @@ +# Install Sieve package + +function ee_mod_install_dovecot() +{ + # Install Sieve + ee_lib_echo "Installing Sieve, please wait..." + $EE_APT_GET amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + || ee_lib_error "Unable to install Sieve, exit status = " $? +} From 9bfd7acaed76df1787d907c121274cedabc0241b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 8 Aug 2014 17:03:21 +0530 Subject: [PATCH 034/131] Added Sieve configuration --- .../stack/install/mail/ee_mod_setup_sieve.sh | 23 +++++++++++++++++++ templates/mail/default.sieve | 4 ++++ 2 files changed, 27 insertions(+) create mode 100644 src/modules/stack/install/mail/ee_mod_setup_sieve.sh create mode 100644 templates/mail/default.sieve diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh new file mode 100644 index 00000000..3cf0c0ed --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -0,0 +1,23 @@ +# Setup Sieve + +function ee_mod_setup_amavis() +{ + # Enable sieve plugin support for dovecot-lmtp + sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mns sieve'" /etc/dovecot/conf.d/20-lmtp.conf + + # Sieve dovecot-pluign configuration + sed -i "s'sieve = ~/.dovecot.sieve'sieve = ~/.dovecot.sieve\n sieve_global_path = /var/lib/dovecot/sieve/default.sieve'" /etc/dovecot/conf.d/90-sieve.conf + sed -i "s'#sieve_global_dir ='sieve_global_dir = /var/lib/dovecot/sieve/'" /etc/dovecot/conf.d/90-sieve.conf + + # Create global Sieve rules file + mkdir -p /var/lib/dovecot/sieve/ + cp /usr/share/easyengine/mail/default.sieve /var/lib/dovecot/sieve/default.sieve + chown -R vmail:vmail /var/lib/dovecot + + # Compile Sieve rules + sievec /var/lib/dovecot/sieve/default.sieve + + # Configure Roundcube + sed -i "s:\$config\['plugins'\] = array(:\$config\['plugins'\] = array(\n 'sieverules':" /var/www/roundcubemail/htdocs/config/config.inc.php + echo "\$config['sieverules_port'] = 4190;" >> /var/www/roundcubemail/htdocs/config/config.inc.php +} diff --git a/templates/mail/default.sieve b/templates/mail/default.sieve new file mode 100644 index 00000000..476a52a6 --- /dev/null +++ b/templates/mail/default.sieve @@ -0,0 +1,4 @@ +require "fileinto"; +if header :contains "X-Spam-Flag" "YES" { + fileinto "Junk"; +} \ No newline at end of file From b26e621cc47a5d0f87bab20ca47fa3ba932c43e7 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 8 Aug 2014 17:50:31 +0530 Subject: [PATCH 035/131] Fixed Sieve Error --- src/modules/stack/install/mail/ee_mod_install_sieve.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_sieve.sh b/src/modules/stack/install/mail/ee_mod_install_sieve.sh index 423c91a2..bf20b52e 100644 --- a/src/modules/stack/install/mail/ee_mod_install_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_install_sieve.sh @@ -1,9 +1,9 @@ # Install Sieve package -function ee_mod_install_dovecot() +function ee_mod_install_sieve() { # Install Sieve ee_lib_echo "Installing Sieve, please wait..." - $EE_APT_GET amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + $EE_APT_GET install amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ || ee_lib_error "Unable to install Sieve, exit status = " $? } From e46c421a498cf334f1e56947623db3928e2ac16e Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Fri, 8 Aug 2014 17:57:11 +0530 Subject: [PATCH 036/131] Minor fix --- src/vendor/ee_ven_install_vimbadmin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index 8055ee9d..29da0421 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -9,7 +9,7 @@ function ee_ven_install_vimbadmin() ee_lib_echo "Installing ViMbAdmin, please wait..." mkdir -p /var/www/22222/htdocs/vimbadmin - tar -zxf /var/www/22222/htdocs/vimbadmin.tar.gz -C /var/www/22222/htdocs/vimbadmin --strip-components=1 + tar --strip-components=1 -zxf /var/www/22222/htdocs/vimbadmin.tar.gz -C /var/www/22222/htdocs/vimbadmin # Install Composer cd /var/www/22222/htdocs/vimbadmin From 79dc012e4657a2c72231533ffc4e1a2d69a54460 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 11 Aug 2014 12:56:26 +0530 Subject: [PATCH 037/131] Changed comments --- src/lib/ee_lib_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ee_lib_service.sh b/src/lib/ee_lib_service.sh index 6bafda2d..5eb9fad0 100644 --- a/src/lib/ee_lib_service.sh +++ b/src/lib/ee_lib_service.sh @@ -29,7 +29,7 @@ function ee_lib_service() && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? elif [ $ee_service_name = "dovecot" ]; then - # Test and start/stop/restart/reload php5-fpm service + # Test and start/stop/restart/reload Dovecot service $ee_service_name -n &>> $EE_COMMAND_LOG \ && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? From 02a2b15c114a598ff7850b3d2d61df774fb99056 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 11 Aug 2014 13:15:01 +0530 Subject: [PATCH 038/131] Added Error Handling for Sieve and Amavis --- .../stack/install/mail/ee_mod_setup_amavis.sh | 14 +++++++++----- .../stack/install/mail/ee_mod_setup_sieve.sh | 14 +++++++++----- 2 files changed, 18 insertions(+), 10 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh index fa4d4b46..84af5a92 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh @@ -3,18 +3,22 @@ function ee_mod_setup_amavis() { # Confiure Amavis - sed -i "s'#@'@'" /etc/amavis/conf.d/15-content_filter_mode - sed -i "s'# ' '" /etc/amavis/conf.d/15-content_filter_mode + sed -i "s'#@'@'" /etc/amavis/conf.d/15-content_filter_mode && \ + sed -i "s'# ' '" /etc/amavis/conf.d/15-content_filter_mode \ + || ee_lib_error "Unable to setup Amavis, exit status = " $? # Add mail filtering rules - sed -i "s/use strict;/use strict;\n\$sa_spam_subject_tag = undef;\n\$spam_quarantine_to = undef;\n\$sa_tag_level_deflt = undef;\n\n# Prevent spams from automatically rejected by mail-server\n\$final_spam_destiny = D_PASS;\n# We need to provide list of domains for which filtering need to be done\n@lookup_sql_dsn = (\n ['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',\n 'vimbadmin',\n 'password']);\n\n\$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';/" /etc/amavis/conf.d/50-user + sed -i "s/use strict;/use strict;\n\$sa_spam_subject_tag = undef;\n\$spam_quarantine_to = undef;\n\$sa_tag_level_deflt = undef;\n\n# Prevent spams from automatically rejected by mail-server\n\$final_spam_destiny = D_PASS;\n# We need to provide list of domains for which filtering need to be done\n@lookup_sql_dsn = (\n ['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',\n 'vimbadmin',\n 'password']);\n\n\$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';/" /etc/amavis/conf.d/50-user \ + || ee_lib_error "Unable to setup Amavis, exit status = " $? + # Configure Postfix to use Amavis # For postfix main.cf postconf -e "content_filter = smtp-amavis:[127.0.0.1]:10024" # For postfix master.cf - sed -i "s/1 pickup/1 pickup\n -o content_filter=\n -o receive_override_options=no_header_body_checks/" /etc/postfix/master.cf + sed -i "s/1 pickup/1 pickup\n -o content_filter=\n -o receive_override_options=no_header_body_checks/" /etc/postfix/master.cf \ + || ee_lib_error "Unable to setup Amavis, exit status = " $? cat /usr/share/easyengine/mail/amavis-master.cf >> /etc/postfix/master.cf - + } diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index 3cf0c0ed..8b80c72c 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -3,11 +3,13 @@ function ee_mod_setup_amavis() { # Enable sieve plugin support for dovecot-lmtp - sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mns sieve'" /etc/dovecot/conf.d/20-lmtp.conf + sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mns sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ + || ee_lib_error "Unable to add sieve plugin support for dovecot-lmtp, exit status = " $? # Sieve dovecot-pluign configuration - sed -i "s'sieve = ~/.dovecot.sieve'sieve = ~/.dovecot.sieve\n sieve_global_path = /var/lib/dovecot/sieve/default.sieve'" /etc/dovecot/conf.d/90-sieve.conf - sed -i "s'#sieve_global_dir ='sieve_global_dir = /var/lib/dovecot/sieve/'" /etc/dovecot/conf.d/90-sieve.conf + sed -i "s'sieve = ~/.dovecot.sieve'sieve = ~/.dovecot.sieve\n sieve_global_path = /var/lib/dovecot/sieve/default.sieve'" /etc/dovecot/conf.d/90-sieve.conf && \ + sed -i "s'#sieve_global_dir ='sieve_global_dir = /var/lib/dovecot/sieve/'" /etc/dovecot/conf.d/90-sieve.conf \ + || ee_lib_error "Unable to setup Sieve dovecot-pluign, exit status = " $? # Create global Sieve rules file mkdir -p /var/lib/dovecot/sieve/ @@ -15,9 +17,11 @@ function ee_mod_setup_amavis() chown -R vmail:vmail /var/lib/dovecot # Compile Sieve rules - sievec /var/lib/dovecot/sieve/default.sieve + sievec /var/lib/dovecot/sieve/default.sieve \ + || ee_lib_error "Unable to compile Sieve rules, exit status = " $? # Configure Roundcube - sed -i "s:\$config\['plugins'\] = array(:\$config\['plugins'\] = array(\n 'sieverules':" /var/www/roundcubemail/htdocs/config/config.inc.php + sed -i "s:\$config\['plugins'\] = array(:\$config\['plugins'\] = array(\n 'sieverules':" /var/www/roundcubemail/htdocs/config/config.inc.php \ + || ee_lib_error "Unable to configure Sieve Roundcube plugin, exit status = " $? echo "\$config['sieverules_port'] = 4190;" >> /var/www/roundcubemail/htdocs/config/config.inc.php } From 33c8a84fb041e48894e3cdb03b9325268f4fa2f3 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 11 Aug 2014 14:27:45 +0530 Subject: [PATCH 039/131] Added service exists or not check --- src/lib/ee_lib_service.sh | 59 ++++++++++++++++++++------------------- 1 file changed, 31 insertions(+), 28 deletions(-) diff --git a/src/lib/ee_lib_service.sh b/src/lib/ee_lib_service.sh index 5eb9fad0..55660ddb 100644 --- a/src/lib/ee_lib_service.sh +++ b/src/lib/ee_lib_service.sh @@ -7,36 +7,39 @@ function ee_lib_service() { for ee_service_name in ${@:1:$(($#-1))}; do - # Display message - ee_lib_echo "Executing service $ee_service_name ${@: -1}, please wait..." + dpkg --get-selections | grep -v deinstall | grep $ee_service_name &>> $EE_COMMAND_LOG + if [ $? -eq 0 ];then + # Display message + ee_lib_echo "Executing service $ee_service_name ${@: -1}, please wait..." - # Check nginx and php5-fpm test before start/stop/restart/reload - if [ $ee_service_name = "nginx" ]; then - # Adjust nginx server_names_hash_bucket_size - $ee_service_name -t 2>&1 | grep server_names_hash_bucket_size &>> $EE_COMMAND_LOG - if [ $? -eq 0 ];then - EE_NGINX_CALCULATION=$(echo "l($(ls /etc/nginx/sites-enabled/ | wc -c))/l(2)+2" | bc -l) - EE_NGINX_SET_BUCKET=$(echo "2^$EE_NGINX_CALCULATION" | bc -l 2> /dev/null) - sed -i "s/.*server_names_hash_bucket_size.*/\tserver_names_hash_bucket_size $EE_NGINX_SET_BUCKET;/" /etc/nginx/nginx.conf + # Check nginx and php5-fpm test before start/stop/restart/reload + if [ $ee_service_name = "nginx" ]; then + # Adjust nginx server_names_hash_bucket_size + $ee_service_name -t 2>&1 | grep server_names_hash_bucket_size &>> $EE_COMMAND_LOG + if [ $? -eq 0 ];then + EE_NGINX_CALCULATION=$(echo "l($(ls /etc/nginx/sites-enabled/ | wc -c))/l(2)+2" | bc -l) + EE_NGINX_SET_BUCKET=$(echo "2^$EE_NGINX_CALCULATION" | bc -l 2> /dev/null) + sed -i "s/.*server_names_hash_bucket_size.*/\tserver_names_hash_bucket_size $EE_NGINX_SET_BUCKET;/" /etc/nginx/nginx.conf + fi + # Test and start/stop/restart/reload nginx service + $ee_service_name -t &>> $EE_COMMAND_LOG \ + && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? + elif [ $ee_service_name = "php5-fpm" ]; then + # Test and start/stop/restart/reload php5-fpm service + $ee_service_name -t &>> $EE_COMMAND_LOG \ + && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ + || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? + elif [ $ee_service_name = "dovecot" ]; then + # Test and start/stop/restart/reload Dovecot service + $ee_service_name -n &>> $EE_COMMAND_LOG \ + && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ + || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? + else + # start/stop/restart/reload services + service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? fi - # Test and start/stop/restart/reload nginx service - $ee_service_name -t &>> $EE_COMMAND_LOG \ - && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? - elif [ $ee_service_name = "php5-fpm" ]; then - # Test and start/stop/restart/reload php5-fpm service - $ee_service_name -t &>> $EE_COMMAND_LOG \ - && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ - || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? - elif [ $ee_service_name = "dovecot" ]; then - # Test and start/stop/restart/reload Dovecot service - $ee_service_name -n &>> $EE_COMMAND_LOG \ - && service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG\ - || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? - else - # start/stop/restart/reload services - service $ee_service_name ${@: -1} &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to execute service $ee_service_name ${@: -1}, exit status = " $? fi done } From 4a08e6d10e4683875612fa0058a772c0071de58b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 11 Aug 2014 15:39:40 +0530 Subject: [PATCH 040/131] Redirect unwanted msg --- src/modules/stack/ee_mod_stack_status.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/stack/ee_mod_stack_status.sh b/src/modules/stack/ee_mod_stack_status.sh index f2a6e4eb..6083a89e 100644 --- a/src/modules/stack/ee_mod_stack_status.sh +++ b/src/modules/stack/ee_mod_stack_status.sh @@ -30,13 +30,13 @@ function ee_mod_stack_status() fi # Service status - local ee_nginx_status=$(service nginx status | grep 'nginx is running' \ + local ee_nginx_status=$(service nginx status 2> /dev/null 2>> $EE_COMMAND_LOG| grep 'nginx is running' \ &>> $EE_COMMAND_LOG && ee_lib_echo "Running" || ee_lib_echo_fail "Stopped") - local ee_php_status=$(service php5-fpm status | grep running \ + local ee_php_status=$(service php5-fpm status 2> /dev/null | grep running \ &>> $EE_COMMAND_LOG && ee_lib_echo "Running" || ee_lib_echo_fail "Stopped") local ee_mysql_status=$(mysqladmin ping \ &>> $EE_COMMAND_LOG && ee_lib_echo "Running" || ee_lib_echo_fail "Stopped") - local ee_postfix_status=$(service postfix status | grep 'postfix is running' \ + local ee_postfix_status=$(service postfix status 2> /dev/null | grep 'postfix is running' \ &>> $EE_COMMAND_LOG && ee_lib_echo "Running" || ee_lib_echo_fail "Stopped") ee_lib_echo From d41583c50996074c50c42aecd9fe296080337e1d Mon Sep 17 00:00:00 2001 From: harshadyeola Date: Mon, 11 Aug 2014 15:44:12 +0530 Subject: [PATCH 041/131] check directory before cd --- src/lib/ee_lib_git.sh | 30 ++++++++++++++++-------------- 1 file changed, 16 insertions(+), 14 deletions(-) diff --git a/src/lib/ee_lib_git.sh b/src/lib/ee_lib_git.sh index 7f050dc4..3467c90e 100644 --- a/src/lib/ee_lib_git.sh +++ b/src/lib/ee_lib_git.sh @@ -3,22 +3,24 @@ function ee_lib_git() { for ee_git_dir in ${@:1:$(($#-1))}; do - # Change directory - cd $ee_git_dir || ee_lib_error "Unable to change directory $ee_git_dir, exit status = " $? + if [ -d $ee_git_dir ]; then + # Change directory + cd $ee_git_dir - # Check .git - if [ ! -d .git ]; then - # ee_lib_echo "Initialize Git on ${ee_git_dir}" - git init &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to initialize Git on $ee_git_dir, exit status = " $? - fi + # Check .git + if [ ! -d .git ]; then + # ee_lib_echo "Initialize Git on ${ee_git_dir}" + git init &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to initialize Git on $ee_git_dir, exit status = " $? + fi - # Check for untracked files - if [ $(git status -s | wc -l) -ne 0 ]; then - # Add files in Git version control - ee_lib_echo "Git commit on $ee_git_dir, please wait..." - git add --all && git commit -am "${@: -1}" &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? + # Check for untracked files + if [ $(git status -s | wc -l) -ne 0 ]; then + # Add files in Git version control + ee_lib_echo "Git commit on $ee_git_dir, please wait..." + git add --all && git commit -am "${@: -1}" &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to Git commit on $ee_git_dir, exit status = " $? + fi fi done } From cdcbbfdbc59e3ea74e2574fffd76690c7eea0b41 Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 11 Aug 2014 16:06:36 +0530 Subject: [PATCH 042/131] Avoid mysql match on php5-mysqlnd --- src/lib/ee_lib_service.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ee_lib_service.sh b/src/lib/ee_lib_service.sh index 55660ddb..441c9419 100644 --- a/src/lib/ee_lib_service.sh +++ b/src/lib/ee_lib_service.sh @@ -7,7 +7,7 @@ function ee_lib_service() { for ee_service_name in ${@:1:$(($#-1))}; do - dpkg --get-selections | grep -v deinstall | grep $ee_service_name &>> $EE_COMMAND_LOG + dpkg --get-selections | grep -v deinstall | grep ^$ee_service_name &>> $EE_COMMAND_LOG if [ $? -eq 0 ];then # Display message ee_lib_echo "Executing service $ee_service_name ${@: -1}, please wait..." From 5e43b29b32dbc6afc4fe653c89f3e062fadb5caf Mon Sep 17 00:00:00 2001 From: Mitesh Shah Date: Mon, 11 Aug 2014 16:18:59 +0530 Subject: [PATCH 043/131] Better way to detect service is available to reload/restart/stop/start --- src/lib/ee_lib_service.sh | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/lib/ee_lib_service.sh b/src/lib/ee_lib_service.sh index 441c9419..6ec5dcc2 100644 --- a/src/lib/ee_lib_service.sh +++ b/src/lib/ee_lib_service.sh @@ -7,8 +7,7 @@ function ee_lib_service() { for ee_service_name in ${@:1:$(($#-1))}; do - dpkg --get-selections | grep -v deinstall | grep ^$ee_service_name &>> $EE_COMMAND_LOG - if [ $? -eq 0 ];then + if [ -f /etc/init.d/$ee_service_name ];then # Display message ee_lib_echo "Executing service $ee_service_name ${@: -1}, please wait..." From 1c51bb2b60c0d703592fb0e6d8acff2fcbce4e3f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 11 Aug 2014 17:07:19 +0530 Subject: [PATCH 044/131] Added ViMbAdmin warning --- src/vendor/ee_ven_install_vimbadmin.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index 29da0421..1468782c 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -7,11 +7,12 @@ function ee_ven_install_vimbadmin() wget -cqO /var/www/22222/htdocs/vimbadmin.tar.gz https://github.com/opensolutions/ViMbAdmin/archive/3.0.10.tar.gz \ || ee_lib_error "Unable to download ViMbAdmin, exit status = " $? - ee_lib_echo "Installing ViMbAdmin, please wait..." mkdir -p /var/www/22222/htdocs/vimbadmin tar --strip-components=1 -zxf /var/www/22222/htdocs/vimbadmin.tar.gz -C /var/www/22222/htdocs/vimbadmin # Install Composer + ee_lib_echo "Installing ViMbAdmin, please wait..." + ee_lib_echo "It will take nearly 10-20 minutes, please wait..." cd /var/www/22222/htdocs/vimbadmin curl -sS https://getcomposer.org/installer | php &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to install Composer, exit status = " $? From d67770380e576c3c8e1d875fa8b63df7cbe84fec Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 14 Aug 2014 13:20:18 +0530 Subject: [PATCH 045/131] Support Remote MySQL for mail server --- src/vendor/ee_ven_setup_roundcube.sh | 2 +- src/vendor/ee_ven_setup_vimbadmin.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index 620f79c6..f7908aae 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -12,7 +12,7 @@ function ee_ven_setup_roundcube() || ee_lib_error "Unable to create Roundcube database, exit status = " $? # Create MySQL user - mysql -e "grant all privileges on roundcubemail.* to roundcube@'$EE_MYSQL_HOST' IDENTIFIED BY '$ee_random'" \ + mysql -e "grant all privileges on roundcubemail.* to roundcube@'$EE_MYSQL_GRANT_HOST' IDENTIFIED BY '$ee_random'" \ || ee_lib_error "Unable to grant privileges for Roundcube database user, exit status = " $? mysql -e "flush privileges" diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index fad62321..eb419282 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -12,7 +12,7 @@ function ee_ven_setup_vimbadmin() || ee_lib_error "Unable to create ViMbAdmin database, exit status = " $? # Create MySQL User - mysql -e "grant all privileges on vimbadmin.* to vimbadmin@'$EE_MYSQL_HOST' IDENTIFIED BY '$ee_random'" \ + mysql -e "grant all privileges on vimbadmin.* to vimbadmin@'$EE_MYSQL_GRANT_HOST' IDENTIFIED BY '$ee_random'" \ || ee_lib_error "Unable to grant privileges for ViMbAdmin database user, exit status = " $? mysql -e "flush privileges" From 3788de9b74ec41002b5e7ec2ffc49fdf5d47396d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 14 Aug 2014 17:11:43 +0530 Subject: [PATCH 046/131] Fixes #189 --- src/vendor/ee_ven_install_utils.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vendor/ee_ven_install_utils.sh b/src/vendor/ee_ven_install_utils.sh index be315097..26c3ad1c 100644 --- a/src/vendor/ee_ven_install_utils.sh +++ b/src/vendor/ee_ven_install_utils.sh @@ -115,6 +115,12 @@ function ee_ven_install_utils() echo -e "\t\tendscript" >> /etc/logrotate.d/mysql-server echo -e "}" >> /etc/logrotate.d/mysql-server fi + + # Download pt-query-advisor Fixed #189 + wget -q http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/2.1/download/head:/ptquerydigest-20110624220137-or26tn4expb9ul2a-16/pt-query-digest -O /usr/bin/pt-query-advisor \ + || ee_lib_error "Unable to copy download pt-query-advisor, exit status = " $? + chmod 0755 /usr/bin/pt-query-advisor + fi fi # Change permission From 086cbad99c77a5b124339d2ee910b58295865586 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 14 Aug 2014 17:15:26 +0530 Subject: [PATCH 047/131] Added -i to sed --- src/vendor/ee_ven_install_utils.sh | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/vendor/ee_ven_install_utils.sh b/src/vendor/ee_ven_install_utils.sh index 26c3ad1c..348cbf3f 100644 --- a/src/vendor/ee_ven_install_utils.sh +++ b/src/vendor/ee_ven_install_utils.sh @@ -121,6 +121,10 @@ function ee_ven_install_utils() || ee_lib_error "Unable to copy download pt-query-advisor, exit status = " $? chmod 0755 /usr/bin/pt-query-advisor + # Enable pt-query-advisor plugin in Anemometer + sed -i "s/# 'query_advisor'/ 'query_advisor'/" /var/www/22222/htdocs/db/anemometer/conf/config.inc.php \ + || ee_lib_error "Unable to to activate pt-query-advisor plugin, exit status = " $? + fi fi # Change permission From 3a45e5615b62224bbc2bbaf6e6d6821f6dde5315 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 14 Aug 2014 17:24:13 +0530 Subject: [PATCH 048/131] Removed Extra Space --- src/vendor/ee_ven_install_utils.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_install_utils.sh b/src/vendor/ee_ven_install_utils.sh index 348cbf3f..502598d1 100644 --- a/src/vendor/ee_ven_install_utils.sh +++ b/src/vendor/ee_ven_install_utils.sh @@ -122,7 +122,7 @@ function ee_ven_install_utils() chmod 0755 /usr/bin/pt-query-advisor # Enable pt-query-advisor plugin in Anemometer - sed -i "s/# 'query_advisor'/ 'query_advisor'/" /var/www/22222/htdocs/db/anemometer/conf/config.inc.php \ + sed -i "s/# 'query_advisor'/ 'query_advisor'/" /var/www/22222/htdocs/db/anemometer/conf/config.inc.php \ || ee_lib_error "Unable to to activate pt-query-advisor plugin, exit status = " $? fi From 54cb5127a995a07be8c11242d10c8e1ab13975e9 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 19 Aug 2014 19:52:36 +0530 Subject: [PATCH 049/131] Introduced mail command --- bin/easyengine | 40 +++++++++++++++++++++++++++++++++++++++- 1 file changed, 39 insertions(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index 5735fad8..8f1d36ce 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -90,7 +90,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Display success message ee_lib_echo "$EE_THIRD successfully installed" - elif [ "$EE_THIRD" = "" ]; then + elif [ "$EE_THIRD" = "" ] || [ "$EE_THIRD" = "--web" ] || [ "$EE_THIRD" = "--all" ]; then # Setup NGINX/PHP repository ee_mod_repo_nginx ee_mod_repo_php @@ -128,6 +128,44 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo "Successfully installed all packages" ee_lib_echo "Create your first WordPress site powered by NGINX using:" ee_lib_echo_info "ee site create example.com --wp" + + # EasyEngine mail server setup + elif ["$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then + # Install Dovecot + ee_mod_install_dovecot + + # Install ViMbAdmin + ee_ven_install_vimbadmin + + # Install Roundcube + ee_ven_install_roundcube + + # Install Amavis + ee_ven_install_amavis + + # Install Sieve + ee_ven_install_sieve + + # Configure PostFix + ee_mod_setup_postfix + + # Configure Dovecot + ee_mod_setup_dovecot + + # Setup ViMbAdmin + ee_ven_setup_vimbadmin + + # Setup Roundcube + ee_ven_setup_roundcube + + # Setup Amavis + ee_ven_setup_amavis + + # Setup Sieve + ee_ven_setup_sieve + + ee_lib_echo "Successfully installed mail server" + fi # EasyEngine remove/purge From bd413dca0072b26d8f232aed1f2b9122f9d647ef Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 18:39:07 +0530 Subject: [PATCH 050/131] Added Roundcbue Nginx configuration --- src/vendor/ee_ven_setup_roundcube.sh | 7 +++++++ templates/mail/webmail | 23 +++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 templates/mail/webmail diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index f7908aae..2ea51517 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -25,4 +25,11 @@ function ee_ven_setup_roundcube() sed -i "s'mysql://roundcube:pass@localhost/roundcubemail'mysql://roundcube:${ee_random}@${EE_MYSQL_HOST}/roundcubemail'" /var/www/roundcubemail/htdocs/config/config.inc.php \ || ee_lib_error "Unable to setup Roundcube database details in config.inc.php file, exit status = " $? + # Setup Nginx configuration to access Webmail + cp -v /usr/share/easyengine/mail/webmail /etc/nginx/sites-available/ &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to copy Nginx configuration for Roundcube, exit status = " $? + + ln -sf /etc/nginx/sites-available/webmail /etc/nginx/sites-enabled/ \ + || ee_lib_error "Unable to create softlink for Webmail, exit status = " $? + } diff --git a/templates/mail/webmail b/templates/mail/webmail new file mode 100644 index 00000000..fff3a464 --- /dev/null +++ b/templates/mail/webmail @@ -0,0 +1,23 @@ +# Nginx Configuration to access webmail +# Don't modify this file, EasyEngine replaces it with new version + +server { + server_name webmail.*; + + access_log /var/log/nginx/webmail.access.log; + error_log /var/log/nginx/webmail.error.log; + + root /var/www/roundcube/htdocs; + index index.php; + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php$ { + try_files $uri =404; + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + } + +} From ee34f8b21fb8fb43a9bb818a656d2043dbd8cd88 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 18:45:42 +0530 Subject: [PATCH 051/131] Fixed Typo --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index 8f1d36ce..f4fd3003 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -130,7 +130,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo_info "ee site create example.com --wp" # EasyEngine mail server setup - elif ["$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then + elif [ "$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then # Install Dovecot ee_mod_install_dovecot From a62c20935bcb69cfd3daa51dc9e003b2e9afd2dc Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 19:12:01 +0530 Subject: [PATCH 052/131] Fixed some function names and Added service restart code --- bin/easyengine | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index f4fd3003..bfcae201 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -141,10 +141,10 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_ven_install_roundcube # Install Amavis - ee_ven_install_amavis + ee_mod_install_amavis # Install Sieve - ee_ven_install_sieve + ee_mod_install_sieve # Configure PostFix ee_mod_setup_postfix @@ -159,10 +159,15 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_ven_setup_roundcube # Setup Amavis - ee_ven_setup_amavis + ee_mod_setup_amavis # Setup Sieve - ee_ven_setup_sieve + ee_mod_setup_sieve + + + ee_lib_service nginx postfix dovecot restart + + ee_lib_git /etc/nginx/ /etc/php5/ /etc/mysql/ /etc/postfix "Initialize Git" ee_lib_echo "Successfully installed mail server" From fc75b25d0b05438185a314f505b9e1761db463f0 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 19:43:08 +0530 Subject: [PATCH 053/131] Added --all option for Web and Mail install and added dovecot package check --- bin/easyengine | 4 ++-- .../stack/install/mail/ee_mod_install_dovecot.sh | 14 ++++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index bfcae201..c988b222 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -128,9 +128,9 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo "Successfully installed all packages" ee_lib_echo "Create your first WordPress site powered by NGINX using:" ee_lib_echo_info "ee site create example.com --wp" - + fi # EasyEngine mail server setup - elif [ "$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then + if [ "$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then # Install Dovecot ee_mod_install_dovecot diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index 44c2b8c1..ad247354 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -3,9 +3,23 @@ function ee_mod_install_dovecot() { # Install Dovecot + dpkg -l | grep nginx > /dev/null \ + && dpkg -l | grep php5-fpm > /dev/null \ + && dpkg -l | grep mysql > /dev/null \ + && dpkg -l | grep postfix > /dev/null + if [ $? -ne 0 ];then + ee_lib_error "Failed to find pre dependencies. Please install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 + fi + + dkpg -l | grep dovecot-core > /dev/null + if [$? -eq 0 ];then + ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 + fi + ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to install Dovecot, exit status = " $? + } From ac1aac8695932b5cdc5b78207c3c717e67660b2d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 19:47:15 +0530 Subject: [PATCH 054/131] Fixed typo --- src/modules/stack/install/mail/ee_mod_install_dovecot.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index ad247354..c0942291 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -3,7 +3,7 @@ function ee_mod_install_dovecot() { # Install Dovecot - dpkg -l | grep nginx > /dev/null \ + dpkg -l | grep nginx > /dev/null \ && dpkg -l | grep php5-fpm > /dev/null \ && dpkg -l | grep mysql > /dev/null \ && dpkg -l | grep postfix > /dev/null @@ -12,7 +12,7 @@ function ee_mod_install_dovecot() fi dkpg -l | grep dovecot-core > /dev/null - if [$? -eq 0 ];then + if [ $? -eq 0 ];then ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 fi From deab1c5f40c99749b982030a0c9110cd908117a5 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 19:50:43 +0530 Subject: [PATCH 055/131] Fixed typo --- src/modules/stack/install/mail/ee_mod_install_dovecot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index c0942291..38af7058 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -11,7 +11,7 @@ function ee_mod_install_dovecot() ee_lib_error "Failed to find pre dependencies. Please install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 fi - dkpg -l | grep dovecot-core > /dev/null + dpkg -l | grep dovecot-core > /dev/null if [ $? -eq 0 ];then ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 fi From 928752cd00b3805d55ed94a1581f0582ca86d87e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 20 Aug 2014 20:13:40 +0530 Subject: [PATCH 056/131] Fixed Wrong function name --- src/modules/stack/install/mail/ee_mod_setup_sieve.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index 8b80c72c..58e62a92 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -1,6 +1,6 @@ # Setup Sieve -function ee_mod_setup_amavis() +function ee_mod_setup_sieve() { # Enable sieve plugin support for dovecot-lmtp sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mns sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ From 08be992c5b2de659d15566799266a5d3d25ddbac Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 21 Aug 2014 12:12:47 +0530 Subject: [PATCH 057/131] Added ViMbAdmin Nginx configuration --- src/vendor/ee_ven_setup_vimbadmin.sh | 8 ++++++++ templates/mail/vma | 23 +++++++++++++++++++++++ 2 files changed, 31 insertions(+) create mode 100644 templates/mail/vma diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index eb419282..d5df5091 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -53,4 +53,12 @@ function ee_ven_setup_vimbadmin() /var/www/22222/htdocs/vimbadmin/bin/doctrine2-cli.php orm:schema-tool:create \ || ee_lib_error "Unable to setup ViMbAdmin default database , exit status = " $? + # Setup Nginx configuration to access ViMbAdmin + cp -v /usr/share/easyengine/mail/vma /etc/nginx/sites-available/ &>> $EE_COMMAND_LOG \ + || ee_lib_error "Unable to copy Nginx configuration for ViMbAdmin, exit status = " $? + + ln -sf /etc/nginx/sites-available/vma /etc/nginx/sites-enabled/ \ + || ee_lib_error "Unable to create softlink for ViMbAdmin, exit status = " $? + + } diff --git a/templates/mail/vma b/templates/mail/vma new file mode 100644 index 00000000..fc15e31b --- /dev/null +++ b/templates/mail/vma @@ -0,0 +1,23 @@ +# Nginx Configuration to access webmail +# Don't modify this file,After update EasyEngine replaces it with new version + +server { + server_name vma.*; + + access_log /var/log/nginx/vma.access.log; + error_log /var/log/nginx/vma.error.log; + + root /var/www/22222/htdocs/vimbadmin; + index index.php; + + location / { + try_files $uri $uri/ /index.php?$args; + } + + location ~ \.php$ { + try_files $uri =404; + include fastcgi_params; + fastcgi_pass 127.0.0.1:9000; + } + +} From c2d53dd3ca25a26854f733895200612b4e90c72b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 21 Aug 2014 13:55:46 +0530 Subject: [PATCH 058/131] Fixed Sieve rules compialtion issue --- src/modules/stack/install/mail/ee_mod_setup_sieve.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index 58e62a92..4fcfac88 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -3,7 +3,7 @@ function ee_mod_setup_sieve() { # Enable sieve plugin support for dovecot-lmtp - sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mns sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ + sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mail_plugins = \$mail_plugins sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ || ee_lib_error "Unable to add sieve plugin support for dovecot-lmtp, exit status = " $? # Sieve dovecot-pluign configuration From a423dc0f513c0ede1f22d830a1a1689f8d2a639c Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 21 Aug 2014 14:23:03 +0530 Subject: [PATCH 059/131] Fixed wrong functin name --- src/modules/stack/install/mail/ee_mod_install_amavis.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_amavis.sh b/src/modules/stack/install/mail/ee_mod_install_amavis.sh index c2804cb1..0ad49490 100644 --- a/src/modules/stack/install/mail/ee_mod_install_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_install_amavis.sh @@ -1,6 +1,6 @@ # Install Amavis package -function ee_mod_install_dovecot() +function ee_mod_install_amavis() { # Install Amavis ee_lib_echo "Installing Amavis, please wait..." From 2e0dac463e30c259266a8fcbd5de0b2b03eae556 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 21 Aug 2014 15:31:08 +0530 Subject: [PATCH 060/131] Fixed Amavis installation --- src/modules/stack/install/mail/ee_mod_install_amavis.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_amavis.sh b/src/modules/stack/install/mail/ee_mod_install_amavis.sh index 0ad49490..6f72603a 100644 --- a/src/modules/stack/install/mail/ee_mod_install_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_install_amavis.sh @@ -3,7 +3,7 @@ function ee_mod_install_amavis() { # Install Amavis - ee_lib_echo "Installing Amavis, please wait..." - $EE_APT_GET amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ - || ee_lib_error "Unable to install Amavis, exit status = " $? + ee_lib_echo "Installing Amavis and ClamAV, please wait..." + $EE_APT_GET install amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + || ee_lib_error "Unable to install Amavis and ClamAV, exit status = " $? } From 6ca0597b9570407eee8f7243c6adede580464b5d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 22 Aug 2014 13:14:29 +0530 Subject: [PATCH 061/131] Fixed Missing package and ROundcube setup issue: --- src/modules/stack/install/mail/ee_mod_install_dovecot.sh | 2 +- src/modules/stack/install/mail/ee_mod_setup_sieve.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index 38af7058..692dcad4 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -19,7 +19,7 @@ function ee_mod_install_dovecot() ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" - $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ + $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved postfix-mysql \ || ee_lib_error "Unable to install Dovecot, exit status = " $? } diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index 4fcfac88..f49222ef 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -21,7 +21,7 @@ function ee_mod_setup_sieve() || ee_lib_error "Unable to compile Sieve rules, exit status = " $? # Configure Roundcube - sed -i "s:\$config\['plugins'\] = array(:\$config\['plugins'\] = array(\n 'sieverules':" /var/www/roundcubemail/htdocs/config/config.inc.php \ + sed -i "s:\$config\['plugins'\] = array(:\$config\['plugins'\] = array(\n 'sieverules',:" /var/www/roundcubemail/htdocs/config/config.inc.php \ || ee_lib_error "Unable to configure Sieve Roundcube plugin, exit status = " $? echo "\$config['sieverules_port'] = 4190;" >> /var/www/roundcubemail/htdocs/config/config.inc.php } From c3d5cbb383a9039c44d467b9b50e4097c2d19e96 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 22 Aug 2014 16:16:45 +0530 Subject: [PATCH 062/131] Added Certificate for Dovecot and Postfix --- .../stack/install/mail/ee_mod_setup_dovecot.sh | 18 ++++++++++++++++++ .../stack/install/mail/ee_mod_setup_postfix.sh | 13 +++++++++++++ 2 files changed, 31 insertions(+) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index ca77fc4a..43b4e9e7 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -2,6 +2,14 @@ function ee_mod_setup_dovecot() { + + EE_EMAIL=$($EE_CONFIG_GET wordpress.email) + if [[ $EE_EMAIL = "" ]]; then + EE_EMAIL=$(git config user.email) + fi + + EE_HOSTNAME=$(hostname -f) + ee_lib_echo "Setting up Dovecot, please wait..." # Adding mail user with GID 5000 and UID 5000 groupadd -g 5000 vmail && useradd -g vmail -u 5000 vmail -d /var/vmail -m \ @@ -39,4 +47,14 @@ function ee_mod_setup_dovecot() # Change Dovecot log location sed -i "s/#log_path = syslog/log_path = \/var\/log\/dovecot.log/" /etc/dovecot/conf.d/10-logging.conf \ || ee_lib_error "Unable to setup Dovecot log_path, exit status = " $? + + # Configure self signed SSL for Dovecot + ee_lib_echo "Generating self signed certificate for Dovecot, please wait..." + openssl req -new -x509 -days 3650 -nodes -subj /commonName=${EE_HOSTNAME}/emailAddress=${EE_EMAIL} -out /etc/ssl/certs/dovecot.pem -keyout /etc/ssl/private/dovecot.pem &>> $EE_COMMAND_LOG + + # Setting up certificate in file + sed -i "s'/etc/dovecot/dovecot.pem'/etc/ssl/certs/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \ + sed -i "s'/etc/dovecot/private/dovecot.pem'/etc/ssl/private/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \ + || ee_lib_error "Unable to setup Dovecot SSL certificate path, exit status = " $? + } diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index a8d19fa5..9c0bd7bb 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -2,6 +2,13 @@ function ee_mod_setup_postfix() { + + EE_EMAIL=$($EE_CONFIG_GET wordpress.email) + if [[ $EE_EMAIL = "" ]]; then + EE_EMAIL=$(git config user.email) + fi + + EE_HOSTNAME=$(hostname -f) ee_lib_echo "Setting up Postfix, please wait..." #Configure Master.cf sed -i 's/#submission/submission/' /etc/postfix/master.cf && @@ -43,4 +50,10 @@ function ee_mod_setup_postfix() cp -av /usr/share/easyengine/mail/virtual_mailbox_maps.cf /etc/postfix/mysql/virtual_mailbox_maps.cf &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to copy Postfix MySQL configuration files, exit status = " $? + # Configure self signed SSL for Postfix + ee_lib_echo "Generating self signed certificate for Postfix, please wait..." + openssl req -new -x509 -days 3650 -nodes -subj /commonName=${EE_HOSTNAME}/emailAddress=${EE_EMAIL} -out /etc/ssl/certs/postfix.pem -keyout /etc/ssl/private/postfix.pem &>> $EE_COMMAND_LOG + postconf -e smtpd_tls_cert_file=/etc/ssl/certs/postfix.pem + postconf -e smtpd_tls_key_file=/etc/ssl/private/postfix.pem + } From 6945d6ada9b554959a1adc6709622d1331541a79 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 22 Aug 2014 16:29:34 +0530 Subject: [PATCH 063/131] Added Dovecot init.d script and Set the permission for dovcot/postfix key file --- .../install/mail/ee_mod_setup_dovecot.sh | 3 + .../install/mail/ee_mod_setup_postfix.sh | 2 + templates/mail/dovecot | 72 +++++++++++++++++++ 3 files changed, 77 insertions(+) create mode 100644 templates/mail/dovecot diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 43b4e9e7..876ca553 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -57,4 +57,7 @@ function ee_mod_setup_dovecot() sed -i "s'/etc/dovecot/private/dovecot.pem'/etc/ssl/private/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \ || ee_lib_error "Unable to setup Dovecot SSL certificate path, exit status = " $? + # Setting Dovecot init.d script + cp -v /usr/share/easyengine/mail/dovecot /etc/init.d/dovecot &>> $EE_COMMAND_LOG \ + } diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index 9c0bd7bb..c49b05f2 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -53,6 +53,8 @@ function ee_mod_setup_postfix() # Configure self signed SSL for Postfix ee_lib_echo "Generating self signed certificate for Postfix, please wait..." openssl req -new -x509 -days 3650 -nodes -subj /commonName=${EE_HOSTNAME}/emailAddress=${EE_EMAIL} -out /etc/ssl/certs/postfix.pem -keyout /etc/ssl/private/postfix.pem &>> $EE_COMMAND_LOG + chmod 0600 /etc/ssl/private/postfix.pem + postconf -e smtpd_tls_cert_file=/etc/ssl/certs/postfix.pem postconf -e smtpd_tls_key_file=/etc/ssl/private/postfix.pem diff --git a/templates/mail/dovecot b/templates/mail/dovecot new file mode 100644 index 00000000..d3bdd857 --- /dev/null +++ b/templates/mail/dovecot @@ -0,0 +1,72 @@ +### BEGIN INIT INFO +# Provides: dovecot +# Required-Start: $local_fs $remote_fs $network $syslog $time +# Required-Stop: $local_fs $remote_fs $network $syslog +# Should-Start: postgresql mysql slapd winbind +# Should-Stop: postgresql mysql slapd winbind +# Default-Start: 2 3 4 5 +# Default-Stop: 0 1 6 +# Short-Description: Dovecot init script +# Description: Init script for dovecot services +### END INIT INFO + +# Example /etc/init.d/dovecot script. Change DAEMON if necessary. +# License is public domain. + +DAEMON=/usr/sbin/dovecot + +# Uncomment to allow Dovecot daemons to produce core dumps. +#ulimit -c unlimited + +test -x $DAEMON || exit 1 +set -e + +base_dir=`$DAEMON config -h base_dir` +pidfile=$base_dir/master.pid + +if test -f $pidfile; then + running=yes +else + running=no +fi + +case "$1" in + start) + echo -n "Starting Dovecot" + $DAEMON + echo "." + ;; + stop) + if test $running = yes; then + echo "Stopping Dovecot" + kill `cat $pidfile` + echo "." + else + echo "Dovecot is already stopped." + fi + ;; + reload) + if test $running = yes; then + echo -n "Reloading Dovecot configuration" + kill -HUP `cat $pidfile` + echo "." + else + echo "Dovecot isn't running." + fi + ;; + restart|force-reload) + echo -n "Restarting Dovecot" + if test $running = yes; then + kill `cat $pidfile` + sleep 1 + fi + $DAEMON + echo "." + ;; + *) + echo "Usage: /etc/init.d/dovecot {start|stop|reload|restart|force-reload}" >&2 + exit 1 + ;; +esac + +exit 0 \ No newline at end of file From e271db2c50d7a428b4fc1c936f1c91763a518a3b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 25 Aug 2014 13:08:50 +0530 Subject: [PATCH 064/131] Fixed 'Unable to setup Dovecot SSL certificate path' --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 876ca553..5c3d1dd4 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -51,10 +51,11 @@ function ee_mod_setup_dovecot() # Configure self signed SSL for Dovecot ee_lib_echo "Generating self signed certificate for Dovecot, please wait..." openssl req -new -x509 -days 3650 -nodes -subj /commonName=${EE_HOSTNAME}/emailAddress=${EE_EMAIL} -out /etc/ssl/certs/dovecot.pem -keyout /etc/ssl/private/dovecot.pem &>> $EE_COMMAND_LOG + chmod 0600 /etc/ssl/private/dovecot.pem # Setting up certificate in file sed -i "s'/etc/dovecot/dovecot.pem'/etc/ssl/certs/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \ - sed -i "s'/etc/dovecot/private/dovecot.pem'/etc/ssl/private/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \ + && sed -i "s'/etc/dovecot/private/dovecot.pem'/etc/ssl/private/dovecot.pem'" /etc/dovecot/conf.d/10-ssl.conf \ || ee_lib_error "Unable to setup Dovecot SSL certificate path, exit status = " $? # Setting Dovecot init.d script From 46eb15f272e32ea764aa07d9953ded74220aa861 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 25 Aug 2014 13:17:16 +0530 Subject: [PATCH 065/131] Fixed various small issues --- bin/easyengine | 3 +-- src/modules/stack/install/mail/ee_mod_setup_amavis.sh | 2 ++ src/modules/stack/install/mail/ee_mod_setup_sieve.sh | 2 ++ 3 files changed, 5 insertions(+), 2 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index c988b222..092ea23a 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -163,11 +163,10 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Setup Sieve ee_mod_setup_sieve - ee_lib_service nginx postfix dovecot restart - ee_lib_git /etc/nginx/ /etc/php5/ /etc/mysql/ /etc/postfix "Initialize Git" + ee_lib_git /etc/nginx/ /etc/dovecot /etc/php5/ /etc/mysql/ /etc/postfix "Initialize Git" ee_lib_echo "Successfully installed mail server" diff --git a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh index 84af5a92..ce0e3177 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_amavis.sh @@ -3,6 +3,8 @@ function ee_mod_setup_amavis() { # Confiure Amavis + + ee_lib_echo "Setting up Amavis, please wait..." sed -i "s'#@'@'" /etc/amavis/conf.d/15-content_filter_mode && \ sed -i "s'# ' '" /etc/amavis/conf.d/15-content_filter_mode \ || ee_lib_error "Unable to setup Amavis, exit status = " $? diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index f49222ef..6f47f2dd 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -2,6 +2,8 @@ function ee_mod_setup_sieve() { + ee_lib_echo "Setting up Sieve, please wait..." + # Enable sieve plugin support for dovecot-lmtp sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mail_plugins = \$mail_plugins sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ || ee_lib_error "Unable to add sieve plugin support for dovecot-lmtp, exit status = " $? From 1f0723ec06edaabcb684f5e6f982f49dcf9ac735 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 25 Aug 2014 15:27:34 +0530 Subject: [PATCH 066/131] Added conotent to Identify mail server is done by EasyEngine or not --- templates/mail/dovecot | 1 + 1 file changed, 1 insertion(+) diff --git a/templates/mail/dovecot b/templates/mail/dovecot index d3bdd857..c7b13ace 100644 --- a/templates/mail/dovecot +++ b/templates/mail/dovecot @@ -1,3 +1,4 @@ +# EasyEngine Dovecot init script ### BEGIN INIT INFO # Provides: dovecot # Required-Start: $local_fs $remote_fs $network $syslog $time From 410f8b166a6f4dbabaf8000f8783ef8ff273b853 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 25 Aug 2014 16:42:26 +0530 Subject: [PATCH 067/131] Simplified Installation code --- bin/easyengine | 19 +++++++++++++++++-- bin/update | 6 +++--- .../install/mail/ee_mod_install_dovecot.sh | 15 +-------------- ...l_amavis.sh => ee_mod_install_mailscan.sh} | 6 +++--- .../install/mail/ee_mod_install_sieve.sh | 2 +- ...tup_amavis.sh => ee_mod_setup_mailscan.sh} | 2 +- .../install/mail/ee_mod_setup_postfix.sh | 7 +++++++ 7 files changed, 33 insertions(+), 24 deletions(-) rename src/modules/stack/install/mail/{ee_mod_install_amavis.sh => ee_mod_install_mailscan.sh} (56%) rename src/modules/stack/install/mail/{ee_mod_setup_amavis.sh => ee_mod_setup_mailscan.sh} (97%) diff --git a/bin/easyengine b/bin/easyengine index 092ea23a..505db325 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -131,6 +131,21 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then fi # EasyEngine mail server setup if [ "$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then + + # Check required Packages are installed or not + dpkg --get-selections | grep -v deinstall | grep nginx > /dev/null \ + && dpkg --get-selections | grep -v deinstall | grep php5-fpm > /dev/null \ + && dpkg --get-selections | grep -v deinstall | grep mysql > /dev/null \ + && dpkg --get-selections | grep -v deinstall | grep postfix > /dev/null + if [ $? -ne 0 ];then + ee_lib_error "Failed to find pre dependencies. Please install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 + fi + + dpkg --get-selections | grep -v deinstall | grep dovecot-core > /dev/null + if [ $? -eq 0 ];then + ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 + fi + # Install Dovecot ee_mod_install_dovecot @@ -141,7 +156,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_ven_install_roundcube # Install Amavis - ee_mod_install_amavis + ee_mod_install_mailscan # Install Sieve ee_mod_install_sieve @@ -159,7 +174,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_ven_setup_roundcube # Setup Amavis - ee_mod_setup_amavis + ee_mod_setup_mailscan # Setup Sieve ee_mod_setup_sieve diff --git a/bin/update b/bin/update index d332bd74..6f3f05a0 100644 --- a/bin/update +++ b/bin/update @@ -285,7 +285,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then || ee_lib_error "Unable to generate SSL certificate for port 22222, exit status = " $? # Update PHP configuration - dpkg -l | grep php5-fpm &>> $EE_UPDATE_LOG + dpkg --get-selections | grep -v deinstall | grep php5-fpm &>> $EE_UPDATE_LOG if [ $? -eq 0 ]; then ee_lib_echo "Installing php5-xdebug package, please wait..." apt-get -y install php5-xdebug \ @@ -325,7 +325,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then || ee_lib_error "Unable to add xdebug settings for debug pool, exit status = " $? fi - dpkg -l | grep mysql-server &>> $EE_UPDATE_LOG + dpkg --get-selections | grep -v deinstall | grep mysql-server &>> $EE_UPDATE_LOG if [ $? -eq 0 ]; then ee_lib_echo "Installing percona-toolkit package, please wait..." apt-get -y install percona-toolkit \ @@ -396,7 +396,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then fi if [[ $EE_CURRENT_VERSION = 2.0.0 ]]; then - dpkg -l | grep php5-fpm &>> $EE_UPDATE_LOG + dpkg --get-selections | grep -v deinstall | grep php5-fpm &>> $EE_UPDATE_LOG if [ $? -eq 0 ]; then # WP-CLI change the installation method diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index 692dcad4..ed49ba86 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -3,23 +3,10 @@ function ee_mod_install_dovecot() { # Install Dovecot - dpkg -l | grep nginx > /dev/null \ - && dpkg -l | grep php5-fpm > /dev/null \ - && dpkg -l | grep mysql > /dev/null \ - && dpkg -l | grep postfix > /dev/null - if [ $? -ne 0 ];then - ee_lib_error "Failed to find pre dependencies. Please install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 - fi - - dpkg -l | grep dovecot-core > /dev/null - if [ $? -eq 0 ];then - ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 - fi - ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" - $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved postfix-mysql \ + $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ || ee_lib_error "Unable to install Dovecot, exit status = " $? } diff --git a/src/modules/stack/install/mail/ee_mod_install_amavis.sh b/src/modules/stack/install/mail/ee_mod_install_mailscan.sh similarity index 56% rename from src/modules/stack/install/mail/ee_mod_install_amavis.sh rename to src/modules/stack/install/mail/ee_mod_install_mailscan.sh index 6f72603a..d30be7ef 100644 --- a/src/modules/stack/install/mail/ee_mod_install_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_install_mailscan.sh @@ -1,9 +1,9 @@ # Install Amavis package -function ee_mod_install_amavis() +function ee_mod_install_mailscan() { # Install Amavis - ee_lib_echo "Installing Amavis and ClamAV, please wait..." + ee_lib_echo "Installing Amavis, SpamAssassin and ClamAV, please wait..." $EE_APT_GET install amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ - || ee_lib_error "Unable to install Amavis and ClamAV, exit status = " $? + || ee_lib_error "Unable to install Amavis, SpamAssassin and ClamAV, exit status = " $? } diff --git a/src/modules/stack/install/mail/ee_mod_install_sieve.sh b/src/modules/stack/install/mail/ee_mod_install_sieve.sh index bf20b52e..e72503cb 100644 --- a/src/modules/stack/install/mail/ee_mod_install_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_install_sieve.sh @@ -4,6 +4,6 @@ function ee_mod_install_sieve() { # Install Sieve ee_lib_echo "Installing Sieve, please wait..." - $EE_APT_GET install amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + $EE_APT_GET install apt-get install dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to install Sieve, exit status = " $? } diff --git a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh similarity index 97% rename from src/modules/stack/install/mail/ee_mod_setup_amavis.sh rename to src/modules/stack/install/mail/ee_mod_setup_mailscan.sh index ce0e3177..811242e5 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_amavis.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh @@ -1,6 +1,6 @@ # Setup Amavis -function ee_mod_setup_amavis() +function ee_mod_setup_mailscan() { # Confiure Amavis diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index c49b05f2..59dac0d6 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -9,6 +9,13 @@ function ee_mod_setup_postfix() fi EE_HOSTNAME=$(hostname -f) + + #We previously not used this package. So, if some one don't have Postfix-MySQL installed, + #Postfix will not work + ee_lib_echo "Installing Postfix-MySQL, please wait..." + $EE_APT_GET install postfix-mysql \ + || ee_lib_error "Unable to install Postfix-MySQL, exit status = " $? + ee_lib_echo "Setting up Postfix, please wait..." #Configure Master.cf sed -i 's/#submission/submission/' /etc/postfix/master.cf && From 22b1b368ab6fad7b3387b5a2d6f2fa2cda986fa7 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 25 Aug 2014 17:35:16 +0530 Subject: [PATCH 068/131] Fixed Wrong package names --- src/modules/stack/install/mail/ee_mod_install_sieve.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_sieve.sh b/src/modules/stack/install/mail/ee_mod_install_sieve.sh index e72503cb..5deecdbf 100644 --- a/src/modules/stack/install/mail/ee_mod_install_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_install_sieve.sh @@ -4,6 +4,6 @@ function ee_mod_install_sieve() { # Install Sieve ee_lib_echo "Installing Sieve, please wait..." - $EE_APT_GET install apt-get install dovecot-sieve dovecot-managesieved \ + $EE_APT_GET install dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to install Sieve, exit status = " $? } From a590c12a7a6959cbad11d6c46cdb60f70ece1fb7 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 25 Aug 2014 17:44:20 +0530 Subject: [PATCH 069/131] Addded missing ViMbAdmin Packages --- src/vendor/ee_ven_install_vimbadmin.sh | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index 1468782c..8b550622 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -2,6 +2,12 @@ function ee_ven_install_vimbadmin() { + + # Install needed PHP5 libraries for ViMbAdmin + ee_lib_echo "Installing PHP5 libraries for ViMbAdmin, please wait..." + $EE_APT_GET install php5-cgi php5-mcrypt php5-memcache php5-json php5-mysqlnd php-gettext \ + || ee_lib_error "Unable to install php-pear, exit status = " $? + # Install ViMbAdmin ee_lib_echo "Downloading ViMbAdmin, please wait..." wget -cqO /var/www/22222/htdocs/vimbadmin.tar.gz https://github.com/opensolutions/ViMbAdmin/archive/3.0.10.tar.gz \ From b0628ef3642a881d5e3780127591aa9c0c6c5860 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 26 Aug 2014 14:26:51 +0530 Subject: [PATCH 070/131] Created ViMbAdmin Nginx rules --- src/vendor/ee_ven_setup_vimbadmin.sh | 8 -------- templates/mail/vma | 23 ----------------------- templates/nginx/22222 | 19 +++++++++++++++++++ 3 files changed, 19 insertions(+), 31 deletions(-) delete mode 100644 templates/mail/vma diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index d5df5091..eb419282 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -53,12 +53,4 @@ function ee_ven_setup_vimbadmin() /var/www/22222/htdocs/vimbadmin/bin/doctrine2-cli.php orm:schema-tool:create \ || ee_lib_error "Unable to setup ViMbAdmin default database , exit status = " $? - # Setup Nginx configuration to access ViMbAdmin - cp -v /usr/share/easyengine/mail/vma /etc/nginx/sites-available/ &>> $EE_COMMAND_LOG \ - || ee_lib_error "Unable to copy Nginx configuration for ViMbAdmin, exit status = " $? - - ln -sf /etc/nginx/sites-available/vma /etc/nginx/sites-enabled/ \ - || ee_lib_error "Unable to create softlink for ViMbAdmin, exit status = " $? - - } diff --git a/templates/mail/vma b/templates/mail/vma deleted file mode 100644 index fc15e31b..00000000 --- a/templates/mail/vma +++ /dev/null @@ -1,23 +0,0 @@ -# Nginx Configuration to access webmail -# Don't modify this file,After update EasyEngine replaces it with new version - -server { - server_name vma.*; - - access_log /var/log/nginx/vma.access.log; - error_log /var/log/nginx/vma.error.log; - - root /var/www/22222/htdocs/vimbadmin; - index index.php; - - location / { - try_files $uri $uri/ /index.php?$args; - } - - location ~ \.php$ { - try_files $uri =404; - include fastcgi_params; - fastcgi_pass 127.0.0.1:9000; - } - -} diff --git a/templates/nginx/22222 b/templates/nginx/22222 index 1ea0e1bd..44e50952 100644 --- a/templates/nginx/22222 +++ b/templates/nginx/22222 @@ -39,4 +39,23 @@ server { fastcgi_pass php; } + # ViMbAdmin Rules + location = /vimbadmin/ { + return 301 $scheme://$host:22222/vimbadmin/public/; + } + + location ~* \.(js|css|jpg|gif|png)$ { + root /var/www/22222/htdocs/; + } + + location ~* /vimbadmin/public/(.*)/(.*) { + root /var/www/22222/htdocs/vimbadmin/public; + try_files $uri $uri/ /vimbadmin/public/index.php?$args; + } + + location ~* /vimbadmin/public/(.*) { + root /var/www/22222/htdocs/vimbadmin/public; + try_files $uri $uri/ /vimbadmin/public/index.php?$args; + } + } From b28f3eec20fd5f4404d48e14cde135948134de63 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 26 Aug 2014 16:32:08 +0530 Subject: [PATCH 071/131] Fixed Amavis MySQL issue --- bin/easyengine | 16 ++++++++-------- .../stack/install/mail/ee_mod_setup_sieve.sh | 7 ++++++- src/vendor/ee_ven_setup_vimbadmin.sh | 5 +++++ 3 files changed, 19 insertions(+), 9 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index 505db325..354cba73 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -167,21 +167,21 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Configure Dovecot ee_mod_setup_dovecot - # Setup ViMbAdmin - ee_ven_setup_vimbadmin - - # Setup Roundcube - ee_ven_setup_roundcube - # Setup Amavis ee_mod_setup_mailscan # Setup Sieve ee_mod_setup_sieve + + # Setup ViMbAdmin + ee_ven_setup_vimbadmin + + # Setup Roundcube + ee_ven_setup_roundcube - ee_lib_service nginx postfix dovecot restart + ee_lib_service nginx postfix dovecot amavis restart - ee_lib_git /etc/nginx/ /etc/dovecot /etc/php5/ /etc/mysql/ /etc/postfix "Initialize Git" + ee_lib_git /etc/nginx/ /etc/dovecot /etc/php5/ /etc/mysql/ /etc/postfix /etc/amavis "Initialize Git" ee_lib_echo "Successfully installed mail server" diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index 6f47f2dd..35d2b561 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -2,10 +2,15 @@ function ee_mod_setup_sieve() { + EE_EMAIL=$($EE_CONFIG_GET wordpress.email) + if [[ $EE_EMAIL = "" ]]; then + EE_EMAIL=$(git config user.email) + fi + ee_lib_echo "Setting up Sieve, please wait..." # Enable sieve plugin support for dovecot-lmtp - sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address = admin@example.com\n mail_plugins = \$mail_plugins sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ + sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address =$EE_EMAIL \n mail_plugins = \$mail_plugins sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ || ee_lib_error "Unable to add sieve plugin support for dovecot-lmtp, exit status = " $? # Sieve dovecot-pluign configuration diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index eb419282..c6e72744 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -46,6 +46,11 @@ function ee_ven_setup_vimbadmin() sed -i "s/hosts=localhost/hosts=$EE_MYSQL_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 -s "s/127.0.0.1/$EE_MYSQL_HOST/" /etc/amavis/conf.d/50-user && + sed -s "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 From 81379517cbca9e9894139224f0a356a7c9e69910 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 26 Aug 2014 17:22:09 +0530 Subject: [PATCH 072/131] Fixed Sieve configuration issue --- bin/easyengine | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index 354cba73..78e9271f 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -170,14 +170,14 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Setup Amavis ee_mod_setup_mailscan - # Setup Sieve - ee_mod_setup_sieve - # Setup ViMbAdmin ee_ven_setup_vimbadmin # Setup Roundcube ee_ven_setup_roundcube + + # Setup Sieve + ee_mod_setup_sieve ee_lib_service nginx postfix dovecot amavis restart From 07176bb90a8b47b2211646b3f343f4199f38febc Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 26 Aug 2014 18:11:49 +0530 Subject: [PATCH 073/131] Fixed Amavis setup issue --- src/vendor/ee_ven_setup_vimbadmin.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index c6e72744..e432897c 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -47,8 +47,8 @@ function ee_ven_setup_vimbadmin() || 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 -s "s/127.0.0.1/$EE_MYSQL_HOST/" /etc/amavis/conf.d/50-user && - sed -s "s/password/$ee_random/" /etc/amavis/conf.d/50-user \ + sed -i "s/127.0.0.1/$EE_MYSQL_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 From 3eeb0dcafe0c000d1449cf195610c6461ca6386a Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 26 Aug 2014 18:40:29 +0530 Subject: [PATCH 074/131] Fixed Roundcube path issue in Nginx Conf file --- templates/mail/webmail | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/templates/mail/webmail b/templates/mail/webmail index fff3a464..b1b2b3a1 100644 --- a/templates/mail/webmail +++ b/templates/mail/webmail @@ -7,7 +7,7 @@ server { access_log /var/log/nginx/webmail.access.log; error_log /var/log/nginx/webmail.error.log; - root /var/www/roundcube/htdocs; + root /var/www/roundcubemail/htdocs/; index index.php; location / { From b6231d187cba9c0f91d60f603f5d0c6f68538113 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 26 Aug 2014 19:35:34 +0530 Subject: [PATCH 075/131] Fixed Postfix not connecting to local MySQL --- src/vendor/ee_ven_setup_vimbadmin.sh | 18 ++++++++++++------ 1 file changed, 12 insertions(+), 6 deletions(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index e432897c..c60161a5 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -2,6 +2,12 @@ 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..." # 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/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/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 \ || ee_lib_error "Unable to setup ViMbAdmin configuration file, exit status = " $? # 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/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 = " $? 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 = " $? 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 = " $? 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 = " $? # 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 \ || ee_lib_error "Unable to setup ViMbAdmin database details in 50-user file, exit status = " $? From efe9cdd0f9fbf87d14c4b03fe930200e81646663 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 13:22:08 +0530 Subject: [PATCH 076/131] Added mail remove and purge commands --- bin/easyengine | 30 +++++++++++++++++-- .../remove/mail/ee_mod_remove_dovecot.sh | 9 ++++++ .../remove/mail/ee_mod_remove_mailscan.sh | 9 ++++++ .../stack/remove/mail/ee_mode_remove_sieve.sh | 10 +++++++ src/vendor/ee_ven_install_vimbadmin.sh | 3 +- src/vendor/ee_ven_remove_roundcube.sh | 15 +++++++++- src/vendor/ee_ven_remove_vimbadmin.sh | 8 +++++ 7 files changed, 79 insertions(+), 5 deletions(-) create mode 100644 src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh create mode 100644 src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh create mode 100644 src/modules/stack/remove/mail/ee_mode_remove_sieve.sh diff --git a/bin/easyengine b/bin/easyengine index 78e9271f..f350492d 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -210,7 +210,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then elif [ "$EE_SECOND" = "purge" ];then ee_lib_echo "$EE_THIRD successfully purged" fi - elif [ "$EE_THIRD" = "" ]; then + elif [ "$EE_THIRD" = "" ] || [ "$EE_THIRD" = "--web" ] || [ "$EE_THIRD" = "--all" ]; then # Remove/Purge NGINX/PHP/MySQL/Postfix package ee_mod_remove_nginx ee_mod_remove_php @@ -228,11 +228,35 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Display success message if [ "$EE_SECOND" = "remove" ];then - ee_lib_echo "Successfully removed all packages" + ee_lib_echo "Successfully removed web packages" + elif [ "$EE_SECOND" = "purge" ];then + ee_lib_echo "Successfully purged web packages" + fi + fi + if [ "$EE_THIRD" = "--all" ] || [ "$EE_THIRD" = "--mail"];then + # Remove Dovecot + ee_mod_remove_dovecot + + # Remove ViMbAdmin + ee_ven_remove_vimbadmin + + # Remove Roundcube + ee_ven_remove_roundcube + + # Remove Amavis + ee_mod_remove_mailscan + + # Remove Sieve + ee_mod_remove_sieve + + # 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 all packages" + ee_lib_echo "Successfully purged mail server packages" fi fi + elif [ "$EE_SECOND" = "status" ]; then ee_mod_stack_status elif [ "$EE_SECOND" = "start" ] || [ "$EE_SECOND" = "stop" ] || [ "$EE_SECOND" = "reload" ] || [ "$EE_SECOND" = "restart" ]; then diff --git a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh new file mode 100644 index 00000000..8119d457 --- /dev/null +++ b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh @@ -0,0 +1,9 @@ +# Remove Dovecot package + +function ee_mod_remove_dovecot() +{ + ee_lib_echo "$EE_SECOND Dovecot package, please wait..." + $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ + || ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $? + +} diff --git a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh new file mode 100644 index 00000000..8ebd8808 --- /dev/null +++ b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh @@ -0,0 +1,9 @@ +# Remove MailScan package + +function ee_mod_remove_mysql() +{ + 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 cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + || ee_lib_error "Unable to $EE_SECOND Amavis, SpamAssassin and ClamAV,, exit status = " $? + +} diff --git a/src/modules/stack/remove/mail/ee_mode_remove_sieve.sh b/src/modules/stack/remove/mail/ee_mode_remove_sieve.sh new file mode 100644 index 00000000..0c553907 --- /dev/null +++ b/src/modules/stack/remove/mail/ee_mode_remove_sieve.sh @@ -0,0 +1,10 @@ +# Remove Sieve package + +function ee_mod_remove_sieve() +{ + ee_lib_echo "$EE_SECOND Sieve package, please wait..." + $EE_APT_GET $EE_SECOND dovecot-sieve dovecot-managesieved \ + || ee_lib_error "Unable to $EE_SECOND Sieve, exit status = " $? + + +} diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index 8b550622..ef96eaf1 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -5,7 +5,8 @@ function ee_ven_install_vimbadmin() # Install needed PHP5 libraries for ViMbAdmin ee_lib_echo "Installing PHP5 libraries for ViMbAdmin, please wait..." - $EE_APT_GET install php5-cgi php5-mcrypt php5-memcache php5-json php5-mysqlnd php-gettext \ + # ee stack install php installed php5-mcrypt, php5-memcache, php5-mysqlnd + $EE_APT_GET install php5-cgi php5-json php-gettext \ || ee_lib_error "Unable to install php-pear, exit status = " $? # Install ViMbAdmin diff --git a/src/vendor/ee_ven_remove_roundcube.sh b/src/vendor/ee_ven_remove_roundcube.sh index fe9e4cda..31297b3a 100644 --- a/src/vendor/ee_ven_remove_roundcube.sh +++ b/src/vendor/ee_ven_remove_roundcube.sh @@ -2,7 +2,20 @@ function ee_ven_remove_roundcube() { + ee_lib_echo "Removing Roundcube dependencies, please wait..." + # Remove packages installed using Pear + pear uninstall Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG &>> $EE_COMMAND_LOG + + # Remove Php-Pear + $EE_APT_GET $EE_SECOND php-pear \ + ||ee_lib_error "Unable to $EE_SECOND Roundcube PHP dependencies, exit status = " $? + + # Remove Roundcube ee_lib_echo "Removing Roundcube, please wait..." - rm -rf /var/www/roundcubemail \ + + mysql -e "drop database \`roundcubemail\`" &>> $EE_COMMAND_LOG + mysql -e "drop user roundcube@'$EE_MYSQL_GRANT_HOST'" &>> $EE_COMMAND_LOG + + rm -rf /var/www/roundcubemail /etc/nginx/sites-available/webmail /etc/nginx/sites-enabled/webmail \ || ee_lib_error "Unable to remove Roundcube, exit status = " $? } diff --git a/src/vendor/ee_ven_remove_vimbadmin.sh b/src/vendor/ee_ven_remove_vimbadmin.sh index f7090e86..962f0784 100644 --- a/src/vendor/ee_ven_remove_vimbadmin.sh +++ b/src/vendor/ee_ven_remove_vimbadmin.sh @@ -3,6 +3,14 @@ function ee_ven_remove_vimbadmin() { ee_lib_echo "Removing ViMbAdmin, please wait..." + + mysql -e "drop database \`vimbadmin\`" &>> $EE_COMMAND_LOG + mysql -e "drop user vimbadmin@'$EE_MYSQL_GRANT_HOST'" &>> $EE_COMMAND_LOG + + ee_lib_echo "Removing ViMbAdmin PHP dependencies, please wait..." + $EE_APT_GET $EE_SECOND php5-cgi php5-json php-gettext \ + ||ee_lib_error "Unable to $EE_SECOND ViMbAdmin PHP dependencies, exit status = " $? + rm -rf /var/www/22222/htdocs/vimbadmin \ || ee_lib_error "Unable to remove ViMbAdmin, exit status = " $? } From 34221bcc954b3dfcd195b5be18e3380ef2f77b65 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 13:25:08 +0530 Subject: [PATCH 077/131] Fixed Missing space --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index f350492d..8ac20cac 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -233,7 +233,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo "Successfully purged web packages" fi fi - if [ "$EE_THIRD" = "--all" ] || [ "$EE_THIRD" = "--mail"];then + if [ "$EE_THIRD" = "--all" ] || [ "$EE_THIRD" = "--mail" ];then # Remove Dovecot ee_mod_remove_dovecot From 893d4185615be7a93fc4804f49310e42d2726f78 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 13:28:48 +0530 Subject: [PATCH 078/131] Fixed Typo --- .../stack/remove/mail/ee_mod_remove_mailscan.sh | 2 +- src/modules/stack/remove/mail/ee_mode_remove_sieve.sh | 10 ---------- 2 files changed, 1 insertion(+), 11 deletions(-) delete mode 100644 src/modules/stack/remove/mail/ee_mode_remove_sieve.sh diff --git a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh index 8ebd8808..be4b8dc1 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh @@ -1,6 +1,6 @@ # Remove MailScan package -function ee_mod_remove_mysql() +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 cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ diff --git a/src/modules/stack/remove/mail/ee_mode_remove_sieve.sh b/src/modules/stack/remove/mail/ee_mode_remove_sieve.sh deleted file mode 100644 index 0c553907..00000000 --- a/src/modules/stack/remove/mail/ee_mode_remove_sieve.sh +++ /dev/null @@ -1,10 +0,0 @@ -# Remove Sieve package - -function ee_mod_remove_sieve() -{ - ee_lib_echo "$EE_SECOND Sieve package, please wait..." - $EE_APT_GET $EE_SECOND dovecot-sieve dovecot-managesieved \ - || ee_lib_error "Unable to $EE_SECOND Sieve, exit status = " $? - - -} From 9a72563e2a39deee010172368308958ab4b5ce58 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 13:30:09 +0530 Subject: [PATCH 079/131] Fixed Typo --- src/modules/stack/remove/mail/ee_mod_remove_sieve.sh | 10 ++++++++++ 1 file changed, 10 insertions(+) create mode 100644 src/modules/stack/remove/mail/ee_mod_remove_sieve.sh diff --git a/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh b/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh new file mode 100644 index 00000000..0c553907 --- /dev/null +++ b/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh @@ -0,0 +1,10 @@ +# Remove Sieve package + +function ee_mod_remove_sieve() +{ + ee_lib_echo "$EE_SECOND Sieve package, please wait..." + $EE_APT_GET $EE_SECOND dovecot-sieve dovecot-managesieved \ + || ee_lib_error "Unable to $EE_SECOND Sieve, exit status = " $? + + +} From e755f3b2955050b3f982a47216533e1a70e470c8 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 13:40:31 +0530 Subject: [PATCH 080/131] Removed Missing packages --- src/modules/stack/install/mail/ee_mod_install_mailscan.sh | 2 +- src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_mailscan.sh b/src/modules/stack/install/mail/ee_mod_install_mailscan.sh index d30be7ef..18559f74 100644 --- a/src/modules/stack/install/mail/ee_mod_install_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_install_mailscan.sh @@ -4,6 +4,6 @@ function ee_mod_install_mailscan() { # Install Amavis ee_lib_echo "Installing Amavis, SpamAssassin and ClamAV, please wait..." - $EE_APT_GET install amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + $EE_APT_GET install amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract p7zip rpm unrar-free \ || ee_lib_error "Unable to install Amavis, SpamAssassin and ClamAV, exit status = " $? } diff --git a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh index be4b8dc1..15364ea9 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh @@ -3,7 +3,7 @@ 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 cpio lzop cabextract apt-listchanges libauthen-sasl-perl libdbi-perl libmail-dkim-perl p7zip rpm unrar-free libsnmp-perl \ + $EE_APT_GET $EE_SECOND amavisd-new spamassassin clamav clamav-daemon arj zoo nomarch cpio lzop cabextract p7zip rpm unrar-free \ || ee_lib_error "Unable to $EE_SECOND Amavis, SpamAssassin and ClamAV,, exit status = " $? } From df6a62ed62ae5c068ecff6bb4d50c055da1af24f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 14:42:35 +0530 Subject: [PATCH 081/131] Removed unwanted packages --- src/vendor/ee_ven_remove_vimbadmin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_remove_vimbadmin.sh b/src/vendor/ee_ven_remove_vimbadmin.sh index 962f0784..3966ae19 100644 --- a/src/vendor/ee_ven_remove_vimbadmin.sh +++ b/src/vendor/ee_ven_remove_vimbadmin.sh @@ -8,7 +8,7 @@ function ee_ven_remove_vimbadmin() mysql -e "drop user vimbadmin@'$EE_MYSQL_GRANT_HOST'" &>> $EE_COMMAND_LOG ee_lib_echo "Removing ViMbAdmin PHP dependencies, please wait..." - $EE_APT_GET $EE_SECOND php5-cgi php5-json php-gettext \ + $EE_APT_GET $EE_SECOND php5-cgi php-gettext \ ||ee_lib_error "Unable to $EE_SECOND ViMbAdmin PHP dependencies, exit status = " $? rm -rf /var/www/22222/htdocs/vimbadmin \ From e52ceb3b5f95ec05212cb35e90fab1de3b546f9f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 14:53:07 +0530 Subject: [PATCH 082/131] Removed unwanted packages --- src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh | 2 +- src/vendor/ee_ven_remove_roundcube.sh | 4 ---- 2 files changed, 1 insertion(+), 5 deletions(-) diff --git a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh index 15364ea9..d893959f 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_mailscan.sh @@ -3,7 +3,7 @@ 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 cpio lzop cabextract p7zip rpm unrar-free \ + $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/vendor/ee_ven_remove_roundcube.sh b/src/vendor/ee_ven_remove_roundcube.sh index 31297b3a..57546631 100644 --- a/src/vendor/ee_ven_remove_roundcube.sh +++ b/src/vendor/ee_ven_remove_roundcube.sh @@ -6,10 +6,6 @@ function ee_ven_remove_roundcube() # Remove packages installed using Pear pear uninstall Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG &>> $EE_COMMAND_LOG - # Remove Php-Pear - $EE_APT_GET $EE_SECOND php-pear \ - ||ee_lib_error "Unable to $EE_SECOND Roundcube PHP dependencies, exit status = " $? - # Remove Roundcube ee_lib_echo "Removing Roundcube, please wait..." From 74272d710b2601ad67035ece1527b0811055177b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 15:02:01 +0530 Subject: [PATCH 083/131] Added apt-get autoremove --- bin/easyengine | 3 +++ 1 file changed, 3 insertions(+) diff --git a/bin/easyengine b/bin/easyengine index 8ac20cac..064760ac 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -249,6 +249,9 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Remove Sieve ee_mod_remove_sieve + # Execute: apt-get autoremove + ee_lib_autoremove + # Display success message if [ "$EE_SECOND" = "remove" ];then ee_lib_echo "Successfully removed mail server packages" From 536d9c963962f035c0da5424d46f895723855126 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 15:17:34 +0530 Subject: [PATCH 084/131] Added autocompletion for mail --- config/bash_completion.d/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/bash_completion.d/ee b/config/bash_completion.d/ee index 72d723b6..9f2b57da 100644 --- a/config/bash_completion.d/ee +++ b/config/bash_completion.d/ee @@ -25,7 +25,7 @@ function EE_AUTO() ;; install|remove|purge) - COMPREPLY=( $( compgen -W '$( cd /usr/local/lib/easyengine/modules/stack/install; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null; cd /usr/local/lib/easyengine/vendor/; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null)' -- $CURRENT ) ) + COMPREPLY=( $( compgen -W '$(echo --mail --all --web; cd /usr/local/lib/easyengine/modules/stack/install; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null; cd /usr/local/lib/easyengine/vendor/; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null | egrep -v "roundcube|vimbadmin" )' -- $CURRENT ) ) return 0 ;; From 63746ee33493e639567f7e1567d66810f877252e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 15:21:04 +0530 Subject: [PATCH 085/131] Added user vmail deletion --- src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh index 8119d457..fb733dad 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh @@ -6,4 +6,5 @@ function ee_mod_remove_dovecot() $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ || ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $? + userdel -rf vmail || ee_lib_error "Unable to Remove user vmail, exit status = " $? } From fe5cb1bd439cbbfcc2cb76140ee124aa1c2c9fd0 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 15:33:55 +0530 Subject: [PATCH 086/131] Fixed autocompletion --- config/bash_completion.d/ee | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/bash_completion.d/ee b/config/bash_completion.d/ee index 9f2b57da..68e7278e 100644 --- a/config/bash_completion.d/ee +++ b/config/bash_completion.d/ee @@ -25,7 +25,7 @@ function EE_AUTO() ;; install|remove|purge) - COMPREPLY=( $( compgen -W '$(echo --mail --all --web; cd /usr/local/lib/easyengine/modules/stack/install; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null; cd /usr/local/lib/easyengine/vendor/; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null | egrep -v "roundcube|vimbadmin" )' -- $CURRENT ) ) + COMPREPLY=( $( compgen -W '$(echo --mail --all --web; cd /usr/local/lib/easyengine/modules/stack/install; find -maxdepth 1 -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null; cd /usr/local/lib/easyengine/vendor/; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null | egrep -v "roundcube|vimbadmin" )' -- $CURRENT ) ) return 0 ;; From d5a1f2c00a41d6ebee21a6c3aa1bc64616409ad1 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 27 Aug 2014 17:23:25 +0530 Subject: [PATCH 087/131] Fixed Spam mail filetring --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 7 ++++++- .../stack/install/mail/ee_mod_setup_mailscan.sh | 4 ++++ templates/mail/autocreate | 10 ++++++++++ 3 files changed, 20 insertions(+), 1 deletion(-) create mode 100644 templates/mail/autocreate diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 5c3d1dd4..b4a7a3ad 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -59,6 +59,11 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to setup Dovecot SSL certificate path, exit status = " $? # Setting Dovecot init.d script - cp -v /usr/share/easyengine/mail/dovecot /etc/init.d/dovecot &>> $EE_COMMAND_LOG \ + cp -v /usr/share/easyengine/mail/dovecot /etc/init.d/dovecot &>> $EE_COMMAND_LOG + + # Add autocreate plugin + sed -i "s'#mail_plugins = \$mail_plugins'mail_plugins = \$mail_plugins autocreate'" /etc/dovecot/conf.d/20-imap.conf \ + || ee_lib_error "Unable to setup Dovecot autocreate plugin, exit status = " $? + cat /usr/share/easyengine/mail/autocreate >> /etc/dovecot/conf.d/20-imap.conf } diff --git a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh index 811242e5..841fb4f5 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh @@ -23,4 +23,8 @@ function ee_mod_setup_mailscan() || ee_lib_error "Unable to setup Amavis, exit status = " $? cat /usr/share/easyengine/mail/amavis-master.cf >> /etc/postfix/master.cf + # Configure ClamAv and Amavis to each other files + adduser clamav amavis &>> $EE_COMMAND_LOG + adduser amavis clamav &>> $EE_COMMAND_LOG + chmod -R 775 /var/lib/amavis/tmp &>> $EE_COMMAND_LOG } diff --git a/templates/mail/autocreate b/templates/mail/autocreate new file mode 100644 index 00000000..66a68eb0 --- /dev/null +++ b/templates/mail/autocreate @@ -0,0 +1,10 @@ +plugin { +autocreate = Trash +autocreate2 = Junk +autocreate3 = Drafts +autocreate4 = Sent +autosubscribe = Trash +autosubscribe2 = Junk +autosubscribe3 = Drafts +autosubscribe4 = Sent +} From 2d479de3012746d22c0261d2278663e5c0acd415 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Thu, 28 Aug 2014 19:49:16 +0530 Subject: [PATCH 088/131] Fixed Ubuntu 12.04 file not found error --- .../stack/install/mail/ee_mod_setup_dovecot.sh | 3 +-- templates/mail/auth-sql.conf.ext | 13 +++++++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 templates/mail/auth-sql.conf.ext diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index b4a7a3ad..fb75771c 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -34,8 +34,7 @@ function ee_mod_setup_dovecot() cp -v /usr/share/easyengine/mail/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? - # Configuring auth-sql.conf.ext - sed -i "s/# driver = prefetch/userdb {\n driver = prefetch\n}/" /etc/dovecot/conf.d/auth-sql.conf.ext \ + cp -v /usr/share/easyengine/mail/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? diff --git a/templates/mail/auth-sql.conf.ext b/templates/mail/auth-sql.conf.ext new file mode 100644 index 00000000..b302f482 --- /dev/null +++ b/templates/mail/auth-sql.conf.ext @@ -0,0 +1,13 @@ +passdb { +driver = sql +args = /etc/dovecot/dovecot-sql.conf.ext +} + +userdb { +driver = prefetch +} + +userdb { +driver = sql +args = /etc/dovecot/dovecot-sql.conf.ext +} \ No newline at end of file From 045f3fe20ee46f5a8319ce67c125e00236a1ed4e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 11:53:32 +0530 Subject: [PATCH 089/131] Fixed typo --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index fb75771c..fc54803a 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -34,7 +34,7 @@ function ee_mod_setup_dovecot() cp -v /usr/share/easyengine/mail/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? - cp -v /usr/share/easyengine/mail/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext + cp -v /usr/share/easyengine/mail/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext \ || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? From 2b98ebe6df56436eb8d033c947b63232dcc9aa82 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 12:45:21 +0530 Subject: [PATCH 090/131] Fixed printing cp output on Screen --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index fc54803a..623b54b7 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -34,7 +34,7 @@ function ee_mod_setup_dovecot() cp -v /usr/share/easyengine/mail/dovecot-sql.conf.ext /etc/dovecot/dovecot-sql.conf.ext &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to copy dovecot-sql.conf.ext, exit status = " $? - cp -v /usr/share/easyengine/mail/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext \ + cp -v /usr/share/easyengine/mail/auth-sql.conf.ext /etc/dovecot/conf.d/auth-sql.conf.ext &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to setup auth-sql.conf.ext, exit status = " $? From aeeb9eb5f44f17cb54f5e54af1341c9545425daf Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 14:00:45 +0530 Subject: [PATCH 091/131] Redirect doctrine message to log --- src/vendor/ee_ven_setup_vimbadmin.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index c60161a5..10a97b51 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -61,7 +61,7 @@ function ee_ven_setup_vimbadmin() cp -av /var/www/22222/htdocs/vimbadmin/public/.htaccess.dist /var/www/22222/htdocs/vimbadmin/public/.htaccess &>> $EE_COMMAND_LOG # Setting default database - /var/www/22222/htdocs/vimbadmin/bin/doctrine2-cli.php orm:schema-tool:create \ + /var/www/22222/htdocs/vimbadmin/bin/doctrine2-cli.php orm:schema-tool:create &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to setup ViMbAdmin default database , exit status = " $? } From a74b54ec95763279b057f7b435b8b6ef7423f744 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 14:46:23 +0530 Subject: [PATCH 092/131] Removed Hardcoded ViMbAdmin and Roundcube version --- src/lib/ee_lib_variables.sh | 6 ++++++ src/vendor/ee_ven_install_roundcube.sh | 2 +- src/vendor/ee_ven_install_vimbadmin.sh | 2 +- 3 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/lib/ee_lib_variables.sh b/src/lib/ee_lib_variables.sh index cb2ee37a..e24ddc87 100644 --- a/src/lib/ee_lib_variables.sh +++ b/src/lib/ee_lib_variables.sh @@ -9,6 +9,12 @@ readonly EE_WP_CLI_VERSION='0.16.0' # Adminer version readonly EE_ADMINER_VERSION='4.1.0' +# Roundcube Version +readonly EE_ROUNDCUBE_VERSION='1.0.2' + +# ViMbAdmin Version +readonly EE_VIMBADMIN_VERSION='3.0.10' + EE_COMMAND_LOG=/var/log/easyengine/ee.log readonly EE_LOG_DIR=/var/log/easyengine readonly EE_ERROR_LOG=/var/log/easyengine/error.log diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh index 1bafe87e..9424545b 100644 --- a/src/vendor/ee_ven_install_roundcube.sh +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -16,7 +16,7 @@ function ee_ven_install_roundcube() # Install Roundcube ee_lib_echo "Downloading Roundcube, please wait..." - wget -cqO /var/www/roundcube.tar.gz https://github.com/roundcube/roundcubemail/releases/download/1.0.2/roundcubemail-1.0.2.tar.gz \ + wget -cqO /var/www/roundcube.tar.gz https://github.com/roundcube/roundcubemail/releases/download/${EE_ROUNDCUBE_VERSION}/roundcubemail-${EE_ROUNDCUBE_VERSION}.tar.gz \ || ee_lib_error "Unable to download Roundcube, exit status = " $? ee_lib_echo "Installing Roundcube, please wait..." diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index ef96eaf1..6c0ed857 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -11,7 +11,7 @@ function ee_ven_install_vimbadmin() # Install ViMbAdmin ee_lib_echo "Downloading ViMbAdmin, please wait..." - wget -cqO /var/www/22222/htdocs/vimbadmin.tar.gz https://github.com/opensolutions/ViMbAdmin/archive/3.0.10.tar.gz \ + wget -cqO /var/www/22222/htdocs/vimbadmin.tar.gz https://github.com/opensolutions/ViMbAdmin/archive/${EE_VIMBADMIN_VERSION}.tar.gz \ || ee_lib_error "Unable to download ViMbAdmin, exit status = " $? mkdir -p /var/www/22222/htdocs/vimbadmin From cb23f2714320f52ca99f74e19fbc05eb75150561 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 15:52:51 +0530 Subject: [PATCH 093/131] Updated update script --- bin/update | 22 ++++++++++++++++++++++ 1 file changed, 22 insertions(+) diff --git a/bin/update b/bin/update index 6f3f05a0..5783a27f 100644 --- a/bin/update +++ b/bin/update @@ -414,6 +414,28 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then fi fi + if [[ $EE_CURRENT_VERSION < 2.1.0 ]];then + if [ -f /etc/nginx/common/locations.conf ];then + cp -av /usr/share/easyengine/nginx/common/locations.conf /etc/nginx/common/locations.conf &>> $EE_UPDATE_LOG + fi + if [ -f /etc/nginx/sites-available/22222 ];then + cp -av /usr/share/easyengine/nginx/22222 /etc/nginx/sites-available/ &>> $EE_UPDATE_LOG + fi + if [ -d /var/www/22222/htdocs/db/anemometer ];then + # Download pt-query-advisor Fixed #189 + wget -q http://bazaar.launchpad.net/~percona-toolkit-dev/percona-toolkit/2.1/download/head:/ptquerydigest-20110624220137-or26tn4expb9ul2a-16/pt-query-digest -O /usr/bin/pt-query-advisor \ + || ee_lib_error "Unable to copy download pt-query-advisor, exit status = " $? + chmod 0755 /usr/bin/pt-query-advisor + + # Enable pt-query-advisor plugin in Anemometer + sed -i "s/# 'query_advisor'/ 'query_advisor'/" /var/www/22222/htdocs/db/anemometer/conf/config.inc.php \ + || ee_lib_error "Unable to to activate pt-query-advisor plugin, exit status = " $? + fi + + # Update EasyEngine current version + EE_CURRENT_VERSION="2.0.1" + fi + # Restart service ee_lib_service nginx php5-fpm restart From 9ee327ecf3952e2cf4a2e66e7f38505b06febef5 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 15:54:13 +0530 Subject: [PATCH 094/131] Updated Travis Test suite --- .travis.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.travis.yml b/.travis.yml index a2bffd87..88e68603 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,6 +126,8 @@ script: - sudo bash ee debug - sudo bash ee debug --stop +- sudo bash ee stack install --mail + - sudo cat /var/log/easyengine/* From 79e64320764718737bff19c0496c71a432821230 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 16:16:51 +0530 Subject: [PATCH 095/131] Updated Release no --- src/lib/ee_lib_variables.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ee_lib_variables.sh b/src/lib/ee_lib_variables.sh index e24ddc87..65e84076 100644 --- a/src/lib/ee_lib_variables.sh +++ b/src/lib/ee_lib_variables.sh @@ -1,7 +1,7 @@ # Define global variables # EasyEngine version -readonly EE_VERSION='2.0.2' +readonly EE_VERSION='2.1.0' # WP-CLI version readonly EE_WP_CLI_VERSION='0.16.0' From eb17400f8672e91042d22cc105fcdd6999e2c36f Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 18:04:31 +0530 Subject: [PATCH 096/131] Fixes #299 --- src/modules/debug/ee_mod_debug_rewrite.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/modules/debug/ee_mod_debug_rewrite.sh b/src/modules/debug/ee_mod_debug_rewrite.sh index 387cc43d..e7560a67 100644 --- a/src/modules/debug/ee_mod_debug_rewrite.sh +++ b/src/modules/debug/ee_mod_debug_rewrite.sh @@ -18,7 +18,9 @@ function ee_mod_debug_rewrite() fi # Debug message - EE_DEBUG_MSG="$EE_DEBUG_MSG /var/log/nginx/*.error.log" + if [ "$EE_DEBUG_MSG" != "/var/log/nginx/*.error.log" ];then + EE_DEBUG_MSG="$EE_DEBUG_MSG /var/log/nginx/*.error.log" + fi else grep "rewrite_log on;" /etc/nginx/sites-available/$EE_DOMAIN &>> $EE_COMMAND_LOG if [ $? -ne 0 ]; then @@ -34,7 +36,9 @@ function ee_mod_debug_rewrite() fi # Debug message - EE_DEBUG_MSG="$EE_DEBUG_MSG /var/log/$EE_DOMAIN/logs/error.log" + if [ "$EE_DEBUG_MSG" != "/var/www/$EE_DOMAIN/logs/error.log" ];then + EE_DEBUG_MSG="$EE_DEBUG_MSG /var/www/$EE_DOMAIN/logs/error.log" + fi fi elif [ "$EE_DEBUG" = "--stop" ]; then if [ -z $EE_DOMAIN ]; then From 4ba2c91d58c39b59bc4d755853585efdf8466397 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 18:30:05 +0530 Subject: [PATCH 097/131] Otimized Code --- bin/easyengine | 6 +++--- bin/update | 14 ++++++++++---- src/lib/ee_lib_error.sh | 2 +- .../stack/install/mail/ee_mod_install_dovecot.sh | 2 +- .../stack/install/mail/ee_mod_install_sieve.sh | 9 --------- .../stack/remove/mail/ee_mod_remove_dovecot.sh | 2 +- .../stack/remove/mail/ee_mod_remove_sieve.sh | 10 ---------- 7 files changed, 16 insertions(+), 29 deletions(-) delete mode 100644 src/modules/stack/install/mail/ee_mod_install_sieve.sh delete mode 100644 src/modules/stack/remove/mail/ee_mod_remove_sieve.sh diff --git a/bin/easyengine b/bin/easyengine index 064760ac..424f2ce6 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -135,15 +135,15 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Check required Packages are installed or not dpkg --get-selections | grep -v deinstall | grep nginx > /dev/null \ && dpkg --get-selections | grep -v deinstall | grep php5-fpm > /dev/null \ - && dpkg --get-selections | grep -v deinstall | grep mysql > /dev/null \ + && mysqladmin ping &> /dev/null \ && dpkg --get-selections | grep -v deinstall | grep postfix > /dev/null if [ $? -ne 0 ];then - ee_lib_error "Failed to find pre dependencies. Please install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 + ee_lib_error "Failed to find pre dependencies.\nPlease install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 fi dpkg --get-selections | grep -v deinstall | grep dovecot-core > /dev/null if [ $? -eq 0 ];then - ee_lib_error "Found installed mail server, Please remove it before installation, exit status=" 1 + ee_lib_error "Found installed Dovecot Packages server, exit status=" 1 fi # Install Dovecot diff --git a/bin/update b/bin/update index 5783a27f..c719cdda 100644 --- a/bin/update +++ b/bin/update @@ -415,11 +415,17 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then fi if [[ $EE_CURRENT_VERSION < 2.1.0 ]];then - if [ -f /etc/nginx/common/locations.conf ];then - cp -av /usr/share/easyengine/nginx/common/locations.conf /etc/nginx/common/locations.conf &>> $EE_UPDATE_LOG - fi if [ -f /etc/nginx/sites-available/22222 ];then + ee_port=$(grep listen /etc/nginx/sites-available/22222 | awk '{ print $2 }') cp -av /usr/share/easyengine/nginx/22222 /etc/nginx/sites-available/ &>> $EE_UPDATE_LOG + if [ "$EE_LINUX_DISTRO" == "Ubuntu" ]; then + sed -i "s/listen.*/listen $ee_port default_server ssl spdy;/" /etc/nginx/sites-available/22222 \ + || ee_lib_error "Unable to change EasyEngine admin port, exit status = " $? + elif [ "$EE_LINUX_DISTRO" == "Debian" ]; then + # Dotdeb nginx repository doesn't support spdy + sed -i "s/listen.*/listen $ee_port default_server ssl;/" /etc/nginx/sites-available/22222 \ + || ee_lib_error "Unable to change EasyEngine admin port, exit status = " $? + fi fi if [ -d /var/www/22222/htdocs/db/anemometer ];then # Download pt-query-advisor Fixed #189 @@ -431,7 +437,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then sed -i "s/# 'query_advisor'/ 'query_advisor'/" /var/www/22222/htdocs/db/anemometer/conf/config.inc.php \ || ee_lib_error "Unable to to activate pt-query-advisor plugin, exit status = " $? fi - + # Update EasyEngine current version EE_CURRENT_VERSION="2.0.1" fi diff --git a/src/lib/ee_lib_error.sh b/src/lib/ee_lib_error.sh index eabfdf04..206a9023 100644 --- a/src/lib/ee_lib_error.sh +++ b/src/lib/ee_lib_error.sh @@ -2,6 +2,6 @@ function ee_lib_error() { - echo "[ `date` ] $(tput setaf 1)$@$(tput sgr0)" | tee -ai $EE_ERROR_LOG + echo -e "[ `date` ] $(tput setaf 1)$@$(tput sgr0)" | tee -ai $EE_ERROR_LOG exit $2 } diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index ed49ba86..e7ce0ca8 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -6,7 +6,7 @@ function ee_mod_install_dovecot() ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" - $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ + $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to install Dovecot, exit status = " $? } diff --git a/src/modules/stack/install/mail/ee_mod_install_sieve.sh b/src/modules/stack/install/mail/ee_mod_install_sieve.sh deleted file mode 100644 index 5deecdbf..00000000 --- a/src/modules/stack/install/mail/ee_mod_install_sieve.sh +++ /dev/null @@ -1,9 +0,0 @@ -# Install Sieve package - -function ee_mod_install_sieve() -{ - # Install Sieve - ee_lib_echo "Installing Sieve, please wait..." - $EE_APT_GET install dovecot-sieve dovecot-managesieved \ - || ee_lib_error "Unable to install Sieve, exit status = " $? -} diff --git a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh index fb733dad..f3fcc9cf 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh @@ -3,7 +3,7 @@ function ee_mod_remove_dovecot() { ee_lib_echo "$EE_SECOND Dovecot package, please wait..." - $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql \ + $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $? userdel -rf vmail || ee_lib_error "Unable to Remove user vmail, exit status = " $? diff --git a/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh b/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh deleted file mode 100644 index 0c553907..00000000 --- a/src/modules/stack/remove/mail/ee_mod_remove_sieve.sh +++ /dev/null @@ -1,10 +0,0 @@ -# Remove Sieve package - -function ee_mod_remove_sieve() -{ - ee_lib_echo "$EE_SECOND Sieve package, please wait..." - $EE_APT_GET $EE_SECOND dovecot-sieve dovecot-managesieved \ - || ee_lib_error "Unable to $EE_SECOND Sieve, exit status = " $? - - -} From 506c5e3dc7a94d622701b5325c4c6be77a27893d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 18:34:14 +0530 Subject: [PATCH 098/131] Added Missed newline --- templates/mail/amavis-master.cf | 2 +- templates/mail/auth-sql.conf.ext | 2 +- templates/mail/default.sieve | 2 +- templates/mail/dovecot | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/templates/mail/amavis-master.cf b/templates/mail/amavis-master.cf index 1ffae842..cc4b872c 100644 --- a/templates/mail/amavis-master.cf +++ b/templates/mail/amavis-master.cf @@ -21,4 +21,4 @@ smtp-amavis unix - - n - 2 smtp -o smtpd_client_connection_count_limit=0 -o smtpd_client_connection_rate_limit=0 -o receive_override_options=no_header_body_checks,no_unknown_recipient_checks - -o local_header_rewrite_clients= \ No newline at end of file + -o local_header_rewrite_clients= diff --git a/templates/mail/auth-sql.conf.ext b/templates/mail/auth-sql.conf.ext index b302f482..d3f0b7fa 100644 --- a/templates/mail/auth-sql.conf.ext +++ b/templates/mail/auth-sql.conf.ext @@ -10,4 +10,4 @@ driver = prefetch userdb { driver = sql args = /etc/dovecot/dovecot-sql.conf.ext -} \ No newline at end of file +} diff --git a/templates/mail/default.sieve b/templates/mail/default.sieve index 476a52a6..62532322 100644 --- a/templates/mail/default.sieve +++ b/templates/mail/default.sieve @@ -1,4 +1,4 @@ require "fileinto"; if header :contains "X-Spam-Flag" "YES" { fileinto "Junk"; -} \ No newline at end of file +} diff --git a/templates/mail/dovecot b/templates/mail/dovecot index c7b13ace..7d001128 100644 --- a/templates/mail/dovecot +++ b/templates/mail/dovecot @@ -70,4 +70,4 @@ case "$1" in ;; esac -exit 0 \ No newline at end of file +exit 0 From 3fc87e4910cd32f9947cd30293816738dbf5462d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Fri, 29 Aug 2014 18:42:57 +0530 Subject: [PATCH 099/131] Optimized Code --- bin/easyengine | 10 ++-------- .../stack/install/mail/ee_mod_setup_mailscan.sh | 2 +- 2 files changed, 3 insertions(+), 9 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index 424f2ce6..52af6e39 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -155,12 +155,9 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Install Roundcube ee_ven_install_roundcube - # Install Amavis + # Install mail scanner packages ee_mod_install_mailscan - # Install Sieve - ee_mod_install_sieve - # Configure PostFix ee_mod_setup_postfix @@ -181,7 +178,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_service nginx postfix dovecot amavis restart - ee_lib_git /etc/nginx/ /etc/dovecot /etc/php5/ /etc/mysql/ /etc/postfix /etc/amavis "Initialize Git" + ee_lib_git /etc/nginx/ /etc/dovecot /etc/postfix /etc/amavis "Initialize Git" ee_lib_echo "Successfully installed mail server" @@ -246,9 +243,6 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Remove Amavis ee_mod_remove_mailscan - # Remove Sieve - ee_mod_remove_sieve - # Execute: apt-get autoremove ee_lib_autoremove diff --git a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh index 841fb4f5..a5d85462 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh @@ -1,4 +1,4 @@ -# Setup Amavis +# Install mail scanner packages function ee_mod_setup_mailscan() { From 067f5ddcf740cb0b80b21b06c0d2d0c8d8b460f4 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 12:52:58 +0530 Subject: [PATCH 100/131] Added FQDN check --- bin/install | 19 +++++++++++++++++++ bin/update | 3 +++ src/lib/ee_lib_check_fqdn.sh | 18 ++++++++++++++++++ 3 files changed, 40 insertions(+) create mode 100644 src/lib/ee_lib_check_fqdn.sh diff --git a/bin/install b/bin/install index 980ded4a..a752a326 100644 --- a/bin/install +++ b/bin/install @@ -81,6 +81,23 @@ function ee_lib_package_check() done } +# Check hostname is FQDN or not. If not set it +function ee_lib_check_fqdn() +{ + case $1 in + *.*) + if [ $EE_FQDN != "" ];then + echo $EE_FQDN > /etc/hostname + service hostname restart &>> $EE_INSTALL_LOG + hostname -f &>> $EE_INSTALL_LOG + fi + ;; + *) + read -p "Enter FQDN to set for Hostname: " EE_FQDN + ee_lib_check_fqdn $EE_FQDN + ;; + esac +} # Pre checks to avoid later screw ups # Checking EasyEngine (ee) log directory @@ -184,6 +201,8 @@ fi cp -a /tmp/easyengine/docs/man/ee.8 /usr/share/man/man8/ &>> $EE_INSTALL_LOG \ || ee_lib_error "Unable to copy EasyEngine (ee) man page, exit status = " $? +# Make hostname as FQDN +ee_lib_check_fqdn $(hostname -f) # Git config settings GIT_USER_NAME=$(git config user.name) diff --git a/bin/update b/bin/update index c719cdda..55ec38a0 100644 --- a/bin/update +++ b/bin/update @@ -395,6 +395,9 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then done fi + # Make hostname as FQDN + ee_lib_check_fqdn $(hostname -f) + if [[ $EE_CURRENT_VERSION = 2.0.0 ]]; then dpkg --get-selections | grep -v deinstall | grep php5-fpm &>> $EE_UPDATE_LOG if [ $? -eq 0 ]; then diff --git a/src/lib/ee_lib_check_fqdn.sh b/src/lib/ee_lib_check_fqdn.sh new file mode 100644 index 00000000..8639d523 --- /dev/null +++ b/src/lib/ee_lib_check_fqdn.sh @@ -0,0 +1,18 @@ +# Check Server hostname is FQDN or not + +function ee_lib_check_fqdn() +{ + case $1 in + *.*) + if [ $EE_FQDN != "" ];then + echo $EE_FQDN > /etc/hostname + service hostname restart &>> $EE_COMMAND_LOG + hostname -f &>> $EE_COMMAND_LOG + fi + ;; + *) + read -p "Enter FQDN to set for Hostname: " EE_FQDN + ee_lib_check_fqdn $EE_FQDN + ;; + esac +} From 62ca00e4bb667aca76113c782614eb8fb9bc1bde Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 14:51:41 +0530 Subject: [PATCH 101/131] Better Instllation order and Messages --- bin/easyengine | 16 ++++++++-------- .../stack/install/mail/ee_mod_setup_sieve.sh | 4 ++-- src/vendor/ee_ven_install_roundcube.sh | 4 +--- src/vendor/ee_ven_install_vimbadmin.sh | 6 ++---- src/vendor/ee_ven_setup_roundcube.sh | 2 +- src/vendor/ee_ven_setup_vimbadmin.sh | 2 +- 6 files changed, 15 insertions(+), 19 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index 52af6e39..cfe14e46 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -138,7 +138,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then && mysqladmin ping &> /dev/null \ && dpkg --get-selections | grep -v deinstall | grep postfix > /dev/null if [ $? -ne 0 ];then - ee_lib_error "Failed to find pre dependencies.\nPlease install Nginx, PHP5, MySQL and Postfix using command ee stack install, exit status " 1 + ee_lib_error "Failed to find NGINX PHP MySQL Postfix, exit status=" 1 fi dpkg --get-selections | grep -v deinstall | grep dovecot-core > /dev/null @@ -149,15 +149,15 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Install Dovecot ee_mod_install_dovecot + # Install mail scanner packages + ee_mod_install_mailscan + # Install ViMbAdmin ee_ven_install_vimbadmin # Install Roundcube ee_ven_install_roundcube - # Install mail scanner packages - ee_mod_install_mailscan - # Configure PostFix ee_mod_setup_postfix @@ -173,7 +173,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Setup Roundcube ee_ven_setup_roundcube - # Setup Sieve + # Setup Sieve Rules ee_mod_setup_sieve ee_lib_service nginx postfix dovecot amavis restart @@ -234,15 +234,15 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Remove Dovecot ee_mod_remove_dovecot + # Remove Amavis + ee_mod_remove_mailscan + # Remove ViMbAdmin ee_ven_remove_vimbadmin # Remove Roundcube ee_ven_remove_roundcube - # Remove Amavis - ee_mod_remove_mailscan - # Execute: apt-get autoremove ee_lib_autoremove diff --git a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh index 35d2b561..40cf3889 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_sieve.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_sieve.sh @@ -1,4 +1,4 @@ -# Setup Sieve +# Setup Sieve rules function ee_mod_setup_sieve() { @@ -7,7 +7,7 @@ function ee_mod_setup_sieve() EE_EMAIL=$(git config user.email) fi - ee_lib_echo "Setting up Sieve, please wait..." + ee_lib_echo "Setting up Sieve rules, please wait..." # Enable sieve plugin support for dovecot-lmtp sed -i "s' #mail_plugins = \$mail_plugins' postmaster_address =$EE_EMAIL \n mail_plugins = \$mail_plugins sieve'" /etc/dovecot/conf.d/20-lmtp.conf \ diff --git a/src/vendor/ee_ven_install_roundcube.sh b/src/vendor/ee_ven_install_roundcube.sh index 9424545b..03e65f02 100644 --- a/src/vendor/ee_ven_install_roundcube.sh +++ b/src/vendor/ee_ven_install_roundcube.sh @@ -3,7 +3,7 @@ function ee_ven_install_roundcube() { # Install Roundcube dependencies - ee_lib_echo "Installing Roundcube dependencies, please wait..." + ee_lib_echo "Installing Roundcube, please wait..." $EE_APT_GET install php-pear \ || ee_lib_error "Unable to install php-pear, exit status = " $? pear install Mail_Mime Net_SMTP Mail_mimeDecode Net_IDNA2-beta Auth_SASL Net_Sieve Crypt_GPG &>> $EE_COMMAND_LOG \ @@ -15,11 +15,9 @@ function ee_ven_install_roundcube() ee_lib_symbolic_link /var/log/nginx/roundcubemail.error.log /var/www/roundcubemail/logs/error.log # Install Roundcube - ee_lib_echo "Downloading Roundcube, please wait..." wget -cqO /var/www/roundcube.tar.gz https://github.com/roundcube/roundcubemail/releases/download/${EE_ROUNDCUBE_VERSION}/roundcubemail-${EE_ROUNDCUBE_VERSION}.tar.gz \ || ee_lib_error "Unable to download Roundcube, exit status = " $? - ee_lib_echo "Installing Roundcube, please wait..." tar -zxf /var/www/roundcube.tar.gz -C /var/www/roundcubemail/htdocs/ --strip-components=1 \ || ee_lib_error "Unable to extract Roundcube, exit status = " $? diff --git a/src/vendor/ee_ven_install_vimbadmin.sh b/src/vendor/ee_ven_install_vimbadmin.sh index 6c0ed857..4f1d23a9 100644 --- a/src/vendor/ee_ven_install_vimbadmin.sh +++ b/src/vendor/ee_ven_install_vimbadmin.sh @@ -4,13 +4,13 @@ function ee_ven_install_vimbadmin() { # Install needed PHP5 libraries for ViMbAdmin - ee_lib_echo "Installing PHP5 libraries for ViMbAdmin, please wait..." # ee stack install php installed php5-mcrypt, php5-memcache, php5-mysqlnd $EE_APT_GET install php5-cgi php5-json php-gettext \ || ee_lib_error "Unable to install php-pear, exit status = " $? # Install ViMbAdmin - ee_lib_echo "Downloading ViMbAdmin, please wait..." + ee_lib_echo "Installing ViMbAdmin, please wait..." + ee_lib_echo "It will take nearly 10-20 minutes, please wait..." wget -cqO /var/www/22222/htdocs/vimbadmin.tar.gz https://github.com/opensolutions/ViMbAdmin/archive/${EE_VIMBADMIN_VERSION}.tar.gz \ || ee_lib_error "Unable to download ViMbAdmin, exit status = " $? @@ -18,8 +18,6 @@ function ee_ven_install_vimbadmin() tar --strip-components=1 -zxf /var/www/22222/htdocs/vimbadmin.tar.gz -C /var/www/22222/htdocs/vimbadmin # Install Composer - ee_lib_echo "Installing ViMbAdmin, please wait..." - ee_lib_echo "It will take nearly 10-20 minutes, please wait..." cd /var/www/22222/htdocs/vimbadmin curl -sS https://getcomposer.org/installer | php &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to install Composer, exit status = " $? diff --git a/src/vendor/ee_ven_setup_roundcube.sh b/src/vendor/ee_ven_setup_roundcube.sh index 2ea51517..0af6c635 100644 --- a/src/vendor/ee_ven_setup_roundcube.sh +++ b/src/vendor/ee_ven_setup_roundcube.sh @@ -2,7 +2,7 @@ function ee_ven_setup_roundcube() { - ee_lib_echo "configuring Roundcube, please wait..." + ee_lib_echo "Setting up Roundcube, please wait..." # Random characters local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index 10a97b51..c87cce5e 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -8,7 +8,7 @@ function ee_ven_setup_vimbadmin() ee_vimbadmin_host=$EE_MYSQL_HOST fi - ee_lib_echo "configuring ViMbAdmin, please wait..." + ee_lib_echo "Setting up ViMbAdmin, please wait..." # Random characters local ee_random=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 15 | head -n1) From 05fc3dfe5ce9c0682d9128528df95b33dbeaeba2 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 15:59:30 +0530 Subject: [PATCH 102/131] Automated ViMbAdmin security salt --- bin/easyengine | 7 +++++-- src/vendor/ee_ven_setup_vimbadmin.sh | 9 +++++++++ 2 files changed, 14 insertions(+), 2 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index cfe14e46..1ddc919f 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -125,7 +125,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_ven_install_utils # Display success message - ee_lib_echo "Successfully installed all packages" + ee_lib_echo "Successfully installed web server packages" ee_lib_echo "Create your first WordPress site powered by NGINX using:" ee_lib_echo_info "ee site create example.com --wp" fi @@ -180,7 +180,10 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_git /etc/nginx/ /etc/dovecot /etc/postfix /etc/amavis "Initialize Git" - ee_lib_echo "Successfully installed mail server" + # Display message for mail server + ee_lib_echo "Successfully installed mail server packages" + ee_lib_echo "Open https://(hostname -f):22222/vimbadmin in your browser" + ee_lib_echo "Security Salt=${ee_security_salt}" fi diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index c87cce5e..cbcb200b 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -64,4 +64,13 @@ function ee_ven_setup_vimbadmin() /var/www/22222/htdocs/vimbadmin/bin/doctrine2-cli.php orm:schema-tool:create &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to setup ViMbAdmin default database , exit status = " $? + ee_security_salt=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n1) + sed -i "s/securitysalt = \"\"/securitysalt = \"$ee_security_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + + + ee_rememberme_salt=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n1) + sed -i "s/resources.auth.oss.rememberme.salt = \"\"/resources.auth.oss.rememberme.salt = \"$ee_rememberme_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + + ee_password_salt=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n1) + sed "s/defaults.mailbox.password_salt = \"\"/defaults.mailbox.password_salt = \"$ee_password_salt\"/" } From e408a15180601e8a4417e80a0c0d17f92b0ee8fb Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 16:29:07 +0530 Subject: [PATCH 103/131] Fixed sed file not defined error --- src/vendor/ee_ven_setup_vimbadmin.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/vendor/ee_ven_setup_vimbadmin.sh b/src/vendor/ee_ven_setup_vimbadmin.sh index cbcb200b..993b94fc 100644 --- a/src/vendor/ee_ven_setup_vimbadmin.sh +++ b/src/vendor/ee_ven_setup_vimbadmin.sh @@ -65,12 +65,14 @@ function ee_ven_setup_vimbadmin() || ee_lib_error "Unable to setup ViMbAdmin default database , exit status = " $? ee_security_salt=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n1) - sed -i "s/securitysalt = \"\"/securitysalt = \"$ee_security_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini - + sed -i "s/securitysalt = \"\"/securitysalt = \"$ee_security_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini \ + || ee_lib_error "Unable to setup ViMbAdmin security salt , exit status = " $? ee_rememberme_salt=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n1) - sed -i "s/resources.auth.oss.rememberme.salt = \"\"/resources.auth.oss.rememberme.salt = \"$ee_rememberme_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini + sed -i "s/resources.auth.oss.rememberme.salt = \"\"/resources.auth.oss.rememberme.salt = \"$ee_rememberme_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini \ + || ee_lib_error "Unable to setup ViMbAdmin remember me salt , exit status = " $? ee_password_salt=$(cat /dev/urandom | tr -dc 'a-zA-Z0-9' | fold -w 64 | head -n1) - sed "s/defaults.mailbox.password_salt = \"\"/defaults.mailbox.password_salt = \"$ee_password_salt\"/" + sed -i "s/defaults.mailbox.password_salt = \"\"/defaults.mailbox.password_salt = \"$ee_password_salt\"/" /var/www/22222/htdocs/vimbadmin/application/configs/application.ini \ + || ee_lib_error "Unable to setup ViMbAdmin mailbox password salt , exit status = " $? } From a65743bde50ff5322a06df603ea44a819afa0023 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 16:40:37 +0530 Subject: [PATCH 104/131] Fixed missing $ --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index 1ddc919f..663f68c1 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -182,7 +182,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Display message for mail server ee_lib_echo "Successfully installed mail server packages" - ee_lib_echo "Open https://(hostname -f):22222/vimbadmin in your browser" + ee_lib_echo "Open https://$(hostname -f):22222/vimbadmin in your browser" ee_lib_echo "Security Salt=${ee_security_salt}" fi From d13a5b5a21c91eb7a1a8190422b7c2ff82dcc6f8 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 16:53:16 +0530 Subject: [PATCH 105/131] Improved Display Message --- bin/easyengine | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index 663f68c1..f08ca60a 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -181,10 +181,10 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_git /etc/nginx/ /etc/dovecot /etc/postfix /etc/amavis "Initialize Git" # Display message for mail server - ee_lib_echo "Successfully installed mail server packages" - ee_lib_echo "Open https://$(hostname -f):22222/vimbadmin in your browser" - ee_lib_echo "Security Salt=${ee_security_salt}" + ee_lib_echo_escape "Configure ViMbAdmin:\t\thttps://$(hostname -f):22222/vimbadmin" + ee_lib_echo_escape "Security Salt:\t\t${ee_security_salt}\n" + ee_lib_echo "Successfully installed mail server packages" fi # EasyEngine remove/purge From 3a7bfcae83bde07abeef26be68167471c0a8a17d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 17:01:46 +0530 Subject: [PATCH 106/131] Fixed Unary operator Expected error --- bin/install | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/install b/bin/install index a752a326..5d0cf22b 100644 --- a/bin/install +++ b/bin/install @@ -86,7 +86,7 @@ function ee_lib_check_fqdn() { case $1 in *.*) - if [ $EE_FQDN != "" ];then + if [ "$EE_FQDN" != "" ];then echo $EE_FQDN > /etc/hostname service hostname restart &>> $EE_INSTALL_LOG hostname -f &>> $EE_INSTALL_LOG From 971a0901dc6fd757d1e9fa8d5f30ade885d06008 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 17:04:41 +0530 Subject: [PATCH 107/131] Fixed Unary operator Expected error --- src/lib/ee_lib_check_fqdn.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ee_lib_check_fqdn.sh b/src/lib/ee_lib_check_fqdn.sh index 8639d523..987c3b03 100644 --- a/src/lib/ee_lib_check_fqdn.sh +++ b/src/lib/ee_lib_check_fqdn.sh @@ -4,7 +4,7 @@ function ee_lib_check_fqdn() { case $1 in *.*) - if [ $EE_FQDN != "" ];then + if [ "$EE_FQDN" != "" ];then echo $EE_FQDN > /etc/hostname service hostname restart &>> $EE_COMMAND_LOG hostname -f &>> $EE_COMMAND_LOG From 8d5ad94e36cd1b39b08901c76c3f5c90c683d023 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 17:13:56 +0530 Subject: [PATCH 108/131] Improved display message --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index f08ca60a..91b3c92b 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -181,7 +181,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_git /etc/nginx/ /etc/dovecot /etc/postfix /etc/amavis "Initialize Git" # Display message for mail server - ee_lib_echo_escape "Configure ViMbAdmin:\t\thttps://$(hostname -f):22222/vimbadmin" + ee_lib_echo_escape "Configure ViMbAdmin:\thttps://$(hostname -f):22222/vimbadmin" ee_lib_echo_escape "Security Salt:\t\t${ee_security_salt}\n" ee_lib_echo "Successfully installed mail server packages" From 9465324bb4d2b04763fb025c3b67b7a2cdce11ab Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 18:14:02 +0530 Subject: [PATCH 109/131] Improved code --- bin/easyengine | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/easyengine b/bin/easyengine index 91b3c92b..1659ad07 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -178,7 +178,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_service nginx postfix dovecot amavis restart - ee_lib_git /etc/nginx/ /etc/dovecot /etc/postfix /etc/amavis "Initialize Git" + ee_lib_git /etc/nginx /etc/postfix /etc/dovecot /etc/amavis "Initialize Git" # Display message for mail server ee_lib_echo_escape "Configure ViMbAdmin:\thttps://$(hostname -f):22222/vimbadmin" From fc243422e294f8b4f2037ee836b020f9f713664a Mon Sep 17 00:00:00 2001 From: gau1991 Date: Mon, 1 Sep 2014 19:11:19 +0530 Subject: [PATCH 110/131] Fixed Amavis not writing mail scanning header --- src/modules/stack/install/mail/ee_mod_setup_mailscan.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh index a5d85462..833ad583 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh @@ -13,6 +13,8 @@ function ee_mod_setup_mailscan() sed -i "s/use strict;/use strict;\n\$sa_spam_subject_tag = undef;\n\$spam_quarantine_to = undef;\n\$sa_tag_level_deflt = undef;\n\n# Prevent spams from automatically rejected by mail-server\n\$final_spam_destiny = D_PASS;\n# We need to provide list of domains for which filtering need to be done\n@lookup_sql_dsn = (\n ['DBI:mysql:database=vimbadmin;host=127.0.0.1;port=3306',\n 'vimbadmin',\n 'password']);\n\n\$sql_select_policy = 'SELECT domain FROM domain WHERE CONCAT("@",domain) IN (%k)';/" /etc/amavis/conf.d/50-user \ || ee_lib_error "Unable to setup Amavis, exit status = " $? + sed -i "s'\@local_domains_acl = ( \".\$mydomain\" );'\@local_domains_acl = ( \".\" );'" /etc/amavis/conf.d/05-domain_id \ + || ee_lib_error "Unable to setup Amavis, exit status = " $? # Configure Postfix to use Amavis # For postfix main.cf From 2e820ec0b160a205b08547ef23ccc1baaa5b2f54 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 11:59:21 +0530 Subject: [PATCH 111/131] Added freshclam --- src/modules/stack/install/mail/ee_mod_setup_mailscan.sh | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh index 833ad583..8fe08a1f 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_mailscan.sh @@ -29,4 +29,12 @@ function ee_mod_setup_mailscan() adduser clamav amavis &>> $EE_COMMAND_LOG adduser amavis clamav &>> $EE_COMMAND_LOG chmod -R 775 /var/lib/amavis/tmp &>> $EE_COMMAND_LOG + + # Update ClamAV database (freshclam) + ee_lib_echo "Updating ClamAV database, please wait..." + freshclam &>> $EE_COMMAND_LOG + + service clamav-daemon restart &>> $EE_COMMAND_LOG \ + || ee_lib_echo "Unable to start ClamAV deamon" + } From ef2693d8a06b9e457261fa439366c4689b8f6fb3 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 12:04:39 +0530 Subject: [PATCH 112/131] Update man pages --- docs/man/ee.8 | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/docs/man/ee.8 b/docs/man/ee.8 index 7294a639..2b70dad1 100644 --- a/docs/man/ee.8 +++ b/docs/man/ee.8 @@ -5,7 +5,7 @@ .SH SYNOPSIS ee [ version | help | info | stack | site | debug | update ] .TP -ee stack [ install | remove | purge ] [ nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +ee stack [ install | remove | purge ] [ --web | --mail | --all | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .TP ee stack [ status | start | stop | reload | restart ] .TP @@ -44,19 +44,19 @@ Display easyengine (ee) help. .TP .B stack .TP -.B install [ nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +.B install [ --all | --web | --mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .br Install Nginx PHP5 MySQL Postfix stack Packages if not used with .br any options.Installs specific package if used with option. .TP -.B remove [ nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +.B remove [ --all | --web | --mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .br Remove Nginx PHP5 MySQL Postfix stack Packages if not used with .br any options. Remove specific package if used with option. .TP -.B purge [ nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +.B purge [ --all | --web | --mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .br Purge Nginx PHP5 MySQL Postfix stack Packages if not used with any .br From 2bade5596f614872f7868d47607ef6364c20c867 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 12:50:52 +0530 Subject: [PATCH 113/131] Updated Changelog --- CHANGELOG.txt | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index caaacd8d..1efcf316 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -1,4 +1,9 @@ -v 2.0.2 - July 21, 2014 +v 2.1.0 - Sept 2, 2014 + - Added Mail Server Package installation #65 + - Fixed incorrect log file path during debug #299 + - Added support for pt-query-advisor #189 + +v 2.0.2 - Aug 13, 2014 - Remote MySQL Support v 2.0.1 - July 21, 2014 From 7f62724232bd54de8e2efb6537809bbfb89adfc8 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 13:52:46 +0530 Subject: [PATCH 114/131] Change --mail,--web,--all to mail,web,all --- bin/easyengine | 8 ++++---- config/bash_completion.d/ee | 2 +- docs/man/ee.8 | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index 1659ad07..ecfa54a5 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -90,7 +90,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then # Display success message ee_lib_echo "$EE_THIRD successfully installed" - elif [ "$EE_THIRD" = "" ] || [ "$EE_THIRD" = "--web" ] || [ "$EE_THIRD" = "--all" ]; then + elif [ "$EE_THIRD" = "" ] || [ "$EE_THIRD" = "web" ] || [ "$EE_THIRD" = "all" ]; then # Setup NGINX/PHP repository ee_mod_repo_nginx ee_mod_repo_php @@ -130,7 +130,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo_info "ee site create example.com --wp" fi # EasyEngine mail server setup - if [ "$EE_THIRD" = "--mail" ] || [ "$EE_THIRD" = "--all" ];then + if [ "$EE_THIRD" = "mail" ] || [ "$EE_THIRD" = "all" ];then # Check required Packages are installed or not dpkg --get-selections | grep -v deinstall | grep nginx > /dev/null \ @@ -210,7 +210,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then elif [ "$EE_SECOND" = "purge" ];then ee_lib_echo "$EE_THIRD successfully purged" fi - elif [ "$EE_THIRD" = "" ] || [ "$EE_THIRD" = "--web" ] || [ "$EE_THIRD" = "--all" ]; then + elif [ "$EE_THIRD" = "" ] || [ "$EE_THIRD" = "web" ] || [ "$EE_THIRD" = "all" ]; then # Remove/Purge NGINX/PHP/MySQL/Postfix package ee_mod_remove_nginx ee_mod_remove_php @@ -233,7 +233,7 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_lib_echo "Successfully purged web packages" fi fi - if [ "$EE_THIRD" = "--all" ] || [ "$EE_THIRD" = "--mail" ];then + if [ "$EE_THIRD" = "all" ] || [ "$EE_THIRD" = "mail" ];then # Remove Dovecot ee_mod_remove_dovecot diff --git a/config/bash_completion.d/ee b/config/bash_completion.d/ee index 68e7278e..1efbbef1 100644 --- a/config/bash_completion.d/ee +++ b/config/bash_completion.d/ee @@ -25,7 +25,7 @@ function EE_AUTO() ;; install|remove|purge) - COMPREPLY=( $( compgen -W '$(echo --mail --all --web; cd /usr/local/lib/easyengine/modules/stack/install; find -maxdepth 1 -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null; cd /usr/local/lib/easyengine/vendor/; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null | egrep -v "roundcube|vimbadmin" )' -- $CURRENT ) ) + COMPREPLY=( $( compgen -W '$(echo mail all web; cd /usr/local/lib/easyengine/modules/stack/install; find -maxdepth 1 -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null; cd /usr/local/lib/easyengine/vendor/; find -type f | grep install | cut -d'_' -f4 | cut -d '.' -f1 2> /dev/null | egrep -v "roundcube|vimbadmin" )' -- $CURRENT ) ) return 0 ;; diff --git a/docs/man/ee.8 b/docs/man/ee.8 index 2b70dad1..d36a25bd 100644 --- a/docs/man/ee.8 +++ b/docs/man/ee.8 @@ -44,19 +44,19 @@ Display easyengine (ee) help. .TP .B stack .TP -.B install [ --all | --web | --mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +.B install [ all | web | mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .br Install Nginx PHP5 MySQL Postfix stack Packages if not used with .br any options.Installs specific package if used with option. .TP -.B remove [ --all | --web | --mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +.B remove [ all | web | mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .br Remove Nginx PHP5 MySQL Postfix stack Packages if not used with .br any options. Remove specific package if used with option. .TP -.B purge [ --all | --web | --mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] +.B purge [ all | web | mail | nginx | php | mysql | postfix | adminer | phpmyadmin | wpcli | utils ] .br Purge Nginx PHP5 MySQL Postfix stack Packages if not used with any .br From 561b0c52ccb8aed560f70aeda8dfc7724b4d431e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 15:45:40 +0530 Subject: [PATCH 115/131] Update Changelog --- CHANGELOG.txt | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index 1efcf316..eee173cb 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -2,6 +2,7 @@ v 2.1.0 - Sept 2, 2014 - Added Mail Server Package installation #65 - Fixed incorrect log file path during debug #299 - Added support for pt-query-advisor #189 + - Fixed Firefox cross-domain fonts v 2.0.2 - Aug 13, 2014 - Remote MySQL Support From 041e68dcdd5c67375ea959f3b68903348504ae64 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 15:57:23 +0530 Subject: [PATCH 116/131] Improved display messages --- bin/easyengine | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/bin/easyengine b/bin/easyengine index ecfa54a5..a8d2a05e 100644 --- a/bin/easyengine +++ b/bin/easyengine @@ -125,9 +125,11 @@ elif [ "$EE_FIRST" = "stack" ] || [ "$EE_FIRST" = "system" ]; then ee_ven_install_utils # Display success message - ee_lib_echo "Successfully installed web server packages" - ee_lib_echo "Create your first WordPress site powered by NGINX using:" - ee_lib_echo_info "ee site create example.com --wp" + if [ "$EE_THIRD" != "all" ];then + ee_lib_echo "Successfully installed web server packages" + ee_lib_echo "Create your first WordPress site powered by NGINX using:" + ee_lib_echo_info "ee site create example.com --wp" + fi fi # EasyEngine mail server setup if [ "$EE_THIRD" = "mail" ] || [ "$EE_THIRD" = "all" ];then From c6d988452da2bcd94afff76a224a572001904570 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 18:12:06 +0530 Subject: [PATCH 117/131] Fixed Dovcot not removing in Ubuntu 12.04 --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 5 +++-- src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh | 2 ++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 623b54b7..a22d254a 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -58,8 +58,9 @@ function ee_mod_setup_dovecot() || ee_lib_error "Unable to setup Dovecot SSL certificate path, exit status = " $? # Setting Dovecot init.d script - cp -v /usr/share/easyengine/mail/dovecot /etc/init.d/dovecot &>> $EE_COMMAND_LOG - + if [ ! -f /etc/init.d/dovecot ];then + cp -v /usr/share/easyengine/mail/dovecot /etc/init.d/dovecot &>> $EE_COMMAND_LOG + fi # Add autocreate plugin sed -i "s'#mail_plugins = \$mail_plugins'mail_plugins = \$mail_plugins autocreate'" /etc/dovecot/conf.d/20-imap.conf \ || ee_lib_error "Unable to setup Dovecot autocreate plugin, exit status = " $? diff --git a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh index f3fcc9cf..199540f2 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh @@ -7,4 +7,6 @@ function ee_mod_remove_dovecot() || ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $? userdel -rf vmail || ee_lib_error "Unable to Remove user vmail, exit status = " $? + rm -f /etc/init.d/dovecot + } From 1b970de4591575e18f21f6d33f664702a46e31f8 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 18:57:43 +0530 Subject: [PATCH 118/131] Better way to add and delete user --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 2 +- src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index a22d254a..662fac7c 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -12,7 +12,7 @@ function ee_mod_setup_dovecot() ee_lib_echo "Setting up Dovecot, please wait..." # Adding mail user with GID 5000 and UID 5000 - groupadd -g 5000 vmail && useradd -g vmail -u 5000 vmail -d /var/vmail -m \ + adduser --uid 5000 --home /var/vmail --disabled-password --gecos '' vmail \ || ee_lib_error "Unable to setup vmail user/group = " $? # Configuring dovecot.conf diff --git a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh index 199540f2..b929b43b 100644 --- a/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh +++ b/src/modules/stack/remove/mail/ee_mod_remove_dovecot.sh @@ -6,7 +6,8 @@ function ee_mod_remove_dovecot() $EE_APT_GET $EE_SECOND dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ || ee_lib_error "Unable to $EE_SECOND Dovecot, exit status = " $? - userdel -rf vmail || ee_lib_error "Unable to Remove user vmail, exit status = " $? + deluser --remove-home vmail &>> $EE_COMMAND_LOG || ee_lib_error "Unable to Remove user vmail, exit status = " $? rm -f /etc/init.d/dovecot + rm -rf /var/vmail } From 1b07b019e7aa804e8ce74a3fd5d744ccff4c826e Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 19:09:04 +0530 Subject: [PATCH 119/131] Hiden useradd message --- src/modules/stack/install/mail/ee_mod_setup_dovecot.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh index 662fac7c..2b1e62ad 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_dovecot.sh @@ -12,7 +12,7 @@ function ee_mod_setup_dovecot() ee_lib_echo "Setting up Dovecot, please wait..." # Adding mail user with GID 5000 and UID 5000 - adduser --uid 5000 --home /var/vmail --disabled-password --gecos '' vmail \ + adduser --uid 5000 --home /var/vmail --disabled-password --gecos '' vmail &>> $EE_COMMAND_LOG \ || ee_lib_error "Unable to setup vmail user/group = " $? # Configuring dovecot.conf From 34299ccf66bbf134dde6fac24fc7a6b0a544d03b Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 19:22:42 +0530 Subject: [PATCH 120/131] Fixed Version in update script --- bin/update | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bin/update b/bin/update index 55ec38a0..278eeb20 100644 --- a/bin/update +++ b/bin/update @@ -442,7 +442,7 @@ if [[ $EE_CURRENT_VERSION < $EE_LATEST_VERSION ]]; then fi # Update EasyEngine current version - EE_CURRENT_VERSION="2.0.1" + EE_CURRENT_VERSION="2.1.0" fi # Restart service From 94f3eefbf72e4d440380ff1db7f6ea982819feac Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 19:31:45 +0530 Subject: [PATCH 121/131] Better Display msg for FQDN --- bin/install | 2 +- src/lib/ee_lib_check_fqdn.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/install b/bin/install index 5d0cf22b..6335936e 100644 --- a/bin/install +++ b/bin/install @@ -93,7 +93,7 @@ function ee_lib_check_fqdn() fi ;; *) - read -p "Enter FQDN to set for Hostname: " EE_FQDN + read -p "Enter hostname [FQDN]: " EE_FQDN ee_lib_check_fqdn $EE_FQDN ;; esac diff --git a/src/lib/ee_lib_check_fqdn.sh b/src/lib/ee_lib_check_fqdn.sh index 987c3b03..4432031f 100644 --- a/src/lib/ee_lib_check_fqdn.sh +++ b/src/lib/ee_lib_check_fqdn.sh @@ -11,7 +11,7 @@ function ee_lib_check_fqdn() fi ;; *) - read -p "Enter FQDN to set for Hostname: " EE_FQDN + read -p "Enter hostname [FQDN]: " EE_FQDN ee_lib_check_fqdn $EE_FQDN ;; esac From 58f03a2d07106140f22e843059c4bd8a2b322dc2 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 19:43:22 +0530 Subject: [PATCH 122/131] Better way to get OS codename --- src/modules/stack/install/ee_mod_repo_nginx.sh | 2 +- src/modules/stack/install/ee_mod_repo_php.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/modules/stack/install/ee_mod_repo_nginx.sh b/src/modules/stack/install/ee_mod_repo_nginx.sh index bb1c1bec..773b8d54 100644 --- a/src/modules/stack/install/ee_mod_repo_nginx.sh +++ b/src/modules/stack/install/ee_mod_repo_nginx.sh @@ -13,7 +13,7 @@ function ee_mod_repo_nginx() # Add Dotdeb nginx repository ee_lib_echo "Adding Dotdeb NGINX repository, please wait..." - echo "deb http://packages.dotdeb.org $(lsb_release -c | awk '{print($2)}') all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -c | awk '{print($2)}').list \ + echo "deb http://packages.dotdeb.org $(lsb_release -sc) all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -sc).list \ || ee_lib_error "Unable to add Dotdeb NGINX repository, exit status = " $? # Fetch and install dotdeb GnuPG key diff --git a/src/modules/stack/install/ee_mod_repo_php.sh b/src/modules/stack/install/ee_mod_repo_php.sh index d08cbed6..e21bb382 100644 --- a/src/modules/stack/install/ee_mod_repo_php.sh +++ b/src/modules/stack/install/ee_mod_repo_php.sh @@ -14,7 +14,7 @@ function ee_mod_repo_php() elif [ $EE_DEBIAN_VERSION -eq 6 ]; then ee_lib_echo "Adding Dotdeb PHP5.4 repository, please wait..." - echo "deb http://packages.dotdeb.org $(lsb_release -c | awk '{print($2)}')-php54 all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -c | awk '{print($2)}')-php54.list \ + echo "deb http://packages.dotdeb.org $(lsb_release -sc)-php54 all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -sc)-php54.list \ || ee_lib_error "Unable to add Dotdeb PHP5.4 repository, exit status = " $? # Fetch and install Dotdeb GnuPG key @@ -24,7 +24,7 @@ function ee_mod_repo_php() elif [ $EE_DEBIAN_VERSION -eq 7 ]; then ee_lib_echo "Adding Dotdeb PHP5.5 repository, please wait..." - echo "deb http://packages.dotdeb.org $(lsb_release -c | awk '{print($2)}')-php55 all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -c | awk '{print($2)}')-php55.list \ + echo "deb http://packages.dotdeb.org $(lsb_release -sc)-php55 all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -sc)-php55.list \ || ee_lib_error "Unable to add Dotdeb PHP5.5 repository, exit status = " $? # Fetch and install dotdeb GnuPG key From fdeee0a91b4c44be317f42ffbe8ad0fb7ea8c183 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 20:10:11 +0530 Subject: [PATCH 123/131] Better way to handle Debian COdename --- src/lib/ee_lib_variables.sh | 2 +- src/modules/stack/install/ee_mod_repo_php.sh | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/lib/ee_lib_variables.sh b/src/lib/ee_lib_variables.sh index 65e84076..c5b2113e 100644 --- a/src/lib/ee_lib_variables.sh +++ b/src/lib/ee_lib_variables.sh @@ -32,7 +32,7 @@ elif [ "$EE_LINUX_DISTRO" == "Debian" ]; then # Specify nginx package readonly EE_NGINX_PACKAGE=nginx-full # Detect Debian version - readonly EE_DEBIAN_VERSION=$(lsb_release -r | awk '{print($2)}' | cut -d'.' -f1) + readonly EE_DEBIAN_VERSION=$(lsb_release -sc) fi # Find php user-name diff --git a/src/modules/stack/install/ee_mod_repo_php.sh b/src/modules/stack/install/ee_mod_repo_php.sh index e21bb382..2e1015a5 100644 --- a/src/modules/stack/install/ee_mod_repo_php.sh +++ b/src/modules/stack/install/ee_mod_repo_php.sh @@ -11,7 +11,7 @@ function ee_mod_repo_php() || ee_lib_error "Unable to add ondrej php5 launchpad repository, exit status = " $? # Debian 6 - elif [ $EE_DEBIAN_VERSION -eq 6 ]; then + elif [ "$EE_DEBIAN_VERSION" == "squeeze" ]; then ee_lib_echo "Adding Dotdeb PHP5.4 repository, please wait..." echo "deb http://packages.dotdeb.org $(lsb_release -sc)-php54 all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -sc)-php54.list \ @@ -21,7 +21,7 @@ function ee_mod_repo_php() ee_lib_dotdeb # Debian 7 - elif [ $EE_DEBIAN_VERSION -eq 7 ]; then + elif [ "$EE_DEBIAN_VERSION" == "wheezy" ]; then ee_lib_echo "Adding Dotdeb PHP5.5 repository, please wait..." echo "deb http://packages.dotdeb.org $(lsb_release -sc)-php55 all" > /etc/apt/sources.list.d/dotdeb-$(lsb_release -sc)-php55.list \ From 3a5a62121aca04b13d5148f3f8c5a3f9d6f27e17 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Tue, 2 Sep 2014 20:14:32 +0530 Subject: [PATCH 124/131] Fixed Debian hostname issue --- bin/install | 7 ++++++- src/lib/ee_lib_check_fqdn.sh | 6 +++++- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/bin/install b/bin/install index 6335936e..8bdb4d7a 100644 --- a/bin/install +++ b/bin/install @@ -42,6 +42,7 @@ readonly EE_LOG_DIR=/var/log/easyengine readonly EE_INSTALL_LOG=/var/log/easyengine/install.log readonly EE_ERROR_LOG=/var/log/easyengine/error.log readonly EE_LINUX_DISTRO=$(lsb_release -i |awk '{print $3}') +readonly EE_DEBIAN_VERSION=$(lsb_release -sc) # Checking linux distro if [ "$EE_LINUX_DISTRO" != "Ubuntu" ] && [ "$EE_LINUX_DISTRO" != "Debian" ]; then @@ -88,7 +89,11 @@ function ee_lib_check_fqdn() *.*) if [ "$EE_FQDN" != "" ];then echo $EE_FQDN > /etc/hostname - service hostname restart &>> $EE_INSTALL_LOG + if [ "$EE_DEBIAN_VERSION" == "squeeze" ];then + /etc/init.d/hostname.sh start &>> $EE_COMMAND_LOG + else + service hostname restart &>> $EE_COMMAND_LOG + fi hostname -f &>> $EE_INSTALL_LOG fi ;; diff --git a/src/lib/ee_lib_check_fqdn.sh b/src/lib/ee_lib_check_fqdn.sh index 4432031f..1f8648a0 100644 --- a/src/lib/ee_lib_check_fqdn.sh +++ b/src/lib/ee_lib_check_fqdn.sh @@ -6,7 +6,11 @@ function ee_lib_check_fqdn() *.*) if [ "$EE_FQDN" != "" ];then echo $EE_FQDN > /etc/hostname - service hostname restart &>> $EE_COMMAND_LOG + if [ "$EE_DEBIAN_VERSION" == "squeeze" ];then + /etc/init.d/hostname.sh start &>> $EE_COMMAND_LOG + else + service hostname restart &>> $EE_COMMAND_LOG + fi hostname -f &>> $EE_COMMAND_LOG fi ;; From 46152b41019c0683bac67a4e75c59fe98bdc8aae Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 12:27:04 +0530 Subject: [PATCH 125/131] Fixed hostname log issue --- bin/install | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/install b/bin/install index 8bdb4d7a..2125dc5d 100644 --- a/bin/install +++ b/bin/install @@ -90,9 +90,9 @@ function ee_lib_check_fqdn() if [ "$EE_FQDN" != "" ];then echo $EE_FQDN > /etc/hostname if [ "$EE_DEBIAN_VERSION" == "squeeze" ];then - /etc/init.d/hostname.sh start &>> $EE_COMMAND_LOG + /etc/init.d/hostname.sh start &>> $EE_INSTALL_LOG else - service hostname restart &>> $EE_COMMAND_LOG + service hostname restart &>> $EE_INSTALL_LOG fi hostname -f &>> $EE_INSTALL_LOG fi From 7553dfb592cbae4bdef930d9977dd4ddd4c16262 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 14:57:31 +0530 Subject: [PATCH 126/131] Added Dovecot repo for Debian 6 --- .../install/mail/ee_mod_install_dovecot.sh | 4 ++++ .../stack/install/mail/ee_mod_repo_dovecot.sh | 19 +++++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 src/modules/stack/install/mail/ee_mod_repo_dovecot.sh diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index e7ce0ca8..18bc1f38 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -2,6 +2,10 @@ function ee_mod_install_dovecot() { + # Add Dovecot repo for Debian 6 + ee_mod_repo_dovecot + ee_lib_apt_get_update + # Install Dovecot ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" diff --git a/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh b/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh new file mode 100644 index 00000000..677fb1a1 --- /dev/null +++ b/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh @@ -0,0 +1,19 @@ +# Setup nginx repository + +function ee_mod_repo_dovecot() +{ + if [ "$EE_DEBIAN_VERSION" == "squeeze" ];then + + # Add Dovecot repository + # Ref:http://wiki2.dovecot.org/PrebuiltBinaries + + ee_lib_echo "Adding Dovecot repository, please wait..." + echo "deb http://xi.rename-it.nl/debian/ oldstable-auto/dovecot-2.2 main" > /etc/apt/sources.list.d/dovecot-$(lsb_release -sc).list \ + || ee_lib_error "Unable to add Dovecot repository, exit status = " $? + + # Fetch and install Dovecot GnuPG key + wget -O - http://xi.rename-it.nl/debian/archive.key | apt-key add - \ + || ee_lib_error "Unable to fetch Dovecot GnuPG key, exit status = " $? + + fi +} From 05a47ff27b8019fea469c89f1a6b89b3a2bff7f6 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 15:31:49 +0530 Subject: [PATCH 127/131] Changed Dovcot Repo --- .../stack/install/mail/ee_mod_install_dovecot.sh | 11 +++++++++-- src/modules/stack/install/mail/ee_mod_repo_dovecot.sh | 8 +------- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh index 18bc1f38..09225e4b 100644 --- a/src/modules/stack/install/mail/ee_mod_install_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_install_dovecot.sh @@ -10,7 +10,14 @@ function ee_mod_install_dovecot() ee_lib_echo "Installing Dovecot, please wait..." debconf-set-selections <<< "dovecot-core dovecot-core/create-ssl-cert boolean yes" debconf-set-selections <<< "dovecot-core dovecot-core/ssl-cert-name string $(hostname -f)" - $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ - || ee_lib_error "Unable to install Dovecot, exit status = " $? + + # Debian 6 doesn't provide Dovecot 2.x + if [ "$EE_DEBIAN_VERSION" == "squeeze" ]; then + $EE_APT_GET -t squeeze-backports install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ + || ee_lib_error "Unable to install Dovecot, exit status = " $? + else + $EE_APT_GET install dovecot-core dovecot-imapd dovecot-pop3d dovecot-lmtpd dovecot-mysql dovecot-sieve dovecot-managesieved \ + || ee_lib_error "Unable to install Dovecot, exit status = " $? + fi } diff --git a/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh b/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh index 677fb1a1..5f27164b 100644 --- a/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh +++ b/src/modules/stack/install/mail/ee_mod_repo_dovecot.sh @@ -5,15 +5,9 @@ function ee_mod_repo_dovecot() if [ "$EE_DEBIAN_VERSION" == "squeeze" ];then # Add Dovecot repository - # Ref:http://wiki2.dovecot.org/PrebuiltBinaries - ee_lib_echo "Adding Dovecot repository, please wait..." - echo "deb http://xi.rename-it.nl/debian/ oldstable-auto/dovecot-2.2 main" > /etc/apt/sources.list.d/dovecot-$(lsb_release -sc).list \ + echo "deb http://http.debian.net/debian-backports squeeze-backports main" > /etc/apt/sources.list.d/dovecot-$(lsb_release -sc).list \ || ee_lib_error "Unable to add Dovecot repository, exit status = " $? - # Fetch and install Dovecot GnuPG key - wget -O - http://xi.rename-it.nl/debian/archive.key | apt-key add - \ - || ee_lib_error "Unable to fetch Dovecot GnuPG key, exit status = " $? - fi } From dd3a6787a45da115c12cfcb75d85d15694f3f8d1 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 16:25:39 +0530 Subject: [PATCH 128/131] Updated Posfix support for Debian 6 --- .../install/mail/ee_mod_setup_postfix.sh | 30 ++++++++----------- 1 file changed, 13 insertions(+), 17 deletions(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index 59dac0d6..feb80e48 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -22,31 +22,27 @@ function ee_mod_setup_postfix() sed -i 's/#smtps/smtps/' /etc/postfix/master.cf \ || ee_lib_error "Unable to setup details in master.cf file, exit status = " $? - #Configure main.cf - #postconf "#smtpd_tls_session_cache_database = btree:${data_directory}/smtpd_scache" - #postconf "#smtp_tls_session_cache_database = btree:${data_directory}/smtp_scache" - #postconf "#smtpd_tls_cert_file=/etc/ssl/certs/dovecot.pem" - #postconf "#smtpd_use_tls=yes" - #postconf "#smtpd_tls_auth_only = yes" + # Handle SMTP authentication using Dovecot" + # On Debian6 following command not work + # postconf "smtpd_sasl_type = dovecot" - #Handle SMTP authentication using Dovecot" - postconf "smtpd_sasl_type = dovecot" - postconf "smtpd_sasl_path = private/auth" - postconf "smtpd_sasl_auth_enable = yes" + postconf -e "smtpd_sasl_type = dovecot" + postconf -e "smtpd_sasl_path = private/auth" + postconf -e "smtpd_sasl_auth_enable = yes" - postconf "smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination" + postconf -e "smtpd_relay_restrictions = permit_sasl_authenticated, permit_mynetworks, reject_unauth_destination" # other destination domains should be handled using virtual domains - postconf "mydestination = localhost" + postconf -e "mydestination = localhost" # using Dovecot's LMTP for mail delivery and giving it path to store mail - postconf "virtual_transport = lmtp:unix:private/dovecot-lmtp" + postconf -e "virtual_transport = lmtp:unix:private/dovecot-lmtp" # virtual mailbox setups - postconf "virtual_uid_maps = static:5000" - postconf "virtual_gid_maps = static:5000" - postconf "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf" - postconf "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf" + postconf -e "virtual_uid_maps = static:5000" + postconf -e "virtual_gid_maps = static:5000" + postconf -e "virtual_mailbox_domains = mysql:/etc/postfix/mysql/virtual_domains_maps.cf" + postconf -e "virtual_mailbox_maps = mysql:/etc/postfix/mysql/virtual_mailbox_maps.cf" #postconf "message_size_limit = 20971520" From 54ca9d0f58594d6521b6c94aae849240931ad049 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 16:26:58 +0530 Subject: [PATCH 129/131] Updated Posfix support for Debian 6 --- src/modules/stack/install/mail/ee_mod_setup_postfix.sh | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh index feb80e48..6ffbf518 100644 --- a/src/modules/stack/install/mail/ee_mod_setup_postfix.sh +++ b/src/modules/stack/install/mail/ee_mod_setup_postfix.sh @@ -23,8 +23,9 @@ function ee_mod_setup_postfix() || ee_lib_error "Unable to setup details in master.cf file, exit status = " $? # Handle SMTP authentication using Dovecot" - # On Debian6 following command not work + # On Debian6 following command not work ( Postfix < 2.8 ) # postconf "smtpd_sasl_type = dovecot" + # The -e option is no longer needed with Postfix version 2.8 and later. postconf -e "smtpd_sasl_type = dovecot" postconf -e "smtpd_sasl_path = private/auth" From c588e018c5480de7eba7dad565f6fc6f6aa60714 Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 17:36:25 +0530 Subject: [PATCH 130/131] Fixed travis --- .travis.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.travis.yml b/.travis.yml index 88e68603..f9c2e332 100644 --- a/.travis.yml +++ b/.travis.yml @@ -126,7 +126,7 @@ script: - sudo bash ee debug - sudo bash ee debug --stop -- sudo bash ee stack install --mail +- sudo bash ee stack install mail - sudo cat /var/log/easyengine/* From bd575373058fdacc1ec14c97f483f0856ea56e0d Mon Sep 17 00:00:00 2001 From: gau1991 Date: Wed, 3 Sep 2014 18:28:39 +0530 Subject: [PATCH 131/131] Fixed ee site edit command on Nano editor --- CHANGELOG.txt | 1 + src/modules/site/ee_mod_site_edit.sh | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.txt b/CHANGELOG.txt index eee173cb..b9f5a9a4 100644 --- a/CHANGELOG.txt +++ b/CHANGELOG.txt @@ -3,6 +3,7 @@ v 2.1.0 - Sept 2, 2014 - Fixed incorrect log file path during debug #299 - Added support for pt-query-advisor #189 - Fixed Firefox cross-domain fonts + - Fixed ee site edit command on Nano editor v 2.0.2 - Aug 13, 2014 - Remote MySQL Support diff --git a/src/modules/site/ee_mod_site_edit.sh b/src/modules/site/ee_mod_site_edit.sh index a9670216..6028d027 100644 --- a/src/modules/site/ee_mod_site_edit.sh +++ b/src/modules/site/ee_mod_site_edit.sh @@ -2,5 +2,5 @@ function ee_mod_site_edit() { - sensible-editor /etc/nginx/sites-available/$EE_DOMAIN $1 2> /dev/null + sensible-editor /etc/nginx/sites-available/$EE_DOMAIN $1 }