diff --git a/bin/v-change-domain-owner b/bin/v-change-domain-owner index e16c86291..8f2673073 100755 --- a/bin/v-change-domain-owner +++ b/bin/v-change-domain-owner @@ -144,6 +144,11 @@ if [ ! -z "$mail_data" ]; then find $HOMEDIR/$user/mail/$domain -user $owner \ -exec chown -h $user {} \; + # Rebuild config + $BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1 + $BIN/v-rebuild-mail-domains $owner no + $BIN/v-rebuild-mail-domains $user + # Checking exim username for later chowning exim_user="exim"; check_exim_username=$(grep -c '^Debian-exim:' /etc/passwd) @@ -155,11 +160,6 @@ if [ ! -z "$mail_data" ]; then find $HOMEDIR/$user/conf/mail/$domain -user root \ -exec chown $exim_user {} \; fi - - # Rebuild config - $BIN/v-unsuspend-mail-domain $user $domain no >> /dev/null 2>&1 - $BIN/v-rebuild-mail-domains $owner no - $BIN/v-rebuild-mail-domains $user fi # Update counters