diff --git a/src/lib-sieve/plugins/include/Makefile.am b/src/lib-sieve/plugins/include/Makefile.am index 7d8805f50eadbc712fcb60a5b84632ceef736668..dc6f413a8e99f8e151e1851112b30521ee074f43 100644 --- a/src/lib-sieve/plugins/include/Makefile.am +++ b/src/lib-sieve/plugins/include/Makefile.am @@ -11,7 +11,7 @@ AM_CPPFLAGS = \ cmds = \ cmd-include.c \ cmd-return.c \ - cmd-import.c + cmd-global.c libsieve_ext_include_la_SOURCES = \ $(cmds) \ diff --git a/src/lib-sieve/plugins/include/cmd-import.c b/src/lib-sieve/plugins/include/cmd-global.c similarity index 67% rename from src/lib-sieve/plugins/include/cmd-import.c rename to src/lib-sieve/plugins/include/cmd-global.c index 49536e06d4bb0b5fbb5c36402c240bc97284502d..b42f294d7c95fac23243a2670117d110a990739f 100644 --- a/src/lib-sieve/plugins/include/cmd-import.c +++ b/src/lib-sieve/plugins/include/cmd-global.c @@ -22,10 +22,23 @@ * Commands */ -static bool cmd_import_validate +static bool cmd_global_validate (struct sieve_validator *validator, struct sieve_command_context *cmd); -static bool cmd_import_generate +static bool cmd_global_generate (const struct sieve_codegen_env *cgenv, struct sieve_command_context *cmd); + +const struct sieve_command cmd_global = { + "global", + SCT_COMMAND, + 1, 0, FALSE, FALSE, + NULL, NULL, + cmd_global_validate, + cmd_global_generate, + NULL +}; + +/* DEPRICATED: + */ /* Import command * @@ -37,8 +50,8 @@ const struct sieve_command cmd_import = { SCT_COMMAND, 1, 0, FALSE, FALSE, NULL, NULL, - cmd_import_validate, - cmd_import_generate, + cmd_global_validate, + cmd_global_generate, NULL }; @@ -52,8 +65,8 @@ const struct sieve_command cmd_export = { SCT_COMMAND, 1, 0, FALSE, FALSE, NULL, NULL, - cmd_import_validate, - cmd_import_generate, + cmd_global_validate, + cmd_global_generate, NULL }; @@ -61,38 +74,28 @@ const struct sieve_command cmd_export = { * Operations */ -static bool opc_import_dump +static bool opc_global_dump (const struct sieve_operation *op, const struct sieve_dumptime_env *denv, sieve_size_t *address); -static int opc_import_execute +static int opc_global_execute (const struct sieve_operation *op, const struct sieve_runtime_env *renv, sieve_size_t *address); -/* Import operation */ +/* Global operation */ -const struct sieve_operation import_operation = { - "import", +const struct sieve_operation global_operation = { + "global", &include_extension, - EXT_INCLUDE_OPERATION_IMPORT, - opc_import_dump, - opc_import_execute + EXT_INCLUDE_OPERATION_GLOBAL, + opc_global_dump, + opc_global_execute }; -/* Export operation */ - -const struct sieve_operation export_operation = { - "export", - &include_extension, - EXT_INCLUDE_OPERATION_EXPORT, - opc_import_dump, - opc_import_execute -}; - /* * Validation */ -static bool cmd_import_validate +static bool cmd_global_validate (struct sieve_validator *validator, struct sieve_command_context *cmd) { struct sieve_ast_argument *arg = cmd->first_positional; @@ -102,17 +105,27 @@ static bool cmd_import_validate /* Check valid command placement */ if ( !sieve_command_is_toplevel(cmd) || ( !sieve_command_is_first(cmd) && prev_context != NULL && - prev_context->command != &cmd_require && - prev_context->command != &cmd_import && - (cmd->command != &cmd_export || prev_context->command != &cmd_export) ) ) - { - sieve_command_validate_error(validator, cmd, - "%s commands can only be placed at top level " - "at the beginning of the file after any require %scommands", - cmd->command->identifier, cmd->command == &cmd_export ? "or import " : ""); - return FALSE; + prev_context->command != &cmd_require ) ) { + + if ( cmd->command == &cmd_global ) { + if ( prev_context->command != &cmd_global ) { + sieve_command_validate_error(validator, cmd, + "a global command can only be placed at top level " + "at the beginning of the file after any require or other global commands"); + return FALSE; + } + } else { + if ( prev_context->command != &cmd_import && prev_context->command != &cmd_export ) { + sieve_command_validate_error(validator, cmd, + "the DEPRICATED %s command can only be placed at top level " + "at the beginning of the file after any require or import/export commands", + cmd->command->identifier); + return FALSE; + } + } } - + + /* Check for use of variables extension */ if ( !sieve_ext_variables_is_active(validator) ) { sieve_command_validate_error(validator, cmd, "%s command requires that variables extension is active", @@ -120,14 +133,14 @@ static bool cmd_import_validate return FALSE; } - /* Register imported variable */ + /* Register global variable */ if ( sieve_ast_argument_type(arg) == SAAT_STRING ) { /* Single string */ const char *identifier = sieve_ast_argument_strc(arg); struct sieve_variable *var; if ( (var=ext_include_variable_import_global - (validator, cmd, identifier, cmd->command == &cmd_export)) == NULL ) + (validator, cmd, identifier)) == NULL ) return FALSE; arg->context = (void *) var; @@ -141,7 +154,7 @@ static bool cmd_import_validate struct sieve_variable *var; if ( (var=ext_include_variable_import_global - (validator, cmd, identifier, cmd->command == &cmd_export)) == NULL ) + (validator, cmd, identifier)) == NULL ) return FALSE; stritem->context = (void *) var; @@ -157,7 +170,7 @@ static bool cmd_import_validate return FALSE; } - /* Join emport and export commands with predecessors if possible */ + /* Join global commands with predecessors if possible */ if ( prev_context->command == cmd->command ) { /* Join this command's string list with the previous one */ prev_context->first_positional = sieve_ast_stringlist_join @@ -181,15 +194,12 @@ static bool cmd_import_validate * Code generation */ -static bool cmd_import_generate +static bool cmd_global_generate (const struct sieve_codegen_env *cgenv, struct sieve_command_context *cmd) { struct sieve_ast_argument *arg = cmd->first_positional; - if ( cmd->command == &cmd_import ) - sieve_operation_emit_code(cgenv->sbin, &import_operation); - else - sieve_operation_emit_code(cgenv->sbin, &export_operation); + sieve_operation_emit_code(cgenv->sbin, &global_operation); if ( sieve_ast_argument_type(arg) == SAAT_STRING ) { /* Single string */ @@ -197,8 +207,6 @@ static bool cmd_import_generate (void)sieve_binary_emit_unsigned(cgenv->sbin, 1); (void)sieve_binary_emit_unsigned(cgenv->sbin, var->index); - if ( cmd->command == &cmd_import ) - (void)sieve_code_source_line_emit(cgenv->sbin, arg->source_line); } else if ( sieve_ast_argument_type(arg) == SAAT_STRING_LIST ) { /* String list */ @@ -211,9 +219,6 @@ static bool cmd_import_generate (void)sieve_binary_emit_unsigned(cgenv->sbin, var->index); - if ( cmd->command == &cmd_import ) - (void)sieve_code_source_line_emit(cgenv->sbin, stritem->source_line); - stritem = sieve_ast_strlist_next(stritem); } } else { @@ -227,8 +232,8 @@ static bool cmd_import_generate * Code dump */ -static bool opc_import_dump -(const struct sieve_operation *op, +static bool opc_global_dump +(const struct sieve_operation *op ATTR_UNUSED, const struct sieve_dumptime_env *denv, sieve_size_t *address) { unsigned int count, i, var_count; @@ -238,10 +243,7 @@ static bool opc_import_dump if ( !sieve_binary_read_unsigned(denv->sbin, address, &count) ) return FALSE; - if ( op == &import_operation ) - sieve_code_dumpf(denv, "IMPORT (count: %u):", count); - else - sieve_code_dumpf(denv, "EXPORT (count: %u):", count); + sieve_code_dumpf(denv, "GLOBAL (count: %u):", count); scope = ext_include_binary_get_global_scope(denv->sbin); vars = sieve_variable_scope_get_variables(scope, &var_count); @@ -256,17 +258,7 @@ static bool opc_import_dump index >= var_count ) return FALSE; - sieve_code_dumpf(denv, "GLOBAL VAR[%d]: '%s'", - index, vars[index]->identifier); - - if ( op == &import_operation ) { - sieve_code_descend(denv); - - if ( !sieve_code_source_line_dump(denv, address) ) - return FALSE; - - sieve_code_ascend(denv); - } + sieve_code_dumpf(denv, "VAR[%d]: '%s'", index, vars[index]->identifier); } return TRUE; @@ -276,8 +268,8 @@ static bool opc_import_dump * Execution */ -static int opc_import_execute -(const struct sieve_operation *op, +static int opc_global_execute +(const struct sieve_operation *op ATTR_UNUSED, const struct sieve_runtime_env *renv, sieve_size_t *address) { struct sieve_variable_scope *scope; @@ -295,7 +287,7 @@ static int opc_import_execute storage = ext_include_interpreter_get_global_variables(renv->interp); for ( i = 0; i < count; i++ ) { - unsigned int index, source_line; + unsigned int index; if ( !sieve_binary_read_unsigned(renv->sbin, address, &index) ) { sieve_runtime_trace_error(renv, "invalid global variable operand"); @@ -308,28 +300,8 @@ static int opc_import_execute return SIEVE_EXEC_BIN_CORRUPT; } - if ( op == &import_operation ) { - string_t *varval; - - if ( !sieve_code_source_line_read(renv, address, &source_line) ) { - sieve_runtime_trace_error(renv, "invalid source line operand"); - return SIEVE_EXEC_BIN_CORRUPT; - } - - /* Verify variables initialization */ - (void)sieve_variable_get(storage, index, &varval); - - if ( varval == NULL ) { - sieve_runtime_error(renv, - sieve_error_script_location(renv->script, source_line), - "include: imported variable '%s' not previously exported", - vars[index]->identifier); - return SIEVE_EXEC_FAILURE; - } - } else { - /* Make sure variable is initialized (export) */ - (void)sieve_variable_get_modifiable(storage, index, NULL); - } + /* Make sure variable is initialized (export) */ + (void)sieve_variable_get_modifiable(storage, index, NULL); } return SIEVE_EXEC_OK; diff --git a/src/lib-sieve/plugins/include/ext-include-common.c b/src/lib-sieve/plugins/include/ext-include-common.c index d9b65881bff429609e91209af62aa2acd4e130ed..0f932bf9a01d18030e9a143209d3b9da04cec203 100644 --- a/src/lib-sieve/plugins/include/ext-include-common.c +++ b/src/lib-sieve/plugins/include/ext-include-common.c @@ -105,7 +105,6 @@ static void ext_include_ast_free } /* Unreference variable scopes */ - sieve_variable_scope_unref(&actx->import_vars); if ( actx->global_vars != NULL ) sieve_variable_scope_unref(&actx->global_vars); } @@ -122,7 +121,6 @@ struct ext_include_ast_context *ext_include_create_ast_context pool_t pool = sieve_ast_pool(ast); actx = p_new(pool, struct ext_include_ast_context, 1); - actx->import_vars = sieve_variable_scope_create(&include_extension); p_array_init(&actx->included_scripts, pool, 32); if ( parent != NULL ) { diff --git a/src/lib-sieve/plugins/include/ext-include-common.h b/src/lib-sieve/plugins/include/ext-include-common.h index 0c7cc3781007b9f7e5af19472d202077252740d0..128fdd09c362b2e1d4ad4e41c3f1e1a3cb4eae06 100644 --- a/src/lib-sieve/plugins/include/ext-include-common.h +++ b/src/lib-sieve/plugins/include/ext-include-common.h @@ -39,6 +39,9 @@ extern const struct sieve_binary_extension include_binary_ext; extern const struct sieve_command cmd_include; extern const struct sieve_command cmd_return; +extern const struct sieve_command cmd_global; + +/* DEPRICATED */ extern const struct sieve_command cmd_import; extern const struct sieve_command cmd_export; @@ -49,14 +52,12 @@ extern const struct sieve_command cmd_export; enum ext_include_opcode { EXT_INCLUDE_OPERATION_INCLUDE, EXT_INCLUDE_OPERATION_RETURN, - EXT_INCLUDE_OPERATION_IMPORT, - EXT_INCLUDE_OPERATION_EXPORT + EXT_INCLUDE_OPERATION_GLOBAL }; extern const struct sieve_operation include_operation; extern const struct sieve_operation return_operation; -extern const struct sieve_operation import_operation; -extern const struct sieve_operation export_operation; +extern const struct sieve_operation global_operation; /* * Script access @@ -72,7 +73,6 @@ const char *ext_include_get_script_directory /* AST Context */ struct ext_include_ast_context { - struct sieve_variable_scope *import_vars; struct sieve_variable_scope *global_vars; ARRAY_DEFINE(included_scripts, struct sieve_script *); diff --git a/src/lib-sieve/plugins/include/ext-include-variables.c b/src/lib-sieve/plugins/include/ext-include-variables.c index 8d8f2088f8c47f110ee3bb2635c36d7f45f972ed..5f70c5ef606aad3bf9c33c4309fc4f9f05ea65f1 100644 --- a/src/lib-sieve/plugins/include/ext-include-variables.c +++ b/src/lib-sieve/plugins/include/ext-include-variables.c @@ -18,57 +18,22 @@ #include "ext-include-binary.h" #include "ext-include-variables.h" -/* - * Types - */ - -enum ext_include_variable_type { - EXT_INCLUDE_VAR_IMPORTED, - EXT_INCLUDE_VAR_EXPORTED, - EXT_INCLUDE_VAR_INVALID -}; - -struct ext_include_variable { - enum ext_include_variable_type type; - unsigned int source_line; -}; - /* * Variable import-export */ struct sieve_variable *ext_include_variable_import_global (struct sieve_validator *valdtr, struct sieve_command_context *cmd, - const char *variable, bool export) + const char *variable) { struct sieve_ast *ast = cmd->ast_node->ast; struct ext_include_ast_context *ctx = ext_include_get_ast_context(ast); struct sieve_variable_scope *main_scope; - struct sieve_variable *var = NULL, *impvar = NULL; - - /* Check if the requested variable was imported already */ - if ( (impvar=sieve_variable_scope_get_variable(ctx->import_vars, variable, FALSE)) - != NULL ) { - if ( export ) { - /* Yes, and now export is attempted. ERROR */ - sieve_command_validate_error(valdtr, cmd, - "cannot export imported variable '%s'", variable); - return NULL; - } else { - /* Yes, and it is imported again. Warn the user */ - if ( impvar->context != NULL ) { - struct ext_include_variable *varctx = - (struct ext_include_variable *) impvar->context; - sieve_command_validate_warning(valdtr, cmd, - "variable '%s' already imported earlier at line %d", variable, - varctx->source_line); - } - } - } + struct sieve_variable *var = NULL; /* Sanity safeguard */ i_assert ( ctx->global_vars != NULL ); - + /* Get/Declare the variable in the global scope */ var = sieve_variable_scope_get_variable(ctx->global_vars, variable, TRUE); @@ -79,40 +44,10 @@ struct sieve_variable *ext_include_variable_import_global "(max variables: %u)", variable, SIEVE_VARIABLES_MAX_SCOPE_SIZE); } - - /* Assign context for creation of symbol block during code generation */ - if ( var->context == NULL ) { - pool_t pool = sieve_variable_scope_pool(ctx->global_vars); - struct ext_include_variable *varctx; - - /* We only record data from the first encounter */ - varctx = p_new(pool, struct ext_include_variable, 1); - varctx->type = export ? - EXT_INCLUDE_VAR_EXPORTED : EXT_INCLUDE_VAR_IMPORTED; - varctx->source_line = cmd->ast_node->source_line; - var->context = varctx; - } /* Import the global variable into the local script scope */ - if ( impvar == NULL ) { - main_scope = sieve_ext_variables_get_main_scope(valdtr); - (void)sieve_variable_scope_import(main_scope, var); - - /* If this is an import it needs to be registered to detect duplicates */ - if ( !export ) { - pool_t pool = sieve_variable_scope_pool(ctx->import_vars); - struct ext_include_variable *varctx; - - impvar = sieve_variable_scope_declare(ctx->import_vars, variable); - - i_assert( impvar != NULL ); - - varctx = p_new(pool, struct ext_include_variable, 1); - varctx->type = EXT_INCLUDE_VAR_IMPORTED; - varctx->source_line = cmd->ast_node->source_line; - impvar->context = varctx; - } - } + main_scope = sieve_ext_variables_get_main_scope(valdtr); + (void)sieve_variable_scope_import(main_scope, var); return var; } @@ -139,7 +74,6 @@ bool ext_include_variables_save i_assert( varctx != NULL ); - sieve_binary_emit_byte(sbin, varctx->type); sieve_binary_emit_cstring(sbin, vars[i]->identifier); } } @@ -177,36 +111,19 @@ bool ext_include_variables_load /* Read global variable scope */ for ( i = 0; i < count; i++ ) { struct sieve_variable *var; - struct ext_include_variable *varctx; - enum ext_include_variable_type type; string_t *identifier; - if ( - !sieve_binary_read_byte(sbin, offset, &type) || - !sieve_binary_read_string(sbin, offset, &identifier) ) { + if ( !sieve_binary_read_string(sbin, offset, &identifier) ) { /* Binary is corrupt, recompile */ sieve_sys_error("include: failed to read global variable specification " "from dependency block %d of binary %s", block, sieve_binary_path(sbin)); return FALSE; } - - if ( type >= EXT_INCLUDE_VAR_INVALID ) { - /* Binary is corrupt, recompile */ - sieve_sys_error("include: dependency block %d of binary %s " - "reports invalid global variable type (id %d).", - block, sieve_binary_path(sbin), type); - return FALSE; - } var = sieve_variable_scope_declare(*global_vars_r, str_c(identifier)); i_assert( var != NULL ); - - varctx = p_new(pool, struct ext_include_variable, 1); - varctx->type = type; - var->context = varctx; - - i_assert(var->index == i); + i_assert( var->index == i ); } return TRUE; @@ -228,12 +145,7 @@ bool ext_include_variables_dump sieve_binary_dump_sectionf(denv, "Global variables"); for ( i = 0; i < size; i++ ) { - struct ext_include_variable *varctx = - (struct ext_include_variable *) vars[i]->context; - - sieve_binary_dumpf(denv, "%3d: %s '%s' \n", i, - varctx->type == EXT_INCLUDE_VAR_EXPORTED ? "export" : "import", - vars[i]->identifier); + sieve_binary_dumpf(denv, "%3d: '%s' \n", i, vars[i]->identifier); } } diff --git a/src/lib-sieve/plugins/include/ext-include-variables.h b/src/lib-sieve/plugins/include/ext-include-variables.h index 19e1b6a8a4a40e282946dc8f891f96a3517b38c1..7b87e336767345706c8627519cac28760fb0a428 100644 --- a/src/lib-sieve/plugins/include/ext-include-variables.h +++ b/src/lib-sieve/plugins/include/ext-include-variables.h @@ -16,7 +16,7 @@ struct sieve_variable *ext_include_variable_import_global (struct sieve_validator *valdtr, struct sieve_command_context *cmd, - const char *variable, bool export); + const char *variable); /* * Binary symbol table diff --git a/src/lib-sieve/plugins/include/ext-include.c b/src/lib-sieve/plugins/include/ext-include.c index 88e1ab72bf4fa0c82f38021ed9d1dd4111081557..61ead1cecc4a201a6bc51e33a43b7b4771afd47e 100644 --- a/src/lib-sieve/plugins/include/ext-include.c +++ b/src/lib-sieve/plugins/include/ext-include.c @@ -37,8 +37,7 @@ static const struct sieve_operation *ext_include_operations[] = { &include_operation, &return_operation, - &import_operation, - &export_operation + &global_operation }; /* @@ -77,6 +76,9 @@ static bool ext_include_validator_load(struct sieve_validator *validator) /* Register new commands */ sieve_validator_register_command(validator, &cmd_include); sieve_validator_register_command(validator, &cmd_return); + sieve_validator_register_command(validator, &cmd_global); + + /* DEPRICATED */ sieve_validator_register_command(validator, &cmd_import); sieve_validator_register_command(validator, &cmd_export); diff --git a/tests/extensions/include/errors.svtest b/tests/extensions/include/errors.svtest index 233f027c16f5c457185472efe6141a4a16554990..d5caf35a02270ce04fe53848eba642a6f7903df8 100644 --- a/tests/extensions/include/errors.svtest +++ b/tests/extensions/include/errors.svtest @@ -48,7 +48,7 @@ test "Circular - two intermittent" { } /* - * Using import/export without variables required + * Using global without variables required */ test "Variables inactive" { @@ -70,25 +70,8 @@ test "Variables" { test_fail "compile should have failed"; } - if not test_error :count "eq" :comparator "i;ascii-numeric" "4" { + if not test_error :count "eq" :comparator "i;ascii-numeric" "2" { test_fail "wrong number of errors reported"; } } -/* - * Runtime errors - */ - -test "Import runtime" { - if not test_script_compile "errors/import-runtime.sieve" { - test_fail "compile failed"; - } - - if test_script_run { - test_fail "execution should have failed"; - } - - if not test_error :count "eq" :comparator "i;ascii-numeric" "1" { - test_fail "wrong number of errors reported"; - } -} diff --git a/tests/extensions/include/errors/import-runtime.sieve b/tests/extensions/include/errors/import-runtime.sieve deleted file mode 100644 index 3bca51501931969bb42e63f98254014d49452f46..0000000000000000000000000000000000000000 --- a/tests/extensions/include/errors/import-runtime.sieve +++ /dev/null @@ -1,15 +0,0 @@ -/* - * Import runtime test - * - * Tests whether the import directive fails when importing variables that were - * never exported by a parent script or one of its sibblings. - */ -require "include"; -require "variables"; - -# This fails at runtime -import "global"; - -export "local"; - -keep; diff --git a/tests/extensions/include/errors/variables-inactive.sieve b/tests/extensions/include/errors/variables-inactive.sieve index 5506db357cb12b36bc291a16ec935c5becbe1b50..06e0df136dfbfa32f1a7a227947cb1a6e6009d44 100644 --- a/tests/extensions/include/errors/variables-inactive.sieve +++ b/tests/extensions/include/errors/variables-inactive.sieve @@ -1,7 +1,7 @@ require "include"; require "fileinto"; -import "friep"; -export "frop"; +global "friep"; +global "frop"; fileinto "Frop"; diff --git a/tests/extensions/include/errors/variables.sieve b/tests/extensions/include/errors/variables.sieve index 51997fc4bd56ace8587d0ea138714f83d3251a5c..277ca0c4adffb14159db91a43cca652ff04ba5b6 100644 --- a/tests/extensions/include/errors/variables.sieve +++ b/tests/extensions/include/errors/variables.sieve @@ -1,20 +1,8 @@ require "include"; require "variables"; -# Importing unknown variable, but not a compile-time error -import "frop"; - -# Importing unknown variable, but not a compile-time error -import ["friep", "frml"]; - -# Cannot export imported variable -export ["friep"]; - -# Import after export -import "friep"; - keep; -# Export after command not being require, import or export -export "friep"; +# Global after command not being require or global +global "friep"; diff --git a/tests/extensions/include/included/variables-included1.sieve b/tests/extensions/include/included/variables-included1.sieve index 47cb165cdd87083fe67b6f36067f04848928d4d5..ee4b54a6757f3c8acb017754f2ceb02629eefa3d 100644 --- a/tests/extensions/include/included/variables-included1.sieve +++ b/tests/extensions/include/included/variables-included1.sieve @@ -1,7 +1,7 @@ require "include"; require "variables"; -import ["value1", "value2"]; -export ["result1"]; +global ["value1", "value2"]; +global ["result1"]; set "result1" "${value1} ${value2}"; diff --git a/tests/extensions/include/included/variables-included2.sieve b/tests/extensions/include/included/variables-included2.sieve index 8775f79d2539a6ec95ec8d40813c6eee0e55ab5a..06e4551abaf47c4ccb5d860a80b7a661acffbed0 100644 --- a/tests/extensions/include/included/variables-included2.sieve +++ b/tests/extensions/include/included/variables-included2.sieve @@ -1,8 +1,6 @@ require "include"; require "variables"; -import "value3"; -import "value4"; -export "result2"; +global ["value3", "value4", "result2"]; set "result2" "${value3} ${value4}"; diff --git a/tests/extensions/include/included/variables-included3.sieve b/tests/extensions/include/included/variables-included3.sieve index bcde79e9651bfc9c3cebfcf5c54cd957ffc833df..51bb7863cd6da5d104fd26faae04c253bc27001c 100644 --- a/tests/extensions/include/included/variables-included3.sieve +++ b/tests/extensions/include/included/variables-included3.sieve @@ -1,8 +1,8 @@ require "include"; require "variables"; -import "result1"; -import "result2"; -export "result"; +global "result1"; +global "result2"; +global "result"; set "result" "${result1} ${result2}"; diff --git a/tests/extensions/include/variables.svtest b/tests/extensions/include/variables.svtest index 2642f9074b4327b3fb88d227b9cc2aa18d02b6af..3ee0fb54c9b5a37876b205b94c332077ce3ebc06 100644 --- a/tests/extensions/include/variables.svtest +++ b/tests/extensions/include/variables.svtest @@ -3,10 +3,9 @@ require "vnd.dovecot.testsuite"; require "include"; require "variables"; -#export ["value1", "value2", "value3", "value4","result"]; -export ["value1", "value2"]; -export ["value3", "value4"]; -export "result"; +global ["value1", "value2"]; +global ["value3", "value4"]; +global "result"; set "value1" "Works"; set "value2" "fine.";