From 8763c8d18620c0c83e81a6f697096aa97ba1eab6 Mon Sep 17 00:00:00 2001 From: Stephan Bosch <stephan@rename-it.nl> Date: Sun, 4 Jan 2009 19:17:14 +0100 Subject: [PATCH] Updated TODO. --- TODO | 7 +++++-- src/sieve-tools/sieve-test.c | 21 +++++++++++++++++---- 2 files changed, 22 insertions(+), 6 deletions(-) diff --git a/TODO b/TODO index afd0bc57f..f2a12d062 100644 --- a/TODO +++ b/TODO @@ -1,10 +1,13 @@ Current: * Implement executing an arbitrary number of scripts sequentially, acting on the - same set of result actions (multiscript) + same set of result actions (multiscript): - Implement multiscript support in sieve-exec tool - Implement multiscript support in lda sieve plugin - Rigorous testing +* Finish enotify extension: + - Mailto: prevent multiple notifications to a single recipient + - Regorous testing Next (in order of descending priority/precedence): @@ -28,6 +31,7 @@ Next (in order of descending priority/precedence): - Improve handling of invalid addresses in headers (requires Dovecot changes) * Imapflags: merge execution of setflags, removeflags and addflags into one common implementation. +* Implement environment extension * Implement dropping errors in the user's mailbox as a mail message. * Add normalize() method to comparators to normalize the string before matching (for efficiency). @@ -37,7 +41,6 @@ Next (in order of descending priority/precedence): Across Character Sets). - Verify validity of utf8 where necessary. - Implement comparator-i;unicode-casemap. -* Implement environment extension * Make testsuite much more exhaustive: - add support for testing delivered and outgoing smtp messages by looping these back as the active mail message diff --git a/src/sieve-tools/sieve-test.c b/src/sieve-tools/sieve-test.c index ffb460778..755ce8166 100644 --- a/src/sieve-tools/sieve-test.c +++ b/src/sieve-tools/sieve-test.c @@ -200,24 +200,35 @@ int main(int argc, char **argv) /* Run the test */ if ( array_count(&scriptfiles) == 0 ) { + /* Single script */ + + /* Test script */ ret = sieve_test(main_sbin, &msgdata, &scriptenv, ehandler, teststream); if ( ret == SIEVE_EXEC_BIN_CORRUPT ) { i_info("Corrupt binary deleted."); (void) unlink(sieve_binary_path(main_sbin)); } + } else { - struct sieve_binary *sbin; + /* Multiple scripts */ + + struct sieve_binary *sbin = NULL; const char *const *sfiles; unsigned int i, count; struct sieve_multiscript *mscript = sieve_multiscript_start (&msgdata, &scriptenv, ehandler); int result = 1; + /* Execute scripts sequentially */ sfiles = array_get(&scriptfiles, &count); for ( i = 0; i < count && result > 0; i++ ) { o_stream_send_str(teststream, t_strdup_printf("\n## Executing script: %s\n", sfiles[i])); + + /* Close previous script */ + if ( sbin != NULL ) + sieve_close(&sbin); /* Compile sieve script */ if ( force_compile ) { @@ -238,15 +249,17 @@ int main(int argc, char **argv) /* Test script */ result = ( sieve_multiscript_test(mscript, sbin, FALSE, teststream) ? 1 : 0 ); - - /* Close script */ - sieve_close(&sbin); } + /* Execute main script */ if ( result > 0 ) { o_stream_send_str(teststream, t_strdup_printf("## Executing script: %s\n", scriptfile)); + /* Close previous script */ + if ( sbin != NULL ) + sieve_close(&sbin); + sbin = main_sbin; (void)sieve_multiscript_test(mscript, main_sbin, TRUE, teststream); ret = sieve_multiscript_finish(&mscript); -- GitLab