1. 23 Nov, 2016 2 commits
    • 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
  2. 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
  3. 11 Nov, 2016 1 commit
  4. 10 Nov, 2016 1 commit
  5. 07 Nov, 2016 1 commit
  6. 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
    • Minor changes · c8ae6507
      Sergey Poznyakoff authored
  7. 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
  8. 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
  9. 02 Nov, 2016 3 commits
    • Bugfix · d644964e
      * 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
  10. 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
  11. 31 Oct, 2016 1 commit
  12. 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
  13. 29 Oct, 2016 3 commits
  14. 28 Oct, 2016 1 commit
    • Bugfix · b48ac923
      * 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
  15. 24 Oct, 2016 2 commits
    • Sergey Poznyakoff authored
    • * include/mailutils/opt.h (MU_PARSEOPT_SPECIAL_ARGS): New flag.
      (mu_parseopt)<po_special_args>: New field.
      * libmailutils/opt/help.c (option_summary)
      (print_program_usage): Print po_special_args, if defined.
      * libmailutils/opt/opt.c (parseopt_init): Initialize po_special_args
      unless MU_PARSEOPT_SPECIAL_ARGS is set.
      
      MH: Advertise [+FOLDER] special argument if the -folder option is declared.
      
      * mh/mh_getopt.c (folder_option): Bugfix: -folder takes argument.
      (mh_getopt): Set po_special_args if the -folder option is declared.
      * mh/inc.c: Fix arg_doc.
      * mh/mhpath.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/rmf.c: Likewise.
      * mh/rmm.c: Likewise.
      * mh/scan.c: Likewise.
      * mh/show.c: Likewise.
      Sergey Poznyakoff authored
  16. 23 Oct, 2016 1 commit
  17. 22 Oct, 2016 5 commits
    • Bugfixes · d8194bb3
      * libmailutils/cli/cli.c (mu_cli_ext): Initialize hints.data
      (accidentally deleted).
      * libmailutils/opt/help.c (mu_option_describe_options): Don't
      display dup_args_note in single-dash mode.
      * libmailutils/opt/progname.c (mu_set_program_name): Free the
      old value after allocating new copy.  This allows to pass
      mu_full_program_name as argument.  Set mu_program_name to point
      to a segment of mu_full_program_name, not the original arg.
      * mh/mh_getopt.c: Remove duplicate version option.
      * po/POTFILES.in: Add missing files.
      Sergey Poznyakoff authored
    • * include/mailutils/cfg.h (MU_CFG_APPEND_TREE): New flag.
      * include/mailutils/cli.h (mu_version_copyright): New extern.
      (mu_cli_ext): New proto.
      * libmailutils/cfg/parser.y (mu_cfg_parse_config): Check for
      MU_CFG_APPEND_TREE bit set before accessing hints->append_tree.
      * libmailutils/cli/cli.c (param_set): Likewise.
      (mu_cli_ext): New function.
      (mu_cli): Rewrite as an entry point to mu_cli_ext.
      
      * comsat/comsat.c: Remove inclusion of obsolete headers.
      * mu/help.c: Likewise.
      * pop3d/extra.c: Likewise.
      Sergey Poznyakoff authored
    • * libmu_auth/ldap.c: Fix compilation without ldap
      * mh/mh_getopt.c: Fix version output to match what MH-E expects
      Sergey Poznyakoff authored
    • * include/mailutils/cli.h (mu_version_func): Rename to mu_version_hook.
      * libmailutils/cli/cli.c: Likewise.
      * pop3d/popauth.c: Likewise.
      * mh/mh_getopt.c: (mh_getopt): Initialize NLS support. Install
      standard version hook (needed for mh-e autodetect feature).
      
      * mh/ali.c: Update prog_doc. Remove NLS initialization.
      * mh/anno.c: Likewise
      * mh/burst.c: Likewise
      * mh/comp.c: Likewise
      * mh/fmtcheck.c: Likewise
      * mh/folder.c: Likewise
      * mh/forw.c: Likewise
      * mh/inc.c: Likewise
      * mh/install-mh.c: Likewise
      * mh/mark.c: Likewise
      * mh/mhl.c: Likewise
      * mh/mhn.c: Likewise
      * mh/mhparam.c: Likewise
      * mh/mhpath.c: Likewise
      * mh/mhseq.c: Likewise
      * mh/msgchk.c: Likewise
      * mh/pick.c: Likewise
      * mh/prompter.c: Likewise
      * mh/refile.c: Likewise
      * mh/repl.c: Likewise
      * mh/rmf.c: Likewise
      * mh/rmm.c: Likewise
      * mh/scan.c: Likewise
      * mh/send.c: Likewise
      * mh/show.c: Likewise
      * mh/sortm.c: Likewise
      * mh/whatnow.c: Likewise
      * mh/whom.c: Likewise
      Sergey Poznyakoff authored
    • This finishes work started at commit bc73fc65.
      
      * include/mailutils/opt.h (mu_option_cache) <cache_arg>: Made const.
      * libmailutils/opt/opt.c (mu_option_cache_destroy): Don't free cache_arg.
      * doc/texinfo/mu-mh.texi: Update.
      
      * po/POTFILES.in: Remove obsolete files.
      * mh/tests/refile.at: Don't use double-dash options.
      
      * mh/mh_getopt.c (mh_opt_set_folder): New function.
      * mh/mh_getopt.h: Likewise.
      
      * mh/mhn.c: Convert to mh_getopt.
      * mh/mhparam.c: Likewise.
      * mh/mhpath.c: Likewise.
      * mh/mhseq.c: Likewise.
      * mh/msgchk.c: Likewise.
      * mh/pick.c: Likewise.
      * mh/pick.h: Likewise.
      * mh/pick.y: Likewise.
      * mh/prompter.c: Likewise.
      * mh/refile.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/rmf.c: Likewise.
      * mh/rmm.c: Likewise.
      * mh/scan.c: Likewise.
      * mh/send.c: Likewise.
      * mh/show.c: Likewise.
      * mh/sortm.c: Likewise.
      * mh/whatnow.c: Likewise.
      * mh/whom.c: Likewise.
      Sergey Poznyakoff authored
  18. 21 Oct, 2016 1 commit
    • MH utilities will use only single-dash long options.
      
      * include/mailutils/opt.h (mu_option) <opt_default>: New member.
      * libmailutils/opt/opt.c (find_long_option): Improve detection
      of ambiguous options.
      (mu_option_set_value): Use default value (opt_default), if
      supplied.
      * mh/mh_argp.c: Delete.
      * mh/Makefile.am (libmh_a_SOURCES): Remove mh_argp.c
      * mh/mh_getopt.c: Rewrite from scratch using mailutils/opt
      * mh/mh_getopt.h: Likewise.
      * mh/mh.h: Add missing includes
      (mh_read_formfile, mh_alias_read): Change signatures.
      * mh/mh_alias.l (mh_alias_read): Name is const
      * mh/mh_init.c (mh_read_formfile): Name is const.
      
      * mh/ali.c: Convert to mh_getopt.
      * mh/anno.c: Likewise.
      * mh/burst.c: Likewise.
      * mh/comp.c: Likewise.
      * mh/fmtcheck.c: Likewise.
      * mh/folder.c: Likewise.
      * mh/forw.c: Likewise.
      * mh/inc.c: Likewise.
      * mh/install-mh.c: Likewise.
      * mh/mark.c: Likewise.
      * mh/mhl.c: Likewise.
      * mh/scan.c: Likewise.
      
      * mh/tests/burst.at: Don't use double-dash options
      * mh/tests/folder.at: Likewise.
      Sergey Poznyakoff authored
  19. 20 Oct, 2016 3 commits
    • * include/mailutils/opt.h (MU_PARSEOPT_SINGLE_DASH)
      (MU_PARSEOPT_NEGATION): New flags.
      (mu_parseopt) <po_negation, po_long_opt_start>: New fields.
      (mu_option_describe_options): Change signature.
      * libmailutils/opt/help.c (init_usage_vars): Initialize
      long_opt_col depending on the value of MU_PARSEOPT_SINGLE_DASH
      bit.
      (print_option): Handle single-dash long options and boolean
      options with negations.
      (option_summary): Likewise.
      (mu_option_describe_options): Take struct mu_parseopt *
      as its second parameter.
      * libmailutils/opt/opt.c (find_long_option): Handle
      boolean options with negations.  Return also a pointer
      to the mu_option describing the originally used option
      (as opposed to the canonical one returned by the function).
      (parse): Handle single-dash long options.
      (parseopt_init): Initialize po_negation and po_long_opt_start.
      * libmailutils/tests/parseopt.c (parseopt_param): Handle
      MU_PARSEOPT_SINGLE_DASH and MU_PARSEOPT_NEGATION.
      Sergey Poznyakoff authored
    • * libmailutils/stream/wordwrap.c (set_margin): Flush the stream
      if the new margin equals the current offset.
      (_wordwrap_write): Fix conditional
      Sergey Poznyakoff authored
    • * mu/ldflags.c: Ignore "cfg" and "argp" keywords.
      Sergey Poznyakoff authored
  20. 19 Oct, 2016 3 commits
    • Minor fix · 3619df58
      Sergey Poznyakoff authored
    • * Makefile.am: Remove libmu_argp and libmu_cfg
      * configure.ac: Likewise.
      * libmu_argp/: Remove.
      * libmu_cfg/: Remove.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Remove gocs.h,
      libargp.h, libcfg.h
      
      * frm/frm.c: Register tls auth module
      * frm/from.c: Likewise.
      * maidag/maidag.c: Likewise.
      * mail/mail.c: Likewise.
      * messages/messages.c: Likewise.
      * movemail/movemail.c: Likewise.
      * readmsg/readmsg.c: Likewise.
      * sieve/sieve.c: Likewise.
      * frm/frm.h: Remove obsolete includes
      
      * imap4d/Makefile.am: Update.
      * imap4d/imap4d.c: Use mu_cli for command line and configuration
      parsing.
      * imap4d/imap4d.h: Update.
      
      * include/mailutils/gocs.h: Remove.
      * libmailutils/cfg/gocs.c: Remove.
      * libmailutils/cfg/Makefile.am: Remove gocs.c
      
      * include/mailutils/cli.h (mu_cli_capa_apply): Rename to
      mu_cli_capa_extend_settings
      (mu_cli_setup) <inorder, prog_doc_hook>: New fields.
      * include/mailutils/daemon.h: Remove obsolete includes.
      * include/mailutils/gsasl.h: Likewise.
      * include/mailutils/mailutils.h: Update.
      * include/mailutils/mu_auth.h (mu_auth_mode): New enum
      (mu_auth_module): Redo structure.
      * include/mailutils/opt.h (mu_parseopt) <po_prog_doc_hook>: New field.
      * include/mailutils/sql.h (mu_sql_module_config): New extern.
      (mu_sql_interface_index): Change proto.
      * libmailutils/auth/mu_auth.c: Rewrite.
      * libmailutils/auth/system.c (mu_auth_system_module): Update structure
      * libmailutils/cli/capa.c (mu_cli_capa_apply): Rename to
      mu_cli_capa_extend_settings
      * libmailutils/cli/cli.c: Extend settings from auth modules as well.
      * libmailutils/opt/help.c (mu_program_help): Invoke po_prog_doc_hook
      if defined.
      * libmailutils/opt/opt.c (parseopt_init): Check the
      MU_PARSEOPT_PROG_DOC_HOOK flag.
      (find_long_option): Fix recognition of ambiguous options in case
      of exact match.
      * libmu_auth/gsasl.c: Add configuration.
      * libmu_auth/ldap.c: Likewise.
      * libmu_auth/pam.c: Likewise.
      * libmu_auth/radius.c: Likewise.
      * libmu_auth/sql.c: Likewise.
      * libmu_auth/tls.c: Likewise.
      * libmu_auth/virtual.c: Likewise.
      
      * mu/Makefile.am: Update.
      * mu/mu.c: Rewrite using mu_cli
      * mu/mu.h: Likewise.
      * mu/acl.c: Likewise.
      * mu/cflags.c: Likewise.
      * mu/dbm.c: Likewise.
      * mu/dispatch.c: Likewise.
      * mu/filter.c: Likewise.
      * mu/flt2047.c: Likewise.
      * mu/getans.c: Likewise.
      * mu/getarg.c: Likewise.
      * mu/getyn.c: Likewise.
      * mu/help.c: Likewise.
      * mu/imap.c: Likewise.
      * mu/info.c: Likewise.
      * mu/ldflags.c: Likewise.
      * mu/logger.c: Likewise.
      * mu/pop.c: Likewise.
      * mu/query.c: Likewise.
      * mu/send.c: Likewise.
      * mu/shell.c: Likewise.
      * mu/smtp.c: Likewise.
      * mu/util.c: Likewise.
      * mu/verbose.c: Likewise.
      * mu/wicket.c: Likewise.
      
      * pop3d/Makefile.am: Update.
      * pop3d/pop3d.c: Convert to mu_cli interface.
      * pop3d/pop3d.h: Likewise.
      
      * sql/sql.c (mu_sql_interface_index): Change argument qualifiers.
      Sergey Poznyakoff authored
  21. 17 Oct, 2016 1 commit
  22. 16 Oct, 2016 2 commits