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

master
andryyy 2017-10-03 22:39:58 +02:00
parent d8636113dd
commit 4915375500
1 changed files with 1 additions and 1 deletions

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)");