1. 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
  2. 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
  3. 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
  4. 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
  5. 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
  6. 02 Nov, 2010 4 commits
  7. 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
  8. 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
  9. 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
  10. 27 Oct, 2010 4 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
    • The allow_severity and deny_severity variables are valid only for tcpd and
      related applications, hosts_access does not use them.
      
      * lib/tcpwrap.c (mu_tcp_wrapper_cb_hosts_allow_syslog)
      (mu_tcp_wrapper_cb_hosts_deny_syslog): Remove functions.
      (allow_severity, deny_severity): Remove variables.
      (tcpwrapper_param): Remove allow-syslog-priority and
      deny-syslog-priority.
      Sergey Poznyakoff authored
    • * NEWS, configure: Set version number to 2.9.90 to avoid confusion
      with 2.2.x branch.
      Sergey Poznyakoff authored
  11. 26 Oct, 2010 1 commit
    • The purpose is to make it modular and flexible.  URLs are
      parsed out as they are created.  Missing URL parts can be
      supplied via a "URL hint" at creation time (similar to
      the approach used in creating mu_address_t).  Ports
      can be specified either as numbers or as service names.
      Original port string representation can be retrieved from
      the URL, as well as its numeric value.
      
      * libmailutils/url/accessor.h: New file.
      * libmailutils/url/copy.c: New file.
      * libmailutils/url/create.c: New file.
      * libmailutils/url/decode.c: New file.
      * libmailutils/url/destroy.c: New file.
      * libmailutils/url/dup.c: New file.
      * libmailutils/url/expand.c: New file.
      * libmailutils/url/flag.c: New file.
      * libmailutils/url/get-auth.c: New file.
      * libmailutils/url/get-host.c: New file.
      * libmailutils/url/get-param.c: New file.
      * libmailutils/url/get-path.c: New file.
      * libmailutils/url/get-portstr.c: New file.
      * libmailutils/url/get-query.c: New file.
      * libmailutils/url/get-scheme.c: New file.
      * libmailutils/url/get-secret.c: New file.
      * libmailutils/url/get-user.c: New file.
      * libmailutils/url/match.c: New file.
      * libmailutils/url/port.c: New file.
      * libmailutils/url/scheme.c: New file.
      * libmailutils/url/uplevel.c: New file.
      * libmailutils/url/urlstr.c: New file.
      
      * configure.ac (AC_CONFIG_FILES): Add libmailutils/url/Makefile
      * libmailutils/Makefile.am (SUBDIRS): Add url.
      (libmailutils_la_LIBADD): Link with liburl.
      * libmailutils/base/Makefile.am (libbase_la_SOURCES): Remove url.c
      * libmailutils/base/url.c: Remove.
      
      * libmailutils/string/Makefile.am (libstring_la_SOURCES): Add xdecode.c
      * libmailutils/string/xdecode.c: New file.
      
      * include/mailutils/sys/url.h (_mu_url): Change type to short.
      <_get_port>: Change second argument to unsigned.
      <_get_portstr>: New method.
      * include/mailutils/url.h (MU_URL_SCHEME): New flag.
      (MU_URL_PARSE_HEXCODE, MU_URL_PARSE_HIDEPASS)
      (MU_URL_PARSE_PORTSRV, MU_URL_PARSE_PORTWC)
      (MU_URL_PARSE_PIPE, MU_URL_PARSE_SLASH): New flags.
      (mu_url_create_hint, mu_url_copy_hints): New prototypes.
      (mu_url_parse): Remove.
      (mu_url_get_port): Change second argument to unsigned.
      (mu_url_decode_len,mu_url_decode): Remove.
      (mu_url_decode): New proto.
      (mu_url_sget_portstr, mu_url_aget_portstr)
      (mu_url_get_portstr): New protos.
      
      * include/mailutils/util.h (mu_str_url_decode)
      (mu_str_url_decode_inline): New protos.
      * libproto/pop/mbox.c (pop_open): Port is unsigned.
      
      * libproto/imap/folder.c: Use MU_URL_SCHEME in url_may_have.
      * libproto/maildir/folder.c: Likewise.
      * libproto/mailer/prog.c: Likewise.
      * libproto/mailer/remote.c: Likewise.
      * libproto/mailer/sendmail.c: Likewise.
      * libproto/mailer/smtp.c: Likewise.
      * libproto/mbox/folder.c: Likewise.
      * libproto/mh/folder.c: Likewise.
      * libproto/nntp/folder.c: Likewise.
      * libproto/pop/folder.c: Likewise.
      
      * imap4d/imap4d.c: Remove calls to mu_url_parse.
      * libmailutils/base/registrar.c: Likewise.
      * libmailutils/base/wicket.c: Likewise.
      * libmailutils/mailbox/folder.c: Likewise.
      * libmailutils/mailbox/mailbox.c: Likewise.
      * libmailutils/mailer/mailer.c: Likewise.
      * libmailutils/tests/url-parse.c: Likewise.
      * libmailutils/tests/wicket.c: Likewise.
      * libproto/mailer/smtp_auth.c: Likewise.
      * maidag/deliver.c: Likewise.
      * mu/wicket.c: Likewise.
      
      * libmailutils/mime/mimehdr.c (mu_mimehdr_decode_param): Use
      mu_str_url_decode, instead of mu_url_decode.
      * libmailutils/stream/tcp.c (_tcp_instance)<port>: Change type
      to unsigned short. All uses updated.
      (mu_tcp_stream_create_with_source_ip)
      (mu_tcp_stream_create_with_source_host)
      (mu_tcp_stream_create): Port is unsigned.
      * include/mailutils/stream.h (mu_tcp_stream_create_with_source_ip)
      (mu_tcp_stream_create_with_source_host)
      (mu_tcp_stream_create): Port is unsigned.
      * include/mailutils/cpp/url.h (get_port): Return unsigned.
      * libmu_cpp/url.cc (get_port): Return unsigned.
      (parse): Empty function. Schedule for removal.
      * python/libmu_py/url.c (api_url_parse): Empty function.
      Schedule for removal.
      (api_url_get_port): Port is unsigned.
      
      * libmailutils/base/wicket.c (mu_wicket_file_match_url)
      (mu_wicket_file_match_url): New parameter: parse_flags.
      * mu/wicket.c (wicket_match): Use parse_flags to control
      whether or not to show the plaintext password.
      
      * doc/texinfo/url.texi: Update.
      Sergey Poznyakoff authored
  12. 25 Oct, 2010 2 commits
  13. 24 Oct, 2010 3 commits
    • …ckward compatibility.
      
      * config/.gitignore: Remove.
      * config/Makefile.am: Remove.
      * config/mailutils-config.c: Remove.
      * config/maint.mk: Remove.
      * config/mailutils.m4: Move to mu-aux/mailutils.m4
      * mu-aux/Makefile.am (m4datadir, dist_m4data_DATA): New variables.
      
      * Makefile.am (SUBDIRS) <config>: Remove.
      * configure.ac (AC_CONFIG_FILES): Remove config.
      
      * mu/mailutils-config: New file.
      * mu/cflags.c: New file.
      * mu/ldflags.c: New file.
      * mu/Makefile.am (dist_bin_SCRIPTS, EXTRA_DIST): Add mailutils-config.
      (mu_SOURCES): Add cflags.c and ldflags.c.
      (AM_CPPFLAGS): New variable.
      * mu/mu.c: Add new modes: cflags and ldflags.
      * mu/mu.h (mutool_ldflags, mutool_cflags): New protos.
      * po/POTFILES.in: Update.
      Sergey Poznyakoff authored
    • * mu/wicket.c: New file.
      * mu/mu.h (mutool_wicket): New proto.
      * mu/mu.c (mutool_action_tab): Add an entry for wicket mode.
      * mu/Makefile.am (mu_SOURCES): Add wicket.c
      * .gitignore: Update.
      Sergey Poznyakoff authored
    • The new algorithm always returns the best match, i.e. the
      one with the smallest number of wildcard comparisons.
      
      * include/mailutils/auth.h (mu_wicket_stream_match_url)
      (mu_wicket_file_match_url): New protos.
      Remove unnecessary 'extern' qualifiers.
      * include/mailutils/url.h (mu_url_is_ticket): Remove.
      (mu_url_matches_ticket): New proto.
      * libmailutils/base/url.c (mu_url_parse): Fix name corruption during
      password obfuscation.
      (defined): Remove static function.
      (mu_url_is_ticket): Remove function.
      (mu_url_matches_ticket): New function.
      * libmailutils/base/wicket.c (get_ticket_url): Remove.
      (mu_wicket_stream_match_url)
      (mu_wicket_file_match_url): New functions.
      (file_ticket_get_cred): Use mu_wicket_file_match_url.
      
      * libmailutils/tests/wicket.c: New file.
      * libmailutils/tests/Wicketfile: New file.
      * libmailutils/tests/wicket.at: New file.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add wicket.
      (EXTRA_DIST): Add Wicketfile
      (TESTSUITE_AT): Add wicket.at
      * libmailutils/tests/testsuite.at: Include wicket.at
      * libmailutils/tests/.gitignore: Update.
      Sergey Poznyakoff authored
  14. 21 Oct, 2010 2 commits
    • * include/mailutils/smtp.h (mu_smtp_dot): New proto.
      * libproto/mailer/smtp_dot.c: New file.
      * libproto/mailer/Makefile.am (libmu_mailer_la_SOURCES): Add
      smtp_dot.c.
      * libproto/mailer/smtp.c (smtp_send_message): Send RSET after an
      unexpected SMTP reply.
      Call mu_smtp_dot after successful sending.
      * libproto/mailer/smtp_data.c (_mu_smtp_data_end): Set
      state to MU_SMTP_DOT.
      * libproto/mailer/smtp_rset.c (mu_smtp_rset): Improve state
      selection algorithm.
      * libproto/mailer/smtp_send.c (mu_smtp_send_stream): Don't
      reset state: it is done by _mu_smtp_data_end.
      * testsuite/smtpsend.c (main): Call mu_smtp_dot after sending
      message.
      Sergey Poznyakoff authored
    • * libproto/pop/folder.c (_pop_record): Accept URL parameters.
      * libproto/pop/mbox.c (pop_open): Don't start TLS if
      the `notls' parameter is present in the URL.
      Sergey Poznyakoff authored
  15. 20 Oct, 2010 1 commit
    • …-smtp-00.  Minor fix in maidag (url mode).
      
      * include/mailutils/registrar.h (MU_RECORD_DEFAULT)
      (MU_RECORD_LOCAL): New flags.
      (_mu_record) <flags,url_may_have,url_must_have>: New members.
      Remove unnecessary externs.
      (mu_record_set_.*): Remove all protos.
      (mu_record_check_url, mu_registrar_test_local_url): New protos.
      * include/mailutils/sys/url.h (_mu_url) <flags>: New member.
      (MU_URL_USER, MU_URL_SECRET, MU_URL_AUTH)
      (MU_URL_HOST, MU_URL_PORT, MU_URL_PATH)
      (MU_URL_PARAM, MU_URL_QUERY)
      (MU_URL_CRED, MU_URL_INET, MU_URL_ALL): New flags.
      (mu_url_get_flags, mu_url_has_flag): New protos.
      * libmailutils/base/registrar.c (mu_record_set_.*): Remove all.
      (mu_record_check_url): New function.
      (mu_registrar_test_local_url): New function.
      * libmailutils/base/url.c (mu_url_copy0): Copy flags.
      (mu_url_parse): Use flags intead of inspecting each
      structure member. Set flags.
      (mu_url_get_flags, mu_url_has_flag): New functions.
      * libmailutils/diag/errors (MU_ERR_URL_MISS_PARTS)
      (MU_ERR_URL_EXTRA_PARTS): New error codes.
      * libmailutils/mailbox/folder.c (mu_folder_create_from_record): Check
      the URL using mu_record_check_url.
      * libproto/imap/folder.c (_imap_record, _imaps_record): Initialize new fields.
      * libproto/maildir/folder.c (_maildir_record): Likewise.
      * libproto/mbox/folder.c (_mbox_record): Likewise.
      * libproto/mh/folder.c (_mh_record): Likewise.
      * libproto/nntp/folder.c (_nntp_record): Likewise.
      * libproto/pop/folder.c (_pop_record, _pops_record): Likewise.
      * libproto/mailer/prog.c (_prog_record): Likewise.
      (_url_prog_init): Remove extra checks, rely on mu_record_check_url.
      * libproto/mailer/remote.c (_mu_remote_smtp_record)
      (_mu_remote_sendmail_record,_mu_remote_prog_record): Initialize new fields.
      * libproto/mailer/sendmail.c (_url_sendmail_init): Remove extra checks, rely
      on mu_record_check_url.
      (_sendmail_record): Initialize new fields.
      * libproto/nntp/url.c (url_nntp_destroy): Remove.
      (_nntp_url_init): Remove extra checks.
      * libproto/pop/url.c (url_pop_destroy): Remove.
      (_url_pop_init, _url_pops_init): Remove extra checks.
      
      * libproto/mailer/smtp.c (_url_smtp_init): Remove extra checks.
      (_smtp_record): Initialize new fields.
      (smtp_mailer_add_auth_mech): New function.
      (smtp_open): Allow for auth= part before the host name.
      
      * maidag/deliver.c (is_remote_url): New function.
      (do_delivery): Do not try to switch user privileges if the
      URL refers to a remote mailbox.
      * maidag/maidag.c (main): Initialize TLS.
      Sergey Poznyakoff authored
  16. 19 Oct, 2010 1 commit
  17. 18 Oct, 2010 1 commit
    • * include/mailutils/header.h: Remove unnecessary externs.
      (mu_url_sget_param, mu_url_aget_param): New protos.
      * libmailutils/base/url.c (mu_url_sget_param, mu_url_aget_param): New
      functions.
      
      * libmailutils/mailbox/hdrfirst.c: New file.
      * libmailutils/mailbox/Makefile.am (libmailbox_la_SOURCES): Add hdrfirst.c.
      
      * libmailutils/mailbox/message.c (message_envelope_sender): Try to restore
      the envelope sender from X-Envelope-Sender, X-Envelope-From, X-Original-Sender,
      and From headers, in that order.
      * libmailutils/mailer/mailer.c (_set_from): Try to obtain sender from
      the message envelope.  If that fails, fall back to the From header.
      * libproto/mailer/mbox.c (parse_received, guess_message_recipient): New
      static functions.
      (remote_mbox_append_message): Get recipient address from the first
      of X-Envelope-To, Delivered-To, X-Original-To headers, in that order.
      If that fails, try to deduce it from the Received header.  If that
      fails too, fall back to the To header.
      If recipient-headers URL parameter is defined, its value (a comma-separated
      list of names) overrides this list.
      The strip-domain parameter, if present, instructs the function to strip
      domain part from the recipient address before resolving it.
      The domain parameter, if present, supplies the domain name which overrides
      the domain obtained from the URL.
      Sergey Poznyakoff authored
  18. 17 Oct, 2010 1 commit
  19. 16 Oct, 2010 1 commit