From 4915375500754b327457924576dc8c271c5cc6bf Mon Sep 17 00:00:00 2001 From: andryyy Date: Tue, 3 Oct 2017 22:39:58 +0200 Subject: [PATCH] [Web] Fix duplicate key as result of race-condition when recreating mailbox while authentication in IMAP is cached and a mail arrives --- data/web/inc/functions.mailbox.inc.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/data/web/inc/functions.mailbox.inc.php b/data/web/inc/functions.mailbox.inc.php index 1e674e44..1e86b3ee 100644 --- a/data/web/inc/functions.mailbox.inc.php +++ b/data/web/inc/functions.mailbox.inc.php @@ -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)");