mirror of
https://github.com/roundcube/roundcubemail.git
synced 2026-03-10 10:06:52 +01:00
Add option to purge deleted mails older than 30, 60 or 90 days (#5493)
This commit is contained in:
@@ -1039,7 +1039,17 @@ class rcmail extends rcube
|
||||
$trash_mbox = $this->config->get('trash_mbox');
|
||||
|
||||
if ($logout_purge && !empty($trash_mbox)) {
|
||||
$storage->clear_folder($trash_mbox);
|
||||
$messages = '*';
|
||||
|
||||
if (is_numeric($logout_purge)) {
|
||||
$now = new DateTime('now');
|
||||
$interval = new DateInterval('P' . intval($logout_purge) . 'D');
|
||||
|
||||
$index = $storage->search_once($trash_mbox, 'BEFORE ' . $now->sub($interval)->format('j-M-Y'));
|
||||
$messages = $index->get_compressed();
|
||||
}
|
||||
|
||||
$storage->delete_message($messages, $trash_mbox);
|
||||
}
|
||||
|
||||
if ($logout_expunge) {
|
||||
|
||||
Reference in New Issue
Block a user