1. 18 Nov, 2010 2 commits
    • * mh/prompter.c (main): Append terminating \0 to the opool.
      Sergey Poznyakoff authored
    • * configure.ac (MU_COND_READLINE): New cond.
      * mh/prompter.c: New file.
      * mh/prompter-rl.c: New file.
      * mh/prompter-tty.c: New file.
      * mh/prompter.h: New file.
      * mh/TODO: Update.
      * mh/Makefile.am: Build prompter.
      
      * doc/texinfo/mu-mh.texi: Document prompter
      * po/POTFILES.in: Update.
      Sergey Poznyakoff authored
  2. 17 Nov, 2010 1 commit
    • * include/mailutils/filter.h (mu_filter_xcode_t): Change signature.
      (mu_filter_create_args): New proto.
      (mu_inline_comment_filter): New extern.
      
      * libmailutils/filter/inline-comment.c: New file.
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add inline-comment.c.
      * libmailutils/filter/crlfdot.c (alloc_state): Update declaration.
      * libmailutils/filter/crlfflt.c: Likewise.
      * libmailutils/filter/dot.c: Likewise.
      * libmailutils/filter/fromflt.c (_from_alloc_state): Likewise.
      * libmailutils/filter/filter.c (mu_filter_create_args): New function.
      (mu_filter_create): Rewrite via mu_filter_create_args.
      
      mh: inline comments are allowed for use in components and forwcomp files.
      
      * mh/compcommon.c (mh_comp_draft): Fix erroneous conditional.
      * mh/components: Add comments.
      * mh/mh_init.c (mh_file_copy): Rewrite using new API.
      
      mu filter: new option to list supported filters.
      
      * mu/filter.c (filter_options): New option --list (-L).
      (filter_parse_opt): Handle the -L option.
      (filter_printer, list_filters): New functions.
      (main): Print a list of filters if --list was given.
      Sergey Poznyakoff authored
  3. 16 Nov, 2010 5 commits
  4. 15 Nov, 2010 5 commits
    • * libmailutils/stream/message_stream.c (copy_trimmed_value): Fix
      memory allocation.
      Sergey Poznyakoff authored
    • * mh/ali.c (ali_print_name_list): Print -list output.
      * mh/tests/ali.at: New test case.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add ali.at
      * mh/tests/testsuite.at: Include ali.at.
      * mh/tests/anno.at: Fix MH_KEYWORDS definition.
      * mh/tests/folder.at: Likewise.
      * mh/tests/inc.at: Likewise.
      * mh/tests/mark.at: Likewise.
      * mh/tests/mhl.at: Likewise.
      * mh/tests/mhparam.at: Likewise.
      * mh/tests/mhpath.at: Likewise.
      * mh/tests/refile.at: Likewise.
      * mh/tests/rmf.at: Likewise.
      
      * mh/tests/pick.at: Fix MH_KEYWORDS definition. Add more tests.
      Sergey Poznyakoff authored
    • * mh/mh_init.c (mh_install): Exit with code 1 on errors.
      * mh/tests/install-mh.at: New file.
      * mh/tests/pick.at: New file.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add install-mh.at, pick.at.
      * mh/tests/testsuite.at: Include install-mh.at and pick.at.
      Sergey Poznyakoff authored
    • * mh/mh_argp.c (mh_argp_children): Set group number -2, to place
      help output between the application help and informational options.
      * mh/mhn.c (options): Regroup options,
      * mh/pick.c: Likewise.
      
      * mh/ali.c: Reword arg docs.
      * 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/mh_argp.c: Likewise.
      * mh/mhl.c: Likewise.
      * mh/mhn.c: Likewise.
      * mh/mhparam.c: Likewise.
      * mh/mhpath.c: Likewise.
      * mh/pick.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/sortm.c: Likewise.
      * mh/whom.c: Likewise.
      Sergey Poznyakoff authored
    • * mh/mh_getopt.h (mh_option): Move match_len to the end of the
      structure.  It should not be initialized.
      (mh_option_init): New prototype.
      
      * mh/mh_getopt.c (mh_option_init): New function.
      * mh/mh_argp.c (mh_argp_parse): Call mh_option_init.
      
      * mh/ali.c: Update mh_option declaration.
      * 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/pick.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/sortm.c: Likewise.
      * mh/whatnow.c: Likewise.
      * mh/whom.c: Likewise.
      Sergey Poznyakoff authored
  5. 14 Nov, 2010 1 commit
    • The traditional component matching syntax, `--COMP STRING', is
      accepted, provided at least one of the following conditions is met:
      
      1. The word `COMP' contains at least one capital letter;
      2. The word `COMP' ends with a colon;
      3. Standard input is not connected to a terminal.
      
      * mh/mh_getopt.c (mh_help_hook): New global variable.
      (mh_help): Call mh_help_hook, if set.
      * mh/mh_getopt.h (mh_help_hook): New extern.
      * mh/pick.c (doc): Update.
      (opt_handler): Remove ARGP_KEY_ERROR case.
      (pick_help_hook): New function.
      (main): Convert any instance of `--comp string' to
      `--component=comp --pattern=string', if comp contains a
      capital letter or ends with a colon, or fd 0 is not connected
      to terminal.
      * doc/texinfo/mu-mh.texi: Document changes to pick.
      Sergey Poznyakoff authored
  6. 12 Nov, 2010 1 commit
    • Replace 'Mirddin.farlep.net' with 'example.net' throughout the
      testsuite.  Change expected message/part sizes accordingly.
      Files changed:
      
      * imap4d/testsuite/imap4d/fetch.exp
      * mail/testsuite/mail/folder.exp
      * mail/testsuite/mail/read.exp
      * mail/testsuite/mail/write.exp
      * mh/tests/scan.at
      * readmsg/tests/all.at
      * testsuite/maildir/mbox1/new/1284628225.M20118P3883Q2.Trurl
      * testsuite/maildir/mbox1/new/1284628225.M21284P3883Q3.Trurl
      * testsuite/maildir/mbox1/new/1284628225.M22502P3883Q4.Trurl
      * testsuite/mh/mbox1/3
      * testsuite/mh/mbox1/4
      * testsuite/mh/mbox1/5
      * testsuite/mime.at
      * testsuite/spool/mbox
      * testsuite/spool/mbox1
      * testsuite/spool/relational.mbox
      Sergey Poznyakoff authored
  7. 11 Nov, 2010 3 commits
    • * doc/texinfo/nullstream.texi: New file.
      
      * mh/mh_init.c (mh_real_install): Use mu_stream_t instead of
      FILE.
      * mh/mh_whatnow.c (_whatnow): Likewise.
      Sergey Poznyakoff authored
    • * mh/mh_init.c (mh_init): Make sure stdin is open.
      * mh/anno.c (main): Use mu_stream_t to read the answer from stdin.
      Do not display prompt if stdin is not connected to a tty.
      * mh/tests/anno.at: New testcase.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add anno.at
      * mh/tests/testsuite.at: Include anno.at.
      
      * doc/texinfo/mu-mh.texi: Document the changes in the behavior of anno.
      Sergey Poznyakoff authored
    • Mhl now accepts the traditional use of "ignores=", i.e. as a single
      statement on a line and without double-quotes around the argument.
      
      Additional quotes around variable values are not needed in most
      cases.
      
      The name of a component is not printed if that component is not
      present.
      
      The offset variable works as in MH and nmh.
      
      * mh/mh_list.c (parse_variable): Accept traditional use of
      "ignores=", as a single statement on a line, without double-quotes around
      the argument.
      (mhl_format_compile): Use mu_streams instead of FILE.
      Fix line counting.
      (header_is_printed, want_header): Last argument is const char *.
      (ovf_print): Move to the specified offset no matter what the value
      of prefix is.
      (print_component_name): New function.
      (eval_component): Call print_component_name and newline, if necessary
      (eval_body): Likewise.
      (eval_extras): Likewise.
      (eval_comp): Do not print component name, leave that to the called
      function.  Ditto for the trailing newline.
      * mh/mhl.c: Ignore empty moreproc value.
      * mh/mhl.format: Remove extra double-quotes.
      
      * mh/tests/mhl.at: New testcase.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add mhl.at
      * mh/tests/testsuite.at: Include mhl.at
      
      * libmailutils/string/wordsplit.c (scan_qstring): Force _WSNF_EMPTYOK.
      (mu_wordsplit_len): Make sure the tail element is not joinable
      * libmailutils/tests/wordsplit.at: Test these changes.
      
      * doc/texinfo/mu-mh.texi: Update the description of mhl.
      Sergey Poznyakoff authored
  8. 10 Nov, 2010 4 commits
    • * configure.ac (mh/tests): New testdir
      * mh/Makefile.am (SUBDIRS): Add tests
      
      * tests/Makefile.am: New file.
      * mh/tests/Makefile.am: New file.
      * mh/tests/atlocal.in: New file.
      * mh/tests/folder.at: New file.
      * mh/tests/inc.at: New file.
      * mh/tests/mark.at: New file.
      * mh/tests/mhparam.at: New file.
      * mh/tests/mhpath.at: New file.
      * mh/tests/refile.at: New file.
      * mh/tests/rmf.at: New file.
      * mh/tests/rmm.at: New file.
      * mh/tests/scan.at: New file.
      * mh/tests/testsuite.at: New file.
      * mh/tests/.gitignore: New file.
      
      * testsuite/testsuite.inc (MUT_MBCOPY): Work correctly if
      DST is a directory name (for MH and maildir formats).
      
      * mh/folder.c (action_list): Treat empty value as
      equal to no value.
      * mh/install-mh.c (main): Honor MH environment variable.
      * mh/mh_ctx.c (mh_context_read, mh_context_write): Use MU streams
      instead of stdio FILE.
      (mh_context_iterate): Add error checking.
      Do not coredump on NULL header.
      * mh/mh_global.c (_mh_init_global_sequences): Destroy sequences.
      * mh/TODO: Update.
      
      * libmailutils/stream/message_stream.c (copy_trimmed_value): New
      static function.
      (scan_stream): Strip final newline from the saved envelope values.
      
      * mu/Makefile.am (BUILD_SOURCES, EXTRA_DIST): Add
      mu-setup.c and mu-setup.h.
      Sergey Poznyakoff authored
    • * mh/mhn.c (_get_hdr_value): Remove.  All callers modified to use
      mu_header_aget_value_unfold instead.
      (mhn_message_size): Type of 2nd arg is mu_off_t *.
      Use null stream & stream stats in realsize mode.
      (list_handler): Fix rounding of the message size.
      (copy_header): Use mu_header_sget* to avoid unnecessary
      memory allocations.
      Sergey Poznyakoff authored
    • * include/mailutils/stream.h (MU_IOCTL_NULLSTREAM_SET_PATTERN)
      (MU_IOCTL_NULLSTREAM_SET_PATCLASS)
      (MU_IOCTL_NULLSTREAM_SETSIZE)
      (MU_IOCTL_NULLSTREAM_CLRSIZE): New ioctl opcodes.
      (mu_nullstream_pattern): New struct.
      (MU_STREAM_STAT_IN,MU_STREAM_STAT_OUT)
      (MU_STREAM_STAT_READS,MU_STREAM_STAT_WRITES)
      (MU_STREAM_STAT_SEEKS,_MU_STREAM_STAT_MAX): New defines.
      (MU_STREAM_STAT_MASK): New macro.
      (MU_STREAM_STAT_MASK_ALL): New define.
      (mu_stream_stat_buffer): New typedef.
      (mu_stream_set_stat, mu_stream_get_stat)
      (mu_nullstream_create): New protos.
      (mu_stream_bytes_in, mu_stream_bytes_out): Remove protos.
      
      * include/mailutils/sys/nullstream.h: New file.
      * include/mailutils/sys/stream.h (_mu_stream) <bytes_in>,
      <bytes_out>: Remove.
      <statmask,statbuf>: New members.
      * include/mailutils/sys/Makefile.am (sysinclude_HEADERS): Add nullstream.h.
      
      * libmailutils/stream/nullstream.c: New file.
      * libmailutils/stream/stream.c (_stream_read, _stream_write)
      (_stream_seek, _stream_stat_incr): New macros.
      (_stream_fill_buffer, mu_stream_seek)
      (_stream_read_unbuffered)
      (_stream_write_unbuffered): Use _stream_read, _stream_write
      and _stream_seek instead of calling the corresponding methods directly.
      (mu_stream_bytes_in, mu_stream_bytes_out): Remove.
      (mu_stream_unref): Clear statbuf, if provided.
      (mu_stream_set_stat, mu_stream_get_stat): New functions.
      
      * libmailutils/stream/Makefile.am (libstream_la_SOURCES): Add nullstream.c.
      
      * libmailutils/stream/fltstream.c (filter_wr_close): Check for fs->eof.
      
      * examples/base64.c (c_copy): Use new statistics interface.
      * libmailutils/tests/fltst.c: Likewise.
      Sergey Poznyakoff authored
    • * libmailutils/mime/attachment.c (BUF_SIZE): Remove.
      (_mu_mime_io_buffer)<buf, bufsize>: Remove members.
      (MSG_HDR): Remove.
      (mu_message_create_attachment): Use mu_asprintf instead of
      manually crafting the string.
      (mu_mime_io_buffer_set_size)
      (mu_mime_io_buffer_get_size): Remove.
      (mu_message_save_attachment)
      (mu_message_encapsulate)
      (mu_message_unencapsulate): Use mu_header_sget to avoid
      unnecessary memory allocations.
      Use mu_stream_copy instead of (ineffective) loops.
      
      * include/mailutils/message.h (mu_mime_io_buffer_set_size)
      (mu_mime_io_buffer_get_size): Remove prototypes.
      * include/mailutils/header.h (MU_HEADER_RESENT_SENDER)
      (MU_HEADER_CONTENT_TRANSFER_ENCODING)
      (MU_HEADER_DELIVERY_DATE)
      (MU_HEADER_ENVELOPE_TO): Normalize spelling.
      Sergey Poznyakoff authored
  9. 09 Nov, 2010 4 commits
    • * include/mailutils/sys/filter.h (_mu_filter_stream)<eof>: New member.
      * libmailutils/filter/binflt.c (_bit8_filter): Change name initializer
      to "8bit".
      (_bit7_filter): Change name initializer to "7bit".
      * libmailutils/filter/filter.c (mu_filter_create): Limit line
      length for encoding streams only.
      * libmailutils/stream/fltstream.c (filter_read): Use fs->eof instead
      of the regular stream EOF marker.
      * libmailutils/stream/stream.c (mu_stream_eof): Bugfix: take into
      account eventual buffered data.
      (_stream_read_unbuffered): Call mu_stream_eof instead of checking
      the _MU_STR_EOF bit.
      Sergey Poznyakoff authored
    • * libproto/imap/id.c: New file.
      * libproto/imap/login.c: New file.
      * libproto/imap/Makefile.am: Add new files.
      * libproto/imap/capability.c (mu_imap_capability): Clear
      MU_IMAP_RESP before reading response.
      Add MU_WRDSF_QUOTE to mu_wordsplit flags.
      * libproto/imap/err.c (_mu_imap_seterrstr): Bugfix: initialize
      imap->errstr.
      * libproto/imap/logout.c (mu_imap_logout): Clear
      MU_IMAP_RESP before reading response.
      * libproto/imap/response.c (_mu_imap_response): Set error string.
      * mu/imap.c (com_login, com_id): New functions.
      (imap_comtab) <login, id>: New keywords.
      Sergey Poznyakoff authored
    • * libmailutils/stream/stream.c (_stream_fill_buffer): Keep
      track of the current offset.
      (mu_stream_seek): avoid unnecessary seeks.
      (_stream_skip_input_bytes): Call _stream_flush_buffer before
      _stream_fill_buffer.
      (_stream_write_unbuffered): Do not modify current offset.
      (mu_stream_read,mu_stream_write): For unbuffered streams,
      modify current offset after invoking the corresponding I/O
      call.
      (_stream_scandelim): Call _stream_flush_buffer before
      _stream_fill_buffer.
      Sergey Poznyakoff authored
    • UFMS, or "UNIX mailbox first message symptom", is a long-standing
      bug that existed in all previous versions of Mailutils:  under
      certain circumstances, a fragment of the message headers would get
      prepended to the body of the very first message in a UNIX mailbox.
      See the detailed description in testsuite/ufms.c.
      
      Along with fixing this bug, this change also ensures a proper restoring
      of UIDs from UNIX mailboxes.
      
      * libproto/mbox/mbox.c (_msg_body_setup): Call mu_body_clear_modified
      after constructing the body.
      (new_message): Ditto for mu_message_clear_modified.
      (mbox_reset): Rewrite.  Drop all cached messages and rescan entire
      mailbox to avoid the "1st message symptom".
      (mbox_expunge0): Change the call to mbox_reset.
      * libproto/mbox/mboxscan.c (IS_X_UID, IS_X_IMAPBASE): New macros.
      (mbox_scan_internal): Change handling of min_uid.
      Attempt to get UID and imapbase from the corresponding message headers.
      (mbox_scan0): Reflect the above changes.
      
      * testsuite/.gitignore: Add ufms.
      * testsuite/Makefile.am (noinst_PROGRAMS): Add ufms.
      (TESTSUITE_AT): Add ufms.at.
      * testsuite/testsuite.at: Include ufms.at.
      * testsuite/ufms.at: New test case.
      * testsuite/ufms.c: New test program.
      
      * imap4d/testsuite/imap4d/expunge.exp: Fix UIDNEXT expectation.
      Sergey Poznyakoff authored
  10. 08 Nov, 2010 1 commit
    • * include/mailutils/imap.h: New file.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add imap.h
      
      * libproto/imap/capability.c: New file.
      * libproto/imap/capatst.c: New file.
      * libproto/imap/carrier.c: New file.
      * libproto/imap/connect.c: New file.
      * libproto/imap/create.c: New file.
      * libproto/imap/destroy.c: New file.
      * libproto/imap/disconnect.c: New file.
      * libproto/imap/err.c: New file.
      * libproto/imap/fake-folder.c: New file.
      * libproto/imap/logout.c: New file.
      * libproto/imap/response.c: New file.
      * libproto/imap/state.c: New file.
      * libproto/imap/tag.c: New file.
      * libproto/imap/trace.c: New file.
      * libproto/imap/Makefile.am (libmu_imap_la_SOURCES): Temporarly
      remove folder.c, mbox.c and url.c. Add new files.
      
      * mu/getarg.c: New file.
      * mu/imap.c: New file.
      * mu/verbose.c: New file.
      * mu/Makefile.am (IDLE_MODULES): New variable.
      (IMAP_C): New variable.
      (MODULES): Add $(IMAP_C).
      (mu_SOURCES): Add getarg.c and verbose.c
      (mu-setup.h, mu-setup.c): Add IDLE_MODULES both to the dependencies
      and to the mu-setup.awk command line.
      * mu/mu-setup.awk: New keyword mu-cond.
      * mu/pop.c: Add mu-cond keyword.
      
      * include/mailutils/sys/imap.h: Rewrite.
      * include/mailutils/sys/pop3.h (MU_POP3_CHECK_EAGAIN): Take into
      account MU_ERR_REPLY and MU_ERR_BADREPLY, which are recoverable errors.
      
      * libmailutils/base/list.c (mu_list_clear): Return immediately if
      list is NULL.
      * libmu_auth/sql.c (sql_escape_string): Remove unused variable.
      
      * libproto/pop/pop3_carrier.c (mu_pop3_get_carrier): Increase refcount
      on the returned stream.
      * libproto/pop/pop3_response.c (mu_pop3_response): Check POP3 reply code.
      Sergey Poznyakoff authored
  11. 03 Nov, 2010 1 commit
    • * mu/Makefile.am (MODULES): New variable.  Put all commands there.
      (mu_SOURCES): Include $(MODULES).
      (EXTRA_DIST): Add mu-setup.h mu-setup.c mu-setup.awk
      (BUILT_SOURCES): New variable.
      (mu-setup.h, mu-setup.c): New goals.
      
      * mu/mu.c (doc): Remove command description: it is generated automatically.
      (mu_help_filter): New function.
      (argp): Use mu_help_filter.
      (mutool_action_tab): Remove.
      (mutool_nosys,find_action): Remove.
      (mu_help): New function.
      (main): Use dispatch_find_action.
      * mu/mu.h: Include mailutils/types.h
      (mutool_pop, mutool_filter, mutool_flt2047)
      (mutool_info, mutool_query, mutool_acl)
      (mutool_wicket, mutool_ldflags, mutool_cflags): Remove protos.
      (mu_help, dispatch_find_action, dispatch_docstring): New protos.
      
      * mu/acl.c: Add MU Setup comment.
      * mu/cflags.c: Likewise.
      * mu/filter.c: Likewise.
      * mu/flt2047.c: Likewise.
      * mu/info.c: Likewise.
      * mu/ldflags.c: Likewise.
      * mu/pop.c: Likewise.
      * mu/query.c: Likewise.
      * mu/wicket.c: Likewise.
      
      * mu/mu-setup.awk: New file.
      * mu/help.c: New file.
      * mu/dispatch.c: New file.
      
      * mu/.gitignore: Add mu-status.[ch]
      
      * po/POTFILES.in: Add mu/dispatch.c and mu/help.c.
      Sergey Poznyakoff authored
  12. 02 Nov, 2010 4 commits
  13. 30 Oct, 2010 1 commit
    • * libmailutils/string/wordsplit.c (mu_wordsplit_init): Call
      mu_wordsplit_free_words to reclaim the memory.
      (mu_wordsplit_free_words): New function.
      (mu_wordsplit_free): Use mu_wordsplit_free_words.
      
      * imap4d/imap4d.c (imap4d_session_setup0): Use wordsplit instead of
      vartab.
      * imap4d/imap4d.h: Don't include vartab.h.
      * imap4d/preauth.c (do_preauth_ident): Use mu_str_stripws instead of
      the static trimcrlf, which is removed.
      (do_preauth_program): Use wordsplit instead of
      vartab and mu_prog_stream_create instead of popen.
      * libmailutils/mailbox/mbx_default.c: Include nls.h
      Don't include vartab.h
      (mu_construct_user_mailbox_url): Use wordsplit instead of
      vartab.
      * libmailutils/server/acl.c (expand_arg): Use wordsplit instead of
      vartab.
      * libmu_auth/ldap.c (_mu_ldap_search):L Likewise.
      * libmu_auth/radius.c (_expand_query): Likewise.
      * libmu_auth/sql.c (mu_sql_expand_query): Likewise.
      * libproto/mailer/prog.c (_expand_sender, _expand_rcpt): Rewrite.
      (url_to_argv): : Use wordsplit instead of
      vartab.
      
      * po/POTFILES.in: Add more files.
      Sergey Poznyakoff authored
  14. 29 Oct, 2010 3 commits
    • * mu/mu.h (mutool_prompt_vartab): Remove.
      (mutool_prompt_env): New extern.
      * mu/pop.c (pop_prompt_vartab): Rewrite as pop_prompt_env.
      All callers changed.
      * mu/shell.c (mutool_prompt_vartab): Remove variable.
      (mutool_prompt_env): New variable.
      (expand_prompt): Remove function.
      (input_line_interactive): Use mu_wordsplit to expand command prompt.
      Sergey Poznyakoff authored
    • K/V is a new type of environment where variable names (keys) and
      values are stored separately in adjacent environment elements.
      This should simplify wordsplit initialization in many cases.
      
      * include/mailutils/wordsplit.h (MU_WRDSF_ENV_KV): New flag.
      * libmailutils/string/wordsplit.c (mu_wordsplit_find_env): Implement
      search in a K/V environment.
      * libmailutils/tests/wordsplit.at: Test K/V environments.
      * libmailutils/tests/wsp.c (bool_keytab): Implement env_kv.
      (make_env_kv): New function.
      (main): Convert environment if env_kv is given.
      Sergey Poznyakoff authored
    • Eventually this will lead to vartab fading out until it is removed
      in some point in the future.  Wordsplit provides a much better
      variable substitution mechanism.
      
      * include/mailutils/wordsplit.h (mu_wordsplit) <ws_getvar>: Change
      signature.
      <ws_closure>: New member.
      (MU_WRDSF_CLOSURE): New flag.
      * libmailutils/string/wordsplit.c (mu_wordsplit_init): Initialize
      ws_closure to NULL, unless MU_WRDSF_CLOSURE is set.
      Do not modify ws_wordn if MU_WRDSF_DOOFFS is set.
      (wsnode_remove): Clear _WSNF_JOIN on the previous node if the node
      being deleted is the last one in chain.
      (expvar): Pass ws_closure as 3rd argument to ws_getvar.
      Insert a NULL node if the variable is not defined.
      
      * movemail/movemail.c: Use wordsplit instead of vartab. Note a side
      effect: the "source:*" and "dest:*" variables are now written as
      "source_*" and "dest_*", correspondingly.
      (movemail_getvar_closure): New structure.
      (DCL_VTX): Remove macro and its uses.
      (get_url_part, movemail_getvar): New functions.
      (set_program_id): Rewrite using wordsplit.
      Sergey Poznyakoff authored
  15. 28 Oct, 2010 2 commits
    • The wordsplit module (borrowed from another project of mine, called 'grecs')
      provides a flexible and powerful mechanism for parsing input in a way
      similar to posix-shell.  In particular, the POSIX function wordexp is
      a subset of the wordsplit functionality.
      
      The argcv module is now deprecated.
      
      * include/mailutils/wordsplit.h: New file.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add wordsplit.h
      * libmailutils/string/wordsplit.c: New file.
      * libmailutils/string/Makefile.am (libstring_la_SOURCES): Add wordsplit.c.
      * include/mailutils/argcv.h (mu_argcv_join): New proto.
      (mu_argcv_get, mu_argcv_get_n, mu_argcv_get_np)
      (mu_argcv_unquote_char, mu_argcv_quote_char)
      (mu_argcv_quoted_length, mu_argcv_unquote_copy)
      (mu_argcv_quote_copy): Mark as deprecated.
      * include/mailutils/mailutils.h: Include wordsplit.h.
      
      * libmailutils/tests/wsp.c: New file.
      * libmailutils/tests/.gitignore: List wsp.
      * libmailutils/tests/wordsplit.at: New file.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add wsp
      (TESTSUITE_AT): Add wordsplit.at.
      * libmailutils/tests/argcv.c: Define MU_ARCGV_DEPRECATED to
      avoid deprecation warnings.
      * libmailutils/tests/testsuite.at: Include wordsplit.at.
      
      * libmailutils/base/argcvfree.c: New file.
      * libmailutils/base/argcvjoin.c: New file.
      * libmailutils/base/argcvrem.c: New file.
      * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add new files.
      
      * libmailutils/base/argcv.c: Define MU_ARCGV_DEPRECATED to
      avoid deprecation warnings.
      (argcv_string, argcv_free, argv_free)
      (mu_argcv_remove): Rewrite in separate modules.
      
      * comsat/comsat.h: Include wordsplit.h.
      * imap4d/imap4d.h: Likewise.
      * mail/mail.h: Likewise.
      * mh/mh.h: Likewise.
      * readmsg/readmsg.h: Likewise.
      
      * comsat/action.c: Use wordsplit.
      * imap4d/fetch.c: Likewise.
      * lib/mailcap.c: Likewise.
      * libmailutils/auth/mu_auth.c: Likewise.
      * libmailutils/base/mutil.c: Likewise.
      * libmailutils/cfg/format.c: Likewise.
      * libmailutils/cfg/lexer.l: Likewise.
      * libmailutils/cfg/parser.y: Likewise.
      * libmailutils/diag/gdebug.c: Likewise.
      * libmailutils/mailer/mailer.c: Likewise.
      * libmailutils/server/acl.c: Likewise.
      * libmailutils/stream/prog_stream.c: Likewise.
      * libmailutils/tests/listop.c: Likewise.
      * libmailutils/url/create.c: Likewise.
      * libmu_auth/ldap.c: Likewise.
      * libmu_auth/radius.c: Likewise.
      * libmu_sieve/sieve.l: Likewise.
      * libproto/mailer/mbox.c: Likewise.
      * libproto/mailer/smtp.c: Likewise.
      * libproto/mailer/smtp_gsasl.c: Likewise.
      * mail/mailline.c: Likewise.
      * mail/mailvar.c: Likewise.
      * mail/send.c: Likewise.
      * mail/util.c: Likewise.
      * mh/folder.c: Likewise.
      * mh/mh_alias.y: Likewise.
      * mh/mh_argp.c: Likewise.
      * mh/mh_init.c: Likewise.
      * mh/mh_list.c: Likewise.
      * mh/mh_msgset.c: Likewise.
      * mh/mh_sequence.c: Likewise.
      * mh/mh_whatnow.c: Likewise.
      * mh/mh_sequence.c: Likewise.
      * mh/mh_whatnow.c: Likewise.
      * mh/mhn.c: Likewise.
      * mh/send.c: Likewise.
      * movemail/movemail.c: Likewise.
      * mu/shell.c: Likewise.
      * readmsg/readmsg.c: Likewise.
      * testsuite/smtpsend.c: Likewise.
      
      * pop3d/popauth.c: Use wordsplit.
      Use simplified input format (username and password delimited
      by any amount of whitespace).
      Read/produce old format if invoked with the --compatibility option.
      
      * examples/aclck.c: Use wordsplit instead of argcv.
      * examples/header.c: Likewise.
      * examples/mta.c: Likewise.
      * examples/.gitignore: Remove pop3client.
      * examples/Makefile.am: Remove pop3client.
      
      * po/POTFILES.in: Add new files.
      Sergey Poznyakoff authored
  16. 27 Oct, 2010 2 commits
    • Parameters are allowed: they are used to expand hashed or indexed
      mailbox names.
      
      * libproto/maildir/folder.c (_maildir_record): Add MU_URL_PARAM.
      * libproto/mbox/folder.c (_mbox_record): Likewise.
      * libproto/mh/folder.c (_mh_record): Likewise.
      Sergey Poznyakoff authored
    • *gnulib.modules (snprintf, vasprintf): Remove.
      *sieve/tests/reject.at: Use AT_PACKAGE_VERSION instead of
      the hardcoded version number.
      *lib/mu_asprintf.h: Remove.
      
      * imap4d/auth_gss.c: Replace asprintf with mu_asprintf and vasprintf by
      mu_vasnprintf.
      * guimb/guimb.h: Likewise.
      * imap4d/imap4d.h: Likewise.
      * imap4d/unsubscribe.c: Likewise.
      * lib/Makefile.am
      * lib/mailcap.c: Likewise.
      * libmu_argp/muinit.c: Likewise.
      * maidag/deliver.c: Likewise.
      * maidag/maidag.h: Likewise.
      * mail/escape.c: Likewise.
      * mail/mail.c: Likewise.
      * mail/mail.h: Likewise.
      * mail/util.c: Likewise.
      * mail/write.c: Likewise.
      * mh/burst.c: Likewise.
      * mh/forw.c: Likewise.
      * mh/mh.h: Likewise.
      * mh/mh_alias.l: Likewise.
      * mh/mh_format.c: Likewise.
      * mh/mh_getopt.c: Likewise.
      * mh/mh_init.c: Likewise.
      * mh/mh_msgset.c: Likewise.
      * mh/mh_sequence.c: Likewise.
      * mh/mh_whatnow.c: Likewise.
      * mh/mhn.c: Likewise.
      * mh/send.c: Likewise.
      * mimeview/mimetypes.l: Likewise.
      * mimeview/mimetypes.y: Likewise.
      * mimeview/mimeview.c: Likewise.
      * movemail/movemail.c: Likewise.
      * mu/ldflags.c: Likewise.
      * pop3d/expire.c: Likewise.
      * pop3d/pop3d.h: Likewise.
      * sieve/sieve.c: Likewise.
      Sergey Poznyakoff authored