diff --git a/NEWS b/NEWS index a61128851..e5a755000 100644 --- a/NEWS +++ b/NEWS @@ -12,6 +12,7 @@ Enhancements - [web] added custom fields support from Thunderbird's address book - [web] added Latvian (lv) translation - thanks to Juris Balandis - [web] expose user's defaults and settings inline + - [web] can now discard incoming mails during vacation Bug fixes - [web] respect SOGoLanguage and SOGoSupportedLanguages (#4169) diff --git a/SoObjects/SOGo/SOGoSieveManager.m b/SoObjects/SOGo/SOGoSieveManager.m index e31c82f10..aa018fd4e 100644 --- a/SoObjects/SOGo/SOGoSieveManager.m +++ b/SoObjects/SOGo/SOGoSieveManager.m @@ -831,8 +831,10 @@ static NSString *sieveScriptName = @"sogo"; return NO; } + // // We handle vacation messages. // See http://ietfreport.isoc.org/idref/draft-ietf-sieve-vacation/ + // values = [ud vacationOptions]; now = [[NSCalendarDate calendarDate] timeIntervalSince1970]; @@ -849,13 +851,14 @@ static NSString *sieveScriptName = @"sogo"; NSString *text, *templateFilePath, *customSubject; SOGoTextTemplateFile *templateFile; - BOOL ignore, alwaysSend, useCustomSubject; + BOOL ignore, alwaysSend, useCustomSubject, discardMails; int days, i; allConditions = [NSMutableArray array]; days = [[values objectForKey: @"daysBetweenResponse"] intValue]; addresses = [values objectForKey: @"autoReplyEmailAddresses"]; alwaysSend = [[values objectForKey: @"alwaysSend"] boolValue]; + discardMails = [[values objectForKey: @"discardMails"] boolValue]; ignore = [[values objectForKey: @"ignoreLists"] boolValue]; useCustomSubject = [[values objectForKey: @"customSubjectEnabled"] boolValue]; customSubject = [values objectForKey: @"customSubject"]; @@ -962,6 +965,10 @@ static NSString *sieveScriptName = @"sogo"; if ([allConditions count]) [vacation_script appendString: @"}\r\n"]; + // Should we discard incoming mails during vacation? + if (discardMails) + [vacation_script appendString: @"discard;\r\n"]; + // // See https://sogo.nu/bugs/view.php?id=2332 for details // diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 9b86f170a..ab535569a 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -47,6 +47,7 @@ "Enable auto reply on" = "Enable auto reply on"; "Disable auto reply on" = "Disable auto reply on"; "Always send vacation message response" = "Always send vacation message response"; +"Discard incoming mails during vacation" = "Discard incoming mails during vacation"; "Please specify your message and your email addresses for which you want to enable auto reply." = "Please specify your message and your email addresses for which you want to enable auto reply."; "Your vacation message must not end with a single dot on a line." = "Your vacation message must not end with a single dot on a line."; @@ -408,4 +409,4 @@ "animation_NORMAL" = "Normal"; /* Limited Animation Mode */ "animation_LIMITED" = "Limited"; -"animation_NONE" = "None"; \ No newline at end of file +"animation_NONE" = "None"; diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 6b23ad7ae..70f75b7d2 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -951,6 +951,15 @@ +
+ + + +
+