1. 03 Dec, 2016 2 commits
  2. 02 Dec, 2016 1 commit
  3. 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
  4. 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
  5. 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
  6. 26 Nov, 2016 3 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
    • * libmailutils/list/sort.c (mu_list_sort_r): New function.
      * include/mailutils/list.h: Provide prototype.
      Sergey Poznyakoff authored
  7. 25 Nov, 2016 1 commit
    • * libmu_sieve/encoded.c: New file.
      * libmu_sieve/strexp.c: New file.
      * libmu_sieve/Makefile.am: Add new files.
      * libmu_sieve/require.c (mu_sieve_require): Understand "encoded-character".
      * libmu_sieve/sieve-priv.h (mu_i_sv_interp_t): New typedef.
      (mu_i_sv_expand_encoded_char): New proto.
      (mu_sieve_require_encoded_character): New proto.
      * libmu_sieve/sieve.l (string): Rewrite via line_.* functions.  This
      fixes memory leaks on mu_sieve_machine_destroy.
      (line_finish): Expand ${} sequences before returning.
      (mu_sieve_require_encoded_character): New function.
      * sieve/tests/enc-char.at: New file.
      * sieve/tests/Makefile.am: Add enc-char.at
      * sieve/tests/testsuite.at: Likewise.
      Sergey Poznyakoff authored
  8. 24 Nov, 2016 4 commits
    • * include/mailutils/sieve.h (mu_sieve_action_log_t): Change proto.
      * lib/sieve.c (_sieve_action_log): Rewrite.
      * libmu_sieve/util.c (mu_sieve_log_action): Rewrite.
      * python/libmu_py/sieve.c (_sieve_action_printer): Rewrite.
      * sieve/sieve.c (_sieve_action_log): Rewrite.
      Sergey Poznyakoff authored
    • * include/mailutils/sieve.h (MU_SIEVE_DEBUG_TRACE)
      (MU_SIEVE_DEBUG_INSTR,MU_SIEVE_DEBUG_DISAS)
      (MU_SIEVE_DRY_RUN): Remove.
      (mu_sieve_machine_init_ex): Remove proto.
      (mu_sieve_set_dbg_stream,mu_sieve_get_dbg_stream)
      (mu_sieve_stream_save)
      (mu_sieve_stream_restore): New protos.
      * libmu_sieve/runtime.c (INSTR_DISASS,INSTR_DEBUG): Reimplement.
      * libmu_sieve/sieve-priv.h (MU_SV_SAVED_ERR_STATE)
      (MU_SV_SAVED_DBG_STATE,MU_SV_SAVED_STATE): New bitflags.
      (mu_sieve_state_disass): New constant.
      (mu_sieve_machine)<state_flags, err_mode>
      <err_locus,dbg_mode,dbg_locus>: New members.
      <dbgstream>: New member.
      * libmu_sieve/sieve.y (mu_sieve_machine_init_ex): Remove.
      (mu_sieve_machine_dup, mu_sieve_machine_inherit): Fix.
      (mu_sieve_set_dbg_stream)
      (mu_sieve_get_dbg_stream): New functions.
      (mu_sieve_machine_destroy): Destroy dbgstream.
      (with_machine): Preserve stream state (mode & locus).
      * libmu_sieve/util.c (mu_i_sv_debug,mu_i_sv_debug_command): Use ioctl
      instead of format strings.
      (mu_sieve_stream_save, mu_sieve_stream_restore): New functions.
      * python/libmu_py/sieve.c (api_sieve_machine_init): Use
      mu_sieve_machine_init.
      * sieve/sieve.c: Improve help output.
      (main): Dump disassembled code to standard output.
      Sergey Poznyakoff authored
    • * libmu_sieve/runtime.c (_mu_i_sv_instr_nop): Remove.
      * libmu_sieve/sieve-priv.h: Likewise.
      Sergey Poznyakoff authored
    • * bootstrap.conf (mu_sieve_debug, mu_sieve_trace): Remove.
      * include/mailutils/sieve.h (mu_sieve_debug): Remove.
      
      * examples/numaddr.c: Remove calls to mu_sieve_trace.
      * 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.
      * libmu_sieve/tests.c: Likewise.
      
      * libmu_sieve/runtime.c: Use new debugging/tracing functions.
      * libmu_sieve/sieve-priv.h (mu_i_sv_debug, mu_i_sv_trace)
      (mu_i_sv_debug_command)
      (mu_i_sv_argf, mu_i_sv_valf): New prototypes.
      * libmu_sieve/sieve.y (mu_i_sv_valf, mu_i_sv_argf): New functions.
      * libmu_sieve/util.c (mu_sieve_debug): Remove.
      (mu_i_sv_print_value_list): Remove.
      (mu_i_sv_print_tag_list): Remove.
      (mu_sieve_trace): Remove.
      (mu_i_sv_tagf): New function.
      (mu_i_sv_debug): New function.
      (mu_i_sv_trace): New function.
      (mu_i_sv_debug_command): New function.
      Sergey Poznyakoff authored
  9. 23 Nov, 2016 4 commits
    • Sergey Poznyakoff authored
    • Instead of keeping individual debug flags for each Sieve machine,
      use global debugging mechanism, category "sieve".  The following
      levels are defined:
      
        trace1  -  print parse tree before optimization
        trace2  -  print parse tree after optimization
        trace3  -  print parser traces
        trace4  -  print tests and actions being executed
        trace8  -  print disassembled code, don't run
        trace9  -  print each Sieve instruction being executed
      
      * include/mailutils/sieve.h (mu_sieve_get_debug_level)
      (mu_sieve_set_debug_level): Remove.
      (mu_sieve_is_dry_run,mu_sieve_set_dry_run
      * lib/script.c (mu_script_debug_flags): Redo.
      * lib/sieve.c (sieve_init): Remove call to obsoleted
      mu_sieve_set_debug_level.
      
      * examples/numaddr.c: Use mu_sieve_trace
      * 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.
      * libmu_sieve/tests.c: Likewise.
      
      * libmu_sieve/runtime.c (INSTR_DEBUG,INSTR_DISASS): Rewrite.
      (mu_sieve_get_debug_level): Remove.
      (mu_sieve_is_dry_run_: Rewrite.
      (mu_sieve_set_dry_run): New function.
      (mu_sieve_disass): Rewrite.
      * libmu_sieve/sieve-priv.h (mu_sieve_machine) <debug_level>: Remove.
      <dry_run>: New field.
      * libmu_sieve/sieve.y (mu_sieve_set_debug_level): Remove.
      * libmu_sieve/util.c (mu_sieve_trace): New function.
      * sieve/sieve.c: Rewrite support for --dry-run and --debug.
      
      * sieve/tests/ext.at: Use --libdir-prefix instead of -L
      Sergey Poznyakoff authored
    • Prefix internal function names with mu_i_
      Sergey Poznyakoff authored
    • Three objectives:
      
      1. Simplify code.
      2. Produce optimized sieve code.
      3. Improve error reporting.
      4. Prepare for further extensions
      
      * include/mailutils/sieve.h (mu_sieve_tag_checker_t): Change
      signature (take mu_sieve_machine_t as the first arg).  All
      uses changed.
      (mu_sieve_require): Likewise.
      (mu_sieve_yydebug): Remove global.
      
      * libmu_sieve/sieve-priv.h (mu_locus_range): New struct.
      (YYLTYPE): New define
      (mu_sieve_state): New enum.
      (mu_sieve_machine): New members: string_pool, state.
      (mu_sieve_node_type): New enum.
      (mu_sieve_node): New struct.
      Remove unused prototypes.
      
      * libmu_sieve/sieve.l: Keep track of code locations.  Use opool
      for constructing string values.
      * libmu_sieve/sieve.y: Rewrite.  First build the parse tree.  Then
      optimize it.  Finally, generate code.
      * libmu_sieve/tests.c (sieve_test_true,sieve_test_false): Remove.
      True and false tests are always optimized away.
      * libmu_sieve/util.c (mu_sv_compile_error): Remove.
      
      * libmu_sieve/actions.c: Use mu_diag_at_locus to report errors
      and mu_i_sv_error to mark sieve machine as being in error state.
      * libmu_sieve/comparator.c: Likewise.
      * libmu_sieve/prog.c (mu_sv_code): Replace with mu_i_sv_code.
      (mu_sv_code_instr,mu_sv_code_handler)
      (mu_sv_code_list,mu_sv_code_number)
      (mu_sv_code_string,mu_sv_code_source)
      (mu_sv_code_line,mu_sv_change_source)
      (mu_sv_code_action,mu_sv_code_test)
      (mu_sv_code_anyof,mu_sv_code_allof): Remove.
      (mu_i_sv_locus,mu_i_sv_code_action)
      (mu_i_sv_code_test): New function.
      (mu_sv_code_command): Replace with a static function.
      * libmu_sieve/require.c (mu_sieve_require): Take ptr to machine
      as the first arg.
      * libmu_sieve/runtime.c (mu_sieve_mailbox)
      (mu_sieve_message): Refuse to run if the machine is in error state.
      
      * sieve/sieve.c: Update.
      * sieve/tests/i-numeric.at: Update expected error message.
      
      * libmailutils/diag/diag.c (mu_diag_at_locus): Don't pass locus
      if mu_file is NULL.
      * libmu_auth/ldap.c (_mu_entry_to_auth_data): Remove leftover
      mu_error.
      Sergey Poznyakoff authored
  10. 14 Nov, 2016 1 commit
    • This was accidentally broken by commit eea2c4aa.
      
      * include/mailutils/mailbox.h (mu_mailbox_expand_name): New proto.
      * libmailutils/mailbox/mbx_default.c (mu_mailbox_expand_name): New function.
      (mu_mailbox_create_default): Use it.
      (mu_set_folder_directory): Accept NULL as argument.
      (mu_folder_directory): Reset default value after assiging it.  This way
      the folder directory still defaults to the same value as earlier, but
      can be reset to NULL, if so desired.
      (plus_expand): Return a copy of the input string if folder is NULL.
      
      * mail/copy.c (append_to_mailbox): Use mu_mailbox_create, as the mailbox
      name has already been expanded.
      * mail/file.c (mail_expand_name): Use mu_mailbox_expand_name.
      (mail_file): Use mu_mailbox_create, as the mailbox
      name has already been expanded.
      * mail/mailvar.c (mailvar_cmd): New enum.
      (mailvar_symbol) <handler>: Change signature and return type.
      (mailvar_set): Rewrite. Take care not to modify the variable
      if the handler (if any) returns non-null or if the memory can't
      be allocated.
      (set_folder): Handler for the "folder" variable.
      
      * mail/tests/copy01.at: New testcase.
      * mail/tests/copy02.at: New testcase.
      * mail/tests/copy03.at: New testcase.
      * mail/tests/copy04.at: New testcase.
      * mail/tests/Makefile.am: Add new tests.
      * mail/tests/testsuite.at (MUT_MAIL_CMD): Set MAILRC to /dev/null.
      Add new tests.
      Sergey Poznyakoff authored
  11. 11 Nov, 2016 1 commit
  12. 10 Nov, 2016 1 commit
  13. 07 Nov, 2016 1 commit
  14. 05 Nov, 2016 3 commits
    • * libmailutils/opt/opt.c (sort_group): Don't assume stability of the sort.
      Use auxiliary data structure to sort array of options that contain aliases.
      * libmailutils/tests/parseopt.c (set_prog_args): Fix delimiter.
      * libmailutils/tests/strtoc.c (v_cidr_format): Error checking.
      * maidag/Makefile.am (maidag_LDADD): Reorder libraries to make sure maidag
      uses freshly built libraries (not the ones already installed in the system).
      * mh/pick.c (options): Bugfix.
      Sergey Poznyakoff authored
    • Sergey Poznyakoff authored
    • Sergey Poznyakoff authored
  15. 04 Nov, 2016 1 commit
    • * mail/escape.c (parse_headers): Moved to send.c
      (check_headers): New function.
      (escape_continue): Use check_headers.
      * mail/mail.c (read_recipients): New variable.
      The -t option sets read_recipients and editheaders
      * mail/mail.h (parse_headers): New proto.
      * mail/send.c: Special handling for -t option.
      (parse_headers): New function.
      * movemail/movemail.c (onerror statement): Accept a list as
      argument.
      
      * doc/texinfo/mailutils.texi: Update.
      * doc/texinfo/programs.texi: Update.
      Sergey Poznyakoff authored
  16. 03 Nov, 2016 1 commit
    • The field-map statement (.ldap.field-map & .sql.field-map) takes a
      list of mappings as argument.  For compatibility and for internal purposes,
      a string is still allowed.
      
      * doc/texinfo/programs.texi: Update.
      * include/mailutils/cfg.h (mu_cfg_field_map): New proto.
      * include/mailutils/sql.h (mu_password_type): Rename.
      (mu_sql_module_config) <positional>: Remove.
      (mu_sql_decode_password_type): Remove prototype.
      * libmailutils/base/mutil.c (mu_sql_decode_password_type): Remove
      function.
      * libmailutils/cfg/driver.c (mu_cfg_field_map): New function.
      * libmu_auth/ldap.c (cb_field_map): Use mu_cfg_field_map.
      (module_init): Fix default filter.
      * libmu_auth/sql.c (cb_field_map): Use mu_cfg_field_map.
      (mu_sql_param): Rename "password-type" statement to "password-encryption".
      Remove the "positional" statement.
      Sergey Poznyakoff authored
  17. 02 Nov, 2016 3 commits
    • * libmailutils/cfg/parser.y (mu_cfg_parse_config): Silently ignore
      ENOENT
      Sergey Poznyakoff authored
    • The default configuration file name is "mailutils.conf".  Legacy
      configuration file "mailutils.rc" is processed if necessary.
      
      * libmailutils/cli/cli.c: Rename main configuration file to mailutils.conf
      Remove 'rcfile' option aliases.
      (mu_cli_ext): Special handling for legacy configuration file.
      * NEWS: Update.
      * doc/texinfo/mailutils.texi: Update.
      * doc/texinfo/programs.texi: Update.
      Sergey Poznyakoff authored
    • * include/mailutils/cfg.h (mu_cfg_parse_hints):
      Rename site_rcfile to site_file, custom_rcfile to custom_file.
      Remove append_tree and data fields.
      (MU_PARSE_CONFIG_GLOBAL,MU_CFG_PARSE_PROGRAM): Remove.
      (MU_PARSE_CONFIG_VERBOSE): Rename to MU_CF_VERBOSE.
      (MU_PARSE_CONFIG_DUMP): Rename to MU_CF_DUMP.
      (MU_CFG_FMT_LOCUS): Rename to MU_CF_FMT_LOCUS.
      (MU_CFG_FMT_VALUE_ONLY): Rename to MU_CF_FMT_VALUE_ONLY.
      (MU_CFG_FMT_PARAM_PATH): Rename to MU_CF_FMT_PARAM_PATH.
      
      (MU_CFG_COMPATIBILITY,MU_CFG_DEPRECATED): Remove.
      (mu_parse_config, mu_get_config): Remove deprecated functions.
      
      * libmailutils/cli/cli.c (mu_general_help_text): New global.
      (app_data): New struct.
      (init_options): Construct configuration option group depending on
      which configuration files are in use.
      (mu_cli_ext): Don't use per-user configuration files for servers.
      Pass pointer to app_data structure as po.po_data
      (mu_cli): Set MU_CFHINT_PER_USER_FILE flag by default.
      
      * mail/testsuite/lib/mail.exp: Rewrite invocation of the mu_init command.
      * include/mailutils/cli.h (mu_cli_setup) <server>: New field.
      
      * comsat/comsat.c (cli): Mark as server.
      (main): Bugfix: pass pointer to server to mu_cli.
      * imap4d/imap4d.c (cli): Mark as server.
      * pop3d/pop3d.c: Likewise.
      
      * comsat/tests/testsuite.at: Use the --no-site-config
      option.
      * imap4d/tests/testsuite.at: Likewise.
      
      * libmailutils/cfg/driver.c: Update.
      * libmailutils/cfg/format.c: Update.
      * libmailutils/cfg/lexer.l: Update.
      * libmailutils/cfg/parser.y: Update.
      * mu/acl.c: Update.
      
      * pop3d/testsuite/lib/pop3d.exp: Likewise.
      
      * mu/mu.c: Don't read configuration files.
      * mu/query.c: Fix args_doc
      
      * testsuite/lib/mailutils.exp (mu_init): Change option handling.
      Set --no-config option by default.
      Sergey Poznyakoff authored
  18. 01 Nov, 2016 2 commits
    • * libmailutils/stream/logstream.c (_log_write): Force MU_LOG_LOCUS
      mode if the locus is given explicitly.
      Sergey Poznyakoff authored
    • * mh/mh_getopt.c (mh_opt_notimpl_warning): For boolean options,
      don't emit warning if the value would be set to false.
      * mh/anno.c: Fix the type of boolean unimplemented options.
      * mh/refile.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/send.c: Likewise.
      Sergey Poznyakoff authored
  19. 31 Oct, 2016 1 commit
  20. 30 Oct, 2016 1 commit
    • * configure.ac: Version 2.99.993
      * NEWS: Update.
      
      * include/mailutils/opool.h (MU_OPOOL_DEFAULT)
      (MU_OPOOL_ENOMEMABRT): New defines.
      (mu_opool_create): Change meaning of the 2nd argument. All uses updated.
      (mu_opool_free, mu_opool_dup): New proto.
      * libmailutils/base/opool.c (_mu_opool) <memerr>: Replace with flags.
      <head,tail,free>: Rename.
      (mu_opool_free, mu_opool_dup): New functions.
      (mu_opool_head): Bugfix.
      Sergey Poznyakoff authored
  21. 29 Oct, 2016 3 commits
  22. 28 Oct, 2016 1 commit
    • * configure.ac: Version 2.99.992
      * NEWS: Update.
      * libmailutils/opt/opt.c (add_option_cache): Use opt_default if
      no argument is given.
      Sergey Poznyakoff authored