Merge pull request #5200 from mailcow/fix/delete-sender-acl

[Web] Fix deleting sender_acl when mbox is deleted
This commit is contained in:
Patrick Schult 2023-05-08 16:35:42 +02:00 committed by GitHub
commit 173e39c859
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -4989,9 +4989,10 @@ function mailbox($_action, $_type, $_data = null, $_extra = null) {
$stmt->execute(array(
':username' => $username
));
$stmt = $pdo->prepare("DELETE FROM `sender_acl` WHERE `logged_in_as` = :username");
$stmt = $pdo->prepare("DELETE FROM `sender_acl` WHERE `logged_in_as` = :logged_in_as OR `send_as` = :send_as");
$stmt->execute(array(
':username' => $username
':logged_in_as' => $username,
':send_as' => $username
));
// fk, better safe than sorry
$stmt = $pdo->prepare("DELETE FROM `user_acl` WHERE `username` = :username");