1. 10 Dec, 2010 2 commits
    • This is the default behavior now.  The reverse can be requested by
      a special MU_IOCTL_FD,MU_IOCTL_FD_SET_BORROW ioctl.
      
      * include/mailutils/stream.h (MU_STREAM_FD_AUTOCLOSE): Remove. This
      is the default behavior now.
      (MU_IOCTL_FD): New ioctl.
      (MU_IOCTL_FD_GET_BORROW, MU_IOCTL_FD_SET_BORROW): New opcodes.
      * include/mailutils/sys/file_stream.h (_MU_FILE_STREAM_FD_BORROWED): New flag.
      
      * libmailutils/stream/file_stream.c (fd_close): Close the fd unless
      _MU_FILE_STREAM_FD_BORROWED bit is set.
      (fd_open): Clear the _MU_FILE_STREAM_FD_BORROWED bit.
      (fd_ioctl): Handle MU_IOCTL_FD.
      (mu_file_stream_create): Remove MU_STREAM_FD_AUTOCLOSE.
      
      * ibmailutils/base/version.c (mu_print_options): Set borrow mode on the
      temporary stdout stream.
      * libmailutils/cfg/driver.c (mu_cfg_tree_reduce): Set borrow mode on the
      temporary stderr stream.
      * libmailutils/stdstream/strerr.c (mu_stdstream_strerr_create): Set borrow
      mode on the stderr stream.
      * libmailutils/tests/tempfile.c: set borrow mode on the temporary stream,
      because it may be reopened later (verify mode).
      
      * examples/mta.c: Remove MU_STREAM_FD_AUTOCLOSE.
      * imap4d/io.c: Likewise.
      * libmailutils/stream/prog_stream.c: Likewise.
      * libmailutils/stream/socket_stream.c: Likewise.
      * libmailutils/stream/temp_file_stream.c: Likewise.
      * maidag/lmtp.c: Likewise.
      * pop3d/extra.c: Likewise.
      
      These will disappear when the corresponding utilities are rewritten to
      use MU stdstream:
      
      * mail/escape.c (quote0): set borrow mode on the output stream.
      * mimeview/mimeview.c (display_file): set borrow mode on the input stream.
      
      Likewise, these will disappear when MH uses MU stdstream:
      
      * mh/anno.c (main): Set borrow mode on the input stream.
      * mh/mh_init.c (mh_real_install): Likewise.
      * mh/mh_whatnow.c (_whatnow): Likewise.
      * mh/mhl.c (open_output): Set borrow mode on the output stream.
      * mh/mhn.c (mhn_show,store_handler): Likewise.
      Sergey Poznyakoff authored
    • * examples/mta.c: Use MU_STREAM_FD_AUTOCLOSE.
      * imap4d/io.c: Likewise.
      * libmailutils/stream/file_stream.c: Likewise.
      * libmailutils/stream/prog_stream.c: Likewise.
      * libmailutils/stream/socket_stream.c: Likewise.
      * libmailutils/stream/temp_file_stream.c: Likewise.
      * maidag/lmtp.c: Likewise.
      * pop3d/extra.c: Likewise.
      
      * imap4d/preauth.c: Do not use MU_STREAM_AUTOCLOSE.  Instead unref the
      transport stream after creating the derived one.
      * libmailutils/base/rfc2047.c: Likewise.
      * libmailutils/stream/fltstream.c: Likewise.
      * libmailutils/tests/fltst.c: Likewise.
      * libmu_auth/ldap.c: Likewise.
      * libmu_auth/tls.c: Likewise.
      * libmu_sieve/extensions/vacation.c: Likewise.
      * libproto/pop/pop3_stream.c: Likewise.
      * mail/decode.c: Likewise.
      * mh/mhn.c: Likewise.
      
      * libmailutils/filter/filter_iconv.c: Do not handle MU_STREAM_AUTOCLOSE.
      * libmailutils/stream/rdcache_stream.c: Likewise.
      * libmailutils/stream/streamref.c: Likewise.
      * libmailutils/stream/xscript-stream.c: Likewise.
      
      * include/mailutils/stream.h (MU_STREAM_AUTOCLOSE): Rename to
      MU_STREAM_FD_AUTOCLOSE.
      Sergey Poznyakoff authored
  2. 09 Dec, 2010 1 commit
    • * include/mailutils/filter.h (mu_filter_chain_create_pred)
      (mu_filter_chain_create): New prototypes.
      (_mu_filter_record)<max_line_length>: Remove.
      * libmailutils/filter/fltchain.c: New file.
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add fltchain.c.
      * libmailutils/filter/base64.c: Implement line length limit for encoder.
      (base64_state): New enum.
      (base64_line): New struct.
      (_base64_encoder): xd brings a pointer to struct base64_line. Use it
      to limit the output line length.
      (alloc_state): New function.
      (_base64_filter): Register alloc_state.
      (_base64_filter, _B_filter): Remove max_line_length initialization.
      
      * libmailutils/filter/binflt.c: Remove max_line_length initialization.
      * libmailutils/filter/crlfflt.c: Likewise.
      * libmailutils/filter/dot.c: Likewise.
      * libmailutils/filter/fromflt.c: Likewise.
      * libmailutils/filter/header.c: Likewise.
      * libmailutils/filter/inline-comment.c: Likewise.
      * libmailutils/filter/linecon.c: Likewise.
      * libmailutils/filter/qpflt.c: Likewise.
      
      * libmailutils/filter/linelenflt.c: Redo line filter as a regular filter.
      (mu_linelen_filter): New global.
      
      * libmailutils/filter/filter.c (mu_filter_get_list): Register mu_linelen_filter.
      (filter_create_rd, filter_create_wr): Remove.
      (mu_filter_create_args): Use mu_filter_stream_create directly.
      
      * examples/base64.c: Re-implement the -l option via filter chains.
      
      * libmailutils/tests/fltst.c: Remove the linelen option.
      * libmailutils/tests/base64d.at: Remove the linelen option from fltst
      invocations.
      * mu/filter.c: Remove the --line-length option.  Not needed now, its
      effect is achieved by "FLT + [~]linelen" chain.
      Sergey Poznyakoff authored
  3. 08 Dec, 2010 7 commits
    • * examples/config/dot.biffrc: Update.
      * comsat/comsat.c (main): In test mode, normalize biffrc names that
      begin with ./ or ../
      Sergey Poznyakoff authored
    • * comsat/comsat.c (biffrc_errors): New variable.
      (comsat_cfg_param): New statements: biffrc-errors-to-tty and
      biffrc-errors-to-err
      (main): In test mode, set biffrc_errors to BIFFRC_ERRORS_TO_ERR.
      * comsat/comsat.h (BIFFRC_ERRORS_TO_TTY)
      (BIFFRC_ERRORS_TO_ERR): New flags.
      (biffrc_errors): New variable.
      * comsat/action.c (report_error): Consult biffrc_errors.
      Sergey Poznyakoff authored
    • * include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_SET_LOCUS_LINE)
      (MU_IOCTL_LOGSTREAM_SET_LOCUS_COL): New subcodes.
      * libmailutils/stream/logstream.c (_log_ctl): Handle two new subcodes.
      * comsat/action.c (eval_biffrc): Use new ioctl subcode to update the
      line number.
      Sergey Poznyakoff authored
    • * libmailutils/tests/inline-comment.at: Add line info tests.
      * libmailutils/tests/linecon.at: Likewise.
      * libmailutils/filter/linecon.c (LINECON_CONTINUATION): New flag.
      (linecon_newline): Remove.
      (_linecon_decoder): Correctly determine the end of continuation
      in case when the last line contained standalone escapes.
      Sergey Poznyakoff authored
    • * libmailutils/filter/inline-comment.c: Implement line number info
      facility.
      * libmailutils/filter/linecon.c: Likewise.
      * libmailutils/stream/logstream.c (_log_done, _log_close): Always
      close/destroy the underlying transport stream.
      * comsat/action.c: Rewrite using a table-driven parser.
      Use line-info facility of the linecon filter.
      Sergey Poznyakoff authored
    • * comsat/.gitignore: Add biff.rc.h
      * comsat/Makefile.am (comsatd_SOURCES, BUILT_SOURCES): Add biff.rc.h
      (EXTRA_DIST): Add biffrc.sed and biff.rc
      * comsat/action.c (default_action): Include biff.rc.h.
      (biffrc_environ): New struct.
      (eval_biffrc): New function.
      (run_user_action): Rewrite via eval_biffrc.  Default action is
      evaluated if biff.rc cannot be opened, or it contains the "default"
      keyword.
      * comsat/tests/testsuite.at: Add "default" statement where necessary.
      Sergey Poznyakoff authored
    • * comsat/action.c (need_crlf, _open_tty, open_tty): Moved from comsat.c
      (open_default_tty): New function.
      (run_user_action): Take device name as first argument.
      Reuse wordsplit memory.
      * comsat/comsat.c (notify_user): Update invocation of run_user_action.
      * comsat/comsat.h (open_tty): Remove prototype.
      (run_user_action): Change signature.
      * configure.ac: Add comsat tests.
      * comsat/Makefile.am (SUBDIRS): Add tests.
      * comsat/tests/.gitignore: New file.
      * comsat/tests/Makefile.am: New file.
      * comsat/tests/atlocal.in: New file.
      * comsat/tests/testsuite.at: New file.
      Sergey Poznyakoff authored
  4. 07 Dec, 2010 6 commits
    • * comsat/comsat.c (options): New option --file.
      (biffrc): New variable.
      (comsatd_parse_opt): Handle the --file option.
      (open_tty): New function.
      (notify_user): Open the tty using open_tty function and a default
      set of filters.
      (main): Hanlde --file option.
      * comsat/action.c (run_user_action): Implement the `tty' statement.
      * comsat/comsat.h (biffrc): New extern.
      (open_tty): New function.
      
      mu: accept a chain of filters.
      
      * mu/filter.c (filter_doc, filter_docstring): Update.
      (mutool_filter): Accept a filter chain.
      Sergey Poznyakoff authored
    • Two interfaces are provided: mu_prog_stream_create offers full control
      over the program execution environment (i.e. running privileges, cwd,
      resource limits) via a set of hints.
      A simpler interface, mu_command_stream_create, runs the command in the
      current environment.
      
      mu_filter_prog_stream_create is removed, because its functionality can
      be achieved by a correspondingly crafted set of hints to
      mu_prog_stream_create.
      
      * include/mailutils/prog.h: New file.
      * include/mailutils/mailutils.h: Include mailutils/prog.h
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add prog.h
      * include/mailutils/stream.h (mu_prog_stream_create)
      (mu_filter_prog_stream_create): Remove prototypes.
      * include/mailutils/sys/prog_stream.h (_mu_prog_stream): Change structure.
      (_mu_prog_limit_codes, _mu_prog_limit_flags): New externs.
      * include/mailutils/util.h (mu_set_user_privileges)
      (mu_switch_to_privs): New prototypes.
      
      * lib/userprivs.c: Move to libmailutils/base.
      * lib/Makefile.am (libmuaux_a_SOURCES): Remove userprivs.c
      * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add userprivs.c
      * libmailutils/base/userprivs.c (mu_set_user_privileges): New function.
      (mu_switch_to_privs): Rewrite as another entry point to mu_set_user_privileges.
      
      * libmailutils/stream/prog_stream.c (_mu_prog_limit_flags)
      (_mu_prog_limit_codes): New global variables.
      (start_program_filter): Use hints to control execution environment.
      (_prog_stream_create): Save hints.
      (mu_prog_stream_create): Change signature.
      (mu_command_stream_create): New function (corresponds to the prior
      mu_prog_stream_create).
      (mu_filter_prog_stream_create): Remove function.
      * comsat/action.c (action_exec): Use new mu_prog_stream_create calling
      convention.
      * examples/murun.c: Rewrite.
      
      * mh/mhn.c (show_internal): Use new mu_prog_stream_create calling
      convention.
      * mh/tests/mhn.at: Reflect changes to mhn.
      
      * imap4d/preauth.c: Use mu_command_stream_create.
      * libmu_sieve/extensions/pipe.c
      * mail/decode.c
      * mail/pipe.c
      * mail/send.c
      * mh/mhl.c
      * mu/shell.c
      
      * mail/mail.h: Include mailutils/prog.h
      * mh/mh.h
      
      * po/POTFILES.in: Add libmailutils/base/userprivs.c.
      Sergey Poznyakoff authored
    • * comsat/action.c (action_beep, echo_string)
      (action_echo, action_exec): Take mu_stream_t as first argument.
      (open_rc): Take mu_stream_t as tty, return mu_stream_t as well.
      Install the linecon filter.
      (run_user_action): Take mu_stream_t as first arg.  Pass it to all
      invoked actions.
      * comsat/comsat.c (get_newline_str): Remove.
      (need_crlf): New function.
      (notify_user): Use mu_stream_t instead of FILE.
      Install a 7bit filter and CRLF filter (if the device requires it).
      * comsat/comsat.h: Include mailutils/filter.h.
      (run_user_action): Change signature.
      Sergey Poznyakoff authored
    • * libmailutils/stream/file_stream.c (fd_open): Remove file state
      checks: it is the responsibility of the caller.
      Set autoclose on the *stream* flags (bugfix, previously the underlying
      fd was never closed).
      Clear MU_STREAM_SEEK flag if seek fails.
      (_mu_file_stream_create): Remove assignment to stream.error_string
      * include/mailutils/stream.h (MU_STREAM_ALLOW_LINKS): Remove flag.
      * libmailutils/base/amd.c (amd_message_stream_open): Initialize flags
      to 0.
      Sergey Poznyakoff authored
    • * libmailutils/mailbox/mailbox.c (mu_mailbox_open): Fix error
      checking condition.
      * comsat/action.c (act_getline): Remove.
      (open_rc): Return mu_stream_t. Use linecon filter.
      Sergey Poznyakoff authored
    • Line continuation filter removes from its input any sequence of '\\\n'
      (a backslash followed by a newline).  It is useful for reading various
      UNIX configuration files.
      
      * include/mailutils/filter.h (mu_linecon_filter): New extern.
      * libmailutils/filter/linecon.c: New file.
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add linecon.c
      * libmailutils/filter/filter.c (mu_filter_get_list): Register mu_linecon_filter.
      * libmailutils/tests/linecon.at: New test.
      * libmailutils/tests/Makefile.am (TESTSUITE_AT): Add linecon.at
      * libmailutils/tests/testsuite.at: Include linecon.at
      Sergey Poznyakoff authored
  5. 06 Dec, 2010 5 commits
    • * frm/common.c: Use MU streams instead of stdio.
      * frm/frm.c: Likewise.
      * messages/messages.c: Likewise.
      * readmsg/readmsg.c: Likewise.
      * frm/frm.h: Include mailutils/stdstream.h
      * readmsg/readmsg.h: Likewise.
      Sergey Poznyakoff authored
    • The mu_stream_ioctl function gets two argument that identify the ioctl
      in question: "family", which identifies a family of ioctls in question,
      and "opcode", which indicates the requested operation within that family.
      
      * include/mailutils/stream.h: Define ioctl families and opcodes.
      (mu_stream_ioctl): Change signature.
      * include/mailutils/sys/stream.h (_mu_stream)<ctl>: Change signature.
      
      * include/mailutils/log.h (mu_severity_from_string)
      (mu_severity_to_string): New protos.
      
      * libmailutils/stream/stream.c (mu_stream_ioctl): Change signature.
      
      * libmailutils/filter/filter_iconv.c: Rewrite ioctl support.
      * libmailutils/stream/file_stream.c: Likewise.
      * libmailutils/stream/fltstream.c: Likewise.
      * libmailutils/stream/iostream.c: Likewise.
      * libmailutils/stream/logstream.c: Likewise.
      * libmailutils/stream/mapfile_stream.c: Likewise.
      * libmailutils/stream/memory_stream.c: Likewise.
      * libmailutils/stream/nullstream.c: Likewise.
      * libmailutils/stream/prog_stream.c: Likewise.
      * libmailutils/stream/rdcache_stream.c: Likewise.
      * libmailutils/stream/streamref.c: Likewise.
      * libmailutils/stream/syslogstream.c: Likewise.
      * libmailutils/stream/tcp.c: Likewise.
      * libmailutils/stream/xscript-stream.c: Likewise.
      * libmu_auth/tls.c: Likewise.
      
      * comsat/action.c: Change calls to mu_stream_ioctl.
      * imap4d/auth_gsasl.c: Likewise.
      * imap4d/io.c: Likewise.
      * imap4d/util.c: Likewise.
      * libmailutils/base/getpass.c: Likewise.
      * libmailutils/cfg/parser.y: Likewise.
      * libmailutils/mailbox/body.c: Likewise.
      * libmailutils/mime/mime.c: Likewise.
      * libmailutils/stdstream/dbgstream.c: Likewise.
      * libmailutils/stdstream/strerr.c: Likewise.
      * libmu_sieve/runtime.c: Likewise.
      * libmu_sieve/sieve.y: Likewise.
      * libmu_sieve/util.c: Likewise.
      * libproto/imap/trace.c: Likewise.
      * libproto/mailer/smtp_data.c: Likewise.
      * libproto/mailer/smtp_starttls.c: Likewise.
      * libproto/mailer/smtp_trace.c: Likewise.
      * libproto/pop/pop3_stls.c: Likewise.
      * libproto/pop/pop3_stream.c: Likewise.
      * libproto/pop/pop3_trace.c: Likewise.
      * maidag/lmtp.c: Likewise.
      * mail/source.c: Likewise.
      * mu/logger.c: Likewise.
      * pop3d/extra.c: Likewise.
      * pop3d/retr.c: Likewise.
      
      * TODO: Update.
      * doc/texinfo/nullstream.texi: Update.
      Sergey Poznyakoff authored
    • * include/mailutils/stream.h (MU_LOGSTREAM_ADVANCE_LOCUS_LINE)
      (MU_LOGSTREAM_ADVANCE_LOCUS_COL): Rename to MU_IOCTL_.*.  All
      uses updated.
      (MU_IOCTL_LOGSTREAM_SUPPRESS_SEVERITY)
      (MU_IOCTL_LOGSTREAM_SUPPRESS_SEVERITY_NAME): New ioctls.
      * include/mailutils/sys/logstream.h (_mu_log_stream)<threshold>: New
      member.
      * include/mailutils/syslog.h (mu_log_severity_threshold): New extern.
      * libmailutils/cfg/parser.y (_cfg_default_printer): Remove leftover
      static function.
      * libmailutils/stream/logstream.c (mu_severity_from_string)
      (mu_severity_to_string): New functions.
      (_log_write): Fix double free.
      Implement severity suppression.
      (_log_ioctl): Handle MU_IOCTL_LOGSTREAM_SUPPRESS_SEVERITY.
      * libmu_cfg/common.c (mu_logging_param): New parameter
      "severity".
      Sergey Poznyakoff authored
    • * imap4d/testsuite/imap4d.rcin: Suppress syslog, use stderr.
      * pop3d/testsuite/pop3d.rcin" Likewise.
      Sergey Poznyakoff authored
  6. 05 Dec, 2010 3 commits
    • * mh/tests/mhn.at: Bugfix.
      Sergey Poznyakoff authored
    • The mu_debug_t object and associated functions have been removed.
      New debugging functions are based on the logstream interface.
      
      * include/mailutils/debug.hm4: Remove.
      * include/mailutils/debug.h: New file.
      * include/mailutils/Makefile.am (BUILT_SOURCES,EXTRA_DIST): Remove debug.h,
      debug.hm4.
      
      * mu-aux/debugdef.m4: Remove.
      * mu-aux/debcat.awk: New file.
      * mu-aux/Makefile.am (EXTRA_DIST): Replace debugdef.m4 with debcat.awk.
      
      * include/mailutils/sys/dbgstream.h: Remove.
      * include/mailutils/sys/debug.h: Remove.
      * include/mailutils/sys/Makefile.am (sysinclude_HEADERS): Remove debug.h
      and dbgstream.h, add debcat.h
      * include/mailutils/sys/.gitignore: Add debcat.h.
      
      * libmailutils/diag/dbgstderr.c: Remove.
      * libmailutils/diag/dbgsyslog.c: Remove.
      * libmailutils/diag/gdebug.c: Remove.
      * libmailutils/diag/debcat: New file.
      * libmailutils/diag/Makefile.am (libdiag_la_SOURCES): Remove these
      sources.
      * libmailutils/diag/debug.c: Rewrite from scratch.
      * libmailutils/diag/diag.c: Rewrite from scratch.
      
      * libmailutils/diag/syslog.c (mu_diag_syslog_printer): Remove function.
      (mu_log_syslog, mu_log_print_severity): New variables.
      
      * libmailutils/stream/dbgstream.c: Remove.
      * libmailutils/stream/Makefile.am (libstream_la_SOURCES): Remove dbgstream.c..
      * libmailutils/stdstream/Makefile.am (libstdstream_la_SOURCES): Add
      dbgstream.c.
      * libmailutils/stream/logstream.c (_mu_severity_str): Change strings
      to lower case.
      (_log_write): Improve handling of unrecognized escapes.
      (_log_ctl): Handle MU_LOGSTREAM_ADVANCE_LOCUS_LINE and
      MU_LOGSTREAM_ADVANCE_LOCUS_COL.
      
      * libmailutils/mailbox/folder.c (mu_folder_has_debug)
      (mu_folder_get_debug, mu_folder_set_debug): Remove functions.
      
      * mu-aux/debcat.awk: New file.
      * libmailutils/stdstream/dbgstream.c: New file.
      
      * comsat/action.c: Use new debug/log functions.
      * comsat/comsat.c: Likewise.
      * examples/aclck.c: Likewise.
      * examples/echosrv.c: Likewise.
      * examples/msg-send.c: Likewise.
      * examples/nntpclient.c: Likewise.
      * examples/numaddr.c: Likewise.
      * frm/common.c: Likewise.
      * imap4d/imap4d.c: Likewise.
      * imap4d/io.c: Likewise.
      * imap4d/util.c: Likewise.
      * libmailutils/auth/mu_auth.c: Likewise.
      * libmailutils/base/amd.c: Likewise.
      * libmailutils/cfg/driver.c: Likewise.
      * libmailutils/cfg/format.c: Likewise.
      * libmailutils/cfg/lexer.l: Likewise.
      * libmailutils/cfg/parser.y: Likewise.
      * libmailutils/mailbox/mailbox.c: Likewise.
      * libmailutils/mailbox/mbx_default.c: Likewise.
      * libmailutils/mailer/mailer.c: Likewise.
      * libmailutils/mailer/progmailer.c: Likewise.
      * libmailutils/server/acl.c: Likewise.
      * libmailutils/server/ipsrv.c: Likewise.
      * libmailutils/server/msrv.c: Likewise.
      * libmailutils/tests/wicket.c: Likewise.
      * libmu_argp/auth.c: Likewise.
      * libmu_argp/cmdline.c: Likewise.
      * libmu_argp/common.c: Likewise.
      * libmu_auth/ldap.c: Likewise.
      * libmu_cfg/acl.c: Likewise.
      * libmu_cfg/auth.c: Likewise.
      * libmu_cfg/common.c: Likewise.
      * libmu_cfg/ldap.c: Likewise.
      * libmu_cfg/sieve.c: Likewise.
      * libmu_cfg/sql.c: Likewise.
      * libmu_scm/mu_message.c: Likewise.
      * libmu_sieve/prog.c: Likewise.
      * libmu_sieve/runtime.c: Likewise.
      * libproto/imap/trace.c: Likewise.
      * libproto/mailer/mbox.c: Likewise.
      * libproto/mailer/prog.c: Likewise.
      * libproto/mailer/sendmail.c: Likewise.
      * libproto/mailer/smtp.c: Likewise.
      * libproto/mailer/smtp_trace.c: Likewise.
      * libproto/mbox/folder.c: Likewise.
      * libproto/mbox/mbox.c: Likewise.
      * libproto/nntp/folder.c: Likewise.
      * libproto/nntp/nntp_debug.c: Likewise.
      * libproto/pop/mbox.c: Likewise.
      * libproto/pop/pop3_trace.c: Likewise.
      * maidag/guile.c: Likewise.
      * maidag/lmtp.c: Likewise.
      * maidag/maidag.c: Likewise.
      * maidag/util.c: Likewise.
      * mail/mail.c: Likewise.
      * mail/mailvar.c: Likewise.
      * mail/send.c: Likewise.
      * mail/source.c: Likewise.
      * mh/mh_argp.c: Likewise.
      * mh/send.c: Likewise.
      * mimeview/mimeview.c: Likewise.
      * movemail/movemail.c: Likewise.
      * mu/wicket.c: Likewise.
      * pop3d/extra.c: Likewise.
      * pop3d/pop3d.c: Likewise.
      * readmsg/readmsg.c: Likewise.
      * sieve/sieve.c: Likewise.
      * testsuite/mimetest.c: Likewise.
      
      * libmu_sieve/sieve-priv.h (mu_sieve_machine) <parse_error_printer>
      <error_printer, debug_printer, debug>: Remove.
      <errstream>: New member.
      (mu_sv_compile_error, mu_sv_print_value_list)
      (mu_sv_print_tag_list): Change prototypes.
      
      * libmu_sieve/actions.c: Use new sieve debug functions.
      * libmu_sieve/extensions/list.c: Likewise.
      * libmu_sieve/extensions/moderator.c: Likewise.
      * libmu_sieve/extensions/pipe.c: Likewise.
      * libmu_sieve/extensions/spamd.c: Likewise.
      * libmu_sieve/extensions/timestamp.c: Likewise.
      * libmu_sieve/extensions/vacation.c: Likewise.
      * libmu_sieve/sieve.y : Likewise.
      * libmu_sieve/sieve.l: Likewise.
      * libmu_sieve/tests.c: Likewise.
      * libmu_sieve/util.c: Rewrite diagnostic support.
      * /maidag/sieve.c: Use new debug/log and sieve diagnostic functions.
      
      * mu/mu.c (main): Remove call to mu_stdstream_setup. It is called
      by mu_app_init now.
      
      * libmailutils/base/wicket.c (mu_wicket_stream_match_url): Change signature.
      * libmailutils/cfg/gocs.c (mu_gocs_logging_init): Rewrite.
      * libmailutils/mailbox/message.c (mu_message_save_to_mailbox): Remove
      mu_debug_t argument.
      * libmailutils/stdstream/basestr.c (mu_stdstream_setup): Minor fixes.
      * libmailutils/stdstream/strerr.c (mu_stdstream_strerr_create): Do
      not install filter stream if tag is NULL.
      (mu_stdstream_strerr_setup): New function.
      * libmu_argp/muinit.c (mu_app_init): Set mu_log_tag.
      Call mu_stdstream_setup.
      * libmu_scm/mu_dbgport.c: Rewrite port support.
      
      * include/mailutils/acl.h (mu_acl_get_debug)
      (mu_acl_set_debug): Remove prototypes.
      * include/mailutils/auth.h (mu_wicket_stream_match_url): Change signature.
      * include/mailutils/cfg.h (mu_cfg_locus_t): Remove typedef, use
      struct mu_locus instead.
      (mu_cfg_locus): Remove declaration.
      (mu_cfg_node)<locus>: Change type.
      (mu_cfg_node)<debug>: Remove.
      (mu_cfg_vperror,mu_cfg_perror)
      (mu_cfg_parse_error,mu_cfg_format_error): Remove prototypes.
      (mu_cfg_callback_t): Change signature.  All uses updated.
      (mu_cfg_get_debug): Remove prototype.
      (mu_cfg_assert_value_type, mu_cfg_string_value_cb): Change signature.
      (mu_cfg_tree_set_debug): Remove prototype.
      (mu_cfg_tree_create_node): Change signature.
      * include/mailutils/diag.h (MU_DIAG_): Redefine via MU_LOG_ constants.
      (mu_diag_get_debug,mu_diag_set_debug): Remove.
      (mu_diag_cont_vprintf, mu_diag_cont_printf)
      (mu_diag_at_locus): New functions.
      * include/mailutils/folder.h (mu_folder_has_debug)
      (mu_folder_get_debug, mu_folder_set_debug): Remove prototypes.
      * include/mailutils/gocs.h (mu_gocs_logging): Remove structure.
      (mu_gocs_debug)<errpfx>: Remove.
      * include/mailutils/guile.h (mu_scm_make_debug_port): Change prototype.
      * include/mailutils/mailbox.h (mu_mailbox_has_debug)
      (mu_mailbox_get_debug,mu_mailbox_set_debug): Remove.
      * include/mailutils/mailer.h (mu_mailer_get_debug)
      (mu_mailer_set_debug): Remove.
      * include/mailutils/message.h (mu_message_save_to_mailbox): Change
      signature.
      * include/mailutils/mu_auth.h (mu_auth_set_debug): Remove proto.
      * include/mailutils/nntp.h (mu_nntp_set_debug): Remove.
      * include/mailutils/progmailer.h (mu_progmailer_set_debug): Remove proto.
      * include/mailutils/server.h (mu_ip_server_set_debug)
      (mu_ip_server_get_debug): Remove proto.
      
      * include/mailutils/sieve.h (mu_sieve_locus_t): Remove.
      Use struct mu_locus instead.
      (mu_sieve_printf_t, mu_sieve_parse_error_t): Remove.
      (mu_sieve_action_log_t): Change signature.
      (mu_sieve_machine_init): Change signature.
      (mu_sieve_machine_init_ex): New function.
      (mu_sieve_get_diag_stream)
      (mu_sieve_set_diag_stream): New functions.
      (mu_sieve_set_data): New function.
      (mu_sieve_get_locus): Change signature.
      (mu_sieve_set_error,mu_sieve_set_parse_error)
      (mu_sieve_set_debug,mu_sieve_set_debug_object): Remove protos.
      * include/mailutils/stdstream.h (mu_stdstream_strerr_setup): New proto.
      * include/mailutils/stream.h (MU_LOGSTREAM_ADVANCE_LOCUS_LINE)
      (MU_LOGSTREAM_ADVANCE_LOCUS_COL): New ioctls.
      (mu_dbgstream_create): Change signature.
      * include/mailutils/sys/folder.h (_mu_folder) <debug>: Remove.
      * include/mailutils/sys/mailbox.h (_mu_mailbox) <debug>: Remove.
      * include/mailutils/sys/mailer.h (_mu_mailer) <debug>: Remove.
      * include/mailutils/sys/nntp.h (_mu_nntp) <debug>: Remove.
      * include/mailutils/syslog.h (mu_log_syslog)
      (mu_log_print_severity): New externs.
      * include/mailutils/types.hin (_mu_debug, mu_debug_t): Remove.
      * lib/tcpwrap.h: Remove unused prototypes.
      
      * imap4d/imap4d.h: Include mailutils/stdstream.h
      * mail/mail.h: Likewise.
      * pop3d/pop3d.h: Likewise.
      
      * mh/comp.c (main): Bugfix.
      
      * po/POTFILES.in: Update.
      * TODO: Update.
      Sergey Poznyakoff authored
  7. 04 Dec, 2010 3 commits
    • * include/mailutils/error.h (mu_error_pfn_t, mu_default_error_printer)
      (mu_syslog_error_printer): Remove deprecated interfaces.
      * libmailutils/diag/muerror.c: Likewise.
      * libmailutils/stream/logstream.c (_log_write): Send
      MU_IOCTL_LOGSTREAM_SET_SEVERITY to the transport stream.
      * libmailutils/stream/syslogstream.c (_syslog_ctl): Translate
      MU severity to syslog priority level and vice versa.
      * mu/logger.c (mutool_logger): Bugfix.
      Sergey Poznyakoff authored
    • * include/mailutils/stdstream.h (mu_printf): New prototype.
      * include/mailutils/version.h: Include mailutils/types.h instead of
      stdio.h
      (mu_fprint_options, mu_fprint_conf_option): Remove protos.
      (mu_format_options, mu_format_conf_option): New protos.
      * libmailutils/base/version.c (mu_fprint_options): Replace
      with mu_format_options, which outputs formatted data to a mu_stream_t.
      (mu_fprint_conf_option): Ditto.  Replaced by mu_format_conf_option.
      (mu_print_options): Update accordingly.
      * libmailutils/stdstream/basestr.c (mu_printf): New function.
      
      * mu/acl.c: Replace stdio calls with stdstream ones.
      * mu/cflags.c: Likewise.
      * mu/filter.c: Likewise.
      * mu/flt2047.c: Likewise.
      * mu/imap.c: Likewise.
      * mu/info.c: Likewise.
      * mu/ldflags.c: Likewise.
      * mu/logger.c: Likewise.
      * mu/mu.c: Likewise.
      * mu/mu.h: Likewise.
      * mu/pop.c: Likewise.
      * mu/query.c: Likewise.
      * mu/shell.c: Likewise.
      * mu/verbose.c: Likewise.
      * mu/wicket.c: Likewise.
      Sergey Poznyakoff authored
    • * include/mailutils/log.h: New file.
      * include/mailutils/stdstream.h: New file.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add stdstream.h
      and log.h.
      * include/mailutils/argcv.h: Include mailutils/types.h
      * include/mailutils/mailutils.h: Include stdstream.h
      Remove vartab.h
      * include/mailutils/types.hin (MU_DEPRECATED): New define.
      * include/mailutils/vartab.h: Mark this header and all prototypes
      it defines as deprecated.
      
      * libmailutils/stdstream/Makefile.am: New file.
      * libmailutils/stdstream/basestr.c: New file.
      * libmailutils/stdstream/strerr.c: New file.
      * libmu_compat/Makefile.am: New file.
      * libmu_compat/tests/.gitignore: New file.
      * libmu_compat/tests/Makefile.am: New file.
      * libmu_compat/tests/atlocal.in: New file.
      * libmu_compat/tests/testsuite.at: New file.
      * libmailutils/base/Makefile.am (noinst_LTLIBRARIES): Remove
      argcv.c and vartab.c.
      * libmailutils/Makefile.am (SUBDIRS): Add stdstream.
      (libmailutils_la_LIBADD): Add stdstream/libstdstream.la.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Remove argcv
      (TESTSUITE_AT): Remove argcv.at
      * libmailutils/tests/testsuite.at: Do not include argcv.at.
      
      * libmailutils/base/argcv.c: Move to libmu_compat/argcv.c
      * libmailutils/tests/argcv.at: Move to libmu_compat/tests/argcv.at
      * libmailutils/tests/argcv.c: Move to libmu_compat/tests/argcv.c
      * libmailutils/base/vartab.c: Move to libmu_compat/vartab.c
      
      * Makefile.am (SUBDIRS): Add libmu_compat.
      * configure.ac: Add libmu_compat/tests, libmu_compat/tests/Makefile,
      libmu_compat/tests/atlocal, libmu_compat/Makefile and
      libmailutils/stdstream/Makefile to config file list.
      
      * mu/ldflags.c (lib_descr): Add mu_compat.
      * mu/logger.c (logger_parse_opt): -t does not imply --syslog.
      (mutool_logger): Use inline-comment filter to insert "tag: "
      prefix.
      Flush and destroy both streams before returning.
      
      * po/POTFILES.in: Add libmailutils/stream/logstream.c,
      libmailutils/stdstream/baseio.c, libmailutils/stdstream/strerr.c
      and mu/logger.c.
      Sergey Poznyakoff authored
  8. 03 Dec, 2010 3 commits
    • * include/mailutils/mailutils.h: Include mailutils/log.h.
      * include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_GET_SEVERITY)
      (MU_IOCTL_LOGSTREAM_SET_SEVERITY)
      (MU_IOCTL_LOGSTREAM_GET_LOCUS,MU_IOCTL_LOGSTREAM_SET_LOCUS)
      (MU_IOCTL_LOGSTREAM_GET_MODE,MU_IOCTL_LOGSTREAM_SET_MODE): New ioctls.
      * include/mailutils/sys/logstream.h: New file.
      * include/mailutils/sys/syslogstream.h: New file.
      * include/mailutils/sys/Makefile.am (sysinclude_HEADERS): Add logstream.h
      and syslogstream.h
      * include/mailutils/types.hin (mu_locus): New struct.
      
      * libmailutils/stream/Makefile.am (libstream_la_SOURCES): Add logstream.c
      and syslogstream.c.
      
      * mu/logger.c: New file.
      * mu/template.c: New file.
      * mu/Makefile.am (MODULES): Add logger.c
      (EXTRA_DIST): Add template.c.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/stream.h (_mu_stream) <setbuf_hook>: New member.
      * libmailutils/stream/stream.c (mu_stream_set_buffer): Use setbuf_hook
      to decide whether the operation is allowed.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/stream.h (_mu_stream) <setbuf_hook>: New member.
      * libmailutils/stream/stream.c (mu_stream_set_buffer): Use setbuf_hook
      to decide whether the operation is allowed.
      Sergey Poznyakoff authored
  9. 02 Dec, 2010 4 commits
    • * mail/escape.c (quote0): Simplify by using iterators.
      Sergey Poznyakoff authored
    • * libmailutils/filter/inline-comment.c: Recognize multi-char
      comment sequences.
      Implement encode mode.
      * libmailutils/tests/inline-comment.at: Test the new modes.
      
      * mail/escape.c (quote0): Re-implement using inline-comment
      encode mode.
      * mail/mailvar.c (mailvar_tab): Fix a typo.
      Sergey Poznyakoff authored
    • * configure.ac: Remove checks for strtok_r, strchrnul, strndup,
      asprintf, vasprintf: none of these is used any more.
      * maidag/lmtp.c (lmtp_reply): Use mu_vasnprintf.
      * mh/mh.h (strchrnul): Remove proto.
      * mh/mh_list.c (want_header): Rewrite.
      (print): Use strcspn.
      Sergey Poznyakoff authored
    • * TODO: Update.
      * gnulib.modules: Remove strtok_r
      * imap4d/auth_gsasl.c (auth_gsasl_capa_init): Use mu_wordsplit instead
      of strtok.
      * imap4d/imap4d.h (strtok_r): Remove declaration.
      * lib/mailcap.c (mime_context) <no_ask_str>: Remove. All uses updated.
      (mime_context_fill): Use mu_wordsplit instead
      of strtok.
      (mime_context_write_input): Tolerate ENOSYS return from mu_stream_seek.
      (display_stream_mailcap): Use mu_wordsplit instead
      of strtok.
      * libmailutils/diag/gdebug.c (mu_debug_level_from_string)
      (mu_global_debug_from_string): Use mu_wordsplit instead of strtok.
      * libmu_cfg/sieve.c (_add_path): Likewise.
      * libmu_sieve/extensions/list.c: Likewise.
      * mail/escape.c (quote0): Likewise.
      
      * mail/util.c (util_header_expand): Likewise.
      (util_rfc2047_decode): Use mu_parse_lc_all.
      * mh/mh_init.c (mh_charset): Use mu_parse_lc_all.
      * frm/common.c (get_charset): Use mu_parse_lc_all.
      
      * libmailutils/base/lcall.c: New file.
      * libmailutils/base/Makefile.am (libbase_la_SOURCES): Add lcall.c
      * libmailutils/string/strlst.c: New file.
      * libmailutils/string/Makefile.am (libstring_la_SOURCES): Add strlst.c.
      * include/mailutils/cstr.h: Include mailutils/types.h
      (mu_string_split): New proto.
      * include/mailutils/nls.h (MU_LC_LANG, MU_LC_TERR)
      (MU_LC_CSET,MU_LC_MOD): New flags.
      (mu_lc_all): New struct.
      (mu_parse_lc_all, mu_lc_all_free): New protos.
      (mu_charset_lookup): New proto (from util.h).
      * include/mailutils/util.h (mu_charset_lookup): Move to nls.h
      
      * libmailutils/base/tempfile.c (mu_tempname): Shut up compiler
      warning.
      Sergey Poznyakoff authored
  10. 01 Dec, 2010 4 commits
    • * libmailutils/mailbox/message.c (_message_stream_seek): Fix
      ESPIPE conditional.
      (_message_stream_read): Keep running until buffer is full
      or _mss_eof state is reached.
      (_message_stream_readdelim): Keep running until buffer is full,
      _mss_eof state is reached or delimiter is found.
      Sergey Poznyakoff authored
    • * libmu_sieve/sieve.l (input_string_ptr, input_string_level): Remove.
      (input_stream): New static variable.
      (fillbuf): Use mu_stream_read
      (buffer_ctx)<yyin>: Replace with mu_stream_t input;
      (push_source, pop_source): Use stream API.
      (mu_sv_lex_begin_string): Likewise.
      * sieve/sieve.c (options): New option --expression.
      (expression_option): New variable.
      (parser): Handle the --expression option.
      (main): Treat SCRIPT as program text if given the --expression option.
      Sergey Poznyakoff authored
    • Sergey Poznyakoff authored
    • * imap4d/lsub.c (imap4d_lsub): Fix untagged responses.
      * imap4d/imap4d.h (make_interdir): New proto.
      * imap4d/create.c (mkdir_p): Remove function.
      (MKDIR_PERMISSIONS): Move macro definition to imap4d.h
      (imap4d_create): Use make_interdir instead of mkdir_p.
      * imap4d/rename.c (make_interdir): New function.
      (imap4d_rename): Create intermediate directories as required
      by RFC 3501.
      Issue additional diagnostics if rename fails.
      Fix OK response text.
      * imap4d/imap4d.c (imap4d_mainloop): Implement idle timeout.
      * imap4d/bye.c (imap4d_bye0): Reset the SIGPIPE before sending
      the OK response in order to avoid recursion.
      
      Unrelated changes:
      
      * maidag/tests/forward.at: Fix the expected reply (see f5374bc2).
      Sergey Poznyakoff authored
  11. 30 Nov, 2010 2 commits
    • Sergey Poznyakoff authored
    • This still needs some more work because imap4d does not check whether
      the objects being subscribed to are valid folders or mailboxes.
      
      * imap4d/imap4d.h (open_subscription): New prototype.
      * imap4d/lsub.c (imap4d_lsub): Rewrite using MU properties.
      * imap4d/subscribe.c (open_subscription): New function.
      (imap4d_subscribe): Rewrite using MU properties.
      * imap4d/unsubscribe.c (imap4d_unsubscribe): Rewrite using MU properties.
      
      * examples/mblconv.c: New file.
      * examples/Makefile.am: Add mblconv.c
      Sergey Poznyakoff authored