Browse Source

Reset prev set global variables when rebuilding email domain config

Relates to #626
Robert Zollner 6 years ago
parent
commit
7ee9864636
1 changed files with 3 additions and 2 deletions
  1. 3 2
      func/rebuild.sh

+ 3 - 2
func/rebuild.sh

@@ -446,9 +446,10 @@ rebuild_mail_domain_conf() {
     fi
 
     # Inherit web domain local ip address
+    unset -v nat ip local_ip domain_ip
     local domain_ip=$(get_object_value 'web' 'DOMAIN' "$domain" '$IP')
-    local local_ip=$(get_real_ip "$domain_ip")
-    if [ ! -z "$local_ip" ]; then
+    if [ ! -z "$domain_ip" ]; then
+        local local_ip=$(get_real_ip "$domain_ip")
         is_ip_valid "$local_ip" "$user"
     else
         get_user_ip