I managed to get this working, thanks to your help, but after getting the SQL query to work I still get this UI error:
The query is executed successfully, I can logout and login only with the new password. But the UI doesn't respond like expected, it leaves the "Change password" pop-up open and shows the mentioned error.
$mysqlcon=mysqli_connect($config_dbhost, $config_dbuser, $config_dbpass, $config_dbname);
if($mysqlcon){
$sPasshash = exec("doveadm pw -s 'SHA512-CRYPT' -p '".$sPassword."'");
list($sLogin, $sDomainName) = explode('@', $oAccount->Email);
$sql = "UPDATE mailbox SET password = '".$sPasshash."' WHERE username = '".$sLogin."' AND domain = '".$sDomainName."'";
$bResult = mysqli_query($mysqlcon,$sql) or trigger_error(mysqli_error($mysqlcon)." ".$sql);
if (!$bResult){
throw new \Aurora\System\Exceptions\ApiException(\Aurora\System\Exceptions\Errs::UserManager_AccountNewPasswordUpdateError);
}
mysqli_close($mysqlcon);
{"AuthenticatedUserId":4,"@Time":0.09297513961791992,"Module":"Mail","Method":"ChangePassword","Result":false,"SubscriptionsResult":null}
[21:38:17.82][60c25724] API: Mail::ChangePassword^M
[21:38:17.82][60c25724] Execute subscription: ChangePasswordInMailServerDatabasePlugin::onBeforeChangePassword^M
[21:38:17.87][60c25724] Execute subscription: Core::onAfterChangePassword^M