Skip to content

Commit a38c344

Browse files
authored
Merge pull request hestiacp#1603 from hestiacp/fix/2021-01-set-correct-webmail-restore
[Bug] Restore preferred webmail client
2 parents fdd6c9f + fbf2fc3 commit a38c344

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

bin/v-rebuild-mail-domains

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -61,8 +61,12 @@ for domain in $(search_objects 'mail' 'SUSPENDED' "*" 'DOMAIN'); do
6161
rebuild_mail_domain_conf
6262
if [ ! -z "$WEB_SYSTEM" ] || [ ! -z "$PROXY_SYSTEM" ]; then
6363
if [ ! -z "$IMAP_SYSTEM" ]; then
64+
WEBMAIL=$(get_object_value 'web' 'DOMAIN' "$domain" "$WEBMAIL")
6465
$BIN/v-delete-sys-webmail $user $domain '' 'yes'
65-
$BIN/v-add-sys-webmail $user $domain '' 'yes'
66+
$BIN/v-add-sys-webmail $user $domain $WEBMAIL '' 'yes'
67+
if [ $? -ne 0 ]; then
68+
$BIN/v-add-sys-webmail $user $domain '' '' 'yes'
69+
fi
6670
fi
6771
fi
6872
done

0 commit comments

Comments
 (0)