Skip to content

Commit 3015ec2

Browse files
committed
add quota recalc to mailbox cleanup
1 parent 87b6c88 commit 3015ec2

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

server/lib/classes/cron.d/500-clean_mailboxes.inc.php

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,7 @@ public function onRunJob() {
5757
$junk_names=array('Junk', 'Junk Email', 'SPAM', 'INBOX.SPAM');
5858

5959
$purge_cmd = 'doveadm expunge -u ? mailbox ? sentbefore ';
60+
$recalc_cmd = 'doveadm quota recalc -u ?';
6061

6162
$server_id = intval($conf['server_id']);
6263
$records = $app->db->queryAllRecords("SELECT email, maildir, purge_trash_days, purge_junk_days FROM mail_user WHERE maildir_format = 'maildir' AND disableimap = 'n' AND server_id = ? AND (purge_trash_days > 0 OR purge_junk_days > 0)", $server_id);
@@ -77,6 +78,7 @@ public function onRunJob() {
7778
}
7879
}
7980
}
81+
$app->system->exec_safe($recalc_cmd, $email['email']);
8082
}
8183
}
8284

0 commit comments

Comments
 (0)