1
0
mirror of https://github.com/mailcow/mailcow-dockerized.git synced 2025-01-12 04:23:24 +02:00

[Web] Fix duplicate key as result of race-condition when recreating mailbox while authentication in IMAP is cached and a mail arrives

This commit is contained in:
andryyy 2017-10-03 22:39:58 +02:00
parent d8636113dd
commit 4915375500

View File

@ -755,7 +755,7 @@ function mailbox($_action, $_type, $_data = null) {
':active' => $active
));
$stmt = $pdo->prepare("INSERT INTO `quota2` (`username`, `bytes`, `messages`)
VALUES (:username, '0', '0')");
VALUES (:username, '0', '0') ON DUPLICATE KEY UPDATE `bytes` = '0', `messages` = '0';");
$stmt->execute(array(':username' => $username));
$stmt = $pdo->prepare("INSERT INTO `alias` (`address`, `goto`, `domain`, `active`)
VALUES (:username1, :username2, :domain, :active)");