Skip to content

Commit 75f3b34

Browse files
author
Kristan Kenney
committed
Ensure webmail DNS record is removed upon deletion
1 parent 3e60f97 commit 75f3b34

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

bin/v-delete-webmail

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -43,6 +43,18 @@ is_object_unsuspended 'mail' 'DOMAIN' "$domain"
4343
del_webmail_config
4444
del_webmail_ssl_config
4545

46+
# Ensure that corresponding DNS records are removed
47+
if [ ! -z "$DNS_SYSTEM" ]; then
48+
dns_domain=$($BIN/v-list-dns-domains $user | grep $domain | cut -d' ' -f1)
49+
webmail_record=$($BIN/v-list-dns-records $user $domain | grep -i $WEBMAIL_ALIAS | cut -d' ' -f1)
50+
51+
if [ "$dns_domain" = "$domain" ]; then
52+
if [ ! -z "$webmail_record" ]; then
53+
$BIN/v-delete-dns-record $user $domain $webmail_record
54+
fi
55+
fi
56+
fi
57+
4658
#----------------------------------------------------------#
4759
# Hestia #
4860
#----------------------------------------------------------#

0 commit comments

Comments
 (0)