diff --git a/SoObjects/SOGo/SOGoSieveManager.m b/SoObjects/SOGo/SOGoSieveManager.m index 01e5f2b68..1ac03732d 100644 --- a/SoObjects/SOGo/SOGoSieveManager.m +++ b/SoObjects/SOGo/SOGoSieveManager.m @@ -1,8 +1,6 @@ /* SOGoSieveManager.m - this file is part of SOGo * - * Copyright (C) 2010-2019 Inverse inc. - * - * Author: Inverse + * Copyright (C) 2010-2022 Inverse inc. * * This file is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -1159,9 +1157,12 @@ static NSString *sieveScriptName = @"sogo"; if (values && [[values objectForKey: @"enabled"] boolValue]) { + BOOL alwaysSend; + NSString *redirect; id addresses; int i; + alwaysSend = [[values objectForKey: @"alwaysSend"] boolValue]; b = YES; addresses = [values objectForKey: @"forwardAddress"]; @@ -1172,11 +1173,22 @@ static NSString *sieveScriptName = @"sogo"; { v = [addresses objectAtIndex: i]; if (v && [v length] > 0) - [script appendFormat: @"redirect \"%@\";\r\n", v]; + { + redirect = [NSString stringWithFormat: @"redirect \"%@\";\r\n", v]; + if (alwaysSend) + [script insertString: redirect atIndex: 0]; + else + [script appendString: redirect]; + } } if ([[values objectForKey: @"keepCopy"] boolValue]) - [script appendString: @"keep;\r\n"]; + { + if (alwaysSend) + [script insertString: @"keep;\r\n" atIndex: 0]; + else + [script appendString: @"keep;\r\n"]; + } } // We handle header/footer Sieve scripts diff --git a/UI/PreferencesUI/English.lproj/Localizable.strings b/UI/PreferencesUI/English.lproj/Localizable.strings index 61243d544..3014c583c 100644 --- a/UI/PreferencesUI/English.lproj/Localizable.strings +++ b/UI/PreferencesUI/English.lproj/Localizable.strings @@ -68,6 +68,8 @@ /* forward messages */ "Forward incoming messages" = "Forward incoming messages"; +"Always forward" = "Always forward"; +"Incoming messages are forwarded prior to apply your filters." = "Incoming messages are forwarded prior to apply your filters."; "Keep a copy" = "Keep a copy"; "Enter an email" = "Enter an email"; "Add another email" = "Add another email"; diff --git a/UI/Templates/PreferencesUI/UIxPreferences.wox b/UI/Templates/PreferencesUI/UIxPreferences.wox index 58f507823..1a7229141 100644 --- a/UI/Templates/PreferencesUI/UIxPreferences.wox +++ b/UI/Templates/PreferencesUI/UIxPreferences.wox @@ -1248,6 +1248,16 @@ +
+ + +
+
+
+