Implement editheader sieve extension (RFC 5293).
Also fix iterator synchronization after removing an element and improve Sieve API. * include/mailutils/header.h (mu_header_get_itemptr): New proto. * include/mailutils/iterator.h (mu_iterator_advance): Remove. (mu_iterator_delitem): New proto. (mu_iterator_set_delitem): New proto. * include/mailutils/sieve.h (mu_sieve_register_t) <opt_args>: New member. (mu_sieve_register_test_ext) (mu_sieve_register_action_ext): New protos. * include/mailutils/sys/iterator.h (_mu_iterator) <curitem_p>: Remove. <delitem>: New member. All uses updated. * libmailutils/base/iterator.c (mu_iterator_set_delitem): New function. * libmailutils/mailbox/hdritr.c: Implement bidirectional iteration. Implement itrctl method. * libmailutils/mailbox/header.c: Likewise. * libmailutils/base/assoc.c: Use delitem method instead of curitem_p. (mu_iterator_delitem): New function. * libmailutils/base/opool.c * libmailutils/diag/debug.c * libmailutils/list/iterator.c * libmailutils/list/pop.c * libmailutils/list/remove.c * libmailutils/list/removenth.c * libmailutils/mailbox/imapenv.c * libmailutils/mailbox/mbxitr.c * libproto/pop/pop3_iterator.c * libmu_sieve/extensions/Makefile.am: Add editheader.c * libmu_sieve/extensions/editheader.c: New file. * libmu_sieve/prog.c (mu_sv_code_command): Allow for optional positional arguments. * libmu_sieve/register.c (mu_sieve_test_lookup) (mu_sieve_action_lookup): Return NULL if a record with empty (NULL) handler is found. (mu_sieve_register_test_ext) (mu_sieve_register_action_ext): New functions. (mu_sieve_register_test) (mu_sieve_register_action): Rewrite as wrappers to the above. * libmu_sieve/util.c (mu_sieve_vlist_do): Allow for SVT_STRING argument. * sieve/tests/Makefile.am: Add new testcases. * sieve/tests/testsuite.at: Include new testcases. * sieve/tests/addheader.at: New testcase. * sieve/tests/delheader.at: New testcase. * NEWS: Update. * doc/rfc/README: Update.
Showing
28 changed files
with
870 additions
and
80 deletions
libmu_sieve/extensions/editheader.c
0 → 100644
sieve/tests/addheader.at
0 → 100644
sieve/tests/delheader.at
0 → 100644
-
Please register or sign in to post a comment