1. 28 Oct, 2010 1 commit
    • 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
  2. 10 Oct, 2010 2 commits
    • * python/libmu_py/folder.c (api_folder_set_stream): Remove.
      * python/libmu_py/message.c (api_message_set_stream): Remove.
      * python/libmu_py/stream.c (api_stream_ref, api_stream_unref): Add.
      (api_stream_sequential_readline, api_stream_sequential_write): Remove.
      Wojciech Polak authored
    • * libmailutils/base/mutil.c (mu_hex2ul, mu_hexstr2ul): Move to string/hexstr.c.
      (mu_get_homedir, mu_get_full_path)
      (mu_expand_path_pattern): Move to base/filename.c.
      (mu_getcwd): Move to base/getcwd.c.
      (mu_tilde_expansion): Move to base/tilde.c
      (mu_cpystr): Move to string/cpystr.c.
      (mu_get_host_name): Move to base/hostname.c.
      (mu_set_user_email,mu_set_user_email_domain)
      (mu_get_user_email_domain,mu_aget_user_email_domain)
      (mu_get_user_email,mu_normalize_path): Move to base/usremail.c.
      (mu_tempfile,mu_tempname): Move to base/tempfile.c.
      (mu_spawnvp): Move to base/spawnvp.c.
      (mu_qualify_link,mu_unroll_symlink): Move to base/symlink.c.
      (mu_rfc2822_references,mu_rfc2822_msg_id)
      (mu_rfc2822_in_reply_to): Move to base/msgid.c.
      (mu_strcasestr): Move to string/cstrcasestr.c.
      (mu_string_unfold): Move to string/unfold.c.
      (mu_true_answer_p): Move to string/trueans.c.
      (mu_scheme_autodetect_p): Move to base/schemeauto.c.
      (mu_fd_wait): Move to base/fdwait.c.
      (mu_set_default_fallback,mu_decode_filter): Move to filter/decode.c.
      (__argp_base_name): Move to lib/argp_base.c.
      
      * libmailutils/base/fdwait.c: New file.
      * libmailutils/base/filename.c: New file.
      * libmailutils/base/getcwd.c: New file.
      * libmailutils/base/hostname.c: New file.
      * libmailutils/base/msgid.c: New file.
      * libmailutils/base/schemeauto.c: New file.
      * libmailutils/base/spawnvp.c: New file.
      * libmailutils/base/symlink.c: New file.
      * libmailutils/base/tempfile.c: New file.
      * libmailutils/base/tilde.c: New file.
      * libmailutils/base/usremail.c: New file.
      * libmailutils/base/Makefile.am: Add new files.
      
      * libmailutils/filter/decode.c: New file.
      * libmailutils/filter/Makefile.am: Add new files.
      
      * libmailutils/string/cpystr.c: New file.
      * libmailutils/string/cstrcasestr.c: New file.
      * libmailutils/string/hexstr.c: New file.
      * libmailutils/string/trueans.c: New file.
      * libmailutils/string/unfold.c: New file.
      * libmailutils/string/Makefile.am: Add new files.
      
      * lib/argp_base.c: New file.
      * lib/Makefile.am: Add new files.
      
      * include/mailutils/io.h: Include stdarg.h
      * include/mailutils/mutil.h: Rename to util.h.  Reorder prototypes
      and declarations in logical groups.  All uses changed.
      
      * include/mailutils/cstr.h (mu_strcasestr): New proto, moved from
      include/mailutils/mutil.h.
      Sergey Poznyakoff authored
  3. 09 Oct, 2010 1 commit
  4. 08 Oct, 2010 2 commits
  5. 03 Oct, 2010 2 commits
    • * examples/http.c (main): Fix open/wait loop.
      * libmailutils/stream.c (mu_stream_wait): May be used
      on not-open streams.
      * examples/.gitignore: Add more files.
      Sergey Poznyakoff authored
    • One of stream flags bits indicates whether the stream is
      open or not.  The mu_stream_open function refuses to act if it
      already is.  The rest of functions (including mu_stream_close)
      refuses to act if the stream was not open.  A special function
      (mu_stream_is_open) is provided to check if the stream is in
      open state.
      
      Any stream creation function returns an already open stream.  The
      function mu_stream_open should be called only if the stream was
      previously closed by a call to mu_stream_close.
      
      * include/mailutils/stream.h (mu_stream_is_open): New proto.
      * include/mailutils/sys/stream.h (_MU_STR_OPEN): New flag.
      * libmailutils/stream.c (_mu_stream_create): Permit setting the
      _MU_STR_OPEN flag.
      (_stream_init): New static.
      (mu_stream_open): Return MU_ERR_OPEN if the stream is already open.
      (mu_stream_is_open): New function.
      (mu_stream_seek, mu_stream_read, mu_stream_readdelim)
      (mu_stream_getdelim, mu_stream_write, mu_stream_flush)
      (mu_stream_close, mu_stream_size, mu_stream_wait)
      (mu_stream_truncate): Check if the stream is open. Return MU_ERR_NOT_OPEN
      otherwise.
      
      * libmailutils/errors (MU_ERR_OPEN): Reword the diagnostics.
      
      * libmailutils/dbgstream.c (mu_dbgstream_create): Open the stream.
      * libmailutils/file_stream.c (mu_file_stream_create)
      (mu_fd_stream_create): Open the stream.
      * libmailutils/filter_iconv.c (mu_filter_iconv_create): Open the stream.
      * libmailutils/mapfile_stream.c (mu_mapfile_stream_create): Open the stream.
      * libmailutils/fltstream.c (mu_filter_stream_create): Mark the stream
      as open.
      * libmailutils/iostream.c (mu_iostream_create): Likewise.
      * libmailutils/memory_stream.c: Likewise.
      * libmailutils/message.c (_message_stream_create): Likewise.
      * libmailutils/message_stream.c (mu_message_stream_create): Likewise.
      * libmailutils/prog_stream.c (mu_prog_stream_create): Likewise.
      * libmailutils/socket_stream.c (mu_socket_stream_create): Likewise.
      * libmailutils/temp_file_stream.c (mu_temp_file_stream_create): Likewise.
      
      * libmailutils/amd.c (_amd_attach_message): Mark stream as open.
      * libmailutils/body.c (_body_get_stream): Likewise.
      * libmailutils/memory_stream.c: Likewise.
      * libmailutils/rdcache_stream.c (mu_rdcache_stream_create: Likewise.
      * libmailutils/stdio_stream.c (mu_stdio_stream_create): Likewise.
      * libmailutils/streamref.c (mu_streamref_create_abridged): Likewise.
      * libmailutils/tcp.c (mu_tcp_stream_create_with_source_ip): Likewise.
      * libmailutils/xscript-stream.c (mu_xscript_stream_create): Likewise.
      * libmu_auth/tls.c (_mu_tls_io_stream_create): Likewise.
      (_mu_tls_stream_create): Likewise.
      * libproto/pop/pop3_stream.c (mu_pop3_stream_create): Likewise.
      
      * examples/base64.c: Remove unnecessary mu_stream_open.
      * examples/http.c: Likewise.
      * examples/iconv.c: Likewise.
      * examples/msg-send.c: Likewise.
      * examples/murun.c: Likewise.
      * examples/musocio.c: Likewise.
      * examples/pop3client.c: Likewise.
      * imap4d/append.c: Likewise.
      * imap4d/io.c: Likewise.
      * imap4d/preauth.c: Likewise.
      * lib/mailcap.c: Likewise.
      * libmailutils/attachment.c: Likewise.
      * libmailutils/cfg_driver.c: Likewise.
      * libmailutils/header.c: Likewise.
      * libmailutils/mailcap.c: Likewise.
      * libmailutils/mimehdr.c: Likewise.
      * libmailutils/mutil.c: Likewise.
      * libmailutils/tests/fltst.c: Likewise.
      * libmailutils/tests/mailcap.c: Likewise.
      * libmailutils/vartab.c: Likewise.
      * libmailutils/wicket.c: Likewise.
      * libmu_argp/muinit.c: Likewise.
      * libmu_auth/ldap.c: Likewise.
      * libmu_sieve/extensions/pipe.c: Likewise.
      * libmu_sieve/extensions/spamd.c: Likewise.
      * libmu_sieve/extensions/vacation.c: Likewise.
      * libproto/imap/folder.c: Likewise.
      * libproto/mailer/smtp.c: Likewise.
      * libproto/mailer/smtp_starttls.c: Likewise.
      * libproto/mbox/mbox.c: Likewise.
      * libproto/nntp/nntp_connect.c: Likewise.
      * libproto/pop/mbox.c: Likewise.
      * libproto/pop/pop3_connect.c: Likewise.
      * libproto/pop/pop3_stls.c: Likewise.
      * maidag/mailtmp.c: Likewise.
      * mail/decode.c: Likewise.
      * mail/pipe.c: Likewise.
      * mail/send.c: Likewise.
      * mail/send.c: Likewise.
      * mail/write.c: Likewise.
      * mh/burst.c: Likewise.
      * mh/comp.c: Likewise.
      * mh/compcommon.c: Likewise.
      * mh/forw.c: Likewise.
      * mh/mh_init.c: Likewise.
      * mh/mh_whatnow.c: Likewise.
      * mh/mhl.c: Likewise.
      * mh/mhn.c: Likewise.
      * mh/repl.c: Likewise.
      * mimeview/mimeview.c: Likewise.
      * pop3d/extra.c: Likewise.
      * sieve/sieve.c: Likewise.
      * testsuite/smtpsend.c: Likewise.
      Sergey Poznyakoff authored
  6. 25 Sep, 2010 2 commits
    • * examples/musocio.c: Use default stream buffer size.
      * imap4d/io.c: Likewise.
      * libmailutils/dbgstream.c: Likewise.
      * libmailutils/iostream.c: Likewise.
      * libmailutils/xscript-stream.c: Likewise.
      * libmu_auth/gsasl.c: Likewise.
      * libmu_auth/tls.c: Likewise.
      * libproto/pop/mbox.c: Likewise.
      * libproto/pop/pop3_stream.c: Likewise.
      * pop3d/extra.c: Likewise.
      
      * libmailutils/file_stream.c (mu_file_stream_create)
      (mu_fd_stream_create): File streams are fully buffered by default.
      * libmailutils/stdio_stream.c (mu_stdio_stream_create): Stdio streams
      are line buffered by default.
      Sergey Poznyakoff authored
    • * configure.ac: Use libmuaux.a instead of libmuaux.la.
      * examples/Makefile.am: Likewise.
      * examples/cpp/Makefile.am: Likewise.
      * imap4d/Makefile.am: Likewise.
      * mapi/Makefile.am: Likewise.
      * mh/Makefile.am: Likewise.
      * pop3d/Makefile.am: Likewise.
      
      Remove old files from POTFILES.in (see c42bddb0).
      
      * po/POTFILES.in: Remove comsat/oldcfg.c.
      
      Build testsuites after the programs they are to test.
      
      * frm/Makefile.am (SUBDIRS): Put . before tests.
      * messages/Makefile.am: Likewise.
      * readmsg/Makefile.am: Likewise.
      * sieve/Makefile.am: Likewise.
      
      Remove leftovers from CVS times:
      
      * .cvsignore: Remove.
      * am/.cvsignore: Remove.
      * lib/.cvsignore: Remove.
      * po/.cvsignore
      Sergey Poznyakoff authored
  7. 21 Sep, 2010 1 commit
    • * include/mailutils/cpp/pop3.h (capa): Add reread parameter.
      (getline): Add new prototype.
      (send, readline): Remove.
      (response, stat): Change prototype.
      * libmu_cpp/pop3.cc: Likewise.
      * include/mailutils/cpp/stream.h
      (read, write, readline): Change prototype.
      (sequential_readline, sequential_write): Remove.
      * libmu_cpp/stream.cc: Likewise.
      Wojciech Polak authored
  8. 15 Sep, 2010 1 commit
    • * examples/listop.c: Move to libmailutils/tests.
      * examples/Makefile.am (noinst_PROGRAMS): Remove listop.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add listop.
      (TESTSUITE_AT): Add list.at.
      * libmailutils/tests/.gitignore: New file.
      * libmailutils/tests/list.at: New file.
      * libmailutils/tests/testsuite.at: Include list.at.
      
      * libmailutils/list.c (list_itrctl): Fix mu_itrctl_replace.
      Sergey Poznyakoff authored
  9. 14 Sep, 2010 1 commit
    • * configure.ac: Create libmailutils/tests/atlocal and
      libmailutils/tests/Makefile. Remove libmailutils/testsuite.
      * examples/Makefile.am (noinst_PROGRAMS): Remove programs moved
      to libmailutils/tests.
      * examples/argcv.c -> libmailutils/tests/argcv.c
      * libmailutils/testsuite/Decode -> libmailutils/tests/Decode
      * libmailutils/testsuite/Encode -> libmailutils/tests/Encode
      * examples/decode2047.c: Move to libmailutils/tests
      * examples/encode2047.c: Move to libmailutils/tests
      * examples/mailcap.c: Likewise.
      * examples/url-parse.c: Likewise.
      
      * include/mailutils/Makefile.am: Minor changes.
      * libmailutils/Makefile.am (SUBDIRS): Replace testsuite with tests.
      * libmailutils/tests/Makefile.am: New file.
      * libmailutils/tests/addr.c: New file.
      * libmailutils/tests/address.at: New file.
      * libmailutils/tests/argcv.at: New file.
      * libmailutils/tests/atlocal.in: New file.
      * libmailutils/tests/base64d.at: New file.
      * libmailutils/tests/base64e.at: New file.
      * libmailutils/tests/decode2047.at: New file.
      * libmailutils/tests/encode2047.at: New file.
      * libmailutils/tests/fltst.c: New file.
      * libmailutils/tests/mailcap.at: New file.
      * libmailutils/tests/mime.at: New file.
      * libmailutils/tests/testsuite.at: New file.
      * libmailutils/tests/url.at: New file.
      
      * libmailutils/testsuite/: Delete.
      
      * frm/tests/Makefile.am: Prefix package.m4 creation commands with $(AM_V_GEN).
      * readmsg/tests/Makefile.am: Likewise.
      * sieve/tests/Makefile.am: Likewise.
      * frm/tests/testsuite.at: Minor changes.
      * readmsg/tests/testsuite.at: Include testsuite.inc.
      * sieve/tests/testsuite.at: Likewise.
      * sieve/tests/version.at: Comment out inclusion of testsuite.inc.
      * testsuite/testsuite.inc: Add m4_version_prereq.
      Sergey Poznyakoff authored
  10. 13 Sep, 2010 1 commit
    • * include/mailutils/sys/stream.h (_MU_STR_EVENT_SET): Rename
      to _MU_STR_EVENT_SET.
      (_MU_STR_EVENT_CLR): Rename to _MU_STR_EVENT_CLRFLAG.
      (_MU_STR_EVENT_FILLBUF, _MU_STR_EVENT_FLUSHBUF): New event codes.
      (_MU_STR_EVMASK): New macro.
      (_mu_stream) <cur>: Replace with pos, indicating current position
      in the buffer.
      (event_cb): Change signature.
      (mu_stream_read_unbuffered): Remove.
      (mu_stream_write_unbuffered): Remove.
      
      * mailbox/iostream.c (mu_iostream_create): Provide the readdelim method
      only if the underlying input transpor stream provides it.
      * mailbox/streamref.c (mu_streamref_create_abridged): Likewise.
      
      * mailbox/stream.c (_stream_event): New macro.
      (mu_stream_read_unbuffered): Rename to static _stream_read_unbuffered.
      (mu_stream_write_unbuffered): Rename to static _stream_write_unbuffered.
      (_stream_advance_buffer, _stream_buffer_offset)
      (_stream_orig_level): Remove macros.
      (_stream_buffer_freespace): Rewrite.
      (_stream_curp): New macro.
      (_stream_fill_buffer): Make sure the `offset' indicates the offset
      int the transport, corresponding to the beginning of the current
      buffer.
      (_stream_flush_buffer): Essentially rewritten.
      (mu_stream_seek): Reflect changes to the _mu_stream structure. Optimize
      calls to the seek method.
      (_stream_skip_input_bytes): Likewise.
      (mu_stream_read, _stream_scandelim, mu_stream_write): Rewrite using
      new _mu_stream structure.
      
      * mailbox/xscript-stream.c: Rewrite using stream events.
      
      * mailbox/base64.c (_base64_encoder): Bugfix.
      
      * libproto/pop/pop3_stream.c (_pop3_event_cb): Update signature to
      match the changes above.
      * examples/mimetest.c (main): Add more error checking.
      * mail/testsuite/mail/write.exp: Minor fix.
      Sergey Poznyakoff authored
  11. 08 Sep, 2010 18 commits
    • * include/mailutils/stream.h (MU_IOCTL_LEVEL): New ioctl op.
      (XSCRIPT_NORMAL, XSCRIPT_SECURE, XSCRIPT_PAYLOAD): New constants.
      * include/mailutils/sys/xscript-stream.h (_mu_xscript_stream)
      <level>: New member.
      * mailbox/xscript-stream.c (TRANS_DISABLED): New flag.
      (print_transcript): Amount of output varies depending on the
      current output level.  For secure data, try to recognize passwords
      and to replace them with *** on output.
      (_xscript_ctl): Support MU_IOCTL_LEVEL.
      * pop3d/extra.c (set_xscript_level): New function.
      * pop3d/pop3d.h (set_xscript_level): New proto.
      * pop3d/retr.c (pop3d_retr): Set XSCRIPT_PAYLOAD level before
      sending actual data and reset it to XSCRIPT_NORMAL afterwards.
      * pop3d/top.c (pop3d_top): Likewise.
      * pop3d/user.c: Set XSCRIPT_SECURE level while expecting the
      PASS command.
      
      * imap4d/fetch.c (imap4d_fetch): Run imap4d_fetch0 in XSCRIPT_PAYLOAD
      level.
      * imap4d/uid.c (imap4d_uid): Likewise.
      * imap4d/imap4d.c (imap4d_mainloop): Unless started in preauth mode,
      select XSCRIPT_SECURE mode until authentication has been passed.
      * imap4d/imap4d.h (set_xscript_level): New proto.
      * imap4d/io.c (io_format_completion_response): Switch to XSCRIPT_NORMAL
      level when changing to the authenticated state.
      (imap4d_readline): Read literals in XSCRIPT_PAYLOAD level.
      * imap4d/util.c (set_xscript_level): New function.
      
      * include/mailutils/pop3.h (mu_pop3_trace_mask): New prototype.
      (MU_POP3_XSCRIPT_MASK): New macro.
      (_mu_pop3_xscript_level): New proto.
      * libproto/pop/pop3_pass.c (mu_pop3_pass): Set XSCRIPT_SECURE
      while sending the password.
      * libproto/pop/pop3_retr.c (mu_pop3_retr): Set XSCRIPT_PAYLOAD before
      going to MU_POP3_RETR_RX state.
      * libproto/pop/pop3_stream.c (_pop3_event_cb): Set XSCRIPT_NORMAL.
      * libproto/pop/pop3_top.c (mu_pop3_top): Set XSCRIPT_PAYLOAD before
      going to MU_POP3_TOP_RX state.
      * libproto/pop/pop3_trace.c (mu_pop3_trace_mask)
      (_mu_pop3_xscript_level): New functions.
      * libproto/pop/mbox.c (pop_open): Set trace masks depending on the
      trace6 and trace7 debug levels.
      
      * examples/pop3client.c (com_verbose): Allow to mask/unmask transcript
      levels.
      Sergey Poznyakoff authored
    • * mailbox/msgscan.c: New file.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add it.
      
      * include/mailutils/body.h (mu_body_set_get_stream): New prototype.
      * include/mailutils/message.h (MU_SCAN_SEEK, MU_SCAN_SIZE): New
      defines.
      (mu_message_scan): New structure.
      (mu_stream_scan_message): New prototype.
      (mu_message_set_get_stream): New prototype.
      * include/mailutils/stream.h (mu_stream_copy): Change signature: takes
      4 arguments now.
      * include/mailutils/sys/body.h (_mu_body) <_get_stream>: New method.
      * include/mailutils/sys/message.h (_mu_message) <_get_stream>: New method.
      * mailbox/body.c (_body_get_stream): Call _get_stream, if provided.
      * mailbox/message.c (_message_get_stream): Call _get_stream, if provided.
      
      * mailbox/stream.c (_stream_flush_buffer): Avoid infinite recursion:
      call stream->seek directly.
      * mailbox/streamcpy.c (mu_stream_copy): Return the number of bytes
      actually copied in the fourth argument. All uses updated.
      * mailbox/streamref.c (streamref_return): Do not propagate internal
      flags.
      (_streamref_readdelim): Ensure there is enough buffer space for the
      mu_stream_readdelim call.
      
      * libproto/pop/mbox.c: Finish client implementation.
      
      * mail/print.c (mail_print_msg): Close pager before returning on
      error.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/stdio_stream.h: Remove.
      * include/mailutils/sys/socket_stream.h: Remove.
      * include/mailutils/sys/rdcache_stream.h: New file.
      * include/mailutils/sys/Makefile.am: Update.
      * mailbox/rdcache_stream.c: New file.
      * mailbox/Makefile.am: Update.
      
      * examples/mucat.c: New example.
      * examples/musocio.c: New example.
      * examples/Makefile.am (noinst_PROGRAMS): Build new examples.
      
      * include/mailutils/stream.h (mu_fd_stream_create): New proto.
      (mu_rdcache_stream_create): New proto.
      * include/mailutils/sys/file_stream.h (_mu_file_stream_create): Change
      prototype.
      * mailbox/file_stream.c (fd_open): Raise the MU_STREAM_AUTOCLOSE bit.
      (fd_ioctl): Support MU_IOCTL_SET_TRANSPORT.
      (_mu_file_stream_create): Change signature. All uses updated.
      Allocate a copy of the filename argument, unless it is NULL.
      (mu_fd_stream_create): New function.
      
      * mailbox/socket_stream.c: Rewrite using file_stream directly.
      * mailbox/stdio_stream.c: Rewrite. Use rdcache_stream if
      the seek capability is required on an input stream.
      * mailbox/streamcpy.c (mu_stream_copy): Handle eventual
      EACCES return from mu_stream_seek as equivalent to ENOSYS.
      Sergey Poznyakoff authored
    • * examples/pop3client.c (com_capa): Call mu_pop3_capa_test.
      (com_stat): Count is size_t.
      
      * include/mailutils/opool.h (mu_opool_copy): New proto.
      * mailbox/opool.c (mu_opool_copy): New function.
      * mailbox/xscript-stream.c (_xscript_ctl)
      <MU_IOCTL_SWAP_STREAM>: Avoid coredumping if sp->transport
      is NULL.
      
      * include/mailutils/pop3.h (pop3_capa_test): Rename to
      mu_pop3_capa_test.
      (mu_pop3_stat): Third argument is a pointer to mu_off_t.
      * libproto/pop/pop3_capatst.c (pop3_capa_test): Rename to
      mu_pop3_capa_test.
      * libproto/pop/pop3_stat.c (mu_pop3_stat): Third argument is
      a pointer to mu_off_t.
      
      * libproto/pop/Makefile.am (libmu_pop_la_SOURCES): Put back
      folder.c, url.c and mbox.c.
      * libproto/pop/mbox.c: Begin rewriting.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/stream.h (_MU_STR_EVENT_SET)
      (_MU_STR_EVENT_CLR): New defines.
      (_mu_stream) <event_cb, event_mask>: New members.
      * mailbox/stream.c (_stream_setflag, _stream_clrflag): New static
      functions.
      All functions use these instead of setting/clearing flags directly.
      (_mu_stream_cleareof, _mu_stream_seteof): New extern functions.
      (_stream_cleareof): Remove define, use _mu_stream_cleareof instead.
      (_stream_fill_buffer): Set EOF marker when end of stream is reached.
      
      * mailbox/fltstream.c (filter_read): Call _mu_stream_seteof to set
      EOF flag.
      
      * include/mailutils/pop3.h: Get rid of the superfluous "extern" in
      front of function prototypes.
      Add new prototypes.
      Remove extra whitespace.
      
      * libproto/pop/pop3_capatst.c: New file.
      * libproto/pop/pop3_list_cmd.c: New file.
      * libproto/pop/pop3_listas.c: New file.
      * libproto/pop/pop3_rdlist.c: New file.
      * libproto/pop/pop3_uidl_cmd.c: New file.
      * libproto/pop/pop3_uidlas.c: New file.
      * libproto/pop/Makefile.am: Add new files.
      * libproto/pop/pop3_capa.c (_mu_pop3_fill_list): Remove.
      Use mu_pop3_read_list instead.
      (capa_comp): New comparator for capa lists.
      * libproto/pop/pop3_list.c (mu_pop3_list): Fix format specifier.
      * libproto/pop/pop3_lista.c (mu_pop3_list_all): Rewrite.
      * libproto/pop/pop3_retr.c (mu_pop3_retr) <MU_POP3_RETR_RX>: do not
      reset state, this is done by the EOF event callback.
      * libproto/pop/pop3_top.c (mu_pop3_top) <MU_POP3_TOP_RX>: Likewise.
      * libproto/pop/pop3_stream.c (pop3_decode_state): New state pds_char.
      Change semantics of pds_init.
      (newstate, _pop3_decoder): Handle .\r\n in the initial state.
      (_pop3_event_cb): New event callback.
      (mu_pop3_filter_create): Set event callback on the filter stream.
      * libproto/pop/pop3_uidla.c (mu_pop3_uidl_all): Rewrite.
      
      * examples/Makefile.am (pop3client_CPPFLAGS): Add MU_APP_COMMON_INCLUDES.
      * examples/pop3client.c: Rewrite command parser.
      Sergey Poznyakoff authored
    • * include/mailutils/filter.h (mu_filter_io) <eof>: New member.
      * mailbox/fltstream.c (init_iobuf): Initialize eof to 0.
      (filter_read): Break the loop if the decoder has set eof.
      * mailbox/xscript-stream.c (_xscript_ctl) <MU_IOCTL_SWAP_STREAM>: Handle
      a special case when the transport does not support stream swapping.
      
      * include/mailutils/pop3.h (mu_pop3_set_debug): Remove.
      (MU_POP3_TRACE_CLR, MU_POP3_TRACE_SET, MU_POP3_TRACE_QRY): New macros.
      (mu_pop3_trace): New proto.
      (mu_pop3_readline): Remove.
      (mu_pop3_getline): New proto.
      (mu_pop3_capa): Change signature.
      * include/mailutils/sys/pop3.h (mu_pop3_state): Remove the *_ACK states.
      (mu_pop3_work_buf): Remove.
      (MU_POP3_ACK, MU_POP3_TRACE): New defines.
      (_mu_pop3): Rewrite the structure.
      (mu_pop3_debug_cmd, mu_pop3_debug_ack): Remove functions.
      (MU_POP3_FISSET, MU_POP3_FSET, MU_POP3_FCLR): New macros.
      (_mu_pop3_trace_enable, _mu_pop3_trace_disable)
      (_mu_pop3_init): New protos.
      
      * include/mailutils/tls.h (mu_tls_stream_ctl_fn)
      (mu_tls_writeline_fn): Change typedefs.
      * libmu_auth/tls.c (mu_tls_begin): Update function calls
      accordingly.
      
      * libproto/pop/pop3_debug.c: Remove.
      * libproto/pop/pop3_trace.c: New function.
      * libproto/pop/Makefile.am (libmu_pop_la_SOURCES): Temporarly
      comment out folder.c, mbox.c and url.c.
      Remove pop3_debug.c.
      Add pop3_trace.c.
      * libproto/pop/pop3_capa.c: Rewrite.
      * libproto/pop/pop3_create.c: Rewrite.
      * libproto/pop/pop3_iterator.c: Rewrite.
      * libproto/pop/pop3_response.c: Rewrite.
      * libproto/pop/pop3_sendline.c: Rewrite.
      * libproto/pop/pop3_stls.c: Rewrite.
      * libproto/pop/pop3_stream.c: Rewrite.
      * libproto/pop/pop3_apop.c: Reflect changes to the pop3 framework.
      * libproto/pop/pop3_carrier.c: Likewise.
      * libproto/pop/pop3_connect.c: Likewise.
      * libproto/pop/pop3_dele.c: Likewise.
      * libproto/pop/pop3_destroy.c: Likewise.
      * libproto/pop/pop3_disconnect.c: Likewise.
      * libproto/pop/pop3_list.c: Likewise.
      * libproto/pop/pop3_lista.c: Likewise.
      * libproto/pop/pop3_noop.c: Likewise.
      * libproto/pop/pop3_pass.c: Likewise.
      * libproto/pop/pop3_quit.c: Likewise.
      * libproto/pop/pop3_retr.c: Likewise.
      * libproto/pop/pop3_readline.c: Likewise.
      * libproto/pop/pop3_rset.c: Likewise.
      * libproto/pop/pop3_stat.c: Likewise.
      * libproto/pop/pop3_top.c: Likewise.
      * libproto/pop/pop3_uidl.c: Likewise.
      * libproto/pop/pop3_uidla.c: Likewise.
      * libproto/pop/pop3_user.c: Likewise.
      
      * examples/pop3client.c: Implement the stls comand.
      (main) [WITH_TLS]: Call mu_init_tls_libs.
      (com_verbose): Redo verbose support.
      (com_capa): Implement "reread" option.
      Sergey Poznyakoff authored
    • If a stream takes another stream(s) as a transport, it
      always increases its reference count.  This means that
      when that stream is destroyed the underlying stream is
      not destroyed by default (its refcount is decreased, that's
      all). To force destruction of the underlying stream,
      the caller must explicitly unreference it after creating
      the stream that uses it (or give its creation function
      the MU_STREAM_AUTOCLOSE flag, if it supports flags).
      
      Similarly, if a stream uses a non-stream object (e.g. a file
      descriptor) as the transport, it will not destroy it, unless
      it has been created with the MU_STREAM_AUTOCLOSE flag. This
      differs from the previous behavior.
      
      The MU_STREAM_NO_CHECK and MU_STREAM_NO_CLOSE flags are removed.
      
      * examples/base64.c (main): Call mu_filter_create with the
      MU_STREAM_AUTOCLOSE flag.
      * examples/mimetest.c (message_display_parts): Likewise.
      * examples/murun.c (main): Unref the input stream after
      passing it to mu_filter_prog_stream_create.
      * imap4d/fetch.c (fetch_io): Update arguments to mu_filter_create
      and mu_memory_stream_create.
      * imap4d/preauth.c (decode64_buf)
      (do_preauth_ident): Update arguments to mu_memory_stream_create and
      mu_tcp_stream_create.
      * imap4d/util.c (util_setio): Update arguments to mu_filter_create and
      mu_stdio_stream_create.
      * include/mailutils/stream.h (MU_STREAM_NO_CLOSE)
      (MU_STREAM_NO_CHECK): Remove.
      (MU_STREAM_AUTOCLOSE): New flag.
      (mu_iostream_create): Remove the `flags' argument.
      * libmu_argp/muinit.c (mu_app_init): Update arguments to
      mu_stdio_stream_create.
      * libmu_auth/ldap.c: Update arguments to
      mu_memory_stream_create and mu_filter_create.
      * libmu_auth/tls.c (_tls_io_close, _tls_close): Always try to close the
      transport stream. Rely on refcount to protect it.
      (_tls_io_done, _tls_done): Likewise, always unreference it.
      (_mu_tls_io_stream_create): Increase reference counter on the
      transport stream, unless MU_STREAM_AUTOCLOSE is requested.
      (_mu_tls_stream_create): Rewrite using the new MU_STREAM_AUTOCLOSE
      logic.
      * libmu_sieve/extensions/spamd.c (spamd_connect_tcp): Update arguments to
      mu_tcp_stream_create.
      (spamd_connect_tcp): Update arguments to mu_socket_stream_create and
      mu_filter_create.
      * libmu_sieve/extensions/vacation.c (build_mime): Update arguments to
      mu_filter_create.
      * mail/decode.c (display_submessage): Update arguments to
      mu_filter_create.
      * mailbox/attachment.c (mu_message_save_attachment): Update arguments to
      mu_filter_create.
      * mailbox/cfg_driver.c (mu_cfg_tree_reduce): Update arguments to
      mu_stdio_stream_create.
      * mailbox/dbgstream.c (_dbg_done): Use MU_STREAM_AUTOCLOSE bit to
      decide whether to destroy the debug object.
      (mu_dbgstream_create): Use MU_STREAM_AUTOCLOSE instead of
      MU_STREAM_NO_CLOSE.
      * mailbox/file_stream.c (fd_close): Use MU_STREAM_AUTOCLOSE bit to
      decide whether to close the descriptor.
      (mu_file_stream_create): Force MU_STREAM_AUTOCLOSE bit.
      * mailbox/filter.c (filter_create_rd, filter_create_wr): Change
      substream creation logic.
      * mailbox/filter_iconv.c (_icvt_close): Always try to close the
      transport stream. Rely on refcount to protect it.
      (_icvt_done): Ditto for destroying it.
      (mu_filter_iconv_create): Increase refcount on the transport stream,
      unless MU_STREAM_AUTOCLOSE is requested.
      * mailbox/fltstream.c (filter_done): Always dereference the
      transport stream. Rely on refcount to protect it.
      (filter_close): Ditto for closing it.
      (mu_filter_stream_create): Increase refcount on the transport stream,
      unless MU_STREAM_AUTOCLOSE is requested.
      * mailbox/iostream.c (_iostream_close) : Always try to close the
      transport stream. Rely on refcount to protect it.
      (_iostream_done): Ditto for closing it.
      (mu_iostream_create): Remove the use of MU_STREAM_NO_CLOSE.
      * mailbox/mimehdr.c (mu_mimehdr_decode_param): Remove the use of
      MU_STREAM_NO_CLOSE.
      * mailbox/mutil.c (mu_decode_filter) Change substream creation logic.
      * mailbox/prog_stream.c (_prog_open): Use MU_STREAM_AUTOCLOSE bit
      in arguments to mu_stdio_stream_create.
      (mu_filter_prog_stream_create): Increase refcount on the transport
      (input) stream.
      * mailbox/rfc2047.c (mu_rfc2047_decode): Dereference in_stream after
      passing it to mu_decode_filter.
      Pass MU_STREAM_AUTOCLOSE in flags to mu_filter_create.
      * mailbox/socket_stream.c (mu_socket_stream_create): Force
      MU_STREAM_AUTOCLOSE bit.
      * mailbox/streamref.c (_streamref_close): Always close the
      transport stream (refcount will protect it, if necessary).
      (mu_streamref_create_abridged): Mask out the MU_STREAM_AUTOCLOSE bit.
      * mailbox/temp_file_stream.c (mu_temp_file_stream_create: Force
      MU_STREAM_AUTOCLOSE bit.
      * mailbox/xscript-stream.c (_xscript_close): Always close the
      transport stream (refcount will protect it, if necessary).
      (mu_xscript_stream_create): Increase refcounts on both underlying streams,
      unless MU_STREAM_AUTOCLOSE is set.
      * pop3d/extra.c (pop3d_setio): Remove uses of MU_STREAM_NO_CLOSE.
      
      * examples/nntpclient.c: Remove uses of MU_STREAM_NO_CHECK/MU_STREAM_NO_CLOSE.
      * examples/pop3client.c: Likewise.
      * libmu_auth/gsasl.c: Likewise.
      * libproto/nntp/nntp_stream.c: Likewise.
      * libproto/pop/pop3_stream.c: Likewise.
      * mailbox/tcp.c: Likewise.
      * mailbox/vartab.c: Likewise.
      * mh/mh_list.c: Likewise.
      * mimeview/mimeview.c: Likewise.
      * mh/mhn.c: Likewise.
      (edit_mime): Use MU_STREAM_AUTOCLOSE.
      
      Bugfixes:
      
      * mailbox/fltstream.c (init_iobuf): Fix input initialization.
      (filter_write_internal): Bugfix.
      * mailbox/stream.c (_stream_buffer_freespace): New macro.
      (_stream_buffer_is_full): New macro.
      (BUFFER_FULL_P): Remove, use _stream_buffer_is_full instead. All callers
      updated.
      (_stream_flush_buffer): Operation for full buffered streams does not
      depend on the `all' flag.
      (mu_stream_write): Fix calculation of the bytes available in the
      buffer.
      Sergey Poznyakoff authored
    • Bugfix. · c1d1ab07
      * imap4d/append.c: Add a comment.
      * imap4d/imap4d.h (imap4d_child_signal_setup): New proto.
      * libmu_sieve/extensions/pipe.c (sieve_action_pipe): Use
      mu_stream_copy, rewrite error handling.
      * libmu_sieve/extensions/spamd.c (spamd_send_message): se
      mu_stream_copy.
      (spamd_test): Honor dry-run mode.
      * libmu_sieve/extensions/vacation.c (build_mime): Remove
      misleading FIXME. Use mu_stream_copy.
      * libmu_sieve/extensions/moderator.c (moderator_message_get_part): Use
      mu_body_get_streamref.
      * examples/header.c (hstream): New global.
      (cmd_load, cmd_free, cmd_remove, cmd_insert): Discard hstream.
      (cmd_readline): Use hstream. Obtain it using mu_stream_readline.
      * libproto/mbox/mbox.c (mbox_envelope_date): Remove trailing
      newline from the obtained envelope line.
      * mailbox/amd.c (amd_body_stream_seek): Allow for off == size
      (imprtant for empty bodies).
      Sergey Poznyakoff authored
    • * examples/mta.c (finalize_option): New variable.
      (message_finalize): Don't modify the message if finalize_option
      is 0.
      * include/mailutils/sys/message.h (_mu_message)
      <orig_header_size>: New member.
      * include/mailutils/sys/mime.h (_mu_mime) <part_stream>: New member.
      * libmu_sieve/actions.c (mime_create_reason)
      (mime_create_ds): Use mu_body_get_streamref.
      (mime_create_quote): Use mu_body_get_streamref/mu_message_get_streamref.
      (sieve_action_reject): Set the To: header.
      * mailbox/message.c (mu_message_get_header): Set orig_header_size.
      (mu_message_get_body): Use orig_header_size instead of relying
      on mu_header_size.
      * mailbox/mime.c (_mime_part_size): New static.
      (_mime_body_stream_size): New method.
      (_mime_body_seek): Rename to _mime_body_stream_seek.
      (_mime_body_read): Rewrite and rename to _mime_body_stream_read.
      (_mime_body_ioctl): Rename to _mime_body_stream_ioctl.
      (create_mime_body_stream): Take mu_mime_t as the 2nd parameter.
      Initialize sp->stream.size and sp->mime.
      (_mime_body_size): Rewrite using _mime_part_size.
      (mu_mime_destroy): Destroy part_stream.
      * sieve/testsuite/Redirect: Reflect new mta behavior.
      * sieve/testsuite/Reject: Likewise.
      Sergey Poznyakoff authored
    • * examples/base64.c (c_copy): Handle printable mode (-p).
      (reset_line_length): New function.
      (main): New option -lN sets the maximum length for output
      lines to N (0 means unlimited).
      * mailbox/testsuite/mailbox/base64.exp: Use -l0 in the
      Decode test.
      Sergey Poznyakoff authored
    • * include/mailutils/stream.h (mu_stream_skip_input_bytes): New proto.
      * mailbox/stream.c (mu_stream_skip_input_bytes): New function.
      * mailbox/fltstream.c (filter_seek): Re-implement on top of
      mu_stream_skip_input_bytes.
      (mu_filter_stream_create): Fix flag validity checking.
      
      * examples/base64.c: Add new option (-s) for testing seek operations
      on filters.
      Sergey Poznyakoff authored
    • * include/mailutils/libargp.h (mu_program_version_hook): New proto.
      * libmu_argp/Makefile.am (libmu_argp_a_SOURCES): Remove mu_argp.h.
      * libmu_argp/mu_argp.h: Remove.
      * libmu_argp/muinit.c [MU_ALPHA_RELEASE]: Include git-describe.h
      (mu_program_version_hook): New function.
      (mu_argp_init): Set mu_program_version_hook, unless vers is given.
      
      * comsat/comsat.c (main): Call mu_argp_init with NULL arguments.
      * config/mailutils-config.c: Likewise.
      * dotlock/dotlock.c: Likewise.
      * examples/muauth.c: Likewise.
      * frm/frm.c: Likewise.
      * frm/from.c: Likewise.
      * guimb/main.c: Likewise.
      * imap4d/imap4d.c: Likewise.
      * maidag/maidag.c: Likewise.
      * mail/mail.c: Likewise.
      * messages/messages.c: Likewise.
      * mimeview/mimeview.c: Likewise.
      * movemail/movemail.c: Likewise.
      * pop3d/pop3d.c: Likewise.
      * pop3d/popauth.c: Likewise.
      * readmsg/readmsg.c: Likewise.
      * sieve/sieve.c: Likewise.
      Sergey Poznyakoff authored
    • * .gitignore: Add git-describe and git-describe.h.
      * Makefile.am (MU_COND_LIBMU_CPP): Replaced with MU_COND_SUPPORT_CXX
      (SUBDIRS): Begin with .
      (EXTRA_DIST, BUILT_SOURCES): Add git-describe and git-describe.h.
      (git-describe, git-describe.h): New rules.
      (alpha, alphacheck): Use git-describe to produce additional suffix.
      * enable.m4 (MU_ENABLE_SUPPORT): Create an Automake condition.
      * configure.ac: Fix MU_ENABLE_SUPPORT calls.
      (--without-python): Replace with --disable-python.
      * examples/Makefile.am: Disable components based on MU_COND conditions.
      * libproto/Makefile.am: Likewise.
      * include/mailutils/Makefile.am (MU_COND_LIBMU_CPP): Replace with
      MU_COND_SUPPORT_CXX.
      
      * mailbox/nullrec.c: New file.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add nullrec.c.
      
      * mail/decode.c: Remove unused variable.
      * mailbox/streamref.c: Likewise.
      Sergey Poznyakoff authored
    • * examples/header.c: Use streamrefs.
      * examples/mimetest.c: Likewise.
      * examples/mta.c: Likewise.
      * examples/nntpclient.c: Remove an unused variable.
      Sergey Poznyakoff authored
    • * examples/sfrom.c (main): Check return from mu_mailbox_messages_count.
      * include/mailutils/sys/stream.h (_MU_STR_WRT): New constant.
      * libproto/mbox/mbox.c (_msg_stream_setup): Fix 3rd argument to
      mu_streamref_create_abridged.
      * libproto/mbox/mboxscan.c (mbox_scan_internal): Don't use mailbox->stream
      directly, because its offsets may get shifted by observers. Use streamref
      instead.
      * mailbox/argcv.c (argcv_get): Do nothing if argc <= 0.
      * mailbox/mapfile_stream.c (_mapfile_seek): Fill the *presult.
      * mailbox/memory_stream.c (_memory_done): Remove leftover free.
      * mailbox/stream.c: Reorder functions.
      (_mu_stream_create): Increase reference count (i.e. set it to 1)
      before returning.
      (mu_stream_seek): Call _stream_flush_buffer instead of
      mu_stream_flush.
      (mu_stream_read_unbuffered): Return 0 on EOF.
      (mu_stream_write_unbuffered): Set _MU_STR_WRT bit.
      (mu_stream_readline, mu_stream_getdelim): Check the actual
      number of bytes read.
      (mu_stream_flush): Call flush method only if _MU_STR_WRT is set.
      Clear it.
      * mailbox/streamref.c (_streamref_seek): Optimization for off==0 and
      whence == MU_SEEK_CUR.
      (_streamref_seek): Return new offset in ppos.
      (mu_streamref_create_abridged): Set MU_STREAM_NO_CLOSE.
      * mailbox/memory_stream.c (_memory_seek) : Return new offset in presult.
      * mailbox/message_stream.c (_message_seek): Likewise.
      * mailbox/stdio_stream.c (stdio_seek): Fix prototype.
      Sergey Poznyakoff authored
    • Does not compile yet.
      
      New files:
      * mailbox/streamref.c
      * include/mailutils/sys/streamref.h
      * include/mailutils/sys/file_stream.h
      * include/mailutils/sys/header_stream.h
      * include/mailutils/sys/mapfile_stream.h
      * include/mailutils/sys/memory_stream.h
      * include/mailutils/sys/message_stream.h
      * include/mailutils/sys/prog_stream.h
      * include/mailutils/sys/socket_stream.h
      * include/mailutils/sys/stdio_stream.h
      * include/mailutils/sys/stream.h
      * include/mailutils/sys/streamtrans.h
      * mailbox/prog_stream.c
      * mailbox/stdio_stream.c
      * mailbox/stream_printf.c
      * mailbox/stream_vprintf.c
      * mailbox/temp_file_stream.c
      * mailbox/streamcpy.c
      * mailbox/binflt.c
      * mailbox/crlfflt.c
      * mailbox/fltstream.c
      * mailbox/qpflt.c
      * mailbox/linelenflt.c
      
      Removed files:
      * mailbox/filter_rfc822.c
      * mailbox/filter_trans.c
      
      Moved files (with edits):
      * libproto/include/filter0.h -> include/mailutils/sys/filter.h
      * libproto/include/header0.h -> include/mailutils/sys/header.h
      * libproto/include/message0.h -> include/mailutils/sys/message.h
      * libproto/include/mime0.h -> include/mailutils/sys/mime.h
      
      Modified files:
      * comsat/action.c
      * config/mailutils-config.c
      * examples/base64.c
      * examples/cpp/msg-send.cc
      * examples/header.c
      * examples/http.c
      * examples/iconv.c
      * examples/mimetest.c
      * examples/msg-send.c
      * examples/mta.c
      * examples/murun.c
      * examples/nntpclient.c
      * examples/pop3client.c
      * imap4d/append.c
      * imap4d/auth_gsasl.c
      * imap4d/fetch.c
      * imap4d/preauth.c
      * imap4d/search.c
      * imap4d/util.c
      * include/mailutils/body.h
      * include/mailutils/folder.h
      * include/mailutils/header.h
      * include/mailutils/mailbox.h
      * include/mailutils/mailer.h
      * include/mailutils/mailutils.h
      * include/mailutils/message.h
      * include/mailutils/stream.h
      * include/mailutils/sys/Makefile.am
      * include/mailutils/sys/filter.h
      * include/mailutils/sys/header.h
      * include/mailutils/sys/message.h
      * include/mailutils/sys/mime.h
      * include/mailutils/sys/nntp.h
      * include/mailutils/sys/pop3.h
      * include/mailutils/sys/stream.h
      * include/mailutils/types.hin
      * lib/mailcap.c
      * lib/mu_dbm.h
      * libmu_argp/muinit.c
      * libmu_auth/ldap.c
      * libmu_auth/tls.c
      * libmu_scm/Makefile.am
      * libmu_scm/mu_body.c
      * libmu_scm/mu_message.c
      * libmu_scm/mu_port.c
      * libmu_sieve/actions.c
      * libmu_sieve/extensions/pipe.c
      * libmu_sieve/extensions/spamd.c
      * libmu_sieve/extensions/vacation.c
      * libproto/mailer/smtp.c
      * libproto/mbox/mboxscan.c
      * libproto/mbox/mbox.c
      * libproto/mbox/mbox0.h
      * libproto/nntp/nntp_article.c
      * libproto/nntp/nntp_carrier.c
      * libproto/nntp/nntp_destroy.c
      * libproto/nntp/nntp_ihave.c
      * libproto/nntp/nntp_post.c
      * libproto/nntp/nntp_readline.c
      * libproto/nntp/nntp_sendline.c
      * libproto/pop/pop3_carrier.c
      * libproto/pop/pop3_destroy.c
      * libproto/pop/pop3_readline.c
      * libproto/pop/pop3_sendline.c
      * libproto/pop/pop3_stat.c
      * maidag/mailtmp.c
      * mail/decode.c
      * mail/escape.c
      * mail/msgset.y
      * mail/pipe.c
      * mail/print.c
      * mail/send.c
      * mail/top.c
      * mail/util.c
      * mail/write.c
      * mailbox/Makefile.am
      * mailbox/amd.c
      * mailbox/attachment.c
      * mailbox/body.c
      * mailbox/cfg_driver.c
      * mailbox/cfg_format.c
      * mailbox/debug.c
      * mailbox/file_stream.c
      * mailbox/folder.c
      * mailbox/hdritr.c
      * mailbox/header.c
      * mailbox/mailbox.c
      * mailbox/mailcap.c
      * mailbox/mailer.c
      * mailbox/mapfile_stream.c
      * mailbox/memory_stream.c
      * mailbox/message.c
      * mailbox/message_stream.c
      * mailbox/mime.c
      * mailbox/mimehdr.c
      * mailbox/mutil.c
      * mailbox/prog_stream.c
      * mailbox/progmailer.c
      * mailbox/rfc2047.c
      * mailbox/socket_stream.c
      * mailbox/stream.c
      * mailbox/stream_vprintf.c
      * mailbox/tcp.c
      * mailbox/vartab.c
      * mailbox/wicket.c
      * mh/burst.c
      * mh/comp.c
      * mh/compcommon.c
      * mh/forw.c
      * mh/mh_ctx.c
      * mh/mh_format.c
      * mh/mh_init.c
      * mh/mh_list.c
      * mh/mh_whatnow.c
      * mh/mhl.c
      * mh/mhn.c
      * mh/pick.y
      * mh/repl.c
      * mimeview/mimeview.c
      * mu-aux/generr.awk
      * pop3d/extra.c
      * pop3d/pop3d.h
      * pop3d/retr.c
      * pop3d/top.c
      * readmsg/msglist.c
      * readmsg/readmsg.c
      * sieve/sieve.c
      Sergey Poznyakoff authored
  12. 12 Aug, 2010 1 commit
  13. 02 Jun, 2010 1 commit
  14. 14 Apr, 2010 1 commit
    • * mailbox/filter.c (filter_destroy): Destroy the underlying
      stream, unless flag is given.
      (mu_filter_create): Treat last argument as stream flags.
      * mailbox/filter_iconv.c (_icvt_destroy): Free the icvt_stream
      structure.
      
      * examples/mimetest.c (message_display_parts): Pass
      MU_STREAM_NO_CLOSE to the invocation of mu_filter_create.
      * mail/decode.c (display_submessage): Likewise.
      * mailbox/attachment.c (mu_message_save_attachment): Likewise.
      * mh/mh_list.c (eval_body): Likewise.
      * mh/mhn.c (mhn_message_size, show_internal): Likewise.
      (finish_text_msg): Likewise; call mu_stream_destroy
      
      * imap4d/preauth.c (decode64_buf): remove unnecessary
      call to mu_stream_destroy.
      * libmu_auth/ldap.c (chk_md5, chk_smd5)
      (chk_sha, chk_ssha): Likewise.
      
      * mailbox/mutil.c: Fix indentation.
      Sergey Poznyakoff authored
  15. 08 Apr, 2010 3 commits
    • * include/mailutils/message.h (mu_message_save_attachment)
      (mu_message_encapsulate, mu_message_unencapsulate): Change type
      of the last argument.
      (mu_mime_io_buffer_create,mu_mime_io_buffer_destroy)
      (mu_mime_io_buffer_set_size,mu_mime_io_buffer_get_size)
      (mu_mime_io_buffer_set_charset,mu_mime_io_buffer_sget_charset)
      (mu_mime_io_buffer_aget_charset): New prototypes.
      (mu_mimehdr_get_disp,mu_mimehdr_aget_disp): Remove unneeded
      parameter.
      * include/mailutils/types.hin (mu_mime_io_buffer_t): New type.
      * mailbox/attachment.c (_msg_info): Rename structure to
      _mu_mime_io_buffer.
      <header_buf,header_len,mu_header_size>: Remove unreferenced members.
      <refcnt,bufsize,charset>: New members.
      <ioffset,ooffset>: Change type to size_t.
      (mu_mime_io_buffer_create,mu_mime_io_buffer_destroy)
      (mu_mime_io_buffer_set_size,mu_mime_io_buffer_get_size)
      (mu_mime_io_buffer_set_charset,mu_mime_io_buffer_sget_charset)
      (mu_mime_io_buffer_aget_charset): New functions.
      (mu_message_save_attachment)
      (mu_message_encapsulate, mu_message_unencapsulate): Take
      mu_mime_io_buffer_t as the last argument.
      * mailbox/mimehdr.c (mu_mimehdr_get_disp): Remove unneeded
      parameter.
      (mu_mimehdr_aget_disp): Remove unneeded parameter. Store
      return value into pvalue.
      
      * examples/mimetest.c (message_display_parts): Use
      mu_mimehdr_aget_disp and mu_mime_io_buffer_* functions.
      * mailbox/testsuite/Mime: Update.
      
      * mh/mhn.c (options, opt_handler): New option --charset.
      (store_handler): Use mu_message_aget_decoded_attachment_name.
      Sergey Poznyakoff authored
    • * examples/python/mimetest.py: Update.
      * include/mailutils/cpp/message.h (get_attachment_name): Overload.
      * libmu_cpp/message.cc (Message::get_attachment_name): Overload.
      * python/libmu_py/message.c (api_message_get_attachment_name): Update.
      * python/mailutils/message.py (Message.get_attachment_name):
      Add optional charset parameter. Return (name, lang) tuple.
      Wojciech Polak authored
    • * mailbox/mimehdr.c (_header_get_param): If buf is NULL
      on entry, make sure it alwaus points to allocated memory
      afterwards.
      
      * examples/mimetest.c (charset): New variable.
      (main): New command line option -c.
      (message_display_parts): Use mu_message_aget_decoded_attachment_name.
      Pass fname to mu_message_save_attachment.
      Sergey Poznyakoff authored
  16. 06 Apr, 2010 1 commit
    • * mailbox/mimehdr.c: New file.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add
      mailbox/mimehdr.c.
      * mailbox/attachment.c (_header_get_param)
      (_get_attachment_name, mu_message_aget_attachment_name)
      (mu_message_get_attachment_name: Move to mailbox/mimehdr.c (with
      edits).
      (mu_message_save_attachment): Add a FIXME comment.
      * include/mailutils/message.h (MU_MIMEHDR_MULTILINE)
      (MU_MIMEHDR_CSINFO): New defines.
      (mu_mimehdr_get_disp,mu_mimehdr_aget_disp)
      (mu_mimehdr_get_param,mu_mimehdr_aget_param)
      (mu_mimehdr_decode_param)
      (mu_mimehdr_aget_decoded_param): New prototypes.
      (mu_message_aget_attachment_name): Change signature.
      (mu_message_aget_decoded_attachment_name): New prototype.
      
      * mailbox/mutil.c (mu_hex2ul): Fix a silly bug (have
      anybody ever tried to use that function?!?)
      * mailbox/testsuite/Urls: Update.
      
      * examples/mimetest.c (message_display_parts): Add a FIXME comment.
      * libmu_cpp/message.cc (Message::get_attachment_name): Likewise.
      * mh/mhn.c (store_handler): Likewise.
      * python/libmu_py/message.c (api_message_get_attachment_name): Likewise.
      Sergey Poznyakoff authored
  17. 20 Feb, 2010 1 commit
    • * include/mailutils/iterator.h (mu_itrctl_qry_direction)
      (mu_itrctl_set_direction): New mu_itrctl_req constants.
      * mailbox/iterator.c (mu_iterator_dup): Bugfix: copy dup as well.
      * mailbox/list.c (struct list_iterator)
      <backwards>: New member.
      (first, next): Move direction depends on the value
      of list_iterator.backwards.
      (list_itrctl): Handle mu_itrctl_qry_direction and
      mu_itrctl_set_direction
      
      * examples/listop.c (ictl_dir): New function.
      (ictl_ins): Handle new subcommand "dir".
      (help): Show new subcommand "dir".
      * mailbox/testsuite/mailbox/list.exp: Add tests for
      iteration backwards.
      Sergey Poznyakoff authored