Major changes..
This commit is contained in:
		
							
								
								
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										2
									
								
								.gitignore
									
									
									
									
										vendored
									
									
										Normal file
									
								
							| @@ -0,0 +1,2 @@ | ||||
| /conf/*.conf | ||||
| postfixadmin-* | ||||
| @@ -18,22 +18,22 @@ APACHE_LOG_DIR=/var/log/apache2 | ||||
| APACHE_USER=www-data | ||||
| APACHE_GROUP=www-data | ||||
| 
 | ||||
| _use_mod_php_fpm=true | ||||
| _use_mod_fcgid=false | ||||
| _use_mod_php=false | ||||
| 
 | ||||
| APACHE_SERVER_CERT=server.crt | ||||
| APACHE_SERVER_CERT=server-bundle.crt | ||||
| APACHE_SERVER_KEY=server.key | ||||
| 
 | ||||
| ## - Leave empty if not needed | ||||
| ## - | ||||
| CERT_ChainFile=sub.class2.server.ca.pem | ||||
| CERT_ChainFile="" | ||||
| 
 | ||||
| 
 | ||||
| ## - adm.oopen.de | ||||
| IPV4=83.223.86.91 | ||||
| IPV6=2a01:30:0:13:2f7:50ff:fed2:cef7 | ||||
| 
 | ||||
| #_pf_admin_version=2.91 | ||||
| _pf_admin_version=3.0 | ||||
| _pf_admin_version=3.0.2 | ||||
| 
 | ||||
| #_db_type='mysql' | ||||
| _db_type='pgsql' | ||||
| @@ -56,3 +56,14 @@ vacation_group=vacation | ||||
| deleted_maildirs="/var/deleted-maildirs" | ||||
| deleted_maildomains="/var/deleted-maildomains" | ||||
| 
 | ||||
| _welcome_email=" | ||||
| Hallo, | ||||
| 
 | ||||
| Ihre/deine neue E-Mail Adresse ist eingerichtet. | ||||
| 
 | ||||
| O.OPEN | ||||
| 
 | ||||
| -- | ||||
| O.OPEN            |   Phone:  +49 30 / 290 484 91 | ||||
| Erkelenzdamm 21   |   Fax:    +49 30 / 290 484 99 | ||||
| D-10999 Berlin    |   E-MAIL: oo@oopen.de" | ||||
| @@ -18,6 +18,8 @@ APACHE_LOG_DIR=/var/log/apache2 | ||||
| APACHE_USER=www-data | ||||
| APACHE_GROUP=www-data | ||||
| 
 | ||||
| _use_mod_php_fpm=true | ||||
| _use_mod_fcgid=false | ||||
| _use_mod_php=false | ||||
| 
 | ||||
| APACHE_SERVER_CERT=server.crt | ||||
| @@ -25,25 +27,31 @@ APACHE_SERVER_KEY=server.key | ||||
| 
 | ||||
| ## - Leave empty if not needed | ||||
| ## - | ||||
| CERT_ChainFile=SSL123_CA_Bundle.pem | ||||
| 
 | ||||
| CERT_ChainFile="" | ||||
| 
 | ||||
| IPV4=83.223.85.101 | ||||
| IPV6=2a01:30:1fff:3::101 | ||||
| 
 | ||||
| _pf_admin_version=code-1676-trunk | ||||
| #_pf_admin_version=code-1676-trunk | ||||
| _pf_admin_version=3.0.2 | ||||
| 
 | ||||
| #_db_type='pgsql' | ||||
| _db_type='mysql' | ||||
| 
 | ||||
| _db_name='postfix' | ||||
| _db_user='postfix' | ||||
| _db_pass='AeB4kohyie5rahJ7' | ||||
| #_db_host='/var/run/postgresql' | ||||
| _db_host='localhost' | ||||
| 
 | ||||
| _mysql_rootuser=root | ||||
| _mysql_rootpass=buz111 | ||||
| 
 | ||||
| # - mysql_credential_args | ||||
| # - | ||||
| # - Example | ||||
| # -    mysql_credential_args="--login-path=local" | ||||
| # -    mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) | ||||
| # -    mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" | ||||
| # - | ||||
| mysql_credential_args="" | ||||
| 
 | ||||
| # _encrypt=md5crypt | ||||
| _encrypt=cleartext | ||||
| @@ -58,3 +66,12 @@ vacation_group=vacation | ||||
| deleted_maildirs="/var/deleted-maildirs" | ||||
| deleted_maildomains="/var/deleted-maildomains" | ||||
| 
 | ||||
| _welcome_email=" | ||||
| Hallo, | ||||
| 
 | ||||
| Deine neue E-Mail Adresse ist eingerichtet. | ||||
| 
 | ||||
| Support-Team Initiativenserver | ||||
| 
 | ||||
| -- | ||||
| kontakt@initiativenserver.de | ||||
| @@ -18,6 +18,8 @@ APACHE_LOG_DIR=/var/log/apache2 | ||||
| APACHE_USER=www-data | ||||
| APACHE_GROUP=www-data | ||||
| 
 | ||||
| _use_mod_php_fpm=true | ||||
| _use_mod_fcgid=false | ||||
| _use_mod_php=false | ||||
| 
 | ||||
| APACHE_SERVER_CERT=server.crt | ||||
| @@ -25,12 +27,13 @@ APACHE_SERVER_KEY=server.key | ||||
| 
 | ||||
| ## - Leave empty if not needed | ||||
| ## - | ||||
| CERT_ChainFile=sub.class2.server.ca.pem | ||||
| CERT_ChainFile="" | ||||
| 
 | ||||
| IPV4=83.223.85.215 | ||||
| IPV6=2a01:30:1fff:5::215 | ||||
| 
 | ||||
| _pf_admin_version=2.91 | ||||
| #_pf_admin_version=2.91 | ||||
| _pf_admin_version=3.0.2 | ||||
| 
 | ||||
| #_db_type='mysql' | ||||
| _db_type='pgsql' | ||||
| @@ -41,6 +44,15 @@ _db_pass='NcXxt7sf7bfV' | ||||
| #_db_host='localhost' | ||||
| _db_host='/var/run/postgresql' | ||||
| 
 | ||||
| # - mysql_credential_args | ||||
| # - | ||||
| # - Example | ||||
| # -    mysql_credential_args="--login-path=local" | ||||
| # -    mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) | ||||
| # -    mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" | ||||
| # - | ||||
| mysql_credential_args="" | ||||
| 
 | ||||
| _encrypt=md5crypt | ||||
| #_encrypt=cleartext | ||||
| 
 | ||||
| @@ -18,20 +18,22 @@ APACHE_LOG_DIR=/var/log/apache2 | ||||
| APACHE_USER=www-data | ||||
| APACHE_GROUP=www-data | ||||
| 
 | ||||
| _use_mod_php_fpm=true | ||||
| _use_mod_fcgid=false | ||||
| _use_mod_php=false | ||||
| 
 | ||||
| APACHE_SERVER_CERT=server.crt | ||||
| APACHE_SERVER_CERT=server-bundle.crt | ||||
| APACHE_SERVER_KEY=server.key | ||||
| 
 | ||||
| ## - Leave empty if not needed | ||||
| ## - | ||||
| CERT_ChainFile=SSL123_CA_Bundle.pem | ||||
| CERT_ChainFile="" | ||||
| 
 | ||||
| IPV4=83.223.85.154 | ||||
| IPV6=2a01:30:1fff:6::154 | ||||
| IPV4=83.223.86.77 | ||||
| IPV6=2a01:30:0:13:26e:a5ff:fe01:1bd8 | ||||
| 
 | ||||
| #_pf_admin_version=2.3.7 | ||||
| _pf_admin_version=2.91 | ||||
| _pf_admin_version=3.0.2 | ||||
| 
 | ||||
| #_db_type='mysql' | ||||
| _db_type='pgsql' | ||||
| @@ -42,6 +44,15 @@ _db_pass='CbX8vg347Vvm' | ||||
| #_db_host='localhost' | ||||
| _db_host='/var/run/postgresql' | ||||
| 
 | ||||
| # - mysql_credential_args | ||||
| # - | ||||
| # - Example | ||||
| # -    mysql_credential_args="--login-path=local" | ||||
| # -    mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) | ||||
| # -    mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" | ||||
| # - | ||||
| mysql_credential_args="" | ||||
| 
 | ||||
| # _encrypt=md5crypt | ||||
| _encrypt=cleartext | ||||
| 
 | ||||
| @@ -18,6 +18,8 @@ APACHE_LOG_DIR=/var/log/apache2 | ||||
| APACHE_USER=www-data | ||||
| APACHE_GROUP=www-data | ||||
| 
 | ||||
| _use_mod_php_fpm=true | ||||
| _use_mod_fcgid=false | ||||
| _use_mod_php=false | ||||
| 
 | ||||
| APACHE_SERVER_CERT=server.crt | ||||
| @@ -25,12 +27,13 @@ APACHE_SERVER_KEY=server.key | ||||
| 
 | ||||
| ## - Leave empty if not needed | ||||
| ## - | ||||
| CERT_ChainFile=sub.class2.server.ca.pem | ||||
| CERT_ChainFile="" | ||||
| 
 | ||||
| IPV4=83.223.73.193 | ||||
| IPV6=2a01:30:1fff:fd00::193 | ||||
| 
 | ||||
| _pf_admin_version=2.3.7 | ||||
| #_pf_admin_version=2.3.7 | ||||
| _pf_admin_version=3.0.2 | ||||
| 
 | ||||
| #_db_type='mysql' | ||||
| _db_type='pgsql' | ||||
| @@ -41,6 +44,15 @@ _db_pass='9jKqFHNGrgFb' | ||||
| #_db_host='localhost' | ||||
| _db_host='/var/run/postgresql' | ||||
| 
 | ||||
| # - mysql_credential_args | ||||
| # - | ||||
| # - Example | ||||
| # -    mysql_credential_args="--login-path=local" | ||||
| # -    mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) | ||||
| # -    mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" | ||||
| # - | ||||
| mysql_credential_args="" | ||||
| 
 | ||||
| _encrypt=md5crypt | ||||
| #_encrypt=cleartext | ||||
| 
 | ||||
							
								
								
									
										77
									
								
								conf/install_postfixadmin.conf.sample
									
									
									
									
									
										Normal file
									
								
							
							
						
						
									
										77
									
								
								conf/install_postfixadmin.conf.sample
									
									
									
									
									
										Normal file
									
								
							| @@ -0,0 +1,77 @@ | ||||
| ## - Postfixadmin environment for server | ||||
| ## - | ||||
|  | ||||
| ## ------------------------------------- | ||||
| ##  -  | ||||
|  | ||||
| #HOSTNAME="a.mx.oopen.de" | ||||
| #DOMAIN="oopen.de" | ||||
| ADMIN_EMAIL="admin\@warenform.de" | ||||
|  | ||||
| APACHE_CONF_DIR=/usr/local/apache2/conf | ||||
| APACHE_VHOST_DIR=/usr/local/apache2/conf/vhosts | ||||
| APACHE_BASE_WEBDIR=/var/www | ||||
| APACHE_LOG_DIR=/var/log/apache2 | ||||
|  | ||||
| APACHE_USER=www-data | ||||
| APACHE_GROUP=www-data | ||||
|  | ||||
| _use_mod_php_fpm=true | ||||
| _use_mod_fcgid=false | ||||
| _use_mod_php=false | ||||
|  | ||||
| APACHE_SERVER_CERT=server-bundle.crt | ||||
| APACHE_SERVER_KEY=server.key | ||||
|  | ||||
| ## - Leave empty if not needed | ||||
| ## - | ||||
| CERT_ChainFile="" | ||||
|  | ||||
| IPV4="" | ||||
| IPV6="" | ||||
|  | ||||
| #_pf_admin_version=2.3.7 | ||||
| _pf_admin_version=3.0.2 | ||||
|  | ||||
| #_db_type='mysql' | ||||
| _db_type='pgsql' | ||||
|  | ||||
| _db_name='postfix' | ||||
| _db_user='postfix' | ||||
| _db_pass='' | ||||
| #_db_host='localhost' | ||||
| _db_host='/var/run/postgresql' | ||||
|  | ||||
| # - mysql_credential_args | ||||
| # - | ||||
| # - Example | ||||
| # -    mysql_credential_args="--login-path=local" | ||||
| # -    mysql_credential_args="--defaults-file=/etc/mysql/debian.cnf" (Debian default) | ||||
| # -    mysql_credential_args="--defaults-file=/usr/local/mysql/sys-maint.cnf" | ||||
| # - | ||||
| mysql_credential_args="" | ||||
|  | ||||
| # _encrypt=md5crypt | ||||
| _encrypt=cleartext | ||||
|  | ||||
| _spam_folder=Spam | ||||
|  | ||||
| _autoreply_domain='' | ||||
| vacation_user=vacation | ||||
| vacation_group=vacation | ||||
|  | ||||
| deleted_maildirs="/var/deleted-maildirs" | ||||
| deleted_maildomains="/var/deleted-maildomains" | ||||
|  | ||||
| _welcome_email=" | ||||
| Hallo, | ||||
|  | ||||
| Ihre neue E-Mail Adresse ist eingerichtet. | ||||
|  | ||||
| Das WARENFORM-Team | ||||
|  | ||||
| -- | ||||
| WARENFORM         |   Phone:  +49 30 / 61 65 17 52 -0 | ||||
| Dresdner Str. 11  |   Fax:    +49 30 / 61 65 17 52 -66 | ||||
| D-10999 Berlin    |   http://www.warenform.net" | ||||
|  | ||||
							
								
								
									
										240
									
								
								DOC/postfixadmin.install → install_postfixadmin.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							
							
						
						
									
										240
									
								
								DOC/postfixadmin.install → install_postfixadmin.sh
									
									
									
									
									
										
										
										Normal file → Executable file
									
								
							| @@ -1,53 +1,99 @@ | ||||
| ## ---------------------------- ## | ||||
| ## --- install postfixadmin --- ## | ||||
| ## ---------------------------- ## | ||||
| #!/usr/bin/env bash | ||||
| 
 | ||||
| echo -e "\n\tScript is not yet ready for running.\n"  | ||||
| exit # It's not ready for running | ||||
| 
 | ||||
| ## =================================================================== | ||||
| ## - Install Postfixadmin | ||||
| ## =================================================================== | ||||
| 
 | ||||
| ## ----------------------------------------------------------------- | ||||
| ## ---------------------------------------------------------------- | ||||
| ## --- | ||||
| ## --- For configurations see file conf/install_postfixadmin.conf | ||||
| ## --- | ||||
| ## --- Dont make changes here! | ||||
| ## --- | ||||
| ## ----------------------------------------------------------------- | ||||
| ## ----------------------------------------------------------------- | ||||
| 
 | ||||
| # ------------- | ||||
| # - Settings | ||||
| # ------------- | ||||
| 
 | ||||
| #_src_base_dir="$(realpath $(dirname $0))" | ||||
| _src_base_dir=/usr/local/src/postfixadmin | ||||
| conf_file="${_src_base_dir}/conf/install_postfixadmin.conf" | ||||
| curdir=`pwd` | ||||
| 
 | ||||
| log_file="$(mktemp)" | ||||
| 
 | ||||
| 
 | ||||
| ## ------------------------------- | ||||
| ##  - c.mx.oopen.de (adm.initiativenserver.de) | ||||
| # ------------- | ||||
| # - Functions | ||||
| # ------------- | ||||
| 
 | ||||
| . postfixadmin.env.c.mx.oopen.de | ||||
| echononl(){ | ||||
|    echo X\\c > /tmp/shprompt$$ | ||||
|    if [ `wc -c /tmp/shprompt$$ | awk '{print $1}'` -eq 1 ]; then | ||||
|       echo "$*\\c" 1>&2 | ||||
|    else | ||||
|        echo -e -n "$*" 1>&2 | ||||
|    fi | ||||
|    rm /tmp/shprompt$$ | ||||
| } | ||||
| 
 | ||||
| ## - Ende: c.mx.oopen.de (adm.initiativenserver.de) | ||||
| ## ------------------------------------------------ | ||||
| fatal(){ | ||||
|    echo "" | ||||
|    echo -e "\t[ \033[31m\033[1mFatal\033[m ]: $*" | ||||
|    echo "" | ||||
|    echo -e "\t\033[31m\033[1mInstalllation wird abgebrochen\033[m\033[m" | ||||
|    echo "" | ||||
|    exit 1 | ||||
| } | ||||
| 
 | ||||
| ## ------------------------------- | ||||
| ##  - a.mx.oopen.de (adm.oopen.de) | ||||
| error(){ | ||||
|    echo "" | ||||
|    echo -e "\t[ \033[31m\033[1mFehler\033[m ]: $*" | ||||
|    echo "" | ||||
| } | ||||
| 
 | ||||
| . postfixadmin.env.a.mx.oopen.de | ||||
| warn (){ | ||||
|    echo "" | ||||
|    echo -e "\t[ \033[33m\033[1mWarning\033[m ]: $*" | ||||
|    echo "" | ||||
| } | ||||
| 
 | ||||
| ## - Ende: a.mx.oopen.de (adm.oopen.de) | ||||
| ## ------------------------------------ | ||||
| 
 | ||||
| ## ------------------------------------- | ||||
| ##  - mx.warenform.de (adm.warenform.de) | ||||
| 
 | ||||
| . postfixadmin.env.mx.warenform.de | ||||
| 
 | ||||
| ## - Ende: mx.warenform.de (adm.warenform.de) | ||||
| ## ------------------------------------------ | ||||
| 
 | ||||
| ## ------------------------------- | ||||
| ##  - rage.so36.net (adm.so36.net) | ||||
| 
 | ||||
| . postfixadmin.env.rage.so36.net | ||||
| 
 | ||||
| ## - Ende: rage.so36.net (adm.so36.net) | ||||
| ## ------------------------------------ | ||||
| 
 | ||||
| ## -------------------------------------------------------------------------- | ||||
| ##  - mail.interventionistische-linke.org (adm.interventionistische-linke.org) | ||||
| 
 | ||||
| . postfixadmin.env.mail.interventionistische-linke.org | ||||
| 
 | ||||
| ## - Ende: mail.interventionistische-linke.org (adm.interventionistische-linke.org) | ||||
| ## --------------------------------------------------------------------------------------- | ||||
| echo_ok() { | ||||
|    echo -e "\033[75G[ \033[32mok\033[m ]" | ||||
|    ## echo -e "  [ ok ]" | ||||
| } | ||||
| echo_failed(){ | ||||
|    echo -e "\033[75G[ \033[1;31mfailed\033[m ]" | ||||
|    ## echo -e "  [ failed ]" | ||||
| } | ||||
| echo_skipped() { | ||||
|    echo -e "\033[75G[ \033[33m\033[1mskipped\033[m ]" | ||||
| } | ||||
| 
 | ||||
| 
 | ||||
| if [ "$_db_type" = "postgres" -o  "$_db_type" = "postgresql" -o "$_db_type" = "pgsql" -o "$_db_type" = "psql" ];then | ||||
|    _db_type=pgsql | ||||
| fi | ||||
| 
 | ||||
| echo | ||||
| echononl "\tInclude Configuration file.." | ||||
| if [[ ! -f $conf_file ]]; then | ||||
|    echo_failed | ||||
|    fatal "Missing configuration file '$conf_file'" | ||||
| else | ||||
|    source $conf_file | ||||
|    echo_ok | ||||
| fi | ||||
| 
 | ||||
| _log_dir=${_src_base_dir}/log-postfixadmin-$_version | ||||
| 
 | ||||
| 
 | ||||
| 
 | ||||
| ## - Create temp directory for php | ||||
| @@ -55,12 +101,29 @@ fi | ||||
| mkdir -p ${APACHE_BASE_WEBDIR}/${HOSTNAME}/{logs,sessions,tmp} | ||||
| chown ${APACHE_USER}:${APACHE_GROUP} ${APACHE_BASE_WEBDIR}/${HOSTNAME}/{sessions,tmp} | ||||
| 
 | ||||
| if ! $_use_mod_php ; then | ||||
| # - Determin PHP all Versions | ||||
| # - | ||||
| _php_major_versions=`find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort` | ||||
| 
 | ||||
| # - Get the lates PHP version | ||||
| # - | ||||
| php_apache_ver="" | ||||
| for _ver in $_php_major_versions ; do | ||||
|    if [[ -z "$php_apache_ver" ]] ; then | ||||
|       php_apache_ver=$_ver | ||||
|    elif [[ "${_ver%.*}" -gt "${php_apache_ver%.*}" ]] ; then | ||||
|       php_apache_ver=$_ver | ||||
|    elif [[ "${_ver%.*}" -eq "${php_apache_ver%.*}" ]] ; then | ||||
|       [[ "${_ver#*.}"  -gt  "${php_apache_ver#*.}" ]] && php_apache_ver=$_ver | ||||
|    fi | ||||
| done | ||||
| 
 | ||||
| 
 | ||||
| if $_use_mod_fcgid ; then | ||||
|    mkdir -p ${APACHE_BASE_WEBDIR}/${HOSTNAME}/conf | ||||
|    chown root:$APACHE_USER ${APACHE_BASE_WEBDIR}/${HOSTNAME}/conf | ||||
|    chmod 750 ${APACHE_BASE_WEBDIR}/${HOSTNAME}/conf | ||||
| 
 | ||||
|    _php_major_versions=`find /usr/local/ -maxdepth 1 -mindepth 1 -type l -name "php-*" -print | cut -d "-" -f2 | sort` | ||||
|    for _version in $_php_major_versions ; do | ||||
|       cp /usr/local/php-${_version}/etc/php.ini ${APACHE_BASE_WEBDIR}/${HOSTNAME}/conf/php.ini-$_version | ||||
| 
 | ||||
| @@ -192,9 +255,22 @@ cat <<EOF > ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
|    ServerAdmin $ADMIN_EMAIL | ||||
| 
 | ||||
|    ServerName $HOSTNAME | ||||
| 
 | ||||
| EOF | ||||
| if $_use_mod_php ; then | ||||
| if $_use_mod_php_fpm ; then | ||||
|    cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    DocumentRoot "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/" | ||||
| 
 | ||||
|    <FilesMatch \.php$> | ||||
|       SetHandler "proxy:unix:/tmp/php-${php_apache_ver}-fpm.www.sock|fcgi://127.0.0.1" | ||||
|    </FilesMatch> | ||||
| 
 | ||||
|    <IfModule dir_module> | ||||
|       DirectoryIndex index.php index.html | ||||
|    </IfModule> | ||||
| EOF | ||||
| 
 | ||||
| elif $_use_mod_php ; then | ||||
|    cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    ## - its allowed to overwrite by .htaccess | ||||
| @@ -210,8 +286,10 @@ if $_use_mod_php ; then | ||||
| 
 | ||||
|    DocumentRoot "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/" | ||||
| EOF | ||||
|     | ||||
| else | ||||
|    cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    DocumentRoot "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/" | ||||
|    <Directory "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/"> | ||||
|       Require all granted | ||||
| @@ -224,6 +302,7 @@ else | ||||
| EOF | ||||
| fi | ||||
| cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    SSLEngine on | ||||
| 
 | ||||
|    ## - HTTP Strict Transport Security (HSTS) | ||||
| @@ -272,10 +351,24 @@ cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
|    ServerAdmin $ADMIN_EMAIL | ||||
| 
 | ||||
|    ServerName $HOSTNAME | ||||
| 
 | ||||
| EOF | ||||
| if $_use_mod_php ; then | ||||
| if $_use_mod_php_fpm ; then | ||||
|    cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    DocumentRoot "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/" | ||||
| 
 | ||||
|    <FilesMatch \.php$> | ||||
|       SetHandler "proxy:unix:/tmp/php-${php_apache_ver}-fpm.www.sock|fcgi://127.0.0.1" | ||||
|    </FilesMatch> | ||||
| 
 | ||||
|    <IfModule dir_module> | ||||
|       DirectoryIndex index.php index.html | ||||
|    </IfModule> | ||||
| EOF | ||||
| 
 | ||||
| elif $_use_mod_php ; then | ||||
|    cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    ## - its allowed to overwrite by .htaccess | ||||
|    ## - | ||||
|    php_value error_reporting "E_ALL & ~E_NOTICE" | ||||
| @@ -291,6 +384,7 @@ if $_use_mod_php ; then | ||||
| EOF | ||||
| else | ||||
|    cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    DocumentRoot "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/" | ||||
|    <Directory "${APACHE_BASE_WEBDIR}/${HOSTNAME}/htdocs/"> | ||||
|       Require all granted | ||||
| @@ -303,6 +397,7 @@ else | ||||
| EOF | ||||
| fi | ||||
| cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
|    SSLEngine on | ||||
| 
 | ||||
|    ## - HTTP Strict Transport Security (HSTS) | ||||
| @@ -326,7 +421,13 @@ cat <<EOF >> ${APACHE_VHOST_DIR}/$HOSTNAME.conf | ||||
| 
 | ||||
| EOF | ||||
| 
 | ||||
| a2ensite $HOSTNAME | ||||
| debian_installed_apache=false | ||||
| if $debian_installed_apache ; then | ||||
|    a2ensite $HOSTNAME | ||||
| fi | ||||
| 
 | ||||
| apachectl configtest | ||||
| apachectl graceful | ||||
| 
 | ||||
| 
 | ||||
| ## - Datenbank etstellen: | ||||
| @@ -336,14 +437,14 @@ a2ensite $HOSTNAME | ||||
| ## - | ||||
| 
 | ||||
| if [ "$_db_type" = "mysql" ]; then  | ||||
|    if ! mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e \ | ||||
|    if ! mysql $mysql_credential_args -N -s -e \ | ||||
|       "SELECT SCHEMA_NAME FROM INFORMATION_SCHEMA.SCHEMATA WHERE SCHEMA_NAME = '$_db_name'" 2>/dev/null \ | ||||
|       | grep $_db_name > /dev/null 2>&1 ; then | ||||
|       mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e \ | ||||
|       mysql $mysql_credential_args -N -s -e \ | ||||
|          "CREATE DATABASE IF NOT EXISTS $_db_name CHARACTER SET utf8 COLLATE utf8_general_ci" | ||||
|       mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e \ | ||||
|       mysql $mysql_credential_args -N -s -e \ | ||||
|          "GRANT ALL ON $_db_name.* TO '$_db_user'@'localhost' IDENTIFIED BY '$_db_pass'" | ||||
|       mysql -u$_mysql_rootuser -p$_mysql_rootpass -N -s -e "FLUSH PRIVILEGES" | ||||
|       mysql $mysql_credential_args -N -s -e "FLUSH PRIVILEGES" | ||||
|    fi | ||||
| elif [ "$_db_type" = "pgsql" ]; then | ||||
|    count=`su - postgres -c "psql -q -A -t -l" | grep -c -e "^$_db_name"` | ||||
| @@ -356,16 +457,15 @@ fi | ||||
| 
 | ||||
| ## - Get postfixadmin sources if not yet downloaded | ||||
| ## - | ||||
| cd /usr/local/src/mailsystem/tarballs | ||||
| cd $_src_base_dir | ||||
| if [ ! -f postfixadmin-${_pf_admin_version}.tar.gz ];then | ||||
|    wget http://downloads.sourceforge.net/project/postfixadmin/postfixadmin/postfixadmin-${_pf_admin_version}/postfixadmin-${_pf_admin_version}.tar.gz | ||||
| fi | ||||
| 
 | ||||
| cd /usr/local/src/mailsystem | ||||
| if [ -d postfixadmin-${_pf_admin_version} ]; then | ||||
|    mv postfixadmin-${_pf_admin_version} postfixadmin-${_pf_admin_version}.`date "+%Y%m%d-%H%M"` | ||||
| fi | ||||
| gunzip < tarballs/postfixadmin-${_pf_admin_version}.tar.gz | tar -xf - | ||||
| gunzip < postfixadmin-${_pf_admin_version}.tar.gz | tar -xf - | ||||
| 
 | ||||
| ## - Get postfixadmin patch if not yet downloaded | ||||
| ## -  | ||||
| @@ -393,25 +493,36 @@ gunzip < tarballs/postfixadmin-${_pf_admin_version}.tar.gz | tar -xf - | ||||
| ## - | ||||
| ## - I have written a pacth, which fixes that errors | ||||
| ## - | ||||
| patch /usr/local/src/mailsystem/postfixadmin-${_pf_admin_version}/VIRTUAL_VACATION/vacation.pl \ | ||||
|    /usr/local/src/mailsystem/tarballs/vacation-4.0r1.pl_PGSQL.patch | ||||
| #patch /usr/local/src/mailsystem/postfixadmin-${_pf_admin_version}/VIRTUAL_VACATION/vacation.pl \ | ||||
| #   /usr/local/src/mailsystem/tarballs/vacation-4.0r1.pl_PGSQL.patch | ||||
| 
 | ||||
| 
 | ||||
| if [ -f /var/spool/vacation/vacation.pl ]; then | ||||
|    mv /var/spool/vacation/vacation.pl /var/spool/vacation/vacation.pl.`date "+%Y%m%d-%H%M"` | ||||
| fi | ||||
| cp /usr/local/src/mailsystem/postfixadmin-${_pf_admin_version}/VIRTUAL_VACATION/vacation.pl \ | ||||
| cp ${_src_base_dir}/postfixadmin-${_pf_admin_version}/VIRTUAL_VACATION/vacation.pl \ | ||||
|    /var/spool/vacation/vacation.pl | ||||
| 
 | ||||
| 
 | ||||
| ## - Encoding does not work as exspected. | ||||
| ## - | ||||
| ## - NOTE: | ||||
| ## -    this IS NOT a fix, but a workaround | ||||
| ## - | ||||
| perl -i -n -p -e "s/(\s*\'ctype\'\s* =>\s*)\'text\/plain.*$/\1\'text\/plain; charset=iso-8859-1\',/" \ | ||||
|    /var/spool/vacation/vacation.pl | ||||
| 
 | ||||
| 
 | ||||
| chown ${vacation_user}:${vacation_group} /var/spool/vacation/vacation.pl | ||||
| chmod 700 /var/spool/vacation/vacation.pl | ||||
| 
 | ||||
| 
 | ||||
| ## - Use 'Re: $SUBJECT' as the default subject template in postfixadmin | ||||
| ## - | ||||
| perl -i -n -p -e "s#(^\s*\\\$PALANG\['pUsersVacation_subject_text'\].*$)#\#\1\n\\\$PALANG['pUsersVacation_subject_text'] = 'Re: \\\$SUBJECT';#" /usr/local/src/mailsystem/postfixadmin-${_pf_admin_version}/languages/*.lang | ||||
| perl -i -n -p -e "s#(^\s*\\\$PALANG\['pUsersVacation_subject_text'\].*$)#\#\1\n\\\$PALANG['pUsersVacation_subject_text'] = 'Re: \\\$SUBJECT';#" ${_src_base_dir}/postfixadmin-${_pf_admin_version}/languages/*.lang | ||||
| 
 | ||||
| 
 | ||||
| cp -a /usr/local/src/mailsystem/postfixadmin-${_pf_admin_version} ${APACHE_BASE_WEBDIR}/$HOSTNAME | ||||
| cp -a ${_src_base_dir}/postfixadmin-${_pf_admin_version} ${APACHE_BASE_WEBDIR}/$HOSTNAME | ||||
| 
 | ||||
| cd ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version} | ||||
| find -type f -print0 | xargs -0 chmod 640 | ||||
| @@ -419,7 +530,7 @@ find -type f -print0 | xargs -0 chown root:$APACHE_GROUP | ||||
| find -type d -print0 | xargs -0 chown root:$APACHE_GROUP | ||||
| chown -R ${APACHE_USER}:$APACHE_GROUP templates_c | ||||
| 
 | ||||
| mkdir ${APACHE_BASE_WEBDIR}/$HOSTNAME/logs | ||||
| mkdir -p ${APACHE_BASE_WEBDIR}/$HOSTNAME/logs | ||||
| 
 | ||||
| cd ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version} | ||||
| 
 | ||||
| @@ -486,6 +597,10 @@ cd ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version} | ||||
| ## -    $CONF['used_quotas'] = 'YES'; | ||||
| ## -    $CONF['new_quota_table'] = 'YES'; | ||||
| ## - | ||||
| ## -    $CONF['welcome_text'] = <<<EOM | ||||
| ## -    $_welcome_email | ||||
| ## -    EOM; | ||||
| ## - | ||||
| ## - after finished, you must also change the value of $CONF['configured'] | ||||
| ## - to 'true' | ||||
| ## - | ||||
| @@ -575,6 +690,19 @@ cat <<EOF >> ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version} | ||||
| ); | ||||
| EOF | ||||
| 
 | ||||
| perl -i -n -p -e "s#^(\s*\\\$CONF\['welcome_text'\]\s*=.*)#//\n//! 'welcome_text' will be overridden - see end of configfile\n//\n\1#" \ | ||||
|    ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version}/config.inc.php | ||||
| 
 | ||||
| cat <<EOF >> ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version}/config.inc.php | ||||
| 
 | ||||
| // Welcome Message | ||||
| // This message is send to every newly created mailbox. | ||||
| // Change the text between EOM. | ||||
| \$CONF['welcome_text'] = <<<EOM | ||||
| $_welcome_email | ||||
| EOM; | ||||
| EOF | ||||
| 
 | ||||
| perl -i -n -p -e "s#^(\s*\\\$PALANG\['reply_every_mail'\]\s+=.*)#\1\n\\\$PALANG['reply_once_per_day'] = 'Einmal pro Tag antworten';#" \ | ||||
|    ${APACHE_BASE_WEBDIR}/${HOSTNAME}/postfixadmin-${_pf_admin_version}/languages/de.lang | ||||
| perl -i -n -p -e "s#^(\s*\\\$PALANG\['reply_every_mail'\]\s+=.*)#\1\n\\\$PALANG['reply_once_per_day'] = 'Reply once per day';#" \ | ||||
		Reference in New Issue
	
	Block a user