This commit is contained in:
Christoph 2018-05-27 13:48:53 +02:00
commit 0d8f4a7c84
5 changed files with 122 additions and 37 deletions

View File

@ -166,7 +166,7 @@ fi
cat << EOF > $virtual_schleuder_domains_file cat << EOF > $virtual_schleuder_domains_file
dbpath = /var/lib/schleuder/db.sqlite dbpath = /var/lib/schleuder/db.sqlite
query = select distinct substr(email, instr(email, '@') + 1) from lists query = select distinct substr(email, instr(email, '@') + 1) from lists
where email like '%%%s' where email like '%%@%s'
EOF EOF
# - Add 'sqlite:$virtual_schleuder_domains_file' to virtual_mailbox_domains # - Add 'sqlite:$virtual_schleuder_domains_file' to virtual_mailbox_domains

View File

@ -3855,13 +3855,13 @@ fi
## - localhost:10025 inet n - - - - smtpd ## - localhost:10025 inet n - - - - smtpd
## - -o content_filter= ## - -o content_filter=
## - -o smtpd_proxy_filter= ## - -o smtpd_proxy_filter=
## - -o smtpd_authorized_xforward_hosts=127.0.0.0/8 ## - -o smtpd_authorized_xforward_hosts=127.0.0.0/8,[::1]/128
## - -o smtpd_client_restrictions= ## - -o smtpd_client_restrictions=
## - -o smtpd_helo_restrictions= ## - -o smtpd_helo_restrictions=
## - -o smtpd_sender_restrictions= ## - -o smtpd_sender_restrictions=
## - -o smtpd_recipient_restrictions=permit_mynetworks,reject ## - -o smtpd_recipient_restrictions=permit_mynetworks,reject
## - -o smtpd_data_restrictions= ## - -o smtpd_data_restrictions=
## - -o mynetworks=127.0.0.0/8,<$_ipv4_address/32> ## - -o mynetworks=127.0.0.0/8,[::1]/128,<$_ipv4_address/32>
## - -o receive_override_options=no_unknown_recipient_checks ## - -o receive_override_options=no_unknown_recipient_checks
## - ## -
postfix_master_cf="/etc/postfix/master.cf" postfix_master_cf="/etc/postfix/master.cf"
@ -3917,15 +3917,15 @@ EOF
localhost:10025 inet n - y - - smtpd localhost:10025 inet n - y - - smtpd
-o content_filter= -o content_filter=
-o smtpd_proxy_filter= -o smtpd_proxy_filter=
-o smtpd_authorized_xforward_hosts=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8,[::1]/128
-o smtpd_client_restrictions= -o smtpd_client_restrictions=
-o smtpd_helo_restrictions= -o smtpd_helo_restrictions=
-o smtpd_sender_restrictions= -o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions= -o smtpd_data_restrictions=
-o mynetworks=127.0.0.0/8 -o mynetworks=127.0.0.0/8,[::1]/128
-o receive_override_options=no_unknown_recipient_checks -o receive_override_options=no_unknown_recipient_checks
#-o mynetworks=127.0.0.0/8,${IPV4}/32 #-o mynetworks=127.0.0.0/8,[::1]/128,${IPV4}/32
EOF EOF
fi fi
@ -3949,15 +3949,15 @@ EOF
localhost:10025 inet n - y - - smtpd localhost:10025 inet n - y - - smtpd
-o content_filter= -o content_filter=
-o smtpd_proxy_filter= -o smtpd_proxy_filter=
-o smtpd_authorized_xforward_hosts=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8,[::1]/128
-o smtpd_client_restrictions= -o smtpd_client_restrictions=
-o smtpd_helo_restrictions= -o smtpd_helo_restrictions=
-o smtpd_sender_restrictions= -o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions= -o smtpd_data_restrictions=
-o mynetworks=127.0.0.0/8 -o mynetworks=127.0.0.0/8,[::1]/128
-o receive_override_options=no_unknown_recipient_checks -o receive_override_options=no_unknown_recipient_checks
#-o mynetworks=127.0.0.0/8,${IPV4}/32 #-o mynetworks=127.0.0.0/8,[::1]/128,${IPV4}/32
EOF EOF
fi fi
@ -3992,15 +3992,15 @@ EOF
localhost:10025 inet n - y - - smtpd localhost:10025 inet n - y - - smtpd
-o content_filter= -o content_filter=
-o smtpd_proxy_filter= -o smtpd_proxy_filter=
-o smtpd_authorized_xforward_hosts=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8,[::1]/128
-o smtpd_client_restrictions= -o smtpd_client_restrictions=
-o smtpd_helo_restrictions= -o smtpd_helo_restrictions=
-o smtpd_sender_restrictions= -o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions= -o smtpd_data_restrictions=
-o mynetworks=127.0.0.0/8 -o mynetworks=127.0.0.0/8,[::1]/128
-o receive_override_options=no_unknown_recipient_checks -o receive_override_options=no_unknown_recipient_checks
#-o mynetworks=127.0.0.0/8,${IPV4}/32 #-o mynetworks=127.0.0.0/8,[::1]/128,${IPV4}/32
EOF EOF
fi fi
@ -4024,15 +4024,15 @@ EOF
localhost:10025 inet n - y - - smtpd localhost:10025 inet n - y - - smtpd
-o content_filter= -o content_filter=
-o smtpd_proxy_filter= -o smtpd_proxy_filter=
-o smtpd_authorized_xforward_hosts=127.0.0.0/8 -o smtpd_authorized_xforward_hosts=127.0.0.0/8,[::1]/128
-o smtpd_client_restrictions= -o smtpd_client_restrictions=
-o smtpd_helo_restrictions= -o smtpd_helo_restrictions=
-o smtpd_sender_restrictions= -o smtpd_sender_restrictions=
-o smtpd_recipient_restrictions=permit_mynetworks,reject -o smtpd_recipient_restrictions=permit_mynetworks,reject
-o smtpd_data_restrictions= -o smtpd_data_restrictions=
-o mynetworks=127.0.0.0/8 -o mynetworks=127.0.0.0/8,[::1]/128
-o receive_override_options=no_unknown_recipient_checks -o receive_override_options=no_unknown_recipient_checks
#-o mynetworks=127.0.0.0/8,${IPV4}/32 #-o mynetworks=127.0.0.0/8,[::1]/128,${IPV4}/32
EOF EOF
continue continue
fi fi

