[Web][Dovecot] Add retention rules: nightly deletion of mail by folder and age for domains, groups and mailboxes

This commit is contained in:
FreddleSpl0it committed 2026-11-07 21:23:13 +01:00
1 parent 46c9ec90b0
commit a64ee13670
36 files changed
+3013 -16

No files matched your search

+11
View File
@@ -126,6 +126,17 @@ if (isset($_SESSION['mailcow_cc_role'])) {
'mail_policy_groups' => !empty($result) ? $mail_policy->policies->groupChoices([$result['domain']]) : [],
];
}
elseif (isset($_GET['retention-rule']) &&
is_numeric($_GET['retention-rule'])) {
$retention = \Mailcow\Retention\RetentionModule::fromGlobals();
$result = $retention->api->getRule($_GET['retention-rule']);
$template = 'edit/retention-rule.twig';
// Choices: mailboxes and groups of the domain of the rule
$template_data = [
'mailboxes' => !empty($result) ? mailbox('get', 'mailboxes', $result['domain']) : [],
'retention_groups' => !empty($result) ? $retention->rules->groupChoices([$result['domain']]) : [],
];
}
elseif (isset($_GET['api-key']) &&
is_numeric($_GET['api-key'])) {
$result = \Mailcow\ApiKey\ApiKeyModule::fromGlobals()->api->getKey($_GET['api-key']);