1. 08 Sep, 2010 11 commits
    • * include/mailutils/header.h (mu_header_invalidate): New proto.
      * mailbox/header.c (mu_header_invalidate): New function.
      
      * libmu_argp/muinit.c (get_canonical_name): Avoid coredumping
      if argp_program_version is NULL.
      * mailbox/base64.c (mu_base64_decode): Fix inconsistent return
      code.
      * mailbox/debug.c (mu_debug_destroy): Allow for debug->stream == NULL.
      
      * mailbox/mapfile_stream.c (_mapfile_truncate): Incorrect size
      was used when unmapping.
      * mailbox/message.c (mu_message_create_copy): Use a temporary
      memory stream.
      (mu_message_get_body): Comment out the check for MESSAGE_INTERNAL_STREAM.
      (_message_get_stream): Initialize message header and body.
      
      * mailbox/progmailer.c (mu_progmailer_send): Check  return
      from the mu_header_get_streamref.
      
      * mailbox/stream.c (_stream_scandelim, _stream_readdelim): If
      size is 0, return MU_ERR_BUFSPACE.
      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
    • * include/mailutils/sys/stream.h (_mu_stream) <seek>: Remove the
      `whence' parameter.
      * mailbox/stream.c (mu_stream_seek): Update the seek method call.
      
      * mailbox/streamref.c (_streamref_seek): Fix the signature. Remove
      unnecessary code.
      * mailbox/amd.c (amd_body_stream_seek): Likewise.
      * mailbox/body.c (_body_seek): Likewise.
      * mailbox/file_stream.c (fd_seek): Likewise.
      * mailbox/filter_iconv.c (_icvt_seek): Likewise.
      * mailbox/fltstream.c (filter_seek): Likewise.
      * mailbox/header.c (header_seek): Likewise.
      * mailbox/mapfile_stream.c (_mapfile_seek): Likewise.
      * mailbox/memory_stream.c (_memory_seek): Likewise.
      * mailbox/message.c (_message_stream_seek): Likewise.
      * mailbox/message_stream.c (_message_stream_seek): Likewise.
      * mailbox/mime.c (_mime_body_seek): Likewise.
      * mailbox/stdio_stream.c (stdio_seek): Likewise.
      Sergey Poznyakoff authored
    • * include/mailutils/filter.h (mu_filter_new_data_t): Change prototype.
      * mailbox/filter.c (mu_filter_create): Reflect the above.
      * mailbox/crlfflt.c (crlf_state): New enum.
      (_crlf_encoder): Keep state info in xd. Do not modify eventual input
      CRLFs.
      (alloc_state): New function.
      (_rfc822_filter,_crlf_filter): Provide the `newdata' method.
      Sergey Poznyakoff authored
    • This speeds up common reading operations by factor of 4-6.
      
      * include/mailutils/stream.h (mu_stream_readdelim): New proto.
      * include/mailutils/sys/stream.h (_mu_stream) <readdelim>: New method.
      * mailbox/stream.c (_stream_scandelim, _stream_readdelim): New functions.
      (mu_stream_readdelim): New function.
      (mu_stream_readline): Rewrite using mu_stream_readdelim.
      (mu_stream_getdelim): Optimize.
      
      * mailbox/amd.c (amd_body_stream_readdelim): New function.
      (_amd_attach_message): Set the readdelim method.
      * mailbox/header.c: Add a placeholder for readdelim method.
      * mailbox/message.c (_message_stream_readdelim): New function.
      (_message_stream_create): Set the readdelim method.
      * mailbox/streamref.c (_streamref_readdelim): New function.
      (mu_streamref_create_abridged): Set the readdelim method.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/stream.h (_mu_stream)<offset>: New member.
      * mailbox/stream.c (_stream_fill_buffer): Propagate return value
      from mu_stream_read_unbuffered.
      (_stream_flush_buffer): Use stream->offset. Honor the `all' argument.
      (mu_stream_seek): Rewrite using the `offset' member.
      (mu_stream_read_unbuffered)
      (mu_stream_write_unbuffered): Update offset.
      (mu_stream_readline): Return EINVAL if size is 0.
      Sergey Poznyakoff authored
    • The `mail' and `frm' utilities pass tests.
      
      * include/mailutils/stream.h (mu_stream_err): New proto.
      * libproto/mbox/mbox.c (_msg_stream_setup)
      (_msg_body_setup): Fix stream abridgement.
      (mbox_envelope_date, mbox_envelope_sender): Fix seek position.
      (uid_to_stream): Fix invocation of mu_stream_printf.
      (append_message_to_stream): Likewise.
      (mbox_expunge_unlocked): Rewind tempstr before copying its
      contents back to the mailbox.
      (mbox_expunge0): Open tempstr.
      * libproto/mbox/mbox0.h (_mbox_message)<header_from>: Rename to
      envel_from.
      <header_from_end>: Rename to envel_from_end. All uses changed.
      * libproto/mbox/mboxscan.c: Minor changes.
      
      * mail/decode.c: Use streamrefs.
      * mail/escape.c: Likewise.
      * mail/msgset.y: Likewise.
      * mail/pipe.c: Likewise.
      * mail/print.c: Likewise.
      * mail/top.c: Likewise.
      * mail/write.c: Likewise.
      
      * mail/send.c: Use streamrefs.
      (mail_send0): Reset env->header after assigning it to
      the message.
      
      * mailbox/body.c (_body_seek): Fix a typo which produced
      a recursive call.
      * mailbox/file_stream.c (fd_truncate): New function.
      (_mu_file_stream_create): Initialize str->stream.truncate.
      
      * mailbox/header.c (header_parse): Fix parsing of blurbs lacking
      terminating empty line.
      (header_seek): Fix boundary checks.
      Return new position in presult.
      * mailbox/message.c (string_find_eoh): Rewrite to handle \n\n
      split between two successive invocations.
      (_header_fill): Update the invocation of string_find_eoh.
      
      * mailbox/stream.c (mu_stream_destroy): Call mu_stream_close.
      (mu_stream_get_flags, mu_stream_set_flags)
      (mu_stream_clr_flags): Ignore internal
      bits.
      (mu_stream_err): New function.
      (mu_stream_close): Close the stream only if it is not used by anyone else.
      * mailbox/streamref.c (_streamref_read): Clear transport error if
      ESPIPE is returned.
      (_streamref_size): Take into account sp->end and sp->start.
      (mu_streamref_create_abridged): Set pointer to 0.
      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
  2. 14 Apr, 2010 1 commit
  3. 08 Apr, 2010 2 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
  4. 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
  5. 01 Apr, 2010 2 commits
    • * include/mailutils/mailbox.h (mu_mailbox_get_iterator): New function.
      * libproto/include/mailbox0.h (struct _mu_mailbox)<iterator>: New
      member.
      * mailbox/mbxitr.c: New file.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add mbxitr.c
      Sergey Poznyakoff authored
    • * am/guile.m4 (MU_CHECK_GUILE): Check for scm_t_off.
      * include/mailutils/guile.h (mu_scm_makenum)
      (mu_set_variable): Remove prototypes.
      * libmu_scm/mu_address.c: Remove calls to deprecated Guile functions.
      * libmu_scm/mu_body.c: Likewise.
      * libmu_scm/mu_guile.c: Likewise.
      * libmu_scm/mu_mailbox.c: Likewise.
      * libmu_scm/mu_message.c: Likewise.
      * libmu_scm/mu_mime.c: Likewise.
      * libmu_scm/mu_util.c: Likewise.
      * libmu_scm/mu_scm.c (mu_scm_makenum): Remove.
      (mu_set_variable): Remove. Use scm_c_define instead.
      Sergey Poznyakoff authored
  6. 21 Feb, 2010 1 commit
    • * include/mailutils/cfg.h (mu_cfg_node)
      <next,node>: Remove members.
      <nodes>: New member.
      (mu_cfg_tree)<head,tail>: Remove.
      <nodes>: New member.
      (mu_cfg_iter_closure): New struct.
      (mu_cfg_preorder): Change prototype.
      (mu_cfg_postorder): Remove.
      (mu_cfg_create_node_list): New proto.
      (mu_cfg_tree_create_node): Change signature.
      (mu_cfg_tree_add_nodelist): New proto.
      (mu_cfg_find_node): Change signature.
      * include/mailutils/libargp.h (mu_argp_node_list): Remove struct.
      (mu_argp_node_list_init, mu_argp_node_list_add)
      (mu_argp_node_list_new, mu_argp_node_list_finish): Change signature.
      * libmu_argp/cmdline.c (mu_argp_node_list_init, mu_argp_node_list_add)
      (mu_argp_node_list_new, mu_argp_node_list_finish): Take mu_list_t as
      the nodelist argument.
      
      * mailbox/cfg_parser.y (parse_head,parse_tail): Remove.
      (parse_node_list): New static, used instead of the above.
      All uses updated.
      (mu_cfg_alloc_node): Last argument is mu_list_t.
      (mu_cfg_create_node_list): New function.
      (mu_cfg_tree_postprocess): Rewrite.
      (mu_cfg_preorder): Rewrite.
      (mu_cfg_postorder): Remove.
      (mu_cfg_destroy_tree): Use mu_list_destroy to free
      the node list.
      (mu_cfg_scan_tree): Update calls to mu_cfg_preorder.
      (mu_cfg_tree_add_node): Rewrite.
      (mu_cfg_tree_add_nodelist): New function.
      (mu_cfg_find_node): Change type of the first argument.
      (mu_cfg_create_subtree): Rewrite.
      
      * mailbox/cfg_format.c (mu_cfg_format_parse_tree)
      (mu_cfg_format_node): Use new mu_cfg_preorder function.
      
      * libmu_argp/common.c: Update calls to mu_argp_node_ functions.
      * libmu_argp/auth.c: Likewise.
      * comsat/comsat.c: Likewise.
      * config/mailutils-config.c: Likewise.
      * dotlock/dotlock.c: Likewise.
      * imap4d/imap4d.c: Likewise.
      * libmu_argp/sieve.c: Likewise.
      * libmu_argp/tls.c: Likewise.
      * maidag/maidag.c: Likewise.
      * mimeview/mimeview.c: Likewise.
      * movemail/movemail.c: Likewise.
      * pop3d/pop3d.c: Likewise.
      * readmsg/readmsg.c: Likewise.
      * sieve/sieve.c: Likewise.
      Sergey Poznyakoff authored
  7. 20 Feb, 2010 3 commits
    • * 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
    • * include/mailutils/iterator.h (mu_itrctl_delete_nd)
      (mu_itrctl_replace_nd): New mu_itrctl_req constants.
      * include/mailutils/list.h (mu_list_remove_nd)
      (mu_list_replace_nd): New prototypes.
      (mu_list_destroy_item_t): New typedef.
      (mu_list_set_destroy_item): Return mu_list_destroy_item_t.
      * mailbox/list.c (DESTROY_ITEM): New macro.
      (mu_list_destroy): Use DESTROY_ITEM.
      (mu_list_remove, mu_list_replace): Actually destroy the
      item being removed.
      (mu_list_remove_nd, mu_list_replace_nd): New functions.
      (mu_list_set_destroy_item): Return previous value of
      destroy_item.
      (list_itrctl): Handle mu_itrctl_delete_nd and mu_itrctl_replace_nd.
      
      * mailbox/observer.c (mu_observable_create): Register destroy_item
      function.
      (mu_observable_destroy): Remove explicit loop. Rely on destroy_item
      instead.
      (mu_observable_detach): Use mu_iterator_ctl to actually
      remove the event.
      * mh/mh_alias.y (_insert_list): Remove.
      (alias_expand_list): Use mu_iterator_ctl to insert
      replacement list and remove the current item.
      * mh/sortm.c (addop): Register destroy_item function.
      (remop): Remove call to free.
      * movemail/movemail.c (main): <uidl loop>: Use mu_itrctl_delete
      to remove items.
      
      * libmu_sieve/util.c: Minor change.
      
      * mail/util.c (util_slist_compare): New static function.
      (util_slist_add): Register destroy_item and comparison
      functions for the new list.
      (util_slist_remove,util_slist_destroy): Rewrite.
      
      * imap4d/authenticate.c (auth_add): Use mu_list_free_item as
      destroy_item function.
      * imap4d/util.c (util_register_event): Likewise.
      
      * include/mailutils/cpp/list.h (List)<set_destroy_item>: Change
      return value.
      * libmu_cpp/list.cc (List::set_destroy_item): Reflect changes to
      mu_list_set_destroy_item.
      * libmu_argp/common.c: Include stdlib.h
      Sergey Poznyakoff authored
    • * include/mailutils/iterator.h (mu_itrctl_req): New enum.
      (mu_iterator_skip, mu_iterator_ctl)
      (mu_iterator_set_itrctl): New prototypes.
      * include/mailutils/list.h (mu_list_free_item): New prototype.
      * libproto/include/iterator0.h (struct _mu_iterator)<itrctl>: New method.
      * libproto/include/list0.h (_mu_list_clear): New proto.
      * mailbox/iterator.c (mu_iterator_set_itrctl): New function.
      (mu_iterator_skip, mu_iterator_ctl): New functions.
      * mailbox/list.c (_insert_item): Re-implement function.
      (mu_list_insert): Use _insert_item again.
      (mu_list_remove): Don't keep track of the previous item.
      (list_itrctl): New function.
      (mu_list_get_iterator): Set itrctl method.
      * mailbox/listlist.c (clear_list): Rename to _mu_list_clear,
      remove static qualifier. All uses updated.
      
      * mailbox/freeitem.c: New file.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add freeitem.c.
      
      * examples/listop.c (read_list): Rewrite to simplify
      calling convention. All callers updated.
      (inctl_tell,ictl_del,ictl_repl)
      (ictl_ins,ictl): New functions.
      (help): Add new commands.
      (shell): Handle "inctl" command.
      (delete): Fix memory leak.
      (main): Set mu_list_free_item as a destroy_item function.
      
      * mailbox/testsuite/mailbox/listop.c: Add ictl tests.
      
      * libmu_cfg/sieve.c (_add_path): Set mu_list_free_item as
      a destroy_item function.
      * mailbox/gocs.c (mu_gocs_store): Likewise.
      * maidag/lmtp.c (cfun_rcpt_to): Likewise.
      * imap4d/namespace.c (namespace_init): Likewise.
      * libmu_sieve/conf.c (_path_append): Likewise.
      Sergey Poznyakoff authored
  8. 19 Feb, 2010 1 commit
    • * include/mailutils/list.h (_mu_list_ptr_comparator)
      (mu_list_insert_list, mu_list_append_list)
      (mu_list_prepend_list): New prototypes.
      * libproto/include/list0.h (_mu_list_insert_sublist): New prototype.
      * mailbox/listlist.c: New function.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add listlist.c.
      * mailbox/list.c: Remove unnecessary parentheses.
      (def_comp): Rename to _mu_list_ptr_comparator.
      Remove static qualifier. All uses updated.
      (_insert_item): Remove.
      (mu_list_insert): Use _mu_list_insert_sublist instead of _insert_item.
      * examples/listop.c (print): Print number of elements.
      (count): New function.
      (ins): Use mu_list_insert if only one new element was given,
      mu_list_insert_list otherwise.
      (help): Update.
      (main)<count>: New keyword.
      * mailbox/testsuite/mailbox/list.exp: Update. Add new tests.
      Sergey Poznyakoff authored
  9. 05 Jan, 2010 1 commit
  10. 27 Dec, 2009 1 commit
    • Remove obsolete options (these have been made hidden in
      v. 2.0).  Handle "include" and "program" after parsing
      the sources, not while reducing the tree, as was
      previously.  Retain, however, old functions for compatibility,
      making them deprecated.  Add "query" mode to mailutils-config.
      
      * include/mailutils/cfg.h (mu_cfg_node_tag): Remove
      (mu_cfg_statement): Rename to mu_cfg_node_statement.
      (mu_cfg_tree): New member: tail.
      (mu_cfg_perror): Change signature.
      (mu_cfg_vperror, mu_cfg_parse_error): New protos.
      (MU_CFG_PATH_DELIM, MU_CFG_PATH_DELIM_STR): New defines.
      (MU_PARSE_CONFIG_PLAIN,MU_CFG_FMT_LOCUS): New constant.
      (MU_CFG_DEPRECATED): New macro.
      (mu_parse_config,mu_get_config): Deprecated.
      (mu_cfg_format_parse_tree): Change signature.
      (mu_cfg_format_node, mu_cfg_parse_file): New protos.
      (mu_cfg_tree_free): Remove stale proto.
      (mu_cfg_find_node, mu_cfg_create_subtree): New protos.
      * include/mailutils/libcfg.h (mu_libcfg_parse_config): New proto.
      (mu_parse_config_files): Deprecated.
      
      * include/mailutils/mutil.h (mu_make_file_name): New proto.
      (mu_retrieve_fp, mu_register_retriever)
      (mu_retrieve): Remove unused prototypes.
      * include/mailutils/opool.h (mu_opool_union): New proto.
      
      * libmu_argp/Makefile.am (libmu_argp_a_SOURCES): Remove
      sources (see below):
      * po/POTFILES.in: Likewise.
      * libmu_argp/gsasl.c: Remove.
      * libmu_argp/pam.c: Remove.
      * libmu_argp/radius.c: Remove.
      * libmu_argp/sql.c: Remove.
      * libmu_argp/tls.c: Remove.
      * libmu_argp/virtdomain.c: Remove.
      
      * config/mailutils-config.c: New option --query (-q)
      (main): Handle query mode.
      
      * comsat/comsat.c: Define MU_CFG_COMPATIBILITY to suppress
      deprecation warnings.
      
      * bootstrap.conf (XGETTEXT_OPTIONS): Add mu_cfg
      error reporting functions.
      
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add
      mkfilename.c
      * mailbox/mkfilename.c: New file.
      
      * imap4d/imap4d.c: Remove obsolete option (hidden since 2.0)
      * libmu_argp/auth.c: Likewise.
      * libmu_argp/cmdline.c: Likewise.
      * libmu_argp/tls.c: Likewise.
      * pop3d/pop3d.c: Likewise.
      * libmu_argp/common.c: Likewise.
      (mu_common_argp_options): New option --set.
      
      * libmu_argp/muinit.c (mu_app_init): Rewrite using parse
      tree as a principal entity.
      * libmu_cfg/init.c (mu_libcfg_parse_config): New function.
      * mailbox/cfg_driver.c (make_file_name): Remove.
      (_cb_include): Use mu_make_file_name.
      (mu_build_container): Use deprecated code only unless MU_PARSE_CONFIG_PLAIN
      flag is set.
      (mu_cfg_tree_reduce): Do nothing if the tree is NULL.
      * mailbox/cfg_format.c (format_node): Print locus optionally.
      (mu_cfg_format_parse_tree): Take additional argument.
      (mu_cfg_format_node): New function.
      * mailbox/cfg_lexer.l: Update calls to diagnostic functions.
      (mu_cfg_parse_file): New function.
      (mu_get_config): Rewrite.
      * mailbox/cfg_parser.y (parse_tree): Replace with
      parse_head, parse_tail. All usages updated.
      (mu_cfg_free_node): New function.
      (mu_cfg_vperror): New function.
      (mu_cfg_perror,mu_cfg_parse_error): New function.
      (mu_cfg_tree_union): New function.
      (mu_cfg_tree_postprocess): New function.
      (mu_cfg_find_section): Use MU_CFG_PATH_DELIM instead
      of hardcoded slash.
      (mu_cfg_value_eq): New function.
      (mu_cfg_find_node): New function. Redesign of an old idea.
      (mu_cfg_create_subtree): New function.
      * mailbox/opool.c (mu_opool_union): New function.
      
      * frm/testsuite/frm/test.exp: use --set option instead of
      the obsolete --mail-folder.
      * messages/testsuite/messages/test.exp: Likewise.
      * sieve/testsuite/sieve/action.exp: Likewise.
      * mail/testsuite/lib/mail.exp: use --set option instead of
      the obsolete --mail-spool.
      * mailbox/testsuite/lib/mailbox.exp: Likewise.
      * testsuite/lib/mailutils.exp: Likewise.
      * mailbox/mutil.c (mu_register_retriever)
      (mu_retrieve): Remove unused functions.
      
      Minor fix:
      
      * frm/common.c (frm_abort): Initialize URL
      before usage.
      (frm_scan): Don't call frm_abort on a mailbox
      that was not opened successfully.
      Sergey Poznyakoff authored
  11. 16 Dec, 2009 1 commit
    • Affected files:
      
      * comsat/comsat.c
      * examples/header.c
      * examples/mailcap.c
      * examples/pop3client.c
      * examples/url-parse.c
      * imap4d/fetch.c
      * imap4d/id.c
      * imap4d/list.c
      * imap4d/select.c
      * imap4d/status.c
      * imap4d/store.c
      * imap4d/sync.c
      * imap4d/util.c
      * include/mailutils/sieve.h
      * libmu_argp/common.c
      * libmu_argp/muinit.c
      * libmu_sieve/actions.c
      * libmu_sieve/extensions/pipe.c
      * libmu_sieve/extensions/vacation.c
      * libmu_sieve/prog.c
      * libmu_sieve/require.c
      * libmu_sieve/runtime.c
      * libmu_sieve/sieve-priv.h
      * libmu_sieve/sieve.y
      * libproto/imap/folder.c
      * libproto/imap/mbox.c
      * libproto/mailer/sendmail.c
      * libproto/mbox/mbox.c
      * libproto/pop/pop3_list.c
      * libproto/pop/pop3_stat.c
      * maidag/lmtp.c
      * maidag/sieve.c
      * mail/copy.c
      * mail/decode.c
      * mail/envelope.c
      * mail/eq.c
      * mail/escape.c
      * mail/from.c
      * mail/mail.h
      * mail/mailline.c
      * mail/mailvar.c
      * mail/size.c
      * mail/util.c
      * mail/write.c
      * mailbox/cfg_format.c
      * mailbox/folder.c
      * mailbox/parse822.c
      * mailbox/system.c
      * messages/messages.c
      * mh/folder.c
      * mh/forw.c
      * mh/inc.c
      * mh/mh.h
      * mh/mh_alias.l
      * mh/mh_fmtgram.y
      * mh/mh_getopt.h
      * mh/mh_init.c
      * mh/mh_msgset.c
      * mh/mh_whatnow.c
      * mh/mhn.c
      * mh/pick.y
      * mimeview/mimetypes.y
      * python/libmu_py/debug.c
      * sieve/sieve.c
      Sergey Poznyakoff authored
  12. 25 Oct, 2009 2 commits
    • * include/mailutils/gsasl.h (mu_gsasl_module_data): Mark as extern.
      Sergey Poznyakoff authored
    • * examples/base64.c, examples/mta.c,
      imap4d/auth_gss.c, imap4d/imap4d.c,
      imap4d/preauth.c, libmu_auth/ldap.c,
      libmu_auth/virtual.c, libmu_scm/mu_body.c,
      libmu_scm/mu_port.c, libproto/mailer/smtp.c,
      mailbox/acl.c, mailbox/secret.c, pop3d/pop3d.c,
      python/libmu_py/address.c, sql/odbc.c: Fix argument
      signedness.
      
      * imap4d/fetch.c, imap4d/store.c (closures):
      Change type of `count' to int, to match the
      signature of util_msgset.
      * include/mailutils/guile.h (mu_scm_message_get): Fix
      return type (const is useless here).
      * libmu_scm/mu_message.c (mu_scm_message_get): Likewise.
      (scm_mu_message_copy): Fix type of the `wr' automatic variable.
      * libmu_scm/mu_mime.c (mu_scm_mime_get): Remove const qualifier
      from the return type.
      * libmu_argp/cmdline.c: Include stdlib.h.
      Sergey Poznyakoff authored
  13. 24 Sep, 2009 2 commits
    • * include/mailutils/cfg.h (mu_cfg_perror): Mark as printflike.
      (mu_cfg_format_error): Likewise.
      * libmu_argp/radius.c (mu_radius_argp_option): Fix typo in the
      docstring.
      * mail/mail.h [!WITH_READLINE] (mailvar_set_compl): New define.
      Sergey Poznyakoff authored
    • * imap4d/auth_gsasl.c (auth_gsasl): Make IMAP server wait
      for empty final client response.
      * include/mailutils/gsasl.h (mu_gsasl_stream_create): Don't
      use deprecated GNU SASL types.
      Simon Josefsson authored
  14. 25 Aug, 2009 1 commit
    •    The string MESSAGE should not begin with a capital letter when it
         follows a program name and/or file name, because that isn't the
         beginning of a sentence.  (The sentence conceptually starts at the
         beginning of the line.)  Also, it should not end with a period.
      
      * include/mailutils/diag.h (mu_diag_funcall): New prototype.
      * mailbox/diag.c: New function.
      
      * comsat/action.c, comsat/comsat.c, comsat/oldcfg.c,
      config/mailutils-config.c, configure.ac, dotlock/dotlock.c,
      frm/common.c, frm/from.c, guimb/collect.c, guimb/main.c,
      guimb/util.c, imap4d/auth_gsasl.c, imap4d/auth_gss.c, imap4d/bye.c,
      imap4d/close.c, imap4d/imap4d.c, imap4d/login.c, imap4d/preauth.c,
      imap4d/signal.c, imap4d/starttls.c, imap4d/util.c, lib/mailcap.c,
      lib/tcpwrap.c, libmu_argp/mu_argp.c, libmu_auth/ldap.c,
      libmu_auth/radius.c, libmu_auth/sql.c, libmu_auth/tls.c,
      libmu_cfg/acl.c, libmu_cfg/common.c, libmu_cfg/init.c,
      libmu_cfg/ldap.c, libmu_cfg/sql.c, libmu_sieve/actions.c,
      libmu_sieve/comparator.c, libmu_sieve/extensions/moderator.c,
      libmu_sieve/prog.c, libmu_sieve/sieve.l, libproto/imap/folder.c,
      libproto/mbox/mbox.c, maidag/deliver.c, maidag/lmtp.c,
      maidag/maidag.c, maidag/mailquota.c, maidag/mailtmp.c,
      maidag/script.c, mail/alias.c, mail/cd.c, mailbox/cfg_lexer.l,
      mailbox/cfg_parser.y, mailbox/file_stream.c, mailbox/gocs.c,
      mailbox/msrv.c, mailbox/mutil.c, mailbox/registrar.c,
      messages/messages.c, mh/folder.c, mh/forw.c, mh/inc.c, mh/mark.c,
      mh/mh_ctx.c, mh/mh_fmtgram.y, mh/mh_format.c, mh/mh_init.c,
      mh/mh_list.c, mh/mh_msgset.c, mh/mh_whatnow.c, mh/mh_whom.c,
      mh/mhl.c, mh/mhn.c, mh/pick.c, mh/refile.c, mh/repl.c, mh/rmf.c,
      mh/scan.c, mh/send.c, mimeview/mimetypes.l, mimeview/mimeview.c,
      movemail/movemail.c, pop3d/apop.c, pop3d/bulletin.c, pop3d/extra.c,
      pop3d/lock.c, pop3d/logindelay.c, pop3d/pop3d.c, pop3d/popauth.c,
      pop3d/quit.c, pop3d/signal.c, pop3d/user.c, readmsg/readmsg.c,
      sieve/sieve.c: Fix error messages.
      Sergey Poznyakoff authored
  15. 20 Aug, 2009 1 commit
    • * .gitignore: Add pathdefs.h
      * examples/Makefile.am (muauth_CPPFLAGS)
      (muemail_CPPFLAGS): New variables.
      * examples/argcv.c (main): Remove unused local.
      * include/mailutils/gsasl.h [USE_GSASL]: Change to WITH_GSASL.
      * include/mailutils/libcfg.h (mu_acl_cfg_init): New prototype.
      * include/mailutils/mu_auth.h (mu_authenticate): Password is const.
      * include/mailutils/python.h: Fix indentation.
      (mu_py_script_data): module_name is const char *.
      * libmu_auth/radius.c: Include radius/debug.h
      * libproto/mailer/smtp.c: Include io.h and secret.h
      * mail/mail.c: Fix indentation.
      * mail/util.c (util_rfc2047_decode): Fix local variable declaration.
      * mailbox/mu_auth.c (mu_authenticate): Password is const.
      * mh/mh.h (mh_alias_get, mh_alias_get_address)
      (mh_alias_get_alias): Name is const.
      * mh/mh_alias.y: Likewise.
      * mh/mh_list.c (print_header_value): Fix improper use of mu_toupper.
      * mh/mh_whatnow.c (invoke): Add typecasts.
      * python/libmu_py/nls.c (api_nls_set_locale): Remove unused automatic.
      * python/libmu_py/sieve.c (_sieve_error_printer): Provide missing
      return value.
      (_sieve_debug_printer): Likewise.
      Sergey Poznyakoff authored
  16. 13 Aug, 2009 2 commits
    • Minor fixes. · f2eb56bb
      * comsat/comsat.h: Include confpaths.h, not paths.h.
      * lib/utmp.c: Likewise.
      * libmu_scm/mu_scm.h: Likewise.
      * libproto/mailer/sendmail.c: Likewise.
      * mail/mail.h: Likewise.
      * mailbox/mbx_default.c: Likewise.
      * mailbox/version.c: Likewise.
      * lib/daemon.c: Likewise.
      
      * include/mailutils/mailer.h (struct timeval): forward decl.
      Sergey Poznyakoff authored
    • * Makefile.am (MU_COND_LIBMU_CPP): New cond.
      (SUBDIRS): Use LIBMU_CPP_DIR
      * configure.ac: Rename --disable-c++ to --disable-cxx: autoconf
      cannot handle the former.
      (MU_COND_LIBMU_CPP): New cond.
      (AC_CONFIG_FILES): Add include/mailutils/cpp/Makefile
      * include/mailutils/Makefile.am (nobase_pkginclude_HEADERS): Remove
      (MU_COND_LIBMU_CPP): New cond.
      (SUBDIRS): Add CPP_DIR
      * include/mailutils/cpp/Makefile.am: Remove substitution vars.
      (cppincludedir, cppinclude_HEADERS): New variables.
      * include/mailutils/sys/Makefile.am (sysincludedir)
      (sysinclude_HEADERS): New variables.
      Sergey Poznyakoff authored
  17. 09 Aug, 2009 1 commit
    • * include/mailutils/cpp/header.h (Header.has_key): New method.
      * libmu_cpp/header.cc: Likewise.
      * include/mailutils/cpp/mailbox.h (MailboxDefault): Make name optional.
      * libmu_cpp/mailbox.cc: Likewise.
      * python/mailutils/header.py (__contains__, has_key): New method.
      Wojciech Polak authored
  18. 07 Aug, 2009 1 commit
  19. 29 Jul, 2009 1 commit
    • * include/mailutils/cpp/sieve.h: New file.
      * libmu_cpp/sieve.cc: New file.
      * python/libmu_py/sieve.c: New file.
      * python/mailutils/sieve.py: New file.
      * include/mailutils/cstr.h: Do not use C++ keywords.
      * include/mailutils/tls.h: Likewise.
      Wojciech Polak authored
  20. 11 Jul, 2009 1 commit
  21. 08 Jul, 2009 1 commit
    • * include/mailutils/mailbox.h (MU_UIDL_LENGH)
      (MU_UIDL_BUFFER_SIZE): New defines.
      (struct mu_uidl): New struct.
      (mu_mailbox_get_uidls): New prototype.
      * libproto/include/mailbox0.h (struct _mu_mailbox): New member
      _get_uidls.
      * libproto/pop/mbox.c: Implement _get_uidls.
      * libproto/pop/folder.c: Include mailutils/cctype.h.
      
      * mailbox/mailbox.c (mu_mailbox_get_uidls): New function.
      
      * movemail/movemail.c: Implement --uidl option: use UIDLs to avoid
      downloading same messages twice.  Based on the idea of Alfred M. Szmidt.
      Implement --verbose option.
      
      * libproto/imap/mbox.c: Fix comment.
      
      * NEWS: Update.
      * doc/texinfo/programs.texi: Update.
      Sergey Poznyakoff authored
  22. 07 Jul, 2009 2 commits
    • * include/mailutils/cstr.h (mu_str_stripws): New function.
      * mailbox/stripws.c: New file.
      * mailbox/Makefile.am (libmailutils_la_SOURCES): Add stripws.c
      
      * examples/nntpclient.c (stripwhite): Remove. Use mu_str_stripws instead.
      (execute_line): Rewrite using new string functions.
      * examples/pop3client.c: Likewise.
      * mailbox/mailcap.c (stripwhite): Remove. Use mu_str_stripws instead.
      * mailbox/mime.c (_strltrim, _strttrim, _strtrim): Remove. Use
      mu_str_stripws instead.
      
      * mail/mail.c: Use mu_str_stripws.
      * mail/mail.h (util_stripwhite): Remove prototype.
      * mail/util.c (util_stripwhite): Remove
      * examples/pop3client.c: Likewise.
      * imap4d/util.c: Use new string functions.
      * maidag/forward.c: Likewise.
      * maidag/lmtp.c: Likewise.
      * mh/mhn.c: Likewise.
      
      * libproto/imap/folder.c: Remove unused local.
      * libproto/mailer/smtp.c (smtp_writeline): Minor optimization.
      Sergey Poznyakoff authored