ignore SQL error "Illegal mix of collations (ascii_general_ci,IMPLICIT) and (utf8mb3_general_ci,COERCIBLE) for operation '='" stalling mail for usernames with non-ascii chars

This commit is contained in:
ralf 2023-11-14 15:22:53 +02:00
parent e131e24cfa
commit 2f664b1d0a

View File

@ -140,6 +140,7 @@ class Sql extends Mail\Smtp
{ {
$account_id[] = $id; $account_id[] = $id;
} }
try {
foreach($this->db->select(self::TABLE, 'account_id', array( foreach($this->db->select(self::TABLE, 'account_id', array(
'mail_type' => self::TYPE_ALIAS, 'mail_type' => self::TYPE_ALIAS,
'mail_value' => $user, 'mail_value' => $user,
@ -147,6 +148,10 @@ class Sql extends Mail\Smtp
{ {
if (!in_array($row['account_id'], $account_id)) $account_id[] = $row['account_id']; if (!in_array($row['account_id'], $account_id)) $account_id[] = $row['account_id'];
} }
}
catch (Api\Db\Exception $e) {
_egw_log_exception($e); // happens if username contains a non-ascii char
}
//error_log(__METHOD__."('$user') account_id=".array2string($account_id)); //error_log(__METHOD__."('$user') account_id=".array2string($account_id));
} }
if ($account_id) if ($account_id)