Skip to content

Commit 469c411

Browse files
author
Kristan Kenney
committed
Fixes to v-change-sys-webmail
1 parent 62d5076 commit 469c411

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

bin/v-change-sys-webmail

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22
# info: change webmail alias url
3-
# options: WEBMAIL
3+
# options: USER DOMAIN
44
#
55
# This function changes the webmail url in apache2 or nginx configuration.
66

@@ -26,7 +26,7 @@ NEW_ALIAS=$1
2626

2727
# Delete old webmail configuration
2828
for user in `ls /usr/local/hestia/data/users/`; do
29-
for domain in $($BIN/v-list-web-domains $user plain |cut -f 1); do
29+
for domain in $($BIN/v-list-mail-domains $user plain |cut -f 1); do
3030
$BIN/v-delete-sys-webmail $user $domain
3131
done
3232
done
@@ -35,13 +35,16 @@ done
3535
$BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' $NEW_ALIAS
3636

3737
for user in `ls /usr/local/hestia/data/users/`; do
38-
for domain in $($BIN/v-list-web-domains $user plain |cut -f 1); do
38+
for domain in $($BIN/v-list-mail-domains $user plain |cut -f 1); do
3939
$BIN/v-add-sys-webmail $user $domain
4040
done
4141
done
4242

4343
# Update global directory alias configuration
44-
sed -i "s|Alias \/$OLD_ALIAS|Alias \/$NEW_ALIAS|gI" /etc/apache2/conf.d/roundcube.conf
44+
if [ "$WEB_SYSTEM" = "apache2" ]; then
45+
sed -i "s|Alias \/$OLD_ALIAS|Alias \/$NEW_ALIAS|gI" /etc/apache2/conf.d/roundcube.conf
46+
fi
47+
4548
sed -i "s|location \/$OLD_ALIAS|location \/$NEW_ALIAS|gI" /etc/nginx/conf.d/webmail.inc
4649

4750
#----------------------------------------------------------#

0 commit comments

Comments
 (0)