diff --git a/NEWS b/NEWS index a26b8eb467..56b010c3c1 100644 --- a/NEWS +++ b/NEWS @@ -16,6 +16,7 @@ Bug fixes - [web] disable submit button while saving an event or a task (#3880) - [web] fixed computation of week number - [web] fixed and improved IMAP folder subscriptions manager (#3865) + - [web] fixed Sieve script activation when vacation start date is in the future (#3885) 3.2.1 (2016-11-02) ------------------ diff --git a/SoObjects/SOGo/SOGoSieveManager.m b/SoObjects/SOGo/SOGoSieveManager.m index 48a21587e9..0df2f1bc57 100644 --- a/SoObjects/SOGo/SOGoSieveManager.m +++ b/SoObjects/SOGo/SOGoSieveManager.m @@ -1,6 +1,6 @@ /* SOGoSieveManager.m - this file is part of SOGo * - * Copyright (C) 2010-2015 Inverse inc. + * Copyright (C) 2010-2016 Inverse inc. * * Author: Inverse * @@ -20,6 +20,7 @@ * Boston, MA 02111-1307, USA. */ +#import #import #import @@ -783,6 +784,7 @@ - (BOOL) updateFiltersForAccount: (SOGoMailAccount *) theAccount NGSieveClient *client; NSString *filterScript, *v; BOOL b; + unsigned int now; dd = [user domainDefaults]; if (!([dd sieveScriptsEnabled] || [dd vacationEnabled] || [dd forwardEnabled])) @@ -830,8 +832,10 @@ - (BOOL) updateFiltersForAccount: (SOGoMailAccount *) theAccount // We handle vacation messages. // See http://ietfreport.isoc.org/idref/draft-ietf-sieve-vacation/ values = [ud vacationOptions]; + now = [[NSCalendarDate calendarDate] timeIntervalSince1970]; - if (values && [[values objectForKey: @"enabled"] boolValue]) + if (values && [[values objectForKey: @"enabled"] boolValue] && + (![values objectForKey: @"startDateEnabled"] || [[values objectForKey: @"startDate"] intValue] < now)) { NSMutableString *vacation_script; NSArray *addresses;