99# Variable&Function #
1010# ----------------------------------------------------------#
1111
12- # Argument definition
13- WEBMAIL=$1
14-
1512# Includes
1613source $HESTIA /func/main.sh
1714source $HESTIA /conf/hestia.conf
@@ -23,12 +20,6 @@ export $WEBMAIL_ALIAS
2320OLD_ALIAS=$WEBMAIL_ALIAS
2421NEW_ALIAS=$1
2522
26- # ----------------------------------------------------------#
27- # Verifications #
28- # ----------------------------------------------------------#
29-
30- check_args ' 1' " $# " ' WEBMAIL'
31-
3223# ----------------------------------------------------------#
3324# Action #
3425# ----------------------------------------------------------#
@@ -41,17 +32,17 @@ for user in `ls /usr/local/hestia/data/users/`; do
4132done
4233
4334# Set new webmail alias
44- $BIN /v-change-sys-config-value ' WEBMAIL_ALIAS' ' $NEW_ALIAS'
35+ $BIN /v-change-sys-config-value ' WEBMAIL_ALIAS' $NEW_ALIAS
4536
4637for user in ` ls /usr/local/hestia/data/users/` ; do
4738 for domain in $( $BIN /v-list-web-domains $user plain | cut -f 1) ; do
4839 $BIN /v-add-webmail $user $domain
4940 done
5041done
5142
52- # Update alias (non-subdomain) configuration to match
53- sed -i " s|Alias \/webmail |Alias \/$NEW_ALIAS |gI" /etc/apache2/conf.d/roundcube.conf
54- sed -i " s|location \/webmail |location \/$NEW_ALIAS |gI" /etc/nginx/conf.d/webmail.inc
43+ # Update global directory alias configuration
44+ sed -i " s|Alias \/$OLD_ALIAS |Alias \/$NEW_ALIAS |gI" /etc/apache2/conf.d/roundcube.conf
45+ sed -i " s|location \/$OLD_ALIAS |location \/$NEW_ALIAS |gI" /etc/nginx/conf.d/webmail.inc
5546
5647# ----------------------------------------------------------#
5748# Hestia #
@@ -62,7 +53,7 @@ $BIN/v-restart-web $restart
6253$BIN /v-restart-proxy $restart
6354
6455# Logging
65- log_history " changed system webmail alias to $NEW_ALIAS "
56+ log_history " changed global webmail alias to $NEW_ALIAS "
6657log_event " $OK " " $ARGUMENTS "
6758
6859exit
0 commit comments