View File

@ -1859,10 +1859,20 @@ fi
echo "" echo ""
echononl "\tAdjust Postfix Admin's Configuration - Part 1" echononl "\tAdjust Postfix Admin's Configuration - Part 1"
_failed=false _failed=false
if [[ "$POSTFIX_DB_TYPE" = "pgsql" ]]; then
_config_db_type="pgsql"
else
# - database_type 'mysql' uses the deprecated mysql extension , and since PHP 7.0 this extension
# - is no longer available.
# -
# - So use 'mysqli' instead of 'mysql'
# -
_database_type="mysqli"
fi
> $log_file > $log_file
perl -i -n -p -e "s#^(\s*\\\$CONF\['default_language'\]\s*=.*)#//!\1\n\\\$CONF['default_language'] = 'de';#" \ perl -i -n -p -e "s#^(\s*\\\$CONF\['default_language'\]\s*=.*)#//!\1\n\\\$CONF['default_language'] = 'de';#" \
$pfa_conf_file >> $log_file 2>&1 || _failed=true $pfa_conf_file >> $log_file 2>&1 || _failed=true
perl -i -n -p -e "s#^(\s*\\\$CONF\['database_type'\]\s*=.*)#//!\1\n\\\$CONF['database_type'] = '$POSTFIX_DB_TYPE';#" \ perl -i -n -p -e "s#^(\s*\\\$CONF\['database_type'\]\s*=.*)#//!\1\n\\\$CONF['database_type'] = '$_database_type';#" \
$pfa_conf_file >> $log_file 2>&1 || _failed=true $pfa_conf_file >> $log_file 2>&1 || _failed=true
perl -i -n -p -e "s#^(\s*\\\$CONF\['database_host'\]\s*=.*)#//!\1\n\\\$CONF['database_host'] = 'localhost';#" \ perl -i -n -p -e "s#^(\s*\\\$CONF\['database_host'\]\s*=.*)#//!\1\n\\\$CONF['database_host'] = 'localhost';#" \
$pfa_conf_file >> $log_file 2>&1 || _failed=true $pfa_conf_file >> $log_file 2>&1 || _failed=true

View File

