- 13 Dec, 2016 10 commits
-
-
* libmu_sieve/runtime.c (mu_sieve_abort): Jump with code MU_ERR_FAILURE. * libmu_sieve/tests.c (retrieve_address): Tolerate empty addresses. (retrieve_header): Return reasonable error code. * maidag/script.c (script_apply): If the script failed, return 0.
Sergey Poznyakoff authored -
-
* configure.ac: version 3.1 * NEWS: Likewise. * libmu_sieve/comparator.c: Attend to FIXMEs. * libmu_sieve/conf.c: Likewise. * libmu_sieve/prog.c: Likewise. * libmu_sieve/runtime.c: Likewise. * libmu_sieve/sieve.y: Likewise. * libmu_sieve/util.c: Likewise. * libmu_sieve/variables.c: Likewise. * po/POTFILES.in: Add new files.
Sergey Poznyakoff authored -
* libmu_sieve/util.c (mu_sieve_value_get): Treat actual string and expected string list as equivalent types.
Sergey Poznyakoff authored -
* libmailutils/string/wordsplit.c (mu_wordsplit_perror): Use %s format specifier
Sergey Poznyakoff authored -
-
* libmu_sieve/sieve.y: Fix compilation of chained elsif conditions. * sieve/sieve.c: Define the location environment item.
Sergey Poznyakoff authored -
* NEWS: Update. * doc/texinfo/libmu_sieve.texi: Update. * doc/texinfo/sieve.texi: Document extensions * libmu_sieve/comparator.c (mu_sieve_match_part_checker): Check the type of the 2nd argument. * sieve/sieve.c: Define "location" and "phase" environment items. * sieve/tests/pipetest.at: Use "pipe" as the capability string.
Sergey Poznyakoff authored -
* include/mailutils/sieve.h (mu_sieve_get_mailbox) (mu_sieve_get_argc): New protos. * libmu_sieve/runtime.c: New functions.
Sergey Poznyakoff authored -
* libmailutils/string/wordsplit.c: Change ordering of expansions so that command expansion occurs first. This fixes nested expansions and command expansions occurring after variable expansions. * libmailutils/tests/wordsplit.at: Add more tests.
Sergey Poznyakoff authored
-
- 12 Dec, 2016 5 commits
-
-
-
* mh/mh.h (mh_whatnow_env) <nowhatnowproc>: New member. * mh/compcommon.c (check_draft_disposition): Return DISP_REPLACE if nowhatnowproc is set. * mh/mh_whatnow.c (mh_whatnowproc): Return 0 if nowhatnowproc is set. * mh/comp.c: Fix -nowhatnowproc * mh/forw.c: Likewise. * mh/repl.c: Likewise.
Sergey Poznyakoff authored -
* libmailutils/base/ctparse.c (parse_type) (parse_subtype): Fix memory allocation
Sergey Poznyakoff authored -
-
* sieve/tests/environment.at: New testcase. * sieve/tests/Makefile.am: Add new file. * sieve/tests/testsuite.at: Include new file. * lib/muscript.h (mu_script_init): Change signature. * lib/muscript_priv.h (mu_script_fun) <script_init>: Likewise. * lib/guile.c (scheme_init): Update. * lib/python.c (python_init): Update. * lib/script.c (mu_script_init): Pass environment to the script_init method. * lib/sieve.c (sieve_init): Set sieve environment. * maidag/script.c (apply_script): Set environment. * mh/inc.c: Likewise.
Sergey Poznyakoff authored
-
- 11 Dec, 2016 1 commit
-
-
* include/mailutils/sieve.h (mu_sieve_require_environment): New proto. * libmu_sieve/Makefile.am: Add environment.c * libmu_sieve/environment.c: New file. * libmu_sieve/require.c: Handle "environment" keyword. * libmu_sieve/sieve-priv.h (mu_sieve_machine) <exenv>: New member. * libmu_sieve/sieve.l: Bugfixes * libmu_sieve/variables.c: Add missing static qualifiers * sieve/sieve.c: New option --environment
Sergey Poznyakoff authored
-
- 10 Dec, 2016 2 commits
-
-
- 09 Dec, 2016 2 commits
-
-
-
* include/mailutils/util.h (mu_content_type, mu_param): New structs. (mu_content_type_t): New typedef. (mu_content_type_parse, mu_content_type_destroy): New protos. * libmailutils/base/ctparse.c: New file. * libmailutils/base/Makefile.am: Add new file. * imap4d/fetch.c: Use mu_content_type_parse to parse the header. * libmailutils/tests/conttype.c: New file. * libmailutils/tests/Makefile.am: Add new file.
Sergey Poznyakoff authored
-
- 08 Dec, 2016 2 commits
-
-
Don't set mu_log_tag, leave that to the caller. * libmailutils/cli/cli.c (mu_cli_ext): Don't set mu_log_tag. * libmailutils/stdstream/strerr.c: Use MU_LOG_TAG macro from syslog.h * sieve/sieve.c: Redo --no-program-name support
Sergey Poznyakoff authored -
* libmu_sieve/util.c (mu_sieve_vlist_compare): Rewrite. * include/mailutils/sieve.h (mu_sieve_retrieve_t): Change signature. All uses changed. (mu_sieve_relational_count): Remove. (mu_sieve_vlist_compare): Change signature. * libmu_sieve/extensions/list.c (list_retrieve_header): Always return meaningful status. * libmu_sieve/tests.c (mu_sieve_relational_count): Remove. (retrieve_address,retrieve_envelope): Return meaningful status. (retrieve_header): Iterate over all mime parts, if required. (sieve_test_address,sieve_test_header): Rewrite. * libmu_sieve/variables.c (sieve_test_string): Rewrite using mu_sieve_vlist_compare.
Sergey Poznyakoff authored
-
- 07 Dec, 2016 3 commits
-
-
-
* include/mailutils/glob.h: File was missing in df608ed0 * include/mailutils/Makefile.am: Add glob.h
Sergey Poznyakoff authored -
* include/mailutils/sieve.h (mu_sieve_string): New fields "constant" and "changed". (mu_sieve_match_part_tags): New extern. (mu_sieve_relational_count) (mu_sieve_require_variables) (mu_sieve_has_variables) (mu_sieve_string_get): New functions. * libmu_sieve/variables.c: New file. * libmu_sieve/Makefile.am: Add variables.c * libmu_sieve/comparator.c: Use mu_sieve_string_get to obtain the actual value of the string. * libmu_sieve/require.c: Support the "variables" extension. * libmu_sieve/sieve-priv.h (mu_sieve_machine): New fields vartab, match_string, match_buf, match_count, match_max. (mu_i_sv_copy_variables) (mu_i_sv_expand_variables): New protos. * libmu_sieve/sieve.l (line_add): zero length means add entire asciiz string. * libmu_sieve/sieve.y (mu_sieve_machine_reset): Reset the new fields. (mu_sieve_machine_clone): Copy variables and initialize new fields. (string_rescan): New function. (sieve_parse): Rescan string to determine their properties. * libmu_sieve/strexp.c (update_len): Allow for NULL replacement values. * libmu_sieve/string.c (mu_sieve_string_get): New function. (mu_sieve_string): Use it. * libmu_sieve/tests.c (do_count): Rename to mu_sieve_relational_count, make global. All uses changed. (match_part_tags): Rename to mu_sieve_match_part_tags, make global. All uses changed. * sieve/tests/variables.at: New file. * sieve/tests/Makefile.am: Add new testcases. * sieve/tests/testsuite.at: Likewise.
Sergey Poznyakoff authored
-
- 06 Dec, 2016 3 commits
-
-
* include/mailutils/opool.h (mu_nonlocal_jmp_t): New type. (mu_opool_setjmp,mu_opool_clrjmp): New functions. (mu_opool_setup_nonlocal_jump): New macro. * libmailutils/base/opool.c (_mu_opool)<jmp>: New field. (alloc_bucket): Do a non-local jump on out of memory condition, if jmp is not NULL. (mu_opool_setjmp,mu_opool_clrjmp): New functions. * libmailutils/base/glob.c: New file. * libmailutils/base/Makefile.am: Add glob.c * include/mailutils/glob.h: New file. * include/mailutils/mailutils.h: Include glob.h * libmailutils/tests/globtest.c: New file. * libmailutils/tests/globtest.at: New test. * libmailutils/tests/Makefile.am: Add new files. * libmailutils/tests/testsuite.at: Include new test.
Sergey Poznyakoff authored -
* libmailutils/stream/stream.c (mu_stream_ioctl): Don't flush read buffer.
Sergey Poznyakoff authored
- 05 Dec, 2016 1 commit
-
-
* include/mailutils/opool.h (mu_opool_detach): New proto. * libmailutils/base/opool.c (mu_opool_bucket): Redo as union to ensure proper alignment. All uses changed. (mu_opool_detach): New function.
Sergey Poznyakoff authored
-
- 04 Dec, 2016 1 commit
-
-
The purpose is to simplify the machine structure and to ensure its clones are completely independent of the master instance. * include/mailutils/sieve.h (mu_sieve_command): New struct. (mu_sieve_record): New enum (mu_sieve_registry_t): Generalize for storing various types of objects. (mu_sieve_test_lookup,mu_sieve_action_lookup) (mu_sieve_require_action,mu_sieve_require_test) (mu_sieve_require_comparator): Remove. (mu_sieve_register_test_ext,mu_sieve_register_test) (mu_sieve_register_action_ext,mu_sieve_register_action) (mu_sieve_register_comparator) (mu_sieve_load_ext): Change return type. (mu_sieve_registry_require,mu_sieve_unload_ext): New functions. (mu_sieve_machine_inherit): Rename to mu_sieve_machine_clone. * libmu_sieve/sieve-priv.h (mu_sieve_machine): Remove source_list, test_list, action_list, and comp_list. Add a single registry list instead. Add space for file and command (action and test) names: idspace, idcount, idmax. Remove unused field "stack"; (mu_i_sv_lex_finish): Change prototype. (_mu_i_sv_instr_push,_mu_i_sv_instr_pop): Remove protos. (mu_i_sv_id_canon,mu_i_sv_id_num) (mu_i_sv_id_str,mu_i_sv_free_idspace): New protos. * libmu_sieve/register.c: Rename to registry.c * libmu_sieve/registry.c (mu_sieve_test_lookup) (mu_sieve_action_lookup): Remove. (mu_sieve_require_test,mu_sieve_require_action): Remove. (mu_sieve_registry_require): New function. (mu_sieve_registry_add,mu_sieve_registry_lookup): New functions. * libmu_sieve/Makefile.am: Update. * libmu_sieve/comparator.c: Rewrite using new registry functions. * libmu_sieve/load.c (mu_sieve_load_ext): Return module handle. (mu_sieve_unload_ext): New function. * libmu_sieve/mem.c (mu_sieve_free): Gracefully handle NULL argument. (mu_i_sv_id_canon,mu_i_sv_id_num,mu_i_sv_id_str): New functions. * libmu_sieve/prog.c (mu_i_sv_locus): Store index of the file name in the id space, instead of pointer to the name itself. * libmu_sieve/require.c (mu_sieve_require): Rewrite. * libmu_sieve/runtime.c (_mu_i_sv_instr_source): Expect ID index as argument. (_mu_i_sv_instr_push) (_mu_i_sv_instr_pop): Remove unused instructions. * libmu_sieve/sieve.l (file_names): Remove. Use mu_sieve_machine idspace instead. * libmu_sieve/sieve.y (mu_sieve_machine_clone) (mu_sieve_machine_dup): Rewrite. (mu_sieve_machine_destroy): Free idspace and registry * examples/numaddr.c: Reflect changes. * libmu_sieve/extensions/editheader.c: Likewise. * libmu_sieve/extensions/list.c: Likewise. * libmu_sieve/extensions/moderator.c: Likewise. * libmu_sieve/extensions/pipe.c: Likewise. * libmu_sieve/extensions/spamd.c: Likewise. * libmu_sieve/extensions/timestamp.c: Likewise. * libmu_sieve/extensions/vacation.c: Likewise.
Sergey Poznyakoff authored
-
- 03 Dec, 2016 2 commits
-
-
-
* include/mailutils/sieve.h (SVT_IDENT): Remove. * libmu_sieve/comparator.c (mu_sieve_match_part_checker): Remove unused variable. * libmu_sieve/mem.c (mu_sieve_reclaim_list): Remove function. * libmu_sieve/sieve.y: Remove leftover uses of SVT_IDENT. * libmu_sieve/util.c: Likewise. * libmu_sieve/sieve-priv.h: Remove useless prototypes.
Sergey Poznyakoff authored
-
- 02 Dec, 2016 1 commit
-
-
Strings are allocated in a per-machine string space. String and argument lists form contiguous arrays of structures. Regular ex- pressions are compiled when they are needed. Compiled expressions are cached for eventual reuse.
Sergey Poznyakoff authored
-
- 01 Dec, 2016 1 commit
-
-
After successful delivery, maidag would switch back to root privileges too early, due to which the mailbox would be closed when running with root UID. I the property file (.mu-prop) did not exist, it would therefore be created by root. Subsequent attempts to open it by user would fail. One of consequences is that the UIDVALIDITY value would be recalculated each time the mailbox is opened. This would force imap4 clients to rescan mailboxes infinitely, as each scan would change the UIDVALIDITY again. This patch fixes the initialization of UIDVALIDITY and fixes maidag to switch back to root privileges only after closing the mailbox. It also makes sure MH and Maildir mailboxes write .mu-prop upon closing, not upon destroying the mailbox. * libmailutils/base/amd.c (amd_close): Save property. (_amd_scan0): Use mailbox modification time as initial uidvalidity value. * maidag/deliver.c (deliver_to_mailbox): Remove uselsess UID/GID transitions.
Sergey Poznyakoff authored
-
- 29 Nov, 2016 3 commits
-
-
* include/mailutils/sieve.h (mu_sieve_alloc) (mu_sieve_palloc,mu_sieve_prealloc) (mu_sieve_pfree,mu_sieve_pstrdup): Remove. (mu_sieve_mstrdup,mu_sieve_mrealloc) (mu_sieve_mfree): Remove. (mu_sieve_reclaim_t): New typedef. (mu_sieve_calloc,mu_sieve_strdup) (mu_sieve_realloc) (mu_sieve_reclaim_default,mu_sieve_reclaim_list) (mu_sieve_reclaim_value,mu_sieve_reclaim_tag): New functions (mu_sieve_value_create): Change prototype (take mu_sieve_machine_t as first argument) * libmu_sieve/mem.c: New file. * libmu_sieve/Makefile.am: Add new file. * libmu_sieve/comparator.c: Use new allocation functions. * libmu_sieve/prog.c: Likewise. * libmu_sieve/register.c: Likewise. * libmu_sieve/sieve.l: Likewise. * libmu_sieve/sieve.y: Likewise. * libmu_sieve/util.c: Likewise. * doc/texinfo/libmu_sieve.texi: Update (needs revision).
Sergey Poznyakoff authored -
* include/mailutils/list.h (mu_list_remove) (mu_list_remove_nd): Second arg is const. * libmailutils/list/remove.c: Likewise.
Sergey Poznyakoff authored -
-
- 28 Nov, 2016 1 commit
-
-
* include/mailutils/sieve.h (mu_sieve_handler_t): Change signature: remove args and tags arguments, they are contained in struct mu_sieve_machine now. (mu_sieve_get_comparator) (mu_sieve_relcmpn_t): Change signature. (mu_sieve_tag_lookup,mu_sieve_tag_lookup_untyped): Remove (mu_sieve_get_tag,mu_sieve_get_tag_untyped): New protos. (mu_sieve_value_get_optional): Replace by mu_sieve_get_arg_optional. (mu_sieve_value_get_untyped): Replace by mu_sieve_get_arg_untyped. (mu_sieve_value_get): Replace by mu_sieve_get_arg. All uses changed. * libmu_sieve/sieve-priv.h (mu_sieve_machine): New members: arg_list and tag_list * libmu_sieve/runtime.c (instr_run): Set up identifier, arg_list, and tag_list in mu_sieve_machine_t before calling the handler. Reset them afterward. * libmu_sieve/util.c (mu_sieve_value_get_optional): Replace by mu_sieve_get_arg_optional. (mu_sieve_value_get_untyped): Replace by mu_sieve_get_arg_untyped. (mu_sieve_value_get): Replace by mu_sieve_get_arg. (mu_sieve_tag_lookup): Replace by mu_sieve_get_tag (mu_sieve_tag_lookup_untyped): Replace by mu_sieve_get_tag_untyped
Sergey Poznyakoff authored
-
- 26 Nov, 2016 2 commits
-
-
* include/mailutils/sieve.h (mu_sieve_data_type): Remove SVT_VALUE_LIST. (mu_sieve_value_storage): Named union for use in mu_sieve_value_t; remove the tag field. (mu_sieve_tag_lookup): Change prototype. (mu_sieve_value_get): Change prototype. (mu_sieve_value_get_optional) (mu_sieve_value_get_untyped): New functions. (mu_sieve_arg_error): Removed proto. * libmu_sieve/sieve.y: Remove SVT_VALUE_LIST support. * libmu_sieve/util.c (mu_sieve_value_create) (mu_sieve_type_str,mu_sieve_vlist_do): Remove SVT_VALUE_LIST support. (mu_sieve_value_get): Rewrite. (mu_sieve_value_get_untyped) (mu_sieve_value_get_optional): New functions. (mu_sieve_arg_error): Remove. (mu_sieve_tag_lookup): Rewrite. (mu_sieve_tag_lookup_untyped): New function. * doc/texinfo/libmu_sieve.texi: Update. libmu_sieve/tests.c libmu_sieve/actions.c libmu_sieve/extensions/editheader.c libmu_sieve/extensions/list.c libmu_sieve/extensions/moderator.c libmu_sieve/extensions/pipe.c libmu_sieve/extensions/spamd.c libmu_sieve/extensions/timestamp.c libmu_sieve/extensions/vacation.c libmu_sieve/relational.c examples/numaddr.c
Sergey Poznyakoff authored -
* libmu_sieve/sieve-priv.h (sieve_op_t) <unum>: New field. * libmu_sieve/sieve.l: Leave one string interpreter slot.
Sergey Poznyakoff authored
-