Skip to content

Commit 426a952

Browse files
author
Kristan Kenney
committed
Fixes to how webmail aliases are handled
1 parent ce4a09d commit 426a952

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

bin/v-add-sys-webmail

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -43,7 +43,6 @@ get_user_ip
4343

4444
check_args '2' "$#" 'USER DOMAIN [RESTART]'
4545
is_format_valid 'user' 'domain'
46-
is_system_enabled "$MAIL_SYSTEM" 'MAIL_SYSTEM'
4746
is_system_enabled "$WEB_SYSTEM" 'WEB_SYSTEM'
4847
is_system_enabled "$IMAP_SYSTEM" 'IMAP_SYSTEM'
4948
is_object_valid 'user' 'USER' "$user"
@@ -55,8 +54,10 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
5554
# Action #
5655
#----------------------------------------------------------#
5756

58-
# Verify that webmail alias variable exists
59-
if [ ! -z "$WEBMAIL_ALIAS" ]; then
57+
# Verify that webmail alias variable exists and create it if it does not
58+
if [ -z "$WEBMAIL_ALIAS" ]; then
59+
$BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' "webmail"
60+
else
6061
# Ensure DNS record exists if Hestia is hosting DNS zones
6162
if [ ! -z "$DNS_SYSTEM" ]; then
6263
dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
@@ -91,8 +92,6 @@ if [ ! -z "$WEBMAIL_ALIAS" ]; then
9192
add_webmail_config "$PROXY_SYSTEM" "default.stpl"
9293
fi
9394
fi
94-
else
95-
echo "Error: WEBMAIL_ALIAS is not defined in hestia.conf"
9695
fi
9796

9897
#----------------------------------------------------------#

install/hst-install-ubuntu.sh

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1027,7 +1027,6 @@ fi
10271027
# Mail stack
10281028
if [ "$exim" = 'yes' ]; then
10291029
echo "MAIL_SYSTEM='exim4'" >> $HESTIA/conf/hestia.conf
1030-
echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
10311030
if [ "$clamd" = 'yes' ]; then
10321031
echo "ANTIVIRUS_SYSTEM='clamav-daemon'" >> $HESTIA/conf/hestia.conf
10331032
fi

install/upgrade/versions/previous/1.00.0-190618.sh

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -7,11 +7,9 @@
77
#######################################################################################
88

99
# Add webmail alias variable to system configuration if non-existent
10-
WEBMAIL_ALIAS_CHECK=$(cat $HESTIA/conf/hestia.conf | grep WEBMAIL_ALIAS)
11-
if [ -z "$WEBMAIL_ALIAS_CHECK" ]; then
12-
echo "(*) Adding global webmail alias to system configuration..."
13-
sed -i "/WEBMAIL_ALIAS/d" $HESTIA/conf/hestia.conf
14-
echo "WEBMAIL_ALIAS='webmail'" >> $HESTIA/conf/hestia.conf
10+
if [ -z "$WEBMAIL_ALIAS" ]; then
11+
echo "(*) Updating webmail alias configuration..."
12+
$HESTIA/bin/v-change-sys-config-value 'WEBMAIL_ALIAS' "webmail"
1513
fi
1614

1715
# Update Apache and Nginx configuration to support new file structure

0 commit comments

Comments
 (0)