Skip to content

Commit

Permalink
Allow to set Roundcube product_name setting using ROUNDCUBE_PRODUCT_NAME
Browse files Browse the repository at this point in the history
  • Loading branch information
tuffnatty committed Nov 25, 2022
1 parent 9d7783d commit d894517
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
5 changes: 5 additions & 0 deletions include/php.sh
Original file line number Diff line number Diff line change
Expand Up @@ -121,3 +121,8 @@ test_php_fpm()
fi
fi
}

php_quote()
{
stage_exec php -r 'var_export($argv[1]);' "$1"
}
4 changes: 4 additions & 0 deletions mail-toaster.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ mt6_version() { echo "20220621"; }

dec_to_hex() { printf '%04x\n' "$1"; }

sed_replacement_quote() { printf "%s" "$1" | sed 's,[&\\/],\\\1,g'; }

get_random_ip6net()
{
# shellcheck disable=2039
Expand Down Expand Up @@ -57,6 +59,7 @@ export TOASTER_MARIADB="0"
export TOASTER_PKG_AUDIT="0"
export ROUNDCUBE_SQL="0"
export ROUNDCUBE_DEFAULT_HOST=""
export ROUNDCUBE_PRODUCT_NAME="Roundcube Webmail"
export SQUIRREL_SQL="0"
export TOASTER_NRPE=""
export TOASTER_MUNIN=""
Expand Down Expand Up @@ -143,6 +146,7 @@ export TOASTER_MYSQL=${TOASTER_MYSQL:="1"}
export TOASTER_MARIADB=${TOASTER_MARIADB:="0"}
export SQUIRREL_SQL=${SQUIRREL_SQL:="$TOASTER_MYSQL"}
export ROUNDCUBE_SQL=${ROUNDCUBE_SQL:="$TOASTER_MYSQL"}
export ROUNDCUBE_PRODUCT_NAME=${ROUNDCUBE_PRODUCT_NAME:="Roundcube Webmail"}
export TOASTER_NTP=${TOASTER_NTP:="ntp"}
export TOASTER_MSA=${TOASTER_MSA:="haraka"}

Expand Down
1 change: 1 addition & 0 deletions provision/roundcube.sh
Original file line number Diff line number Diff line change
Expand Up @@ -152,6 +152,7 @@ configure_roundcube()
-e "/'smtp_user'/ s/'';/'%u';/" \
-e "/'smtp_pass'/ s/'';/'%p';/" \
-e "/'archive',/ s/,$/, 'managesieve',/" \
-e "/'product_name'/ s/'Roundcube Webmail'/$(sed_replacement_quote "$(php_quote "$ROUNDCUBE_PRODUCT_NAME")")/" \
"$_rcc_conf"

tee -a "$_rcc_conf" <<'EO_RC_ADD'
Expand Down

0 comments on commit d894517

Please sign in to comment.