Skip to content

Commit d998502

Browse files
committed
Set webmail (+LE) ip address to same ip as the web domain
1 parent bdbf630 commit d998502

File tree

2 files changed

+19
-2
lines changed

2 files changed

+19
-2
lines changed

bin/v-add-mail-domain-ssl

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,6 @@ source $HESTIA/conf/hestia.conf
4040
# Additional argument formatting
4141
format_domain
4242
format_domain_idn
43-
get_user_ip
4443

4544
#----------------------------------------------------------#
4645
# Verifications #
@@ -63,6 +62,15 @@ check_hestia_demo_mode
6362
# Action #
6463
#----------------------------------------------------------#
6564

65+
# Inherit web domain local ip address
66+
domain_ip=$(get_object_value 'web' 'DOMAIN' "$domain" '$IP')
67+
local_ip=$(get_real_ip "$domain_ip")
68+
if [ ! -z "$local_ip" ]; then
69+
is_ip_valid "$local_ip" "$user"
70+
else
71+
get_user_ip
72+
fi
73+
6674
# Call routine to add SSL configuration to mail domain
6775
add_mail_ssl_config
6876

bin/v-add-sys-webmail

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ source $HESTIA/conf/hestia.conf
3535
# Additional argument formatting
3636
format_domain
3737
format_domain_idn
38-
get_user_ip
38+
3939

4040
#----------------------------------------------------------#
4141
# Verifications #
@@ -54,6 +54,15 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
5454
# Action #
5555
#----------------------------------------------------------#
5656

57+
# Inherit web domain local ip address
58+
domain_ip=$(get_object_value 'web' 'DOMAIN' "$domain" '$IP')
59+
local_ip=$(get_real_ip "$domain_ip")
60+
if [ ! -z "$local_ip" ]; then
61+
is_ip_valid "$local_ip" "$user"
62+
else
63+
get_user_ip
64+
fi
65+
5766
# Verify that webmail alias variable exists and create it if it does not
5867
if [ -z "$WEBMAIL_ALIAS" ]; then
5968
$BIN/v-change-sys-config-value 'WEBMAIL_ALIAS' "webmail"

0 commit comments

Comments
 (0)