diff --git a/Documentation/SOGoInstallationGuide.asciidoc b/Documentation/SOGoInstallationGuide.asciidoc index 207dbdabf..e6f572835 100644 --- a/Documentation/SOGoInstallationGuide.asciidoc +++ b/Documentation/SOGoInstallationGuide.asciidoc @@ -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 diff --git a/SoObjects/SOGo/SOGoSystemDefaults.h b/SoObjects/SOGo/SOGoSystemDefaults.h index 72e063a64..f024da999 100644 --- a/SoObjects/SOGo/SOGoSystemDefaults.h +++ b/SoObjects/SOGo/SOGoSystemDefaults.h @@ -142,7 +142,7 @@ NSComparisonResult languageSort(id el1, id el2, void *context); - (NSString *)urlCreateAccount; -- (BOOL)disableMailCleaning; +- (BOOL)enableMailCleaning; @end diff --git a/SoObjects/SOGo/SOGoSystemDefaults.m b/SoObjects/SOGo/SOGoSystemDefaults.m index 87d63f85e..52fad7b9a 100644 --- a/SoObjects/SOGo/SOGoSystemDefaults.m +++ b/SoObjects/SOGo/SOGoSystemDefaults.m @@ -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 diff --git a/UI/MailerUI/UIxMailFolderActions.m b/UI/MailerUI/UIxMailFolderActions.m index 60bb13e24..849e1e6d0 100644 --- a/UI/MailerUI/UIxMailFolderActions.m +++ b/UI/MailerUI/UIxMailFolderActions.m @@ -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 diff --git a/UI/MailerUI/UIxMailMainFrame.m b/UI/MailerUI/UIxMailMainFrame.m index cb0d357f9..9398fe4e5 100644 --- a/UI/MailerUI/UIxMailMainFrame.m +++ b/UI/MailerUI/UIxMailMainFrame.m @@ -617,7 +617,7 @@ sd = [SOGoSystemDefaults sharedSystemDefaults]; - result = ![sd disableMailCleaning]; + result = [sd enableMailCleaning]; return result; }