1. 31 May, 2017 2 commits
    • Calls to mh_global_profile_get and similar functions must appear
      only after a call to mh_getopt (more properly, after mh_init and
      mh_init2 are callead).  This sequence was inadvertently changed
      by commit e267ac86, due to which comp, forw, repl and burst stopped
      reading important information from .mh_profile.  Bug spotted by
      Pierre-Jean.
      
      * mh/burst.c: Make sure profile variables are accessed after
      the profile is read.
      * mh/comp.c: Likewise.
      * mh/forw.c: Likewise.
      * mh/repl.c: Likewise.
      * mh/mh.h (mh_whatnow_env_from_environ): Split into two functions:
      mh_whatnow_env_from_environ_early, to be called before mh_getopt,
      and mh_whatnow_env_from_environ_late, to be called after it.
      * mh/whatnowenv.c: Ditto.
      * mh/whatnow.c: Call these two in the right order.
      
      * THANKS: Update.
      Sergey Poznyakoff authored
    • Old short option '-t' renamed to '-f' for consistency (-f stands for
      --file in most other utilities).  Thus, 'mimevief -f my.types' reads
      the file 'my.types'.
      
      The '-t' option is reused as a short equivalent of the new
      '--lint' option, which instructs the tool to check the syntax of the
      mime.types file and exit, ignoring any surplus command line arguments.
      
      Added support for priority and regex functions.
      
      Improved debugging output.
      
      * mimeview/mimetypes.l: Rewrite lexer in a cleaner way.
      * mimeview/mimetypes.y: Rewrite parser.  Track locations.  Add line
      information to nodes and rules.  Improve debugging
      * mimeview/mimeview.c: Remove the debug configuration statement.  Using
      debug { level } provides the same functionality.  Use mu_debug for debugging.
      New option -t (--lint).  Rename the -t short option to -f.
      * mimeview/mimeview.h: Define lexer and parser macros for location tracking.
      
      * NEWS: Document changes to mimeview utility.
      * doc/texinfo/programs.texi: Document changes to mimeview utility.
      
      * lib/mailcap.c: Use standart mu_debug calls for debugging.
      * lib/mailcap.h (display_stream_mailcap): Change last argument: take a
      mu_debug_handle_t
      * libmailutils/diag/debcat (app): New category.  Application-specific
      debug
      * mail/decode.c (display_submessage): Change invocation of
      display_stream_mailcap.
      * mail/mailvar.c: Setting "verbose" enables app.trace7, unsetting it
      clears app.*
      Sergey Poznyakoff authored
  2. 26 May, 2017 2 commits
    • * mh/show.c: Set cur before returning.  Allow for arguments in
      showproc settings.  Move to next or prev if invoked with the
      corresponding argv[0]
      
      * mh/mh.h (mh_msgset_parse): def argument is const.
      (mh_msgset_first_current, mh_msgset_first_uid): Remove proto.
      (mh_msgset_first): Change signature.
      (mh_msgset_last): New function.
      * mh/mh_msgset.c (mh_msgset_first): Return UID or message number
      depending on the value of the second parameter.
      (mh_msgset_first_current, mh_msgset_first_uid): Remove.
      (mh_msgset_last): New function.
      
      * mh/anno.c: Update.
      * mh/comp.c: Update.
      * mh/folder.c: Update.
      * mh/mh_init.c: Update.
      * mh/repl.c: Update.
      
      * mh/Makefile.am (install-exec-hook): Link show to prev and next
      Sergey Poznyakoff authored
    • * include/mailutils/msgset.h (mu_msgset_first, mu_msgset_last): New prototypes.
      * libmailutils/msgset/Makefile.am: Add new files.
      * libmailutils/msgset/first.c: New file.
      * libmailutils/msgset/last.c: New file.
      * libmailutils/tests/msgset.c: New options for testing the new functions.
      * libmailutils/tests/msgset.at: Test new functions.
      Sergey Poznyakoff authored
  3. 22 Apr, 2017 2 commits
    • * mh/etc/Makefile.am (bindir): Override.  Reported by Ken Brown
      <kbrown@cornell.edu>
      Sergey Poznyakoff authored
    • * include/mailutils/cctype.h (MU_CTYPE_TSPEC): New class.  Represents
      tspecials as per RFC 2045, section 5.1.
      (mu_istspec): New define.
      * libmailutils/string/muctype.c (mu_c_tab): Mark tspecials
      
      * include/mailutils/assoc.h (mu_assoc_mark)
      (mu_assoc_sweep): New protos.
      * libmailutils/base/assoc.c (_mu_assoc_elem): New field: mark
      (mu_assoc_mark,mu_assoc_sweep): New functions.
      
      * libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add dq.c
      and percent.c.
      * libmailutils/filter/dq.c: New file.
      * libmailutils/filter/percent.c: New file.
      * include/mailutils/filter.h (mu_percent_filter)
      (mu_dq_filter): New externs.
      * libmailutils/filter/filter.c (mu_filter_get_list): Register
      mu_percent_filter and mu_dq_filter.
      
      * include/mailutils/mime.h (mu_mime_header_set)
      (mu_mime_header_set_w): New protos.
      * libmailutils/mime/Makefile.am (libmime_la_SOURCES): Add mimehdrset.c
      * libmailutils/mime/mimehdrset.c: New file.
      * libmailutils/mime/mime.c (_mime_set_content_type): For multipart/alternative,
      remove also all parameters except charset from the Content-Type header.
      * mail/send.c (saveatt): Remove the now unneeded conditionals.
      * libmailutils/tests/mimehdr.at: Test formatting functions.
      
      * include/mailutils/stream.h (MU_IOCTL_FILTER_SET_OUTBUF_SIZE): New ioctl.
      * include/mailutils/sys/filter.h (_MU_FILTER_DISABLED)
      (_MU_FILTER_EOF): Remove.  Use bitfields instead.
      (_mu_filter_stream): Remove fltflag.  New fields: flag_disabled,
      flag_eof, outbuf_size.
      * libmailutils/stream/fltstream.c (MFB_BASE)
      (MFB_CURPTR, MFB_ENDPTR, MFB_SIZE, MFB_LEVEL)
      (MFB_POS, MFB_RDBYTES, MFB_FREESIZE)
      (MBF_CLEAR, MBF_FREE): Replace with inline functions.
      (init_iobuf): Use the outbuf_size field (unless 0) to
      set the output buffer size.
      (filter_read): Stop if on success if outbuf_size is set,
      without trying to fill the entire buffer.
      (filter_ctl): Handle MU_IOCTL_FILTER_SET_OUTBUF_SIZE.
      
      * libmailutils/tests/mimehdr.c: New option -width: format and
      print the value assuming given line width.
      Sergey Poznyakoff authored
  4. 19 Apr, 2017 5 commits
    • * mail/mail.h: Remove unneeded extern qualifiers.
      Sergey Poznyakoff authored
    • If the mime header is set, then mail will provide the missing 'charset'
      parameter for each Content-Type header that begins with 'text/'.
      Its value will be determined by examining the 'charset' mail variable.
      If it is set to 'auto' (the default), the character set will be extracted
      from the value of the LC_ALL environment variable.  If it is unset, it
      will be deduced from the LANG environment variable.
      
      Thus, provided that LC_ALL is set correctly, the following setting in
      .mailrc is recommended to ensure that mails in native character
      sets will be processed correctly:
      
        set charset=auto mime
      
      In most cases, it can be simplified to just 'set mime'.
      
      * NEWS: Update.
      * doc/texinfo/programs.texi: Update the description of the charset
      variable.
      * mail/mail.h (util_get_charset): New proto.
      * mail/send.c (attach_set_content_type): New function.
      (attlist_add, add_body): Use attach_set_content_type to
      set the content_type field.
      * mail/util.c (util_get_charset): New function.
      (util_rfc2047_decode): Use util_get_charset.
      Sergey Poznyakoff authored
    • Sergey Poznyakoff authored
    • * mail/mail.c (mime_option): New variable.
      (main): assume --mime if either or both of --content-type and
      --content-encoding are set.  Set the mime variable if so.
      * mail/mail.h (mailvar_is_true): New prototype.
      * mail/send.c (add_attachments): Continue if the mime variable
      is set.
      (add_body): Rewrite, treating the text read from the stdin as
      MIME part in itself.
      * mailvar.c (mailvar_tab): New variable "mime"
      (mailvar_is_true): New function.
      
      * NEWS: Document --mime
      * doc/texinfo/programs.texi: Rewrite the Attachments subsection.
      Sergey Poznyakoff authored
    • * mail/mail.c (cli_attach): Exit if unable to attach file.
      * mail/mail.h (send_attach_file): Change prototype.
      * mail/send.c (send_attach_file): Return int.
      (add_body): Honor default_content_type
      Sergey Poznyakoff authored
  5. 18 Apr, 2017 2 commits
    • fix a typo · a72570a2
      Sergey Poznyakoff authored
    • Until now, mu_header_set_value called with replace=0 prepended the header
      to the header list, if a header with such name was already present.  This
      has been changed.  Now, if the header with the requested name is already
      present, its action is as follows:
      
        1. If repl is 0, return MU_ERR_EXISTS
        2. Otherwise, replace the header with the new value.
      
      If the header is not present, it is appended to the end of the header
      list, instead of putting it at the beginning.
      
      This change is incompatible and breaks the tests, that relied on a particular
      field ordering.  These are fixed as well.
      
      The use of mu_header_set_value throughout the sources has been revised to
      ensure that single-instance headers are never added twice.
      
      This change also facilitates the second part of this commit, which
      fixes creation of the multipart/alternative message by the mail utility.
      
      * libmailutils/mailbox/header.c (mu_header_set_value): Fix semantics.
      If the replace parameter is not set and the header field with the
      given name already exists, return MU_ERR_EXISTS without changing
      anything.  If adding new header, append it to the end of the header
      list, instead of pushing it to the top.
      
      * configure.ac: Raise shared library revision number.
      
      * libmu_scm/mu_message.c (mu-message-set-header)
      (mu-message-set-header-fields): call mu_header_set_value explicitly if
      repl is not set.
      * libmu_sieve/extensions/moderator.c: Force replace header mode when
      needed.
      * libmu_sieve/extensions/vacation.c: Likewise.
      * mh/mh_init.c (mh_annotate): Prepend the annotation header.
      * mh/mhn.c: Force replace header mode when needed.
      * mh/repl.c: Likewise.
      * mh/send.c: Likewise.
      
      * libmailutils/tests/modmesg01.at: Change expected header order.
      * libmailutils/tests/modmesg03.at: Likewise.
      * mh/tests/mhn.at: Likewise.
      * mh/tests/send.at: Likewise.
      * sieve/tests/moderator.at: Likewise.
      * sieve/tests/redirect.at: Likewise.
      * sieve/tests/reject.at: Likewise.
      * sieve/tests/vacation.at: Likewise.
      
      * examples/mta.c (message_finalize): Append X-Authentication-Warning,
      instead of setting it.
      
      Make sure Content-Disposition is not set for parts of a multipart/
      alternative MIME message.  Some mail readers (notably, yahoo),
      misinterpret it.
      
      * libmailutils/mime/attachment.c (at_hdr): Use mu_header_set_value
      to set Content-Type and Content-Disposition.
      * libmailutils/mime/mime.c (_mime_set_content_type): If the content
      type is set to multipart/alternative, remove the Content-Disposition
      headers from the message parts.
      
      * mail/send.c (saveatt): Don't set content-disposition for
      multipart/alternative, it is now done by the library.
      (add_attachments): Warn about ignored headers.
      Append only Received and X-* headers, replace others.
      (parse_headers): Append headers.
      (compose_header_set): Use mu_header_append if COMPOSE_APPEND is requested.
      * mail/util.c (util_header_expand): Use mu_header_append.
      Sergey Poznyakoff authored
  6. 13 Apr, 2017 2 commits
    • * libmailutils/base/assoc.c (merge_sort): Fix last argument in call to cmp.
      Sergey Poznyakoff authored
    • The new option --alternative is provided to change the content type of
      the composed message to multipart/alternative.  The ~/ escape toggles
      the type between multipart/mixed and multipart/alternative.  In messages
      of multipart/alternative type, the Content-Disposition header of all
      attachments is reset to "inline".
      
      * libmailutils/mime/mime.c (mu_mime_create): Bugfix: honour the
      MU_MIME_MULTIPART_ALT flag.
      * mail/mail.c: New option --alternative.
      * mail/mail.h (compose_env) <attlist,mime>: New members.
      (multipart_alternative): New global.
      (send_attach_file): Change return value.
      (escape_toggle_multipart_type): New proto.
      * mail/send.c (multipart_alternative): New global.
      Keep the list of attachments in compose_env_t.  Make sure it is freed
      when no longer used.
      Implement the ~/ escape.
      * mail/table.c: New escape ~/
      * mail/util.c: Use mu_strerror instead of strerror.
      
      * NEWS: Document changes to the mail utility
      * doc/texinfo/programs.texi: Likewise.
      Sergey Poznyakoff authored
  7. 11 Apr, 2017 1 commit
    • The subcommands are re-implemented as standalone binaries installed
      to pkglibexecdir.  The main binary acts as a dispatcher.
      
      * configure.ac: Build mu/libexec/Makefile
      * include/mailutils/.gitignore: Ignore gitinfo.h
      
      * include/mailutils/opt.h (mu_parseopt_help_stream_create): New proto.
      * libmailutils/cli/cli.c (mu_cli_ext): Honor MU_PARSEOPT_PROG_NAME
      setting.
      * libmailutils/opt/help.c (mu_parseopt_create_help_stream): New
      function.
      (mu_program_help,mu_program_usage)
      (mu_program_version): Use it.
      
      * mu/Makefile.am: Move commands to separate executables under libexec.
      * mu/mu.c: Rewrite.
      * mu/dispatch.c: Remove.
      * mu/help.c: Remove.
      * mu/libexec/.gitignore: New file.
      * mu/libexec/Makefile.am: New file.
      * mu/libexec/getopt.c: New file.
      * mu/getans.c: Move to mu/libexec.
      * mu/getarg.c: Likewise.
      * mu/getyn.c: Likewise.
      * mu/util.c: Likewise.
      * mu/verbose.c: Likewise.
      * mu/shell.c: Likewise.
      * mu/mu.h: Remove.
      * mu/libexec/mu.h: New file.
      * mu/acl.c: Move to mu/libexec; Rewrite as a standalone program.
      * mu/cflags.c: Likewise.
      * mu/dbm.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/pop.c: Likewise.
      * mu/query.c: Likewise.
      * mu/send.c: Likewise.
      * mu/smtp.c: Likewise.
      * mu/stat.c: Likewise.
      * mu/wicket.c: Likewise.
      * mu/mu-setup.awk: Remove.
      * po/POTFILES.in: Update.
      Sergey Poznyakoff authored
  8. 10 Apr, 2017 1 commit
  9. 09 Apr, 2017 2 commits
  10. 08 Apr, 2017 2 commits
    • * include/mailutils/acl.h (mu_acl_set_session_id): Remove proto.
      * include/mailutils/server.h (mu_session_id): Remove extern.
      (mu_sid): New proto.
      * libmailutils/server/sid.c: New file.
      * libmailutils/server/Makefile.am: Add sid.c
      * libmailutils/server/ipsrv.c (mu_ip_tcp_accept)
      (mu_ip_udp_accept): Remove calls to mu_acl_set_session_id.
      (mu_ip_server_accept): Make sure output to mu_strerr is filtered so
      that session ID is prepended to each line.
      (mu_ip_server_loop): Remove.
      * libmailutils/server/msrv.c (mu_m_server_check_acl): Remove call
      to mu_acl_set_session_id.
      * libmailutils/server/server.c (mu_session_id): Remove variable.
      
      * imap4d/imap4d.c (get_client_address, set_strerr_flt)
      (clr_strerr_flt): Remove unused functions.
      (imap4d_connection): Simplify.
      * pop3d/pop3d.c: Likewise.
      Sergey Poznyakoff authored
  11. 07 Apr, 2017 1 commit
  12. 06 Apr, 2017 2 commits
    • * mu-aux/mailutils.m4: Don't use packed version representation, because of
      eventual numerical overflows.  Compare versions number by number.
      Define the following additional constants: MAILUTILS_VERSION_MAJOR,
      MAILUTILS_VERSION_MINOR, and MAILUTILS_VERSION_PATCH.
      * NEWS: Document changes.
      Sergey Poznyakoff authored
    • * Makefile.am: Minor change.
      * include/mailutils/Makefile.am (gitinfo.h): Build only if
      $(srcdir) and $(builddir) are the same.
      * mu-aux/gitinfo.pl: Rename to mu-aux/gitinfo
      * configure.ac (GITINFO): Reflect this change
      * mu-aux/Makefile.am: Likewise.
      Sergey Poznyakoff authored
  13. 05 Apr, 2017 1 commit
  14. 04 Apr, 2017 1 commit
  15. 03 Apr, 2017 2 commits
  16. 24 Mar, 2017 1 commit
    • * libmailutils/tests/.gitignore: Update.
      * libmailutils/tests/xscript.at: New file.
      * libmailutils/tests/xscript.c: New file.
      * libmailutils/tests/Makefile.am: Add new files.
      * libmailutils/tests/testsuite.at: Include new testcase.
      Sergey Poznyakoff authored
  17. 23 Mar, 2017 2 commits
    • * include/mailutils/debug.h (MU_ASSERT): Prefix local variable name
      with two underscores to diminish the probability of shadowing.
      Sergey Poznyakoff authored
    • * Makefile.am: Mark ChangeLog as noinst_DATA to trigger
      its rule.  Rewrite the ChangeLog rule using a wrapper
      over gitlog-to-changelog, which rewrites the file only
      when needed.
      (dist-hook): Fail if there are uncommitted changes.
      * mu-aux/gencl: New file.
      
      * maint.mk: Remove.
      Sergey Poznyakoff authored
  18. 22 Mar, 2017 1 commit
  19. 21 Mar, 2017 5 commits
  20. 20 Mar, 2017 3 commits
    • Intermediate tarballs have the same version number as initial alpha
      version, to which is appended a suffix "-N", where N is the number of
      commits between the current git HEAD and the original alpha release.
      
      Additionally, the --version (or -version, for MH) output has been changed
      to include the N and the git description (for all releases, but stable).
      
      * .gitignore: Update.
      * Makefile.am: Remove git-describe and git-describe.h goals.
      (alpha, alphacheck): Rewrite.
      * configure.ac (GITINFO): New subst variable.
      * include/mailutils/Makefile.am (gitinfo.h): New built source.
      * libmailutils/cli/cli.c: Include gitinfo.h
      (mu_version_hook): Rewrite.
      * mh/mh_getopt.c: Include gitinfo.h
      (mh_version_hook): Rewrite.
      * mu-aux/gitinfo.pl: New file.
      * mu-aux/Makefile.am (EXTRA_DIST): Add gitinfo.pl
      * mu/Makefile.am (mu-setup.c): Add dependency
      * testsuite/testsuite.inc (MUT_VERSION): Account for changes in
      version output.
      Sergey Poznyakoff authored
    • * pop3d/cmd.c (command_table_head): Remove.  Use command_table
      instead.  All uses changed.
      * pop3d/stls.c (pop3d_stls): Fail if TLS is not requested.
      Sergey Poznyakoff authored
    • * include/mailutils/iterator.h (mu_itrctl_req) <mu_itrctl_count>: New request
      type.
      * libmailutils/base/assoc.c (itrctl): Support mu_itrctl_count.
      * libmailutils/list/iterator.c (list_itrctl): Likewise.
      * libmailutils/mailbox/hdritr.c (hdr_itrctl): Likewise.
      * libmailutils/mailbox/mbxitr.c (mbx_itrctl): Likewise.
      * libmailutils/base/opool.c (opitr_itrctl): New function - support
      mu_itrctl_count.
      (mu_opool_get_iterator): Register opitr_itrctl.
      * libmailutils/diag/debug.c (list_itrctl): Return 1-based position
      indices on mu_itrctl_tell.
      Support mu_itrctl_count.
      Sergey Poznyakoff authored