When changing name of domain, the log shows this error among other things:
Updating users .. .. Mail for domain failed! : mysql::execute_sql_logged failed : SQL set password for 'k2ktbiv12u@testi'@'127.0.0.1' = password('y%czzfgp1w') failed : Can't find any matching row in the user table at /usr/libexec/webmin/web-lib-funcs.pl line 1478.
Modify domain command returns success even if there is this error but user's usermin cannot be accessed.
I did it using remote API using modify-domain command and later found that the same thing happens when I change domain from Virtualmin UI. Also I found out that this error only happens when in Server Templates username format is set to "username@domain". So when modifying the domain name if the username has an '@' in it, the above error is generated and that user's usermin cannot be accessed. If the username format to username-domain and a new user is generated without '@' in username, modify-domain works fine.
So it looks like there is a bug somewhere.
I had asked about this in the forum(https://www.virtualmin.com/node/64982) and asked which project should the issue be raised under but replies yet. So not sure if I have selected the right project for this issue.
Thanks, Vishnu N