1. 24 Nov, 2010 1 commit
    • Static memory stream is a read-only stream whose transport is
      an arbitrary area of memory.  Such streams allow the programmer
      to access C strings using streams interface.
      
      * include/mailutils/stream.h (mu_static_memory_stream_create): New
      proto.
      * libmailutils/stream/memory_stream.c (mu_static_memory_stream_create): New
      function.
      * imap4d/append.c (imap4d_append0): Use static memory stream to
      create a temporary message.
      * imap4d/preauth.c (decode64_buf): Use static memory stream.
      * libmailutils/base/rfc2047.c (mu_rfc2047_decode): Likewise.
      * libmailutils/mime/mimehdr.c (mu_mimehdr_decode_param): Likewise.
      * libmu_auth/ldap.c (chk_md5, chk_sha, chk_ssha): Likewise.
      * libmu_sieve/extensions/vacation.c (build_mime): Likewise.
      Sergey Poznyakoff authored
  2. 23 Nov, 2010 4 commits
    • * libmailutils/stream/message_stream.c (scan_stream): Merge
      with _message_open.
      * mh/mhn.c (edit_forw): Do not set ws_delim.
      Fix message addressing.
      (mhn_edit): Remove the trailing newline.
      Sergey Poznyakoff authored
    • * include/mailutils/sys/amd.h (_amd_data) <delete_msg>: New method.
      * libmailutils/base/amd.c (amd_expunge): If delete_msg is defined,
      use it.
      * libproto/mh/mbox.c (_mh_msg_delete): New method.
      (_mailbox_mh_init): Set delete_msg if "rmmproc" component is
      defined.
      
      * mh/tests/movemsg: New file.
      * mh/tests/Makefile.am (EXTRA_DIST): Add movemsg.
      * mh/tests/rmm.at: Test rmmproc effects.
      * mh/tests/rmf.at (MH_KEYWORDS): Fix copy-n-paste error.
      
      * doc/texinfo/mu-mh.texi: Document rmmproc.
      * mh/TODO: Update.
      Sergey Poznyakoff authored
    • * mh/repl.c: Minor changes.
      * tests/repl.at: New file.
      * tests/Makefile.am (TESTSUITE_AT): Add repl.at
      * mh/tests/testsuite.at: Include repl.at.
      * mh/TODO: Update.
      Sergey Poznyakoff authored
    • * mh/forw.c (options): New option --file.
      (input_file): New variable.
      (opt_handler): Handle --file.
      (finish_draft): Remove a leftover path hack.
      Implement raw file forwarding.
      (main): Minor fix.
      * mh/mh_getopt.c (mh_option_init): Limit match_len to the actual
      length of the option string.
      
      * mh/tests/forw.at: New file.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add forw.at.
      * mh/tests/testsuite.at: Include forw.at.
      * mh/tests/comp.at: Add more keywords.
      Sergey Poznyakoff authored
  3. 22 Nov, 2010 2 commits
    • * include/mailutils/mailbox.h (MU_MAILBOX_UID_TO_MSGNO)
      (MU_MAILBOX_MSGNO_TO_UID): New defines.
      (mu_mailbox_translate): New proto.
      * include/mailutils/sys/mailbox.h (_mu_mailbox) <_translate>: New
      method.
      * libmailutils/mailbox/mailbox.c (mu_mailbox_translate): New
      function.
      * libproto/mh/mbox.c (mh_translate): New function.  Implements
      the _translate method.
      * mh/mh_msgset.c (mh_uid_to_msgno, mh_msgno_to_uid): Remove.  All
      callers updated to use mu_mailbox_translate instead.
      (mh_search_message): Remove.
      (mh_get_message): Rewrite using mu_mailbox_translate.
      
      * mh/comp.c (copy_message): Check return from mu_mailbox_get_message.
      * mh/mh_init.c (mh_draft_message): Rewrite using mu_url_sget_path.
      * mh/tests/comp.at: Test draftfolder functionality.
      Sergey Poznyakoff authored
    • * mh/Makefile.am (bin_PROGRAMS): Add mhseq.
      * mh/comp.c (main): Rewrite to fix compatibility issues.
      * mh/mh.h (MH_MSGSET_UID): New define.
      (mh_msgset_t) <flags,size>: New members.
      * mh/mh_init.c (mh_draft_message): Bugfix: convert msgset to UIDs.
      * mh/mh_msgset.c: Rewrite from scratch.
      
      * mh/tests/comp.at: New file.
      * mh/tests/mhseq.at: New file.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add comp.at, mhseq.at.
      * mh/tests/testsuite.at: Include comp.at and mhseq.at.
      
      * libmailutils/property/mhprop.c (_mh_prop_read_stream): Minor fix.
      Do remove empty lines.
      * mh/mh_whatnow.c (_whatnow): Detect EOF.
      (call_send): Quit after successful send.
      Sergey Poznyakoff authored
  4. 21 Nov, 2010 1 commit
    • * mh/whatnowenv.c: New source.
      * mh/Makefile.am (libmh_a_SOURCES): Add whatnowenv.c
      * mh/TODO: Update.
      * mh/comp.c: Implement draftfolder, whatnowproc and the -use option.
      * mh/forw.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/compcommon.c (check_draft_disposition): Fix typo.
      * mh/mh.h (mh_whatnow_env) <draftfolder>: Remove.
      <mbox>: New member.
      (mh_whatnowproc): New proto.
      (mh_whatnow_env_from_environ)
      (mh_whatnow_env_to_environ): New proto.
      * mh/mh_global.c (prop_merger): Bugfix: initialize dst.
      * mh/mh_init.c (mh_draft_message): Update cur msg.
      * mh/mh_whatnow.c (mh_whatnowproc): New function.
      * mh/whatnow.c (opt_handler): Do not read Draft-Folder variable.
      (main): Initialize data from the environment.
      Sergey Poznyakoff authored
  5. 20 Nov, 2010 3 commits
    • * libmailutils/filter/header.c: New file.
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add header.c.
      * libmailutils/filter/filter.c (mu_filter_get_list): Register
      mu_header_filter.
      * libmailutils/filter/inline-comment.c: (ilcmt_ws)
      (ilcmt_rollback): New states.
      (ILCMT_REMOVE_EMPTY_LINES,ILCMT_SQUEEZE_WS): New flags.
      (ilcmt_data)<buf,size,level,replay>: New members.
      (ilcmt_action): New enum
      (new_ilcmt_state): Return enum ilcmt_action.
      (_ilcmt_decoder): Optionally remove
      empty lines and squeeze leading white space.
      * libmailutils/property/mhprop.c (_mh_prop_read_stream): Remove
      empty lines from the input.
      
      * libmailutils/tests/Makefile.am (TESTSUITE_AT): Add hdrflt.at
      and inline-comment.at.
      * libmailutils/tests/testsuite.at: Include hdrflt.at and inline-comment.at.
      * libmailutils/tests/fltst.c: Pass optional arguments to the
      filter creation procedure.
      
      * mh/mh_whom.c (read_header): New function.
      (mh_whom): Rewrite using headers.
      
      * include/mailutils/filter.h: Fix a typo.
      * libmailutils/stream/fltstream.c: Likewise.
      * libmu_auth/gsasl.c: Likewise.
      Sergey Poznyakoff authored
    • * mh/mh_ctx.c: Remove.
      * mh/Makefile.am (libmh_a_SOURCES): Remove mh_ctx.c
      * mh/folder.c (read_seq_file): Use mu_property_t.
      * mh/mh.h (mh_context_iterator): Remove typedef.
      (mh_global_profile_get, mh_global_profile_set)
      (mh_global_profile_iterate)
      (mh_global_context_set,mh_global_context_set)
      (mh_global_context_iterate): Rewrite as macros.
      (mh_global_sequences_iterate): Change signature.
      (mh_read_property_file,mh_property_merge): New protos.
      (mh_context_create,mh_context_read,mh_context_write)
      (mh_context_get_value,mh_context_set_value,mh_context_iterate)
      (mh_context_destroy,mh_context_merge): Remove protos.
      * mh/mh_global.c (mh_global_profile_get, mh_global_profile_set)
      (mh_global_profile_iterate)
      (mh_global_context_set,mh_global_context_set)
      (mh_global_context_iterate): Remove.
      (mh_read_property_file,mh_property_merge): New functions.
      (_mh_init_global_context,mh_read_profile)
      (mh_set_current_folder,mh_global_sequences_iterate): Rewrite.
      (mh_global_save_state): Rewrite.
      * mh/mh_whom.c (mh_whom): Use mu_property_t.
      * mh/send.c: Use mu_property_t.
      * po/POTFILES.in: Add mh/mboxprop.c.
      Sergey Poznyakoff authored
    • * libmailutils/mailbox/header.c (mu_header_clear): New function.
      (mu_header_sget_value_n): Tolerate pval == NULL.
      * libmailutils/property/assocprop.c (_assoc_prop_setval): Bugfix.
      (_assoc_prop_clear): New method.
      (mu_assoc_property_init): Reference the stream.
      (mu_assoc_property_init): Initialize _prop_clear.
      * libmailutils/property/create.c (_mu_property_init): Now extern.
      * libmailutils/property/propset.c (mu_property_set_value): Null value
      means unset.
      * libmailutils/tests/prop.at: Test property clear and invalidate.
      * libmailutils/tests/prop.c: New commands: 0 for property clear and ! for
      invalidate.
      
      * libmailutils/property/mhprop.c: New file.
      * libmailutils/property/propclr.c: New file.
      * libmailutils/property/propinv.c: New file.
      * libmailutils/property/Makefile.am (noinst_LTLIBRARIES): Add new files.
      
      * include/mailutils/header.h (mu_header_clear): New proto.
      * include/mailutils/property.h (mu_property_clear)
      (mu_property_invalidate): New protos.
      (mu_mh_prop): New struct.
      (mu_mh_property_init): New proto.
      * include/mailutils/sys/property.h (_mu_property) <_prop_clear>: New member.
      (_mu_property_init): New proto.
      * include/mailutils/mh.h: New file.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add mh.h
      
      * libproto/mh/profile.c: New file.
      * libproto/mh/Makefile.am (libmu_mh_la_SOURCES): Add new files.
      
      * libproto/mh/mbox.c (mh_get_property): New static function.
      (_mailbox_mh_init): Set _get_property.
      
      * mh/mh_global.c (current_message, sequences): Remove.  Use mbox
      properties instead.
      (mh_global_sequences_get)
      (mh_global_sequences_set)
      (mh_global_sequences_iterate)
      (mh_global_sequences_drop): Take mbox as first argument. All callers
      updated.
      * mh/mh_init.c (mh_init2): Remove call to mh_global_sequences_get.
      * mh/mh_msgset.c (msgset_cur): Use mh_mailbox_get_cur.
      * mh/mh_sequence.c (mh_seq_read, write_sequence)
      (delete_sequence, mh_seq_add, mh_seq_delete): Take mbox as first argument.
      All callers updated.
      
      * mh/mh.h: Include mailutils/property.h.
      (current_message): Remove.
      (mh_mailbox_cur_default): New extern.
      (mh_global_sequences_get)
      (mh_global_sequences_set)
      (mh_global_sequences_iterate)
      (mh_global_sequences_drop): Take mbox as first argument. All callers
      updated.
      
      * mh/mh_format.c (builtin_cur): Rewrite using mh_message_number.
      
      * mh/mboxprop.c: New file.
      * mh/Makefile.am (libmh_a_SOURCES): Add new file.
      
      * mh/folder.c: Update calls to sequence management functions.
      * mh/mark.c: Likewise.
      * mh/pick.c: Likewise.
      
      * mh/inc.c (main): Set mh_mailbox_cur_default to 1.
      Invalidate properties if changecur is not set.
      * mh/prompter.c (main): Destroy the iterator.
      * mh/rmf.c: Rewrite using mu_mailbox_remove.
      * mh/scan.c: Always close the mailbox.
      
      * mh/tests/folder.at: Update.
      * mh/tests/inc.at: Update.  Inc now sets cur to 1 if it was not
      originally set.  This is what others MHs do.
      Sergey Poznyakoff authored
  6. 18 Nov, 2010 4 commits
    • * configure.ac: Add libmailutils/property/Makefile to config files.
      
      * include/mailutils/property.h (mu_property_create)
      (mu_property_destroy): Change signature.
      (mu_property_get_owner): Remove.
      (mu_property_create_init)
      (mu_property_set_init, mu_property_set_init_data)
      (mu_property_ref, mu_property_unref)
      (mu_property_save): New protos.
      (mu_property_get_iterator)
      (mu_assoc_property_init): New protos.
      * include/mailutils/sys/property.h (property_item): Remove definition.
      (MU_PROP_INIT, MU_PROP_FILL, MU_PROP_MODIFIED): New flags.
      (_mu_property): Rewrite from scratch.
      (_mu_property_check): New proto.
      
      * libmailutils/property/Makefile.am: New file.
      * libmailutils/property/assocprop.c: New file.
      * libmailutils/property/create.c: New file.
      * libmailutils/property/propget.c: New file.
      * libmailutils/property/propitr.c: New file.
      * libmailutils/property/propset.c: New file.
      
      * libmailutils/Makefile.am (SUBDIRS): Add property.
      (libmailutils_la_LIBADD): Add property/libproperty.la.
      
      * libmailutils/base/property.c: Remove.
      * libmailutils/base/Makefile.am (libbase_la_SOURCES): Remove property.c
      
      * libmailutils/base/assoc.c (first): Avoid coredumping on empty
      hash table.
      
      * include/mailutils/folder.h (mu_folder_set_property)
      (mu_folder_get_property): New protos.
      * include/mailutils/sys/folder.h (_mu_folder) <property>
      <_get_property>: New members.
      * libmailutils/mailbox/folder.c (mu_folder_destroy): Destroy the
      property.
      (mu_folder_get_property)
      (mu_folder_set_property): New functions.
      
      * include/mailutils/mailbox.h (mu_mailbox_set_property): New proto.
      * libmailutils/mailbox/mailbox.c (mu_mailbox_set_property): New function.
      (mu_mailbox_get_property): Use _get_property method.
      
      * include/mailutils/mailer.h (mu_mailer_set_property): New proto.
      * include/mailutils/sys/mailer.h (_mu_mailer) <_get_property>: New member.
      * libmailutils/mailer/mailer.c (mu_mailer_set_property): New function.
      (mu_mailer_get_property): Use _get_property method.
      
      * include/mailutils/iterator.h (mu_iterator_set_dataptr): New proto.
      * include/mailutils/sys/iterator.h (_mu_iterator) <dataptr>: New method.
      * libmailutils/base/iterator.c (mu_iterator_set_dataptr): New function.
      (mu_iterator_current): Rewrite as a wrapper around mu_iterator_current_kv.
      (mu_iterator_current_kv): Use dataptr method (if defined) to extract the
      data pointer.
      
      * libmailutils/tests/prop.c: New file.
      * libmailutils/tests/prop.at: New file.
      * libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add prop.
      (TESTSUITE_AT): Add prop.at.
      * libmailutils/tests/testsuite.at: Include prop.at.
      Sergey Poznyakoff authored
    • Sergey Poznyakoff authored
    • * mh/prompter.c (main): Append terminating \0 to the opool.
      Sergey Poznyakoff authored
    • * configure.ac (MU_COND_READLINE): New cond.
      * mh/prompter.c: New file.
      * mh/prompter-rl.c: New file.
      * mh/prompter-tty.c: New file.
      * mh/prompter.h: New file.
      * mh/TODO: Update.
      * mh/Makefile.am: Build prompter.
      
      * doc/texinfo/mu-mh.texi: Document prompter
      * po/POTFILES.in: Update.
      Sergey Poznyakoff authored
  7. 17 Nov, 2010 1 commit
    • * include/mailutils/filter.h (mu_filter_xcode_t): Change signature.
      (mu_filter_create_args): New proto.
      (mu_inline_comment_filter): New extern.
      
      * libmailutils/filter/inline-comment.c: New file.
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add inline-comment.c.
      * libmailutils/filter/crlfdot.c (alloc_state): Update declaration.
      * libmailutils/filter/crlfflt.c: Likewise.
      * libmailutils/filter/dot.c: Likewise.
      * libmailutils/filter/fromflt.c (_from_alloc_state): Likewise.
      * libmailutils/filter/filter.c (mu_filter_create_args): New function.
      (mu_filter_create): Rewrite via mu_filter_create_args.
      
      mh: inline comments are allowed for use in components and forwcomp files.
      
      * mh/compcommon.c (mh_comp_draft): Fix erroneous conditional.
      * mh/components: Add comments.
      * mh/mh_init.c (mh_file_copy): Rewrite using new API.
      
      mu filter: new option to list supported filters.
      
      * mu/filter.c (filter_options): New option --list (-L).
      (filter_parse_opt): Handle the -L option.
      (filter_printer, list_filters): New functions.
      (main): Print a list of filters if --list was given.
      Sergey Poznyakoff authored
  8. 16 Nov, 2010 5 commits
  9. 15 Nov, 2010 5 commits
    • * libmailutils/stream/message_stream.c (copy_trimmed_value): Fix
      memory allocation.
      Sergey Poznyakoff authored
    • * mh/ali.c (ali_print_name_list): Print -list output.
      * mh/tests/ali.at: New test case.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add ali.at
      * mh/tests/testsuite.at: Include ali.at.
      * mh/tests/anno.at: Fix MH_KEYWORDS definition.
      * mh/tests/folder.at: Likewise.
      * mh/tests/inc.at: Likewise.
      * mh/tests/mark.at: Likewise.
      * mh/tests/mhl.at: Likewise.
      * mh/tests/mhparam.at: Likewise.
      * mh/tests/mhpath.at: Likewise.
      * mh/tests/refile.at: Likewise.
      * mh/tests/rmf.at: Likewise.
      
      * mh/tests/pick.at: Fix MH_KEYWORDS definition. Add more tests.
      Sergey Poznyakoff authored
    • * mh/mh_init.c (mh_install): Exit with code 1 on errors.
      * mh/tests/install-mh.at: New file.
      * mh/tests/pick.at: New file.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add install-mh.at, pick.at.
      * mh/tests/testsuite.at: Include install-mh.at and pick.at.
      Sergey Poznyakoff authored
    • * mh/mh_argp.c (mh_argp_children): Set group number -2, to place
      help output between the application help and informational options.
      * mh/mhn.c (options): Regroup options,
      * mh/pick.c: Likewise.
      
      * mh/ali.c: Reword arg docs.
      * mh/anno.c: Likewise.
      * mh/burst.c: Likewise.
      * mh/comp.c: Likewise.
      * mh/fmtcheck.c: Likewise.
      * mh/folder.c: Likewise.
      * mh/forw.c: Likewise.
      * mh/inc.c: Likewise.
      * mh/install-mh.c: Likewise.
      * mh/mark.c: Likewise.
      * mh/mh_argp.c: Likewise.
      * mh/mhl.c: Likewise.
      * mh/mhn.c: Likewise.
      * mh/mhparam.c: Likewise.
      * mh/mhpath.c: Likewise.
      * mh/pick.c: Likewise.
      * mh/refile.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/rmf.c: Likewise.
      * mh/rmm.c: Likewise.
      * mh/scan.c: Likewise.
      * mh/send.c: Likewise.
      * mh/sortm.c: Likewise.
      * mh/whom.c: Likewise.
      Sergey Poznyakoff authored
    • * mh/mh_getopt.h (mh_option): Move match_len to the end of the
      structure.  It should not be initialized.
      (mh_option_init): New prototype.
      
      * mh/mh_getopt.c (mh_option_init): New function.
      * mh/mh_argp.c (mh_argp_parse): Call mh_option_init.
      
      * mh/ali.c: Update mh_option declaration.
      * mh/anno.c: Likewise.
      * mh/burst.c: Likewise.
      * mh/comp.c: Likewise.
      * mh/fmtcheck.c: Likewise.
      * mh/folder.c: Likewise.
      * mh/forw.c: Likewise.
      * mh/inc.c: Likewise.
      * mh/install-mh.c: Likewise.
      * mh/mark.c: Likewise.
      * mh/mhl.c: Likewise.
      * mh/mhn.c: Likewise.
      * mh/mhparam.c: Likewise.
      * mh/mhpath.c: Likewise.
      * mh/pick.c: Likewise.
      * mh/refile.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/rmf.c: Likewise.
      * mh/rmm.c: Likewise.
      * mh/scan.c: Likewise.
      * mh/send.c: Likewise.
      * mh/sortm.c: Likewise.
      * mh/whatnow.c: Likewise.
      * mh/whom.c: Likewise.
      Sergey Poznyakoff authored
  10. 14 Nov, 2010 1 commit
    • The traditional component matching syntax, `--COMP STRING', is
      accepted, provided at least one of the following conditions is met:
      
      1. The word `COMP' contains at least one capital letter;
      2. The word `COMP' ends with a colon;
      3. Standard input is not connected to a terminal.
      
      * mh/mh_getopt.c (mh_help_hook): New global variable.
      (mh_help): Call mh_help_hook, if set.
      * mh/mh_getopt.h (mh_help_hook): New extern.
      * mh/pick.c (doc): Update.
      (opt_handler): Remove ARGP_KEY_ERROR case.
      (pick_help_hook): New function.
      (main): Convert any instance of `--comp string' to
      `--component=comp --pattern=string', if comp contains a
      capital letter or ends with a colon, or fd 0 is not connected
      to terminal.
      * doc/texinfo/mu-mh.texi: Document changes to pick.
      Sergey Poznyakoff authored
  11. 12 Nov, 2010 1 commit
    • Replace 'Mirddin.farlep.net' with 'example.net' throughout the
      testsuite.  Change expected message/part sizes accordingly.
      Files changed:
      
      * imap4d/testsuite/imap4d/fetch.exp
      * mail/testsuite/mail/folder.exp
      * mail/testsuite/mail/read.exp
      * mail/testsuite/mail/write.exp
      * mh/tests/scan.at
      * readmsg/tests/all.at
      * testsuite/maildir/mbox1/new/1284628225.M20118P3883Q2.Trurl
      * testsuite/maildir/mbox1/new/1284628225.M21284P3883Q3.Trurl
      * testsuite/maildir/mbox1/new/1284628225.M22502P3883Q4.Trurl
      * testsuite/mh/mbox1/3
      * testsuite/mh/mbox1/4
      * testsuite/mh/mbox1/5
      * testsuite/mime.at
      * testsuite/spool/mbox
      * testsuite/spool/mbox1
      * testsuite/spool/relational.mbox
      Sergey Poznyakoff authored
  12. 11 Nov, 2010 3 commits
    • * doc/texinfo/nullstream.texi: New file.
      
      * mh/mh_init.c (mh_real_install): Use mu_stream_t instead of
      FILE.
      * mh/mh_whatnow.c (_whatnow): Likewise.
      Sergey Poznyakoff authored
    • * mh/mh_init.c (mh_init): Make sure stdin is open.
      * mh/anno.c (main): Use mu_stream_t to read the answer from stdin.
      Do not display prompt if stdin is not connected to a tty.
      * mh/tests/anno.at: New testcase.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add anno.at
      * mh/tests/testsuite.at: Include anno.at.
      
      * doc/texinfo/mu-mh.texi: Document the changes in the behavior of anno.
      Sergey Poznyakoff authored
    • Mhl now accepts the traditional use of "ignores=", i.e. as a single
      statement on a line and without double-quotes around the argument.
      
      Additional quotes around variable values are not needed in most
      cases.
      
      The name of a component is not printed if that component is not
      present.
      
      The offset variable works as in MH and nmh.
      
      * mh/mh_list.c (parse_variable): Accept traditional use of
      "ignores=", as a single statement on a line, without double-quotes around
      the argument.
      (mhl_format_compile): Use mu_streams instead of FILE.
      Fix line counting.
      (header_is_printed, want_header): Last argument is const char *.
      (ovf_print): Move to the specified offset no matter what the value
      of prefix is.
      (print_component_name): New function.
      (eval_component): Call print_component_name and newline, if necessary
      (eval_body): Likewise.
      (eval_extras): Likewise.
      (eval_comp): Do not print component name, leave that to the called
      function.  Ditto for the trailing newline.
      * mh/mhl.c: Ignore empty moreproc value.
      * mh/mhl.format: Remove extra double-quotes.
      
      * mh/tests/mhl.at: New testcase.
      * mh/tests/Makefile.am (TESTSUITE_AT): Add mhl.at
      * mh/tests/testsuite.at: Include mhl.at
      
      * libmailutils/string/wordsplit.c (scan_qstring): Force _WSNF_EMPTYOK.
      (mu_wordsplit_len): Make sure the tail element is not joinable
      * libmailutils/tests/wordsplit.at: Test these changes.
      
      * doc/texinfo/mu-mh.texi: Update the description of mhl.
      Sergey Poznyakoff authored
  13. 10 Nov, 2010 4 commits
    • * configure.ac (mh/tests): New testdir
      * mh/Makefile.am (SUBDIRS): Add tests
      
      * tests/Makefile.am: New file.
      * mh/tests/Makefile.am: New file.
      * mh/tests/atlocal.in: New file.
      * mh/tests/folder.at: New file.
      * mh/tests/inc.at: New file.
      * mh/tests/mark.at: New file.
      * mh/tests/mhparam.at: New file.
      * mh/tests/mhpath.at: New file.
      * mh/tests/refile.at: New file.
      * mh/tests/rmf.at: New file.
      * mh/tests/rmm.at: New file.
      * mh/tests/scan.at: New file.
      * mh/tests/testsuite.at: New file.
      * mh/tests/.gitignore: New file.
      
      * testsuite/testsuite.inc (MUT_MBCOPY): Work correctly if
      DST is a directory name (for MH and maildir formats).
      
      * mh/folder.c (action_list): Treat empty value as
      equal to no value.
      * mh/install-mh.c (main): Honor MH environment variable.
      * mh/mh_ctx.c (mh_context_read, mh_context_write): Use MU streams
      instead of stdio FILE.
      (mh_context_iterate): Add error checking.
      Do not coredump on NULL header.
      * mh/mh_global.c (_mh_init_global_sequences): Destroy sequences.
      * mh/TODO: Update.
      
      * libmailutils/stream/message_stream.c (copy_trimmed_value): New
      static function.
      (scan_stream): Strip final newline from the saved envelope values.
      
      * mu/Makefile.am (BUILD_SOURCES, EXTRA_DIST): Add
      mu-setup.c and mu-setup.h.
      Sergey Poznyakoff authored
    • * mh/mhn.c (_get_hdr_value): Remove.  All callers modified to use
      mu_header_aget_value_unfold instead.
      (mhn_message_size): Type of 2nd arg is mu_off_t *.
      Use null stream & stream stats in realsize mode.
      (list_handler): Fix rounding of the message size.
      (copy_header): Use mu_header_sget* to avoid unnecessary
      memory allocations.
      Sergey Poznyakoff authored
    • * include/mailutils/stream.h (MU_IOCTL_NULLSTREAM_SET_PATTERN)
      (MU_IOCTL_NULLSTREAM_SET_PATCLASS)
      (MU_IOCTL_NULLSTREAM_SETSIZE)
      (MU_IOCTL_NULLSTREAM_CLRSIZE): New ioctl opcodes.
      (mu_nullstream_pattern): New struct.
      (MU_STREAM_STAT_IN,MU_STREAM_STAT_OUT)
      (MU_STREAM_STAT_READS,MU_STREAM_STAT_WRITES)
      (MU_STREAM_STAT_SEEKS,_MU_STREAM_STAT_MAX): New defines.
      (MU_STREAM_STAT_MASK): New macro.
      (MU_STREAM_STAT_MASK_ALL): New define.
      (mu_stream_stat_buffer): New typedef.
      (mu_stream_set_stat, mu_stream_get_stat)
      (mu_nullstream_create): New protos.
      (mu_stream_bytes_in, mu_stream_bytes_out): Remove protos.
      
      * include/mailutils/sys/nullstream.h: New file.
      * include/mailutils/sys/stream.h (_mu_stream) <bytes_in>,
      <bytes_out>: Remove.
      <statmask,statbuf>: New members.
      * include/mailutils/sys/Makefile.am (sysinclude_HEADERS): Add nullstream.h.
      
      * libmailutils/stream/nullstream.c: New file.
      * libmailutils/stream/stream.c (_stream_read, _stream_write)
      (_stream_seek, _stream_stat_incr): New macros.
      (_stream_fill_buffer, mu_stream_seek)
      (_stream_read_unbuffered)
      (_stream_write_unbuffered): Use _stream_read, _stream_write
      and _stream_seek instead of calling the corresponding methods directly.
      (mu_stream_bytes_in, mu_stream_bytes_out): Remove.
      (mu_stream_unref): Clear statbuf, if provided.
      (mu_stream_set_stat, mu_stream_get_stat): New functions.
      
      * libmailutils/stream/Makefile.am (libstream_la_SOURCES): Add nullstream.c.
      
      * libmailutils/stream/fltstream.c (filter_wr_close): Check for fs->eof.
      
      * examples/base64.c (c_copy): Use new statistics interface.
      * libmailutils/tests/fltst.c: Likewise.
      Sergey Poznyakoff authored
    • * libmailutils/mime/attachment.c (BUF_SIZE): Remove.
      (_mu_mime_io_buffer)<buf, bufsize>: Remove members.
      (MSG_HDR): Remove.
      (mu_message_create_attachment): Use mu_asprintf instead of
      manually crafting the string.
      (mu_mime_io_buffer_set_size)
      (mu_mime_io_buffer_get_size): Remove.
      (mu_message_save_attachment)
      (mu_message_encapsulate)
      (mu_message_unencapsulate): Use mu_header_sget to avoid
      unnecessary memory allocations.
      Use mu_stream_copy instead of (ineffective) loops.
      
      * include/mailutils/message.h (mu_mime_io_buffer_set_size)
      (mu_mime_io_buffer_get_size): Remove prototypes.
      * include/mailutils/header.h (MU_HEADER_RESENT_SENDER)
      (MU_HEADER_CONTENT_TRANSFER_ENCODING)
      (MU_HEADER_DELIVERY_DATE)
      (MU_HEADER_ENVELOPE_TO): Normalize spelling.
      Sergey Poznyakoff authored
  14. 09 Nov, 2010 4 commits
    • * include/mailutils/sys/filter.h (_mu_filter_stream)<eof>: New member.
      * libmailutils/filter/binflt.c (_bit8_filter): Change name initializer
      to "8bit".
      (_bit7_filter): Change name initializer to "7bit".
      * libmailutils/filter/filter.c (mu_filter_create): Limit line
      length for encoding streams only.
      * libmailutils/stream/fltstream.c (filter_read): Use fs->eof instead
      of the regular stream EOF marker.
      * libmailutils/stream/stream.c (mu_stream_eof): Bugfix: take into
      account eventual buffered data.
      (_stream_read_unbuffered): Call mu_stream_eof instead of checking
      the _MU_STR_EOF bit.
      Sergey Poznyakoff authored
    • * libproto/imap/id.c: New file.
      * libproto/imap/login.c: New file.
      * libproto/imap/Makefile.am: Add new files.
      * libproto/imap/capability.c (mu_imap_capability): Clear
      MU_IMAP_RESP before reading response.
      Add MU_WRDSF_QUOTE to mu_wordsplit flags.
      * libproto/imap/err.c (_mu_imap_seterrstr): Bugfix: initialize
      imap->errstr.
      * libproto/imap/logout.c (mu_imap_logout): Clear
      MU_IMAP_RESP before reading response.
      * libproto/imap/response.c (_mu_imap_response): Set error string.
      * mu/imap.c (com_login, com_id): New functions.
      (imap_comtab) <login, id>: New keywords.
      Sergey Poznyakoff authored
    • * libmailutils/stream/stream.c (_stream_fill_buffer): Keep
      track of the current offset.
      (mu_stream_seek): avoid unnecessary seeks.
      (_stream_skip_input_bytes): Call _stream_flush_buffer before
      _stream_fill_buffer.
      (_stream_write_unbuffered): Do not modify current offset.
      (mu_stream_read,mu_stream_write): For unbuffered streams,
      modify current offset after invoking the corresponding I/O
      call.
      (_stream_scandelim): Call _stream_flush_buffer before
      _stream_fill_buffer.
      Sergey Poznyakoff authored
    • UFMS, or "UNIX mailbox first message symptom", is a long-standing
      bug that existed in all previous versions of Mailutils:  under
      certain circumstances, a fragment of the message headers would get
      prepended to the body of the very first message in a UNIX mailbox.
      See the detailed description in testsuite/ufms.c.
      
      Along with fixing this bug, this change also ensures a proper restoring
      of UIDs from UNIX mailboxes.
      
      * libproto/mbox/mbox.c (_msg_body_setup): Call mu_body_clear_modified
      after constructing the body.
      (new_message): Ditto for mu_message_clear_modified.
      (mbox_reset): Rewrite.  Drop all cached messages and rescan entire
      mailbox to avoid the "1st message symptom".
      (mbox_expunge0): Change the call to mbox_reset.
      * libproto/mbox/mboxscan.c (IS_X_UID, IS_X_IMAPBASE): New macros.
      (mbox_scan_internal): Change handling of min_uid.
      Attempt to get UID and imapbase from the corresponding message headers.
      (mbox_scan0): Reflect the above changes.
      
      * testsuite/.gitignore: Add ufms.
      * testsuite/Makefile.am (noinst_PROGRAMS): Add ufms.
      (TESTSUITE_AT): Add ufms.at.
      * testsuite/testsuite.at: Include ufms.at.
      * testsuite/ufms.at: New test case.
      * testsuite/ufms.c: New test program.
      
      * imap4d/testsuite/imap4d/expunge.exp: Fix UIDNEXT expectation.
      Sergey Poznyakoff authored
  15. 08 Nov, 2010 1 commit
    • * include/mailutils/imap.h: New file.
      * include/mailutils/Makefile.am (pkginclude_HEADERS): Add imap.h
      
      * libproto/imap/capability.c: New file.
      * libproto/imap/capatst.c: New file.
      * libproto/imap/carrier.c: New file.
      * libproto/imap/connect.c: New file.
      * libproto/imap/create.c: New file.
      * libproto/imap/destroy.c: New file.
      * libproto/imap/disconnect.c: New file.
      * libproto/imap/err.c: New file.
      * libproto/imap/fake-folder.c: New file.
      * libproto/imap/logout.c: New file.
      * libproto/imap/response.c: New file.
      * libproto/imap/state.c: New file.
      * libproto/imap/tag.c: New file.
      * libproto/imap/trace.c: New file.
      * libproto/imap/Makefile.am (libmu_imap_la_SOURCES): Temporarly
      remove folder.c, mbox.c and url.c. Add new files.
      
      * mu/getarg.c: New file.
      * mu/imap.c: New file.
      * mu/verbose.c: New file.
      * mu/Makefile.am (IDLE_MODULES): New variable.
      (IMAP_C): New variable.
      (MODULES): Add $(IMAP_C).
      (mu_SOURCES): Add getarg.c and verbose.c
      (mu-setup.h, mu-setup.c): Add IDLE_MODULES both to the dependencies
      and to the mu-setup.awk command line.
      * mu/mu-setup.awk: New keyword mu-cond.
      * mu/pop.c: Add mu-cond keyword.
      
      * include/mailutils/sys/imap.h: Rewrite.
      * include/mailutils/sys/pop3.h (MU_POP3_CHECK_EAGAIN): Take into
      account MU_ERR_REPLY and MU_ERR_BADREPLY, which are recoverable errors.
      
      * libmailutils/base/list.c (mu_list_clear): Return immediately if
      list is NULL.
      * libmu_auth/sql.c (sql_escape_string): Remove unused variable.
      
      * libproto/pop/pop3_carrier.c (mu_pop3_get_carrier): Increase refcount
      on the returned stream.
      * libproto/pop/pop3_response.c (mu_pop3_response): Check POP3 reply code.
      Sergey Poznyakoff authored