From 08bb4af74d232dcc4b1ff2a0a455f4ad2d17235f Mon Sep 17 00:00:00 2001 From: Kienan Stewart Date: Wed, 11 Aug 2021 12:31:05 -0400 Subject: [PATCH] Remove dovecot quota entries when mailboxes are truly deleted Without this, when a mailbox is deleted, the entry in dovecot_quota persists and the user's see the that the mailbox continues to take space on the information page. --- bureau/class/m_mail.php | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/bureau/class/m_mail.php b/bureau/class/m_mail.php index 896b1114..de43f04e 100644 --- a/bureau/class/m_mail.php +++ b/bureau/class/m_mail.php @@ -327,6 +327,13 @@ ORDER BY return $res; } + function hook_mail_delete_for_real($mail_id, $address) { + global $db; + // Clean up dovecot_quota table; otherwise users will continue to see + // the e-mail addresses as if they are taking spaceo n the server. + $db->query("DELETE FROM dovecot_quota WHERE user = ?;", array($address)); + } + function hook_mail_get_details($detail) { if ($detail['type'] == 'catchall') { return _(sprintf("Special mail address for catch-all. Click here to manage it.", $detail['domain_id']));