@ -506,6 +506,15 @@ fi
echo -e "\n\n\t\033[37m\033[1mInstall modules for PHP Version ${_version}..\033[m\n" echo -e "\n\n\t\033[37m\033[1mInstall modules for PHP Version ${_version}..\033[m\n"
if $PHP_DEBIAN_INSTALLATION ; then if $PHP_DEBIAN_INSTALLATION ; then
echononl "\tUpdate protocols of channel \"pear.php.net\" .."
pear channel-update pear.php.net > $log_file 2>&1
if [[ "$?" = "0" ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
for _module in $needed_php_pear_modules ; do for _module in $needed_php_pear_modules ; do
echononl "\tInstall Module '$_module'.." echononl "\tInstall Module '$_module'.."
if ! pear list | grep -q "$_module" 2> /dev/null ; then if ! pear list | grep -q "$_module" 2> /dev/null ; then
@ -534,7 +543,17 @@ if $PHP_DEBIAN_INSTALLATION ; then
else else
for _version in $php_major_versions ; do for _version in $php_major_versions ; do
echononl "\tUpdate protocols of channel \"pear.php.net\" .."
pear channel-update pear.php.net > $log_file 2>&1
if [[ "$?" = "0" ]]; then
echo_ok
else
echo_failed
error "$(cat $log_file)"
fi
for _module in $needed_php_pear_modules ; do for _module in $needed_php_pear_modules ; do
echononl "\tInstall Module '$_module'.." echononl "\tInstall Module '$_module'.."
if ! /usr/local/php-${_version}/bin/pear list | grep -q "$_module" 2> /dev/null ; then if ! /usr/local/php-${_version}/bin/pear list | grep -q "$_module" 2> /dev/null ; then
/usr/local/php-${_version}/bin/pear install $_module > $log_file 2>&1 /usr/local/php-${_version}/bin/pear install $_module > $log_file 2>&1

View File

@ -128,9 +128,63 @@ do
echo -e "\n\t\033[33m\033[1mA version number is required!\033[m\n" echo -e "\n\t\033[33m\033[1mA version number is required!\033[m\n"
fi fi
done done
echo "" echo ""
echo -e "\033[32m--\033[m" echo -e "\033[32m--\033[m"
echo "" echo ""
echo "Is this a fresh new installation or an update?"
echo ""
echo ""
if [[ -n "$_update" ]]; then
if $_update || [[ "${_update,,}" = 'yes' ]] ; then
echo -e "\033[37m\033[1m[1] Update\033[m"
echo "[2] New Installation"
else
echo -e "[1] Update"
echo -e "\033[37m\033[1m[2] New Installation\033[m"
fi
echo ""
echononl "Choose a number or press <RETURN> for highlighted value: "
else
echo -e "[1] Update"
echo "[2] New Installation"
echo ""
echononl "Choose a Number: "
fi
update=""
while [[ "$update" != "true" && "$update" != "false" ]] ; do
read OPTION
case $OPTION in
1) update=true
;;
2) update=false
;;
'') if [[ -n "$_update" ]] ; then
if $_update || [[ "${_update,,}" = 'yes' ]] ; then
update=true
else
update=false
fi
else
echo ""
echo -e "\tWrong entry! [ 1 = Update ; 2 = New Installation ]"
echo ""
echononl "Reentry: "
fi
;;
*) update=""
echo ""
if [[ -n "$_IS_RELAY_HOST" ]]; then
echo -e "\tWrong entry! [ 1 = Update ; 2 = New Installation ] or type <RETURN>"
else
echo -e "\tWrong entry! [ 1 = Update ; 2 = New Installation ]"
fi
echo ""
echononl "Reentry: "
;;
esac
done
@ -143,8 +197,8 @@ echo ""
clear; clear;
echo "" echo ""
if $_update ;then if $update ;then
echo -e "\tUpdate Dovecot................: $_update" echo -e "\tUpdate Dovecot................: $update"
else else
echo -e "\tInstall Dovecot first time....: Yes" echo -e "\tInstall Dovecot first time....: Yes"
fi fi
@ -198,8 +252,10 @@ if $xmpp_listener ; then
fi fi
echo "" echo ""
if ! $_update ;then if ! $update ;then
warn "Take care, your PostgreSQL configuration (pg_hba.conf) contains the following line:\n\n\t pg_hba.conf:\n\t \033[1mlocal all postfix trust\033[m" if [[ "$database" = "psql" ]]; then
warn "Take care, your PostgreSQL configuration (pg_hba.conf) contains the following line:\n\n\t pg_hba.conf:\n\t \033[1mlocal all postfix trust\033[m"
fi
fi fi
echononl "Sind die Angaben richtig [ja/nein]: " echononl "Sind die Angaben richtig [ja/nein]: "
@ -221,7 +277,7 @@ done
echo "" echo ""
if $_update ;then if $update ;then
_new=false; _new=false;
else else
_new=true; _new=true;
@ -712,7 +768,7 @@ if $_new ; then
echononl "\tCreate table expires in database ${dbname}.." echononl "\tCreate table expires in database ${dbname}.."
cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1 cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1
create table expires ( CREATE TABLE IF NOT EXISTS expires (
username varchar(100) not null, username varchar(100) not null,
mailbox varchar(255) not null, mailbox varchar(255) not null,
expire_stamp integer not null, expire_stamp integer not null,
@ -724,7 +780,7 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal Creating table expires failed error "Creating table expires failed"
fi fi
echononl "\tCreate function merge_expires() / trigger mergeexpires.." echononl "\tCreate function merge_expires() / trigger mergeexpires.."
@ -800,7 +856,7 @@ EOF
echononl "\tCreate table expires in database ${dbname}.." echononl "\tCreate table expires in database ${dbname}.."
cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1 cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1
create table expires ( CREATE TABLE IF NOT EXISTS expires (
username varchar(100) not null, username varchar(100) not null,
mailbox varchar(255) not null, mailbox varchar(255) not null,
expire_stamp integer not null, expire_stamp integer not null,
@ -811,7 +867,7 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal Creating table expires failed error "Creating table expires failed"
fi fi
fi fi
fi fi
@ -2276,7 +2332,7 @@ if $_new ; then
echononl "\tCreate table quota2 in database \"$dbname\".." echononl "\tCreate table quota2 in database \"$dbname\".."
cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1 cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1
CREATE TABLE quota2 ( CREATE TABLE IF NOT EXISTS quota2 (
username varchar(100) not null, username varchar(100) not null,
bytes bigint not null default 0, bytes bigint not null default 0,
messages integer not null default 0, messages integer not null default 0,
@ -2287,7 +2343,7 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Creating table quota2 in database \"$dbname\" failed" error "Creating table quota2 in database \"$dbname\" failed"
fi fi
echononl "\tCreate Trigger mergequota2.." echononl "\tCreate Trigger mergequota2.."
@ -2344,7 +2400,7 @@ EOF
elif [ "$db_driver" = "mysql" ]; then elif [ "$db_driver" = "mysql" ]; then
echononl "\tCreate table quota2 in database \"$dbname\".." echononl "\tCreate table quota2 in database \"$dbname\".."
cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1 cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1
CREATE TABLE quota2 ( CREATE TABLE IF NOT EXISTS quota2 (
username varchar(100) not null, username varchar(100) not null,
bytes bigint not null default 0, bytes bigint not null default 0,
messages integer not null default 0, messages integer not null default 0,
@ -2355,7 +2411,7 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Creating table quota2 in database \"$dbname\" failed" error "Creating table quota2 in database \"$dbname\" failed"
fi fi
fi fi
@ -2909,7 +2965,7 @@ if $_new ; then
## - ## -
echononl "\tCreate table user_share" echononl "\tCreate table user_share"
cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1 cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1
CREATE TABLE user_shares ( CREATE TABLE IF NOT EXISTS user_shares (
from_user varchar(100) not null, from_user varchar(100) not null,
to_user varchar(100) not null, to_user varchar(100) not null,
dummy char(1) DEFAULT '1', -- always '1' currently dummy char(1) DEFAULT '1', -- always '1' currently
@ -2921,12 +2977,12 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Creating table user_shares failed" error "Creating table user_shares failed"
fi fi
echononl "\tCreate table anyone_shares" echononl "\tCreate table anyone_shares"
cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1 cat << EOF | psql -U$dbuser $dbname > /dev/null 2>&1
CREATE TABLE anyone_shares ( CREATE TABLE IF NOT EXISTS anyone_shares (
from_user varchar(100) not null, from_user varchar(100) not null,
dummy char(1) DEFAULT '1', -- always '1' currently dummy char(1) DEFAULT '1', -- always '1' currently
primary key (from_user) primary key (from_user)
@ -2937,7 +2993,7 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Creating table anyone_shares failed" error "Creating table anyone_shares failed"
fi fi
elif [ "$db_driver" = "mysql" ]; then elif [ "$db_driver" = "mysql" ]; then
@ -2946,7 +3002,7 @@ EOF
## - ## -
echononl "\tCreate table user_share" echononl "\tCreate table user_share"
cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1 cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1
CREATE TABLE user_shares ( CREATE TABLE IF NOT EXISTS user_shares (
from_user varchar(100) not null, from_user varchar(100) not null,
to_user varchar(100) not null, to_user varchar(100) not null,
dummy char(1) DEFAULT '1', -- always '1' currently dummy char(1) DEFAULT '1', -- always '1' currently
@ -2957,12 +3013,12 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Creating table user_shares failed" error "Creating table user_shares failed"
fi fi
echononl "\tCreate table anyone_shares" echononl "\tCreate table anyone_shares"
cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1 cat << EOF | mysql -u$dbuser -p$dbpassword $dbname > /dev/null 2>&1
CREATE TABLE anyone_shares ( CREATE TABLE IF NOT EXISTS anyone_shares (
from_user varchar(100) not null, from_user varchar(100) not null,
dummy char(1) DEFAULT '1', -- always '1' currently dummy char(1) DEFAULT '1', -- always '1' currently
primary key (from_user) primary key (from_user)
@ -2972,7 +3028,7 @@ EOF
echo -e "$rc_done" echo -e "$rc_done"
else else
echo -e "$rc_failed" echo -e "$rc_failed"
fatal "Creating table anyone_shares failed" error "Creating table anyone_shares failed"
fi fi
fi fi
fi fi