diff --git a/TODO b/TODO index 8e5750f3aa1f0a6252fdcc6349bcc7f5abe5ff4c..4aa084effbeed2a7f63abde049c49ef9b26cf289 100644 --- a/TODO +++ b/TODO @@ -17,6 +17,7 @@ Next (in order of descending priority/precedence): * ## MAKE A FIRST RELEASE ## +* Implement notify extension with sole support for mailto mechanism. * Make this implementation conform section 2.7.2 of RFC3028 (Comparisons Across Character Sets). * Verify outgoing mail addresses at runtime when necessary (e.g. after variables @@ -35,7 +36,6 @@ Next (in order of descending priority/precedence): the binary and byte-code format. * Make the engine and its extensions much more configurable. Possibly this can be merged with Dovecot's new master config implementation. -* Implement notify extension with sole support for mailto mechanism. * Implement editheader extension * Implement mimeloop extension * Give the byte code format some more thought, it is currently quite rough and diff --git a/src/lib-sieve/plugins/include/ext-include-binary.c b/src/lib-sieve/plugins/include/ext-include-binary.c index a49549a112d17a1dd98cc0718bfa37bc0f9d40c1..c651dd9c6851c4f395333c85f4c602d43cd2b23f 100644 --- a/src/lib-sieve/plugins/include/ext-include-binary.c +++ b/src/lib-sieve/plugins/include/ext-include-binary.c @@ -202,8 +202,6 @@ static bool ext_include_binary_open(struct sieve_binary *sbin) return FALSE; } - printf("SCRIPT: %d %d %s\n", block_id, location, str_c(script_name)); - if ( location >= EXT_INCLUDE_LOCATION_INVALID ) { /* Binary is corrupt, recompile */ i_error("sieve: include: dependency block %d of binary %s " diff --git a/src/lib-sieve/plugins/include/ext-include-variables.c b/src/lib-sieve/plugins/include/ext-include-variables.c index 59f66279ab5c59dd74221a3eb17b70566d711ff7..2d89d979e2a6c2fbfb812a36c753707e6b642e52 100644 --- a/src/lib-sieve/plugins/include/ext-include-variables.c +++ b/src/lib-sieve/plugins/include/ext-include-variables.c @@ -84,7 +84,6 @@ bool ext_include_variable_import_global ctx->global_vars = sieve_variable_scope_create(pool, ext_include_my_id); } - printf("VAR EXPORT: %s\n", variable); var = sieve_variable_scope_get_variable(ctx->global_vars, variable, TRUE); } else { @@ -101,7 +100,6 @@ bool ext_include_variable_import_global return FALSE; } - printf("VAR IMPORT: %s\n", variable); (void)sieve_variable_scope_declare(ctx->import_vars, variable); } diff --git a/src/lib-sieve/plugins/variables/ext-variables-arguments.c b/src/lib-sieve/plugins/variables/ext-variables-arguments.c index 1455847b2bec7ba5b4a57845948901e4b6153939..4a65b0ddf8320d0225f7de60555e359b6b170d8b 100644 --- a/src/lib-sieve/plugins/variables/ext-variables-arguments.c +++ b/src/lib-sieve/plugins/variables/ext-variables-arguments.c @@ -295,22 +295,7 @@ static bool arg_variable_string_validate sieve_ast_arg_list_add(arglist, strarg); } } else { - int i; /* FIXME: Namespaces are not supported. */ - /* DEBUG: Just print the variable substitution: */ - - printf("NS_VARIABLE: "); - for ( i = 0; i < nelements; i++ ) { - const struct ext_variable_name *cur_element = - array_idx(&substitution, (unsigned int) i); - - if ( cur_element->num_variable == -1 ) { - printf("%s.", str_c(cur_element->identifier)); - } else { - printf("%d.", cur_element->num_variable); - } - } - printf("\n"); } strstart = p + 1; diff --git a/src/lib-sieve/sieve-interpreter.c b/src/lib-sieve/sieve-interpreter.c index 15e3b43d9996768ac3eddbed089fd6026d7cc836..8b0c7e9ff5205cfd8ffeacb6f9e56d1ffd0179dd 100644 --- a/src/lib-sieve/sieve-interpreter.c +++ b/src/lib-sieve/sieve-interpreter.c @@ -332,7 +332,7 @@ int sieve_interpreter_continue interp->pc < sieve_binary_get_code_size(interp->runenv.sbin) ) { if ( !sieve_interpreter_execute_operation(interp) ) { - printf("Execution aborted.\n"); + sieve_runtime_trace(&interp->runenv, "[[EXECUTION ABORTED]]"); ret = -1; } } diff --git a/src/lib-sieve/sieve-lexer.c b/src/lib-sieve/sieve-lexer.c index a46dd339a68cc384a25ec87548907faf9cc01796..54aa08f0ca905cecd09b47c50186f75a157b8a86 100644 --- a/src/lib-sieve/sieve-lexer.c +++ b/src/lib-sieve/sieve-lexer.c @@ -145,11 +145,6 @@ static void sieve_lexer_shift(struct sieve_lexer *lexer) lexer->buffer_pos = 0; } - - /*if ( lexer->buffer != NULL ) - printf("D %c\n", lexer->buffer[lexer->buffer_pos]); - else - printf("NULL!\n");*/ } static inline int sieve_lexer_curchar(struct sieve_lexer *lexer) { @@ -597,9 +592,6 @@ bool sieve_lexer_skip_token(struct sieve_lexer *lexer) if ( !sieve_lexer_scan_raw_token(lexer) ) return FALSE; } - //sieve_lexer_print_token(lexer); - //printf("\n"); - return TRUE; } diff --git a/src/lib-sieve/sieve-result.c b/src/lib-sieve/sieve-result.c index 3319f0c95a046317c430d9a721245eaa0ff646b8..a27dd83f741e8ef50ec0dc8982fc1d9b3d9d11e6 100644 --- a/src/lib-sieve/sieve-result.c +++ b/src/lib-sieve/sieve-result.c @@ -413,9 +413,9 @@ int sieve_result_execute result->action_env.msgdata = msgdata; result->action_env.scriptenv = senv; - /* Transaction start */ - - printf("\nTransaction start:\n"); /* REMOVEME */ + /* + * Transaction start + */ rac = result->first_action; while ( success && rac != NULL ) { @@ -429,9 +429,9 @@ int sieve_result_execute rac = rac->next; } - /* Transaction execute */ - - printf("\nTransaction execute:\n"); /* REMOVEME */ + /* + * Transaction execute + */ last_attempted = rac; rac = result->first_action; @@ -471,11 +471,9 @@ int sieve_result_execute rac = rac->next; } - /* Transaction commit/rollback */ - if ( success ) /* REMOVEME */ - printf("\nTransaction commit:\n"); - else - printf("\nTransaction rollback:\n"); + /* + * Transaction commit/rollback + */ commit_ok = success; rac = result->first_action; @@ -524,9 +522,6 @@ int sieve_result_execute rac = rac->next; } - /* REMOVEME */ - printf("\nTransaction result: %s\n", commit_ok ? "success" : "failed"); - /* Return value indicates whether the caller should attempt an implicit keep * of its own. So, if the above transaction fails, but the implicit keep below * succeeds, the return value is still true. An error is/should be logged @@ -536,9 +531,7 @@ int sieve_result_execute /* Execute implicit keep if the transaction failed or when the implicit keep * was not canceled during transaction. */ - if ( !commit_ok || implicit_keep ) { - printf("Executing implicit keep\n"); - + if ( !commit_ok || implicit_keep ) { if ( !sieve_result_implicit_keep(result, !commit_ok) ) return -1; diff --git a/src/sieve-bin/sieve-exec.c b/src/sieve-bin/sieve-exec.c index 17754310f7cfb15811616bfe6154eb8494784f74..e91ac5a12c29f0b60daa246f6e2bd3c71e355e17 100644 --- a/src/sieve-bin/sieve-exec.c +++ b/src/sieve-bin/sieve-exec.c @@ -189,10 +189,19 @@ int main(int argc, char **argv) sieve_error_handler_accept_infolog(ehandler, TRUE); /* Run */ - if ( sieve_execute(sbin, &msgdata, &scriptenv, ehandler) > 0 ) + switch ( sieve_execute(sbin, &msgdata, &scriptenv, ehandler) ) { + case 1: i_info("Final result: success\n"); - else - i_info("Final result: failed (caller please handle implicit keep!)\n"); + break; + case 0: + i_info("Final result: failed; resolved with successful implicit keep\n"); + break; + case -1: + i_info("Final result: utter failure (caller please handle implicit keep!)\n"); + break; + default: + i_info("Final result: unrecognized return value?!\n"); + } sieve_close(&sbin); sieve_error_handler_unref(&ehandler);