diff --git a/Tools/SOGoToolRestore.m b/Tools/SOGoToolRestore.m index 38441501d..90cad1ea3 100644 --- a/Tools/SOGoToolRestore.m +++ b/Tools/SOGoToolRestore.m @@ -1,6 +1,6 @@ /* SOGoToolRestore.m - this file is part of SOGo * - * Copyright (C) 2009-2015 Inverse inc. + * Copyright (C) 2009-2019 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 @@ -614,6 +614,7 @@ - (BOOL) _updateSieveScripsForLogin: (NSString *) theLogin { /* credentials file handling */ + NSException *error; NSString *credsFilename, *authname=nil, *authpwd=nil; SOGoCredentialsFile *cf; SOGoUser *user; @@ -650,7 +651,13 @@ account = [folder lookupName: @"0" inContext: localContext acquire: NO]; [account setContext: localContext]; - return [account updateFiltersWithUsername: authname andPassword: authpwd]; + error = [account updateFiltersWithUsername: authname + andPassword: authpwd + forceActivation: NO]; + if (error) + return NO; + + return YES; } - (BOOL) restoreUserPreferencesFromUserRecord: (NSDictionary *) userRecord diff --git a/Tools/SOGoToolUpdateAutoReply.m b/Tools/SOGoToolUpdateAutoReply.m index f39d15503..34b13b645 100644 --- a/Tools/SOGoToolUpdateAutoReply.m +++ b/Tools/SOGoToolUpdateAutoReply.m @@ -1,6 +1,6 @@ /* SOGoToolUpdateAutoReply.m - this file is part of SOGo * - * Copyright (C) 2011-2016 Inverse inc. + * Copyright (C) 2011-2019 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 @@ -81,6 +81,7 @@ SOGoUserDefaults *userDefaults; SOGoUser *user; BOOL result; + NSException *error; user = [SOGoUser userWithLogin: theLogin]; @@ -127,10 +128,10 @@ account = [folder lookupName: @"0" inContext: localContext acquire: NO]; [account setContext: localContext]; - result = [account updateFiltersWithUsername: theUsername + error = [account updateFiltersWithUsername: theUsername andPassword: thePassword forceActivation: NO]; - if (!result) + if (error) { // Can't update Sieve script -- Reactivate auto-reply if (disabling) @@ -139,6 +140,7 @@ [vacationOptions setObject: [NSNumber numberWithBool: YES] forKey: @"startDateEnabled"]; [userDefaults setVacationOptions: vacationOptions]; [userDefaults synchronize]; + result = NO; } } diff --git a/Tools/SOGoToolUserPreferences.m b/Tools/SOGoToolUserPreferences.m index 28fe726f6..b5f7ef81b 100644 --- a/Tools/SOGoToolUserPreferences.m +++ b/Tools/SOGoToolUserPreferences.m @@ -1,6 +1,6 @@ /* SOGoToolUserPreferences.m - this file is part of SOGo * - * Copyright (C) 2011-2017 Inverse inc. + * Copyright (C) 2011-2019 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 @@ -122,6 +122,7 @@ typedef enum } /* update sieve script */ + NSException *error; SOGoUser *user; SOGoUserFolder *home; SOGoMailAccounts *folder; @@ -141,7 +142,11 @@ typedef enum account = [folder lookupName: @"0" inContext: localContext acquire: NO]; [account setContext: localContext]; - return [account updateFiltersWithUsername: authname andPassword: authpwd]; + error = [account updateFiltersWithUsername: authname + andPassword: authpwd + forceActivation: NO]; + if (error) + return NO; } return YES;