chore(tool): add the possibility to force the sieve script activation

This commit is contained in:
Hivert Quentin
2024-11-22 09:08:13 +01:00
parent 7f7c743976
commit ce86d14826
3 changed files with 19 additions and 8 deletions
+14 -3
View File
@@ -68,6 +68,7 @@ typedef enum
" -p credentialFile Specify the file containing the sieve admin credentials\n"
" The file should contain a single line:\n"
" username:password\n"
" -F force the activation of the sieve script in case external scripts. Must be the las targument after -p credentialsFile"
" Examples:\n"
" sogo-tool user-preferences get defaults janedoe SOGoLanguage\n"
" sogo-tool user-preferences unset settings janedoe Mail\n"
@@ -144,9 +145,19 @@ typedef enum
account = [folder lookupName: @"0" inContext: localContext acquire: NO];
[account setContext: localContext];
error = [account updateFiltersWithUsername: authname
andPassword: authpwd
forceActivation: NO];
if([[arguments lastObject] isEqualToString: @"-F"])
{
error = [account updateFiltersWithUsername: authname
andPassword: authpwd
forceActivation: YES];
}
else
{
error = [account updateFiltersWithUsername: authname
andPassword: authpwd
forceActivation: NO];
}
if (error)
return NO;
}