feat(mail): Deletion of mail older than x. Closes #6023. Remove also template folder. Change SOGoDisableMailCleaning to SOGoEnableMailCleaning (disabled by default).

This commit is contained in:
smizrahi
2024-11-25 10:23:22 +01:00
parent ce86d14826
commit ea427ea41a
5 changed files with 9 additions and 8 deletions
+2 -2
View File
@@ -1678,8 +1678,8 @@ URL could be set to something like:
See the "EMail reminders" section in this document for more information.
|S |SOGoDisableMailCleaning
|Parameter used to disable the feature 'remove mails older than X days' introduced in 5.12. Default value is `NO`.
|S |SOGoEnableMailCleaning
|Parameter used to enable cleaning folders and mailbox (remove mail older than X days). Default value is `NO`.
|S |SOGoDisableOrganizerEventCheck
|Parameter used to disable organizer's calendar event check
+1 -1
View File
@@ -142,7 +142,7 @@ NSComparisonResult languageSort(id el1, id el2, void *context);
- (NSString *)urlCreateAccount;
- (BOOL)disableMailCleaning;
- (BOOL)enableMailCleaning;
@end
+2 -2
View File
@@ -933,9 +933,9 @@ NSComparisonResult languageSort(id el1, id el2, void *context)
return [self stringForKey: @"SOGoURLCreateAccount"];
}
- (BOOL) disableMailCleaning
- (BOOL) enableMailCleaning
{
return [self boolForKey: @"SOGoDisableMailCleaning"];
return [self boolForKey: @"SOGoEnableMailCleaning"];
}
@end
+3 -2
View File
@@ -1368,7 +1368,7 @@
request = [[self context] request];
jsonRequest = [[request contentAsString] objectFromJSONString];
if ([[SOGoSystemDefaults sharedSystemDefaults] disableMailCleaning])
if (![[SOGoSystemDefaults sharedSystemDefaults] enableMailCleaning])
return [self responseWithStatus: 401];
if (![self isDateStringValid: [jsonRequest objectForKey: @"date"]]) {
@@ -1401,7 +1401,8 @@
}
folder = [account folderWithTraversal: folderName andClassName: nil];
// Disable clean for trash folder
if (![folderName isEqualToString: [account trashFolderNameInContext: [self context]]])
if (![folderName isEqualToString: [account trashFolderNameInContext: [self context]]]
&& ![folderName isEqualToString: [account templatesFolderNameInContext: [self context]]])
[self cleanFolderWithFolder: folder
withQualifier: searchQualifier
recursive: isRecursive
+1 -1
View File
@@ -617,7 +617,7 @@
sd = [SOGoSystemDefaults sharedSystemDefaults];
result = ![sd disableMailCleaning];
result = [sd enableMailCleaning];
return result;
}