2019-07-13  Automatically generated  <bug-mailutils@gnu.org>

	HEAD bd46cf8d48852639e10e66a87500f7b9ec18e1ef.

2019-07-13  Sergey Poznyakoff  <gray@gnu.org>

	Fixes in the mail testsute.

	* mail/tests/copy00.at: Fix description. Skip test if
	/dev/stdout cannot be locked.
	* mail/tests/copy03.at: Rename MBOX to avoid name clashes on
	case-insensitive file systems.

2019-07-11  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* include/mailutils/sys/dotmail.h: Remove stray variable
	declaration.

2019-07-11  Sergey Poznyakoff  <gray@gnu.org>

	Pull wordsplit from submodule.

	* .gitmodules: Add wordsplit.
	* configure.ac: Version 3.7.90
	* NEWS: Raise version number.
	* include/mailutils/sys/Makefile.am: Include wordsplit.h from
	the submodule.
	* include/mailutils/sys/wordsplit.h: New file.
	* include/mailutils/wordsplit.h: Rewrite as a wrapper over
	mailutils/sys/wordsplit.h
	* libmailutils/Makefile.am: Distribute files from wordsplit.
	* libmailutils/string/Makefile.am: Add libmailutils/wordsplit
	to the include path.
	* libmailutils/string/wordsplit.c: Replace with a wrapper over
	wordsplit/wordsplit.c
	* libmailutils/tests/.gitignore: Update.
	* libmailutils/tests/Makefile.am: Pull wordsplit testsuite from
	the submodule.
	* libmailutils/tests/wordsplit.at: Remove.
	* libmailutils/tests/wsp.c: Remove.

2019-06-22  Sergey Poznyakoff  <gray@gnu.org>

	Use defines for internal mail variable names.

2019-06-22  Sergey Poznyakoff  <gray@gnu.org>

	Fix typos and wording in some diagnostic messages.

2019-06-21  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.7.

2019-06-21  Sergey Poznyakoff  <gray@gnu.org>

	Update NEWS.

2019-05-30  Sergey Poznyakoff  <gray@gnu.org>

	Fix conditional compilation; add dotmail support to libmu_scm.

	* configure.ac: Accept dotmail as a value for
	MU_DEFAULT_SCHEME. Display dotmail support status at the end of
	the run.
	* libmailutils/base/nullrec.c: Provide placeholder for disabled
	dotmail.
	* libmu_scm/mu_scm.c (format_table): Add dotmail.
	* libmu_scm/tests/testsuite.at: Don't assume mbox as the
	default. Load it explicitly.

2019-05-30  Sergey Poznyakoff  <gray@gnu.org>

	Minor change.

	* maint/flowgraph.mk: Pass --all to cflow.

2019-05-29  Sergey Poznyakoff  <gray@gnu.org>

	mh: fix folder +/absolute/name.

	* mh/folder.c (name_prefix_len): Remove global.
	(install_folder_info,_scan): Take additional argument: length
	of the name prefix to skip.
	(folder_scan): New function.
	(action_print): Don't impose name prefix unconditionally. Call
	folder_scan to set it up as necessary.

2019-05-22  Sergey Poznyakoff  <gray@gnu.org>

	Fix a bug in TLS read.

	This complements afda9ba4. Thanks to Rafael Fontenelle for
	helping locate the bug.

	* libmu_auth/tlsiostr.c (_tls_io_read): Handle GNUTLS_E_AGAIN
	and GNUTLS_E_INTERRUPTED.
	* libmailutils/stream/stream.c (mu_stream_seterr): EINTR is a
	transient error condition.
	* THANKS: Update.

2019-05-22  Sergey Poznyakoff  <gray@gnu.org>

	URL parser: use case-insensitive comparison for auth and host
	parts.

	* libmailutils/url/accessor.h: (URL_PART_CMP_ICASE)
	(URL_PART_CMP_ICASE): New defines.
	* libmailutils/url/get-auth.c: Request case-insensitive
	comparison.
	* libmailutils/url/get-host.c: Likewise.

2019-05-21  Sergey Poznyakoff  <gray@gnu.org>

	Describe maidag delivery-mode configuration variable.

2019-05-09  Sergey Poznyakoff  <gray@gnu.org>

	Maidag: fix coredump in daemon mode.

	* maidag/maidag.c (main): Pass pointer to the server as data
	parameter to mu_cli.

2019-05-03  Sergey Poznyakoff  <gray@gnu.org>

	movemail: make sure UIDLs are properly stored.

	* movemail/movemail.c (main): When using POP3 UIDLs for message
	identification, be sure to store them in the X-UIDL header.

2019-04-24  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes.

	* libmailutils/diag/diag.c (mu_diag_vprintf): Fix debug level
	formatting. It missed 's' after the escape character.
	* mu/libexec/ldflags.c (lib_descr): Add dotmail.

2019-03-29  Sergey Poznyakoff  <gray@gnu.org>

	Remove explicit _DEPENDENCIES variables from Makefiles.

	These might be needed only in rare cases during the development
	cycle. There is no use keeping them around.

	* configure.ac (MU_AUTHLIBS_DEPENDENCY)
	(DBMLIB_DEPENDENCY,SQLLIB_DEPENDENCY): Remove.
	* imap4d/Makefile.am: Remove explicit _DEPENDENCIES.
	* pop3d/Makefile.am: Likewise.
	* libmu_auth/Makefile.am: Likewise.
	* libmu_dbm/Makefile.am: Likewise.

2019-03-27  Sergey Poznyakoff  <gray@gnu.org>

	Use <prog>_LDADD to link in libmu_test.

	This helps automake discover dependency on this library.

2019-03-27  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix (follow-up to 60c5545ba)

2019-03-27  Sergey Poznyakoff  <gray@gnu.org>

	Minor fixes in dot filters.

	The DOT decoder accepts input consisting of two characters
	".\n" and decodes it to empty output. When encoding empty
	input, ".\n" is produced

	Similarly, CRLFDOT handles ".\r\n" the same way.

	* libmailutils/filter/crlfdot.c (_crlfdot_encoder): Accept
	".\r\n" as input.
	* libmailutils/filter/dot.c: Accept ".\n" as input.
	* libmailutils/tests/crlfdot.at: Add new test.
	* libmailutils/tests/dot.at: Likewise.

2019-03-26  Sergey Poznyakoff  <gray@gnu.org>

	Use mu_folder_scan in imap4d.

	* imap4d/list.c (list_fun): Don't check if the returned record
	matches refinfo->pfx->record. This is done by mu_folder_scan.
	(list_ref): Use mu_folder_scan.

2019-03-26  Sergey Poznyakoff  <gray@gnu.org>

	Consistently use the term 'depth' when referring to directory
	nesting depth.

	* include/mailutils/folder.h (mu_list_response): Rename 'level'
	to 'depth'. All uses updated.

2019-03-26  Sergey Poznyakoff  <gray@gnu.org>

	Implement selection of requested mailbox formats in scanning
	the local file system folders.

	* include/mailutils/registrar.h (mu_record_match): New struct.
	(mu_registrar_match_records): New proto.
	* libmailutils/base/registrar.c (mu_registrar_match_records):
	New function.
	* libmailutils/mailbox/fsfolder.c (list_helper): Actually
	select the matching record from scn->records (if supplied).
	* libmailutils/tests/Makefile.am: Add new tests.
	* libmailutils/tests/fsfolder.c: Minor changes.
	* libmailutils/tests/testsuite.at: Add new tests.
	* libmailutils/tests/fsfolder03.at: New file.
	* libmailutils/tests/fsfolder04.at: New file.

2019-03-25  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes in fsfolder.

	* libmailutils/mailbox/fsfolder.c (list_helper): Fix depth cut
	off. Fix the lookup in scn->records.
	* libmailutils/tests/fsfolder.c: Implement two test records.
	New command: "scan".

2019-03-25  Sergey Poznyakoff  <gray@gnu.org>

	Implement test shell framework.

	* libmailutils/tests/tesh.c: New file.
	* libmailutils/tests/tesh.h: New file.
	* libmailutils/tests/Makefile.am: Add new files.
	* libmailutils/tests/fsfolder.c: Rewrite using test shell
	framework.
	* libmailutils/tests/fsfolder00.at: Use semicolons to delimit
	commands.
	* libmailutils/tests/fsfolder01.at: Likewise.
	* libmailutils/tests/linetrack.c: Rewrite using test shell
	framework.
	* libmailutils/tests/linetrack.at: Change command initial
	character to dot.
	* libmailutils/tests/listop.c: Rewrite using test shell
	framework.
	* libmailutils/tests/list.at: Minor changes.
	* libproto/dotmail/tests/dm_mesg.c: Rewrite using test shell
	framework.
	* libproto/dotmail/tests/Makefile.am: Link dm_mesg with
	libmu_tesh
	* libproto/dotmail/dotmail.c: Fix typo.

2019-03-23  Sergey Poznyakoff  <gray@gnu.org>

	Two new string functions.

	mu_string_prefix(A, B) returns true if B is the prefix of A.
	mu_string_suffix(A, B) returns true if B is the suffix of A.

	* include/mailutils/cstr.h (mu_string_prefix)
	(mu_string_suffix): protos.
	* libmailutils/string/Makefile.am: Add new files.
	* libmailutils/string/strpref.c: New file.
	* libmailutils/string/strsuf.c: New file.

2019-03-23  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite folder listing interface.

	New function mu_folder_scan provides an improved scanning
	interface. In particular, it allows the user to abridge the
	scan to mailboxes of certain type (or types).

	Existing listing API functions are rewritten as alternative
	entry points to mu_folder_scan.

	* include/mailutils/folder.h (mu_folder_scanner): New struct.
	(mu_folder_scan): New function.
	* include/mailutils/registrar.h (mu_registrar_list_p): New
	function.
	* include/mailutils/sys/folder.h (_mu_folder._list): Change
	signature.
	* libmailutils/base/registrar.c (mu_registrar_list_p): New
	function.
	* libmailutils/mailbox/folder.c (mu_folder_scan): New function.
	(mu_folder_enumerate): Rewrite as entry point to
	mu_folder_scan.
	* libmailutils/mailbox/fsfolder.c: Use new API,
	* libmailutils/tests/fsfolder.c: Rewrite scheme matcher.
	* libmailutils/tests/fsfolder00.at: Fix test output.
	* libmailutils/tests/fsfolder02.at: Likewise.
	* libproto/imap/folder.c: Use new API.

2019-03-22  Sergey Poznyakoff  <gray@gnu.org>

	Fix MH format detection.

	* libproto/mh/folder.c (mh_dir_p): Check only regular files.
	(_mh_list_p): Ditto. All directories are eligible for listing.
	* libmailutils/base/registrar.c (mu_record_list_p): Remove
	useless check.

2019-03-13  Sergey Poznyakoff  <gray@gnu.org>

	mail: force mime mode if at least one attachment was given.

	This fixes
	https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=918806

	* mail/mail.c (cli_attach): Set mime_option.

2019-03-10  Sergey Poznyakoff  <gray@gnu.org>

	Fix encoding of empty input by DOT filter.

	* libmailutils/filter/dot.c (_dot_encoder): Don't emit
	additional empty line on empty input (i.e. if mu_filter_lastbuf
	arrives when dfa is in dot_encode_init state).
	* libmailutils/tests/dot.at: Test empty input.

2019-03-06  Sergey Poznyakoff  <gray@gnu.org>

	Simplify dotmail test environment.

	The dm_mbox tool is not needed after ff847bb1. Remove it.
	Modify dm_mesg to optionally take commands from the command
	line. Use it instead of dm_mbox in testcases.

2019-03-06  Sergey Poznyakoff  <gray@gnu.org>

	Minor change.

	* NEWS: Document the recent changes.
	* THANKS: Add Kurt Hackenberg.

2019-03-06  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* libproto/mbox/mbox.c (restore_date): Fix possible
	uninitialized memory access.

2019-03-06  Sergey Poznyakoff  <gray@gnu.org>

	Revamp UID support in dotmail.

	* include/mailutils/stream.h (mu_stream_header_copy): New
	proto.
	* libmailutils/stream/hdrcpy.c: New file.
	* libmailutils/stream/Makefile.am: Add hdrcpy.c
	* libmailutils/tests/hdrcpy.c: New test program.
	* libmailutils/tests/hdrcpy.at: New testcase.
	* libmailutils/tests/Makefile.am: Add new test program and
	testcase.
	* libmailutils/tests/testsuite.at: Add new testcase.
	* libproto/dotmail/tests/append.at: Add new tests.
	* libmailutils/tests/.gitignore: Update. 
	* include/mailutils/sys/dotmail.h (mu_dotmail_message): Remove
	headers_scanned. New field: uid_modified.
	(mu_dotmail_mailbox): Change type for uidnext to unsigned long.
	Remove scanned_uids_count. (mu_dotmail_message_headers_prescan)
	(mu_dotmail_mailbox_scan_uids): Remove.
	(mu_dotmail_mailbox_uid_setup): New proto.
	* libproto/dotmail/dotmail.c: Revamp UID support. See "Notes"
	on line 251 for description.
	* libproto/dotmail/message.c (mu_dotmail_message_reconstruct):
	Optimize for the case where the message remains unchanged
	except for the UID information.
	* libproto/dotmail/tests/dm_mesg.c: Add mailbox inspection
	commands from dm_mbox. Perhaps the latter can be removed.

2019-03-03  Sergey Poznyakoff  <gray@gnu.org>

	Implement automatic dot-unstuffing in dotmail mailboxes.

	* include/mailutils/sys/dotmail.h (mu_dotmail_message): New
	members: body_size and body_dot_stuffed.
	* libproto/dotmail/dotmail.c (dotmail_rescan_unlocked): Count
	dot-unstuffed octets in the body. Set dmsg->body_dot_stuffed to
	1 if at least one byte was dot-stuffed.
	* libproto/dotmail/message.c (dotmail_body_size): Return
	unstuffed size.
	(_msg_body_setup): If the body was dot-stuffed, return rdcache
	stream built over the "DOT" decoder.
	* libproto/dotmail/tests/body.at: Check dot-unstuffing.

2019-03-02  Sergey Poznyakoff  <gray@gnu.org>

	Fix the dot filter decoding.

	* libmailutils/filter/dot.c (_dot_decoder): Don't emit extra
	newline at the "\n.\n" marker.
	* libmailutils/stream/stream.c (mu_stream_seterr): Don't treat
	ENOSYS as fatal error.
	* libmailutils/tests/dot.at: New file.
	* libmailutils/tests/testsuite.at: Include dot.at.
	* libmailutils/tests/Makefile.am: Add dot.at
	* testsuite/smtp-msg.at: Remove extra newline from the expected
	output.
	* testsuite/smtp-str.at: Likewise.

2019-03-02  Sergey Poznyakoff  <gray@gnu.org>

	Improve the dotmail testsuite.

	* libproto/dotmail/tests/dm_mesg.c: Rewrite to take commands
	from stdin.
	* libproto/dotmail/tests/Makefile.am: Add setattr.at
	* libproto/dotmail/tests/testsuite.at (DM_MESG): New macro.
	* libproto/dotmail/tests/setattr.at: New file.
	* libproto/dotmail/tests/append.at: Use DM_MESG.
	* libproto/dotmail/tests/attr.at: Likewise.
	* libproto/dotmail/tests/body.at: Likewise.
	* libproto/dotmail/tests/delete.at: Likewise.
	* libproto/dotmail/tests/env.at: Likewise.
	* libproto/dotmail/tests/header.at: Likewise.
	* libproto/dotmail/tests/uid.at: Likewise.

2019-03-02  Sergey Poznyakoff  <gray@gnu.org>

	Implement different accuracy levels for the mailbox format
	detection.

	Selecting the accuracy level allows the user to achieve the
	desired balance between the speed of the folder scan and
	accuracy of mailbox format detection.

	The accuracy level can be set either from the configuration
	file, using the mailbox.accuracy-level statement, or from the
	environment, using the MU_AUTODETECT_ACCURACY variable.

	The default accuracy level 1 discerns valid mbox and dotmail
	mailboxes providing reasonable scan speed. Level 0 (previous
	default) does not discern them, but provides maximal speed.
	Level 2 and higher provide better accuracy at the price of
	speed.

	* include/mailutils/url.h (MU_AUTODETECT_ACCURACY_AUTO)
	(MU_AUTODETECT_ACCURACY_FAST)
	(MU_AUTODETECT_ACCURACY_DEFAULT): New constants.
	(mu_scheme_autodetect_p): New proto, moved here from util.h
	(mu_set_autodetect_accuracy)
	(mu_autodetect_accuracy): New protos.
	* libmailutils/base/schemeauto.c (mu_set_autodetect_accuracy)
	mu_autodetect_accuracy): New functions.
	* libmailutils/cli/stdcapa.c: New configuration statement:
	mailbox.autodetect-accuracy.
	* libmailutils/url/create.c (_mu_url_create_internal): Assume
	the "file" scheme if the MU_URL_PARSE_LOCAL flag is set.
	* libproto/dotmail/folder.c: Implement format detection. Three
	accuracy levels: 0, 1, and >1
	* libproto/mbox/folder.c (_mbox_is_scheme): Implement default
	format detection.
	* libproto/dotmail/tests/Makefile.am: Add new test.
	* libproto/dotmail/tests/autodetect.at: New test.
	* libproto/dotmail/tests/dm_detect.c: New file.
	* libproto/dotmail/tests/testsuite.at: Add new test.

2019-03-01  Sergey Poznyakoff  <gray@gnu.org>

	Initial implementation of the dotfile format.

	* configure.ac: Enable new local format.
	* include/mailutils/registrar.h (mu_dotmail_record): New
	extern. (mu_register_all_mbox_formats)
	(mu_register_local_mbox_formats): Add mu_dotmail_record
	* include/mailutils/sys/dotmail.h: New file.
	* libproto/dotmail/Makefile.am: New file.
	* libproto/dotmail/dotmail.c: New file.
	* libproto/dotmail/message.c: New file.
	* libproto/dotmail/folder.c: New file.
	* libproto/dotmail/tests/.gitignore: New file.
	* libproto/dotmail/tests/Makefile.am: New file.
	* libproto/dotmail/tests/atlocal.in: New file.
	* libproto/dotmail/tests/count.at: New file.
	* libproto/dotmail/tests/dm_mbox.c: New file.
	* libproto/dotmail/tests/dm_mesg.c: New file.
	* libproto/dotmail/tests/env.at: New file.
	* libproto/dotmail/tests/header.at: New file.
	* libproto/dotmail/tests/recent.at: New file.
	* libproto/dotmail/tests/testsuite.at: New file.
	* libproto/dotmail/tests/attr.at: New file.
	* libproto/dotmail/tests/body.at: New file.
	* libproto/dotmail/tests/uid.at: New file.
	* libproto/dotmail/tests/dm_qget.c: New file.
	* libproto/dotmail/tests/qget.at: New file.
	* libproto/dotmail/tests/append.at: New file.
	* libproto/dotmail/tests/delete.at: New file. 
	* libmu_scm/mailutils/ancilla.scm: Fix regular expression to
	take into account changes introduced by 4bdc41ff90.

2019-02-26  Sergey Poznyakoff  <gray@gnu.org>

	Provide fallback mechanism for mu_mailbox_messages_recent and
	mu_mailbox_message_unseen.

	* libmailutils/mailbox/mailbox.c (mu_mailbox_messages_recent)
	(mu_mailbox_message_unseen): Fall back to iteration if no
	backend-specific method is provided.

2019-02-26  Sergey Poznyakoff  <gray@gnu.org>

	envelope: attempt to recover from trace information if not
	available otherwise.

	* libmailutils/mailbox/msgenv.c (message_envelope_date): Use
	timestamp from Received header.
	(message_envelope_sender): Give preference to Return-Path
	header

2019-02-26  Sergey Poznyakoff  <gray@gnu.org>

	New autoconf macro for activating mailbox format support.

	* am/enable.m4 (MU_ENABLE_SUPPORT)
	(MU_ENABLE_BUILD): Use m4_-prefixed directives.
	(MU_ENABLE_MAILBOX_FORMAT) (MU_ENABLE_LOCAL_MAILBOX_FORMAT_
	(MU_ENABLE_REMOTE_MAILBOX_FORMAT): New macros. (MU_LIB_MAILBOX)
	(MU_LIB_LOCAL_MAILBOX)
	(MU_LIB_REMOTE_MAILBOX): New substitution variables.
	* configure.ac: Use new macros to enable mailbox formats
	* libproto/Makefile.am: Augment SUBDIRS instead of using
	Makefile variables.
	* comsat/Makefile.am: Use MU_LIB_.*MAILBOX macros to link in
	the necessary libraries.
	* examples/Makefile.am: Likewise.
	* examples/cpp/Makefile.am: Likewise.
	* frm/Makefile.am: Likewise.
	* imap4d/Makefile.am: Likewise.
	* include/mailutils/sys/Makefile.am: Likewise.
	* libmu_scm/Makefile.am: Likewise.
	* libproto/Makefile.am: Likewise.
	* maidag/Makefile.am: Likewise.
	* mail/Makefile.am: Likewise.
	* messages/Makefile.am: Likewise.
	* mh/Makefile.am: Likewise.
	* movemail/Makefile.am: Likewise.
	* mu/libexec/Makefile.am: Likewise.
	* pop3d/Makefile.am: Likewise.
	* python/2/libmu_py/Makefile.am: Likewise.
	* python/3/libmu_py/Makefile.am: Likewise.
	* readmsg/Makefile.am: Likewise.
	* sieve/Makefile.am: Likewise.
	* testsuite/Makefile.am: Likewise.

2019-02-24  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* python/3/libmu_py/mailcap.c: Fix leftover uses of
	PyString_FromString and PyInt_FromLong.

2019-02-23  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.6.

	* NEWS: Update.
	* configure.ac: Raise version number Raise VI_CURRENT and clear
	VI_REVISION (due to 18e23d6e).
	* libproto/imap/close.c: Add missing include.

2019-02-03  Sergey Poznyakoff  <gray@gnu.org>

	Update NEWS.

2019-02-03  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite the mailcap support.

	* configure.ac: Build libmailutils/mailcap/Makefile 
	* include/mailutils/mailcap.h: Rewrite
	* include/mailutils/sys/Makefile.am: Add mailcap.h
	* include/mailutils/sys/mailcap.h: New file.
	* include/mailutils/util.h: Add missing include.
	* lib/mailcap.c: Rewrite using new API.
	* libmailutils/Makefile.am: Build in mailcap
	* libmailutils/base/Makefile.am: Remove mailcap.c
	* libmailutils/base/mailcap.c: Remove. 
	* libmailutils/mailcap/Makefile.am: New file.
	* libmailutils/mailcap/ctmatch.c: New file.
	* libmailutils/mailcap/deferrclos.c: New file.
	* libmailutils/mailcap/mcp_creat.c: New file.
	* libmailutils/mailcap/mcp_destr.c: New file.
	* libmailutils/mailcap/mcp_err.c: New file.
	* libmailutils/mailcap/mcp_flags.c: New file.
	* libmailutils/mailcap/mcp_get.c: New file.
	* libmailutils/mailcap/mcp_sel.c: New file.
	* libmailutils/mailcap/mcp_count.c: New file.
	* libmailutils/mailcap/mcp_find.c: New file.
	* libmailutils/mailcap/ent_cmd.c: New file.
	* libmailutils/mailcap/ent_creat.c: New file.
	* libmailutils/mailcap/ent_destr.c: New file.
	* libmailutils/mailcap/ent_locus.c: New file.
	* libmailutils/mailcap/ent_type.c: New file.
	* libmailutils/mailcap/fieldacc.c: New file.
	* libmailutils/mailcap/fields.c: New file.
	* libmailutils/mailcap/finder.c: New file.
	* libmailutils/mailcap/parse.c: New file.
	* libmailutils/mailcap/parsefile.c: New file. 
	* libmailutils/tests/mailcap.c: Rewrite using new API. Improve
	cli
	* libmailutils/tests/mcf.c: New file.
	* libmailutils/tests/ctm.c: New file.
	* libmailutils/tests/ctm.at: New file.
	* libmu_cpp/mailcap.cc: Rewrite using new API.
	* python/2/libmu_py/mailcap.c: Rewrite using new API.
	* python/3/libmu_py/mailcap.c: Rewrite using new API.
	* examples/python/2/mailcap.py: Minor change. This example is
	broken with the new API. Should be fixed.
	* include/mailutils/cpp/mailcap.h: Update
	* include/mailutils/cpp/pop3.h: Update

2019-02-02  Sergey Poznyakoff  <gray@gnu.org>

	New iterator functions: mu_iterator_skip_while and
	mu_iterator_skip_until.

	The mu_iterator_skip_while function continues iteration while
	the supplied predicate function returns true. The
	mu_iterator_skip_until function continues iteration until the
	supplied predicate function returns true.

	* include/mailutils/iterator.h: Add new prototypes.
	* libmailutils/base/iterator.c: Implement new functions.

2019-01-31  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite the transcript stream.

	The new implementation consists of two independent state
	machines for each transcript channel (input and output). The
	MU_XSCRIPT_PAYLOAD state can be turned on for a predefined
	number of bytes on each channel. After that many bytes pass
	through, the state will return back to MU_XSCRIPT_NUMBER. This
	allows, in particular, to improve logging of client commands
	containing literals in imap4d.

	* include/mailutils/stream.h (MU_IOCTL_XSCRIPTSTREAM_CHANNEL):
	New ioctl subcode.
	(mu_xscript_channel): New struct. (MU_XSCRIPT_LEVEL_IS_PACKED)
	(MU_XSCRIPT_LEVEL_MASK,MU_XSCRIPT_LEVEL_UNMASK)
	(MU_XSCRIPT_LEVEL_PACK): New macros.
	* include/mailutils/sys/xscript-stream.h (_mu_xscript_channel):
	New struct.
	(_mu_xscript_stream): Keep independent state for each channel.
	* libmailutils/stream/xscript-stream.c: Rewrite as a state
	machine with independent states for input and output channels.
	* libmailutils/tests/xscript.at: Test packed channel levels and
	MU_IOCTL_XSCRIPTSTREAM_CHANNEL ioctl.
	* libmailutils/tests/xscript.c: Rewrite command parser. 
	* imap4d/imap4d.h (xscript_declare_client_payload): New proto.
	* imap4d/util.c (xscript_declare_client_payload): New function.
	* imap4d/io.c (imap4d_readline): Use
	xscript_declare_client_payload after literals.

2019-01-29  Sergey Poznyakoff  <gray@gnu.org>

	imap4d: Proper case-insensitive searches over multibyte
	strings.

	This requires libunistring.

	* NEWS: Update.
	* README: Update.
	* configure.ac: Check for libunistring.
	* libmailutils/base/version.c: Reflect libunistring usage.
	* imap4d/Makefile.am: Link with libunistring, if available.
	* imap4d/imap4d.h (unistr_downcase)
	(unistr_is_substring): New protos.
	* imap4d/search.c (_scan_header)
	(_scan_header_all,_match_text): Use unistr_is_substring for
	searches.
	* imap4d/unistr_c.c: New file.
	* imap4d/unistr_u8.c: New file.
	* imap4d/tests/search.at: Add new test.

2019-01-28  Sergey Poznyakoff  <gray@gnu.org>

	Revert 3aeec0dcc151b836cb09d756ad41598c95201446.

	Adding 1 to the buffer size is necessary, because
	_stream_scandelim requires buffer to provide enough space to
	accomodate the trailing 0. Consequently, the minimal acceptable
	buffer size is 2.

2019-01-27  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

	* search.c (_match_multipart): Initialize result.

2019-01-26  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

	* imap4d/search.c (parse_search_key): Fix eventual NULL pointer
	dereference.

2019-01-26  Sergey Poznyakoff  <gray@gnu.org>

	Add tests for imap4d SEARCH BODY, TEXT, and CHARSET.

	* imap4d/tests/.gitignore: New file.
	* imap4d/tests/ckiconv.c: New file.
	* imap4d/tests/Makefile.am: Build ckiconv.c
	* imap4d/tests/search.at: Add tests for BODY, TEXT and CHARSET
	* imap4d/tests/testsuite.at (IMAP4D_WITH_PREREQ): New macro
	(IMAP4D_CHECK): Skip test if the supplied prerequisite is not
	satisfied. 
	* testsuite/spool/search2.mbox: New file.
	* testsuite/spool/DISTFILES: Add search2.mbox. 
	* mail/decode.c (mime_descend): Fix handling of message/rfc822.

2019-01-26  Sergey Poznyakoff  <gray@gnu.org>

	Remove misguiding comment.

2019-01-26  Sergey Poznyakoff  <gray@gnu.org>

	imap4d: implement SEARCH CHARSET; fix BODY and TEXT searches.

	* imap4d/search.c: Implement proper BODY searches. Implement
	CHARSET.
	* imap4d/util.c (util_strcasestr): Remove. Use mu_c_strcasestr
	instead.
	* imap4d/imap4d.h: Likewise.
	* NEWS: Document changes.

2019-01-25  Sergey Poznyakoff  <gray@gnu.org>

	Improve error checking in stream writing functions.

	* libmailutils/stream/stream.c (mu_stream_write): Return EIO on
	short writes if pnwritten is NULL.
	* libmailutils/stream/streamcpy.c (mu_stream_copy): Likewise
	(if source stream size is known.

2019-01-24  Sergey Poznyakoff  <gray@gnu.org>

	Fix stream reference implementation.

	Do not propagate streamref's error and eof state upstream.

	* libmailutils/stream/streamref.c (streamref_return): Remove
	function. All uses updated.

2019-01-23  Sergey Poznyakoff  <gray@gnu.org>

	mail: fix completion of set, unset, and variable.

2019-01-23  Sergey Poznyakoff  <gray@gnu.org>

	mail: implement variable and command expansion in echo command.

	* mail/echo.c: Implement variable and command expansion.
	* mail/mail.c (main): Set PID mailvar.
	* mail/mailvar.c (mailvar_tab): New variable PID (to help in
	debugging).
	(set_folder): Expand initial ~
	* mail/set.c: Remove misguiding comment.

2019-01-23  Sergey Poznyakoff  <gray@gnu.org>

	Fix in IMAP wildcard matcher.

	* libmailutils/imapio/wildmatch.c (_wild_match): Handle % at
	the end of input same way as *.

2019-01-23  Sergey Poznyakoff  <gray@gnu.org>

	mail: fixes in completion routines.

2019-01-23  Sergey Poznyakoff  <gray@gnu.org>

	mail: improve message set parser.

	* mail/from.c (sender_string): New function.
	* mail/mail.h: Likewise.
	* mail/msgset.y: Fix memory management and error reporting.
	Implement sender address matching.
	* mail/util.c (util_outfolder_name): Always return allocated
	value.
	* mail/copy.c (mail_copy0): Add typecast.

2019-01-23  Sergey Poznyakoff  <gray@gnu.org>

	mail: new notation @, for the mailbox given with the -f option.

	* doc/texinfo/programs/mail.texi: Document the @ notation.
	* NEWS: Likewise.
	* mail/copy.c (mail_copy0): Rewrite. Use mailbox URLs instead
	of filenames.
	* mail/file.c (mail_expand_name): Return integer code. On
	success, convert the expanded name to URL and return it in the
	memory location supplied by the second argument. Use new
	shorthand notation @, for the name of the file given with the
	-f option. All uses changed.
	* mail/mail.c (secondary_url): New global.
	(main): Save the URL of the file given with the -f option in
	secondary_url. Use it, instead of the file variable, to decide
	what kind of summary message to display for empty mailbox (see
	commit 99b6b6f02c3cf94ebe1daf7233a702c743d6a2b5).
	* mail/mail.h (secondary_url): New global.
	(mail_expand_name): Change prototype.
	* mail/mailline.c: Minor changes. 
	* libmailutils/wicket/noauth.c (noauth_ticket_get_cred): Return
	MU_ERR_AUTH_NO_CRED.

2019-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Summarize recent changes in NEWS.

2019-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Improve mail folder completion.

	* mail/mailline.c (filegen_init): Check if the mail folder is
	the same as the one used by the current mailbox, and reuse it
	if so.

2019-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Add missing prototype.

	* include/mailutils/url.h (mu_url_is_same_portstr): New proto.

2019-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Remove central registry of created folders.

	The way it is implemented now, it creates more problems than
	offers solutions. In particular, it makes it impossible to open
	two mailboxes in the same IMAP account.

	* libmailutils/mailbox/folder.c (known_folder_list)
	(folder_lock): Remove variable.
	(is_known_folder): Remove function.
	(mu_folder_create_from_record): Don't use static folder list.

2019-01-22  Sergey Poznyakoff  <gray@gnu.org>

	fix in mail completion.

	* mail/mailline.c (filegen_init): Append tailing delimiter to
	folders only on exact match.

2019-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix in imap client.

	* libproto/imap/close.c (_mu_close_handler): Free mbox_name.

2019-01-21  Sergey Poznyakoff  <gray@gnu.org>

	Fixes in imap client: handle EXPUNGE response, fix
	incorporation of new messages.

	Certain servers do not issue EXISTS unsolicited response after
	expunging. Use EXPUNGE responses to keep track of the deleted
	messages.

	Internal structure of imap mailbox object did not interact well
	with incorporating new messages. It is fixed.

	* include/mailutils/imap.h (MU_IMAP_CB_EXPUNGE): New callback
	code.
	* include/mailutils/sys/imap.h (_mu_imap_message): New member:
	msgno.
	(_mu_imap_mailbox): Change type of msgs to struct
	_mu_imap_message **. Each _mu_imap_message * is registered as
	owner for various MU objects, so it is important it does not
	change during reallocations.
	* libproto/imap/mbox.c (_imap_msg_free): Free the message
	itself.
	(_imap_attr_clr_flags): Fix bitwise op.
	(_imap_mbx_get_message,_imap_realloc_messages)
	(aggregate_attributes,_imap_mbx_gensync)
	(_imap_fetch_callback): Reflect change in the type of msgs
	array.
	(_imap_expunge_callback): New callback.
	(_imap_mbx_open): Register _imap_expunge_callback.
	* libproto/imap/resproc.c (_process_unsolicited_response):
	handle the EXPUNGE response.

2019-01-21  Sergey Poznyakoff  <gray@gnu.org>

	Fix page invalidation in mail.

2019-01-21  Sergey Poznyakoff  <gray@gnu.org>

	Improve folder handling and expansion in mail. Add convenience
	functions to the library.

	* configure.ac: Build libmailutils/wicket
	* libmailutils/Makefile.am: Likewise.
	* libmailutils/base/wicket.c: Move file wicket stuff to ...
	* libmailutils/wicket/file.c: ... here
	* libmailutils/wicket/noauth.c: New file.
	* libmailutils/wicket/Makefile.am: New file. 
	* include/mailutils/auth.h (mu_noauth_ticket_create)
	(mu_noauth_wicket_create): New protos.
	* include/mailutils/folder.h (mu_folder_attach_ticket)
	(mu_folder_is_local): New protos.
	* include/mailutils/mailbox.h (mu_mailbox_attach_ticket): New
	proto.
	* include/mailutils/sys/folder.h (_mu_folder): Remove flags.
	Add new member: is_local.
	* libmailutils/mailbox/folder.c (mu_folder_create_from_record):
	Set is_local.
	(mu_folder_attach_ticket): New function.
	(mu_folder_is_local): New function.
	* libmailutils/mailbox/mbx_default.c
	(mu_mailbox_attach_ticket): New function.
	* libmailutils/url/create.c: Allow for trailing / in url. 
	* libproto/imap/mbox.c (_imap_mbx_open): Do initial scan.
	(__imap_msg_get_stream): Initialize clos.size.
	* libproto/imap/tests/imapfolder.c: Attach ticket to the
	folder. 
	* mail/cd.c (mail_cd): Expand directory name (~, %, +
	notations) prior to use.
	* mail/file.c (mail_file): Attach ticket to the mailbox.
	* mail/copy.c (append_to_mailbox): Likewise.
	* mail/mailline.c: Rewrite directory expansion. Implement fully
	functional folder expansion.
	* mail/util.c (util_folder_path)
	(util_outfolder_name): Rewrite using mu_mailbox_expand_name.

2019-01-18  Sergey Poznyakoff  <gray@gnu.org>

	Read message headers during initial scan of an imap mailbox.

	This considerably speeds up the operation of such tools as mail
	(initial loading), frm or from.

	* include/mailutils/sys/imap.h (_mu_imap_message): New member:
	header_stream.
	* libproto/imap/mbox.c (_imap_msg_free): Destroy header_stream.
	(_imap_hdr_fill): Rewrite.
	(fetch_response_parser): Handle MU_IMAP_FETCH_BODY.
	(_imap_mbx_scan): Fetch BODY.PEEK[HEADER].

2019-01-18  Sergey Poznyakoff  <gray@gnu.org>

	Don't reveal file name with the '0 messages' summary message.

	Rationale: file name can contain password.

	* mail/mail.c (main): Make sure file is always allocated. Fill
	it with 0's and free when no longer needed. Use mail_summary to
	display the summary for empty mailbox.

2019-01-18  Sergey Poznyakoff  <gray@gnu.org>

	Minor change.

	* mail/testsuite/lib/mail.exp (default_mail_start): Join
	arguments into a string.

2019-01-18  Sergey Poznyakoff  <gray@gnu.org>

	mail: implement msglist completion.

	* mail/mailline.c (msglist_closure_compl): Make the matches
	argument optional.
	(msglist_compl): Implement using msglist_closure_compl.

2019-01-17  Sergey Poznyakoff  <gray@gnu.org>

	Improve completion in mail.

	This affects the following commands: pipe, file, write, store.

	* mail/mail.h (shell_compl): New function.
	* mail/mailline.c (ml_command_completion): Change the meaning
	of the last argument to command_completion function. All
	functions updated.
	(msgtype_generator): Take into account '/' that can follow ':'.
	Prefix returned values with :.
	(header_generator): Append ':/' to the returned strings.
	(compl_concat): New function.
	(file_compl): Rewrite.
	(msglist_closure_compl): New function.
	(file_compl_matches,msglist_file_compl,exec_compl): Rewrite.
	(shell_compl): New function.
	* mail/table.c: Implement completion for pipe and shell
	commands.

2019-01-16  Sergey Poznyakoff  <gray@gnu.org>

	Edit docs.

	* doc/texinfo/programs/mail.texi: Reorder material. Document
	message states. Rewrite description of message lists. Describe
	mailbox argument in file, save, write, etc.
	* doc/texinfo/mailutils.texi: Regenerate detailed menu

2019-01-16  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* libmailutils/base/amd.c (amd_body_stream_readdelim): Fix line
	length calculation.

2019-01-16  Sergey Poznyakoff  <gray@gnu.org>

	mail: fix / and :/ searches in message sets.

	* mail/mail.h (msgset_remove): New proto.
	* mail/msgset.y (yylex): Make sure to never move cur_p past the
	terminating 0 character.
	(msgset_append): Eliminated duplicates.
	(select_body): Read entire lines. Fix the conditional: return
	true if the matching line was found.

2019-01-16  Sergey Poznyakoff  <gray@gnu.org>

	Split programs.texi into manageable parts.

	* NEWS: Update.
	* configure.ac: Version 3.5.90
	* doc/texinfo/Makefile.am (mailutils_TEXINFOS): Add new files.
	* doc/texinfo/programs.texi: Include sections from
	programs/*.texi
	* doc/texinfo/programs/comsatd.texi: New file.
	* doc/texinfo/programs/frm.texi: New file.
	* doc/texinfo/programs/guimb.texi: New file.
	* doc/texinfo/programs/imap4d.texi: New file.
	* doc/texinfo/programs/maidag.texi: New file.
	* doc/texinfo/programs/mail.texi: New file.
	* doc/texinfo/programs/mailutils.texi: New file.
	* doc/texinfo/programs/messages.texi: New file.
	* doc/texinfo/programs/mimeview.texi: New file.
	* doc/texinfo/programs/movemail.texi: New file.
	* doc/texinfo/programs/pop3d.texi: New file.
	* doc/texinfo/programs/readmsg.texi: New file.
	* doc/texinfo/programs/sieve.texi: New file.

2019-01-15  Sergey Poznyakoff  <gray@gnu.org>

	Fix the pipe command (mail)

	* mail/pipe.c: Always treat last argument as the name of the
	command to use.

2019-01-15  Sergey Poznyakoff  <gray@gnu.org>

	Improve mail documentation.

2019-01-15  Sergey Poznyakoff  <gray@gnu.org>

	Minor change.

	* libmailutils/cli/cli.c: Update copyright year.

2019-01-03  Sergey Poznyakoff  <gray@gnu.org>

	Update copyright years.

2018-12-25  Sergey Poznyakoff  <gray@gnu.org>

	Fix typos and improve wording in the docs.

	Reported by Dan Jacobson.

2018-12-25  Sergey Poznyakoff  <gray@gnu.org>

	Fix showenvelope.

	* mail/envelope.c (print_stream_envelope): New function. End
	output with a newline.
	* mail/mail.h: Likewise.
	* mail/print.c (mail_print_msg): Print envelope to the created
	output stream, instead of mu_strout.

2018-11-09  Sergey Poznyakoff  <gray@gnu.org>

	Fix obsolete docstring.

	* libmailutils/cli/stdcapa.c: Fix description of the argument
	syntax for the "debug" statement.

2018-10-27  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.5.

2018-10-24  Sergey Poznyakoff  <gray@gnu.org>

	Add missing prototype.

2018-10-24  Sergey Poznyakoff  <gray@gnu.org>

	sieve: set variables from command line.

	The new command line option --variable initializes the RFC 5229
	variable.

	* NEWS: Update.
	* doc/texinfo/programs.texi: Fix description of sieve command
	line options.
	* include/mailutils/sieve.h (mu_sieve_variable_initialize): New
	proto.
	* libmu_sieve/runtime.c (sieve_run): Call
	mu_i_sv_init_variables to clear and initialize the table of
	variables.
	* libmu_sieve/sieve-gram.y (mu_sieve_machine_dup): Copy
	variables.
	(mu_sieve_machine_destroy): Destroy table of variables and
	initializer list.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine) <init_var>: New
	member.
	(mu_sieve_variable_initializer): New type.
	(mu_i_sv_init_variables): New proto.
	* libmu_sieve/variables.c (mu_sieve_variable_initialize): New
	function.
	(mu_i_sv_copy_variables): Copy initializers as well.
	(mu_i_sv_init_variables): New function.
	* sieve/sieve.c: New command line option --variable.
	* sieve/tests/variables.at: Test the --variable option.

2018-10-23  Sergey Poznyakoff  <gray@gnu.org>

	Fix static linkage.

	* libmailutils/datetime/scantime.c (get_num): static
	* mu/libexec/ldflags.c: Make sure libmailutils is linked after
	all libmu_ libraries that rely on it.

2018-10-22  Sergey Poznyakoff  <gray@gnu.org>

	Fix wordsplit command expansion and related tests.

	* include/mailutils/wordsplit.h (MU_WRDSO_ARGV): Remove.
	* libmailutils/string/wordsplit.c (expcmd): Always split
	command line into arguments. This fixes
	https://savannah.gnu.org/bugs/?54830
	* libmailutils/tests/wordsplit.at: Rewrite command expansion
	tests.
	* libmailutils/tests/wsp.c: Implement internal commands,
	instead of calling shell ones. This fixes
	https://savannah.gnu.org/bugs/?54829.
	* libmailutils/string/expvar.c: Remove the use of
	MU_WRDSO_ARGV.

2018-10-04  Sergey Poznyakoff  <gray@gnu.org>

	Fix imap client behavior when opening empty mailboxes.

	According to RFC 3501 (page 89):

	 The server should respond with a tagged BAD
	 response to a command that uses a message
	 sequence number greater than the number of
	 messages in the selected mailbox. This
	 includes "*" if the selected mailbox is empty. 
	* include/mailutils/sys/imap.h (_mu_imap_mailbox)<total_size>:
	Remove unnecessary field.
	* libproto/imap/mbox.c (_imap_fetch_callback): Fix array size
	calculation.
	(_imap_mbx_scan): Don't issue FETCH command if the mailbox is
	empty.

2018-08-26  Sergey Poznyakoff  <gray@gnu.org>

	Implement SCM interface to mailutils filters.

	* include/mailutils/guile.h (mu_port_make_from_stream): Remove
	unused msg argument. All uses updated.
	* libmu_scm/mu_filter.c: New file.
	* libmu_scm/Makefile.am: Add mu_filter.c
	* libmu_scm/mu_message.c (mu-message-get-port): Add missing
	anchor to the docstring.
	* libmu_scm/mu_port.c (mu_port): Remove msg.
	* libmu_scm/mu_scm.c (mu_scm_init): Call mu_scm_filter_init. 
	* NEWS: Updated.

2018-08-25  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix in base64 encoder.

	* libmailutils/filter/base64.c (_base64_encoder): Don't return
	immediately on eof. The encoder can have some more characters
	for output, left over from the previous call.

2018-08-16  Ivan A. Melnikov  <iv@altlinux.org>

	Force terminating \0 in mh_format result.

	Apparently, mu_stream_read is not required to put the
	terminating zero into the buffer, so we need to do it in its
	caller.

	Signed-off-by: Ivan A. Melnikov <iv@altlinux.org>

2018-08-13  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix in python configuration code.

	* configure.ac: Use $PYTHON_CONFIG instead of the hardcoded
	python-config name.

2018-07-30  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.4.91.

	* NEWS: Update version number.
	* configure.ac: Likewise.

2018-07-30  Sergey Poznyakoff  <gray@gnu.org>

	Support for Python 3.

	Support for v2 is retained for a while. Both the API and the
	syntax of the two versions differ considerably enough to keep
	both versions apart in parallel directory subtrees, instead of
	fiddling with CPP directives and Automake conditionals. So,
	instead of prior 'python/' and 'examples/python' we now have
	'python/2', 'python/3', and 'examples/python/2' with
	'examples/python/3'. The customized loader is modified to
	insert the appropriate path to the sys.path.

	When Python 2 is definitely gone, the directory structures will
	be flattened again, by removing additional version number
	subdirectory.

	* Makefile.am (SUBDIRS): Add python unconditionally
	* configure.ac (PYTHON_MAJOR): New substvar.
	(MU_LIB_PY): Change path
	(MU_COND_PYTHON2,MU_COND_PYTHON3): New conditionals.
	* examples/python/*: Rename to examples/python/2/*
	* examples/python/3/Makefile.am: New file.
	* examples/python/3/addr.py: New file.
	* examples/python/3/auth.py: New file.
	* examples/python/3/iconv.py: New file.
	* examples/python/3/lsf.py: New file.
	* examples/python/3/mailcap.py: New file.
	* examples/python/3/mimetest.py: New file.
	* examples/python/3/msg-send.py: New file.
	* examples/python/3/sfrom.py: New file.
	* examples/python/3/url-parse.py: New file.
	* include/mailutils/python.h: Remove inclusion of Python.h. It
	must included before all other files.
	* lib/python.c: Include Python.h
	* python/*: Rename to python/2/*
	* python/usercustomize.py: Insert path to the appropriate
	Python version implementation to the sys.path
	* python/3/Makefile.am: New file.
	* python/3/libmu_py/Makefile.am: New file.
	* python/3/libmu_py/address.c: New file.
	* python/3/libmu_py/attribute.c: New file.
	* python/3/libmu_py/auth.c: New file.
	* python/3/libmu_py/body.c: New file.
	* python/3/libmu_py/envelope.c: New file.
	* python/3/libmu_py/errno.c: New file.
	* python/3/libmu_py/error.c: New file.
	* python/3/libmu_py/filter.c: New file.
	* python/3/libmu_py/folder.c: New file.
	* python/3/libmu_py/header.c: New file.
	* python/3/libmu_py/libmu_py.c: New file.
	* python/3/libmu_py/libmu_py.h: New file.
	* python/3/libmu_py/list.c: New file.
	* python/3/libmu_py/mailbox.c: New file.
	* python/3/libmu_py/mailcap.c: New file.
	* python/3/libmu_py/mailer.c: New file.
	* python/3/libmu_py/message.c: New file.
	* python/3/libmu_py/mime.c: New file.
	* python/3/libmu_py/nls.c: New file.
	* python/3/libmu_py/registrar.c: New file.
	* python/3/libmu_py/script.c: New file.
	* python/3/libmu_py/secret.c: New file.
	* python/3/libmu_py/sieve.c: New file.
	* python/3/libmu_py/stream.c: New file.
	* python/3/libmu_py/url.c: New file.
	* python/3/libmu_py/util.c: New file.
	* python/3/mailutils/Makefile.am: New file.
	* python/3/mailutils/__init__.py: New file.
	* python/3/mailutils/address.py: New file.
	* python/3/mailutils/attribute.py: New file.
	* python/3/mailutils/auth.py: New file.
	* python/3/mailutils/body.py: New file.
	* python/3/mailutils/c_api.c: New file.
	* python/3/mailutils/envelope.py: New file.
	* python/3/mailutils/error.py: New file.
	* python/3/mailutils/filter.py: New file.
	* python/3/mailutils/folder.py: New file.
	* python/3/mailutils/header.py: New file.
	* python/3/mailutils/mailbox.py: New file.
	* python/3/mailutils/mailcap.py: New file.
	* python/3/mailutils/mailer.py: New file.
	* python/3/mailutils/message.py: New file.
	* python/3/mailutils/mime.py: New file.
	* python/3/mailutils/nls.py: New file.
	* python/3/mailutils/registrar.py: New file.
	* python/3/mailutils/secret.py: New file.
	* python/3/mailutils/sieve.py: New file.
	* python/3/mailutils/stream.py: New file.
	* python/3/mailutils/url.py: New file.
	* python/3/mailutils/util.py: New file.

2018-07-27  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* libmailutils/mime/mimehdr.c (_mime_header_parse): Initialize
	ws.ws_options prior to modifying it.

2018-07-25  Sergey Poznyakoff  <gray@gnu.org>

	Add maintainer's makefiles.

2018-07-23  Sergey Poznyakoff  <gray@gnu.org>

	Support for Berkeley DB versions 5 and 6.

	Drop the legacy configure option --with-db2

2018-07-20  Sergey Poznyakoff  <gray@gnu.org>

	Add test cases missing from the distribution.

	* readmsg/tests/Makefile.am (TESTSUITE_AT): Add missing
	testcases

2018-06-22  Sergey Poznyakoff  <gray@gnu.org>

	Minor documentation fix.

2018-06-22  Sergey Poznyakoff  <gray@gnu.org>

	Fix endianness bug in string to IP conversion.

	* libmailutils/cidr/fromsa.c (_mu_inaddr_to_bytes)
	(_mu_sockaddr_to_bytes): Fix improper endianness conversion.
	* libmailutils/cidr/tosa.c (mu_cidr_to_sockaddr): Simplify
	conversion.

2018-06-13  Sergey Poznyakoff  <gray@gnu.org>

	Fix eventual segmentation violation in imap4d.

	The coredump occurred if a recently started child received a
	termination signal before initializing iostream.

	* imap4d/bye.c (imap4d_bye0): Rename to imap4d_bye_command. All
	uses changed.
	* imap4d/io.c (io_untagged_response): Check if iostream is
	initialized.

2018-06-13  Sergey Poznyakoff  <gray@gnu.org>

	libmu_scm: fix docs.

2018-06-12  Sergey Poznyakoff  <gray@gnu.org>

	libmu_scm: add testcases for mu-mime functions (with bugfixes)

	* libmu_scm/mu_message.c (mu_scm_message_add_owner): Fix owner
	list construction.
	* libmu_scm/mu_mime.c (mu-mime-create): Fix a bug: both
	arguments are optional now.
	* libmu_scm/tests/Makefile.am: Add new tests.
	* libmu_scm/tests/testsuite.at: Likewise,

	New testcases: 
	* libmu_scm/tests/mime-add-part.at
	* libmu_scm/tests/mime-create.at
	* libmu_scm/tests/mime-get-num-parts.at
	* libmu_scm/tests/mime-get-part.at
	* libmu_scm/tests/mime-multipart-p.at
	* libmu_scm/tests/mime-p.at

2018-06-12  Sergey Poznyakoff  <gray@gnu.org>

	libmu_scm: more tests.

	* testsuite/spool/mbox2: New file. Same messages as in mbox1,
	but with Mailutils auxiliary headers added. Ideally,
	libmailutils should not add any headers to the messages, unless
	explicitly requested to do so. Hopefully, I'll fix this in
	future.
	* testsuite/spool/DISTFILES: Add mbox2 and mime.msg 
	* libmu_scm/tests/mailbox-append-message.at: New testcase.
	* libmu_scm/tests/mailbox-expunge.at: New testcase.
	* libmu_scm/tests/message-delete.at: New testcase.
	* libmu_scm/tests/message-get-flag.at: New testcase. 
	* libmu_scm/mu_message.c (mu_scm_message_print): Display flags.
	* libmu_scm/tests/Makefile.am: Add new files.
	* libmu_scm/tests/mailbox-print.at: Remove the now superfluous
	quoting.
	* libmu_scm/tests/message-get-part.at: Likewise.
	* libmu_scm/tests/testsuite.at (MU_GUILE_CHECK): Quote the
	argument to AT_DATA Include new tests.

	Changes missing from the previous commit: 
	* libmu_scm/mailutils/ancilla.scm
	* libmu_scm/mu_body.c
	* libmu_scm/mu_port.c

2018-06-10  Sergey Poznyakoff  <gray@gnu.org>

	libmu_scm: minor fixes; add more tests.

	* libmu_scm/mailutils/ancilla.scm (string->message)
	(file->message): Ise open- call instead of call-with-input to
	avoid premature closing of the input port. This has a drawbak
	that the port will be actually closed only after the returned
	message is destroyed (possibly by the gc).
	* libmu_scm/mu_body.c: Use scm_intprint when printing objects.
	* libmu_scm/mu_mailbox.c: Likewise.
	* libmu_scm/mu_port.c: Likewise.
	* libmu_scm/mu_message.c (mu_scm_message_free): Fix destroying
	of the underlying mu_message_t object. 
	* libmu_scm/tests/message-get-num-parts.at: New file.
	* libmu_scm/tests/message-get-part.at: New file.
	* libmu_scm/tests/message-multipart.at: New file.
	* testsuite/spool/mime.msg: New file.

2018-06-09  Sergey Poznyakoff  <gray@gnu.org>

	Upgrade gint.

	This suppresses spurious warnings when generating
	guile-procedures.txt

2018-06-09  Sergey Poznyakoff  <gray@gnu.org>

	Add more libmu_scm tests.

	* libmu_scm/Makefile.am (C_SRCS): Add portstream.c
	* libmu_scm/mailutils/Makefile.am (EXTRA_DIST): Add ancilla.scm
	* libmu_scm/mailutils/ancilla.scm: New file
	* libmu_scm/mu_message.c (mu-message-get-header-fields): Fix
	operation when called with three arguments.
	(mu-message-from-port): New function.
	* libmu_scm/portstream.c: New file.

2018-06-08  Sergey Poznyakoff  <gray@gnu.org>

	Further fixes in the scheme library. Add guile testsuite.

	* .gitignore: Ignore .gdbinit
	* README: Update.
	* configure.ac: Add guile testsuite
	* libmu_scm/Makefile.am (SUBDIRS): Add tests.
	* libmu_scm/mu_body.c: Update smob support.
	* libmu_scm/mu_dbgport.c (mu_scm_make_debug_port): Delegate
	buffering to mailutils streams layer.
	* libmu_scm/mu_mailbox.c: Update smob support.
	(mu-mailbox-more-messages?): Fix reversed return value.
	* libmu_scm/mu_message.c: Update smob support.
	* libmu_scm/mu_mime.c: Likewise.
	* libmu_scm/mu_port.c (mu_port_make_from_stream): Delegate
	buffering to mailutils streams layer. 
	* libmu_scm/tests/.gitignore: New file.
	* libmu_scm/tests/Makefile.am: New file.
	* libmu_scm/tests/atlocal.in: New file.
	* libmu_scm/tests/const.at: New file.
	* libmu_scm/tests/mailbox-get-message.at: New file.
	* libmu_scm/tests/mailbox-get-size.at: New file.
	* libmu_scm/tests/mailbox-get-url.at: New file.
	* libmu_scm/tests/mailbox-iterate.at: New file.
	* libmu_scm/tests/mailbox-messages-count.at: New file.
	* libmu_scm/tests/mailbox-open-exc.at: New file.
	* libmu_scm/tests/mailbox-open.at: New file.
	* libmu_scm/tests/mailbox-print.at: New file.
	* libmu_scm/tests/message-create.at: New file.
	* libmu_scm/tests/message-print.at: New file.
	* libmu_scm/tests/testsuite.at: New file.

2018-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to Guile 2.2.0.

	* configure.ac" Set minimum supported Guile version to 2.2.0
	* libmu_scm/mu_body.c: Rewrite.
	* libmu_scm/mu_dbgport.c: Rewrite.
	* libmu_scm/mu_mailbox.c: Update types.
	* libmu_scm/mu_message.c: Likewise.
	* libmu_scm/mu_mime.c: Likewise.
	* libmu_scm/mu_port.c: Likewise.

2018-06-02  Sergey Poznyakoff  <gray@gnu.org>

	Fix absolute name of the "missing" utility.

	* am/bison.m4: Use $am_aux_dir. Take care to not expand $SHELL
	prematurely.
	* am/flex.m4: Likewise.

2018-05-16  Sergey Poznyakoff  <gray@gnu.org>

	Fix the use of uninitialized variable.

2018-04-18  Sergey Poznyakoff  <gray@gnu.org>

	Minor fixes in the mailutils-dbm utility.

	* mu/libexec/dbm.c (write_quoted_string): Fix expected return
	from mu_wordsplit_c_quote_char.
	(add_records): Don't break on empty lines.

2018-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Port wordsplit from grecs
	dae43f323db9578e656e3a6c53440e2365421af7.

	* libmailutils/string/wordsplit.c (expvar): Gracefully handle
	NULL values in an ENV_KV environment.
	* include/mailutils/wordsplit.h: Fix typos

2018-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.4.90; update copyright years.

2018-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add new date/time specifier for headline variable in mail.

	The new %D specifier allows the user to supply arbitrary
	strftime(3) format string for outputting message date/time.
	E.g.:

	 set headline="%4m %20D{%Y-%m-%dT%H:%M:%S} %18f %s" 
	* mail/from.c (hdr_date): Take format from data, if supplied.
	(compile_headline): Handle the %D specifier
	* mail/util.c (util_do_command): Return immediately if command
	parsing failed. 
	* mail/tests/D.at: New testcase.
	* mail/tests/Makefile.am: Add new testcase.
	* mail/tests/testsuite.at: Likewise. 
	* NEWS: Document changes.
	* doc/texinfo/strftime.texi: New file.
	* doc/texinfo/Makefile.am: Add strftime.texi
	* doc/texinfo/mailutils.texi: Include strftime.texi
	* doc/texinfo/programs.texi: Document the %D format specifier.

2018-01-18  Sergey Poznyakoff  <gray@gnu.org>

	Fix header field alignment in header output of the mail
	command.

	* mail/from.c (compile_headline): Honor the alingment setting.
	* mail/tests/align.at: New testcase.
	* mail/tests/Makefile.am: Add new testcase.
	* mail/tests/testsuite.at: Include new testcase.

2018-01-18  Sergey Poznyakoff  <gray@gnu.org>

	Minor fixes.

	* doc/texinfo/mailutils.texi: Fix typos in the imap URL
	example.
	* libmailutils/locus/linetrack.c: Re-word the comment.
	* mimeview/grammar.y: Remove unnecessary assignment.

2017-12-29  Sergey Poznyakoff  <gray@gnu.org>

	Fix memory management in imap4d.

	* imap4d/io.c (imap4d_tokbuf_getline): Add missing index check.
	* imap4d/search.c (parse_simple_key): Don't free msgset (it
	will be freed later).

2017-12-17  Sergey Poznyakoff  <gray@gnu.org>

	Update ChangeLog.amend.

2017-12-16  Sergey Poznyakoff  <gray@gnu.org>

	Fix the operation of CRLF and CRLFDOT filters.

	When encoding, these filters used to retain any existing CRLF
	sequences untouched on output. As a result, it was not possible
	to predict the number of characters output having the number of
	characters and number of lines on input. Due to this imap4d
	fetch would produce invalid literal output on FETCH command if
	the requested stream (usually body), contained a mixture of LF
	and CRLF terminated lines. Moreover, encode + decode operations
	would not be idempotent in this case.

	To fix this, the default behavior of CRLF and CRLFDOT filter in
	encode mode is changed to translate each LF to CRLF, no matter
	what the prior character was. To invoke the former
	"normalizing" behavior, the "-n" option argument is provided
	for mu_filter_create_args.

	* imap4d/fetch.c (fetch_io): Use raw stream when possible. Use
	a temporary CRLF translator to ensure proper positioning if
	start offset is specified. This is suboptimal (to say the very
	least) and will be fixed as soon as possible.
	* imap4d/io.c (io_enable_crlf): New function (hopefully
	temporary).
	* libmailutils/filter/crlfdot.c: When encoding, retain input
	CRLF only if the -n option was used when creating the filter.
	Otherwise, translate it to CRCRLF.
	* libmailutils/filter/crlfflt.c: Likewise.
	* libmailutils/stream/fltstream.c (filter_read): Make sure
	mu_filter_lastbuf is always emitted prior to closing the
	filter.
	(filter_seek): Clear flag_eof.
	* libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add dump
	and tocrlf.
	* libmailutils/tests/crlf.at: New test case.
	* libmailutils/tests/crlfdot.at: New test case.
	* libmailutils/tests/dump.c: New auxiliary program.
	* libmailutils/tests/tocrlf.c: Likewise.
	* libmailutils/tests/testsuite.at (MU_FILTER_TEST_NIBBLE)
	(MU_FILTER_TEST): New defines.

2017-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typos.

2017-11-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Follow up to 78132d34.

	* libmailutils/mime/mime.c (_mime_parse_mpart_message): Avoid
	segmentation violation on nbytes==0.

2017-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	MIME: part boundary in not required to be followed by a
	newline.

	* libmailutils/mime/mime.c: Part boundary can be either
	followed by a newline, or appear at the very end of input.
	* testsuite/Makefile.am: Add mime01.at
	* testsuite/testsuite.at: Include mime01.at.
	* testsuite/mime01.at: New file.
	* testsuite/mime.at: Update expected output. Don't filter
	output through tr & sed.
	* testsuite/mimetest.c: Change output to make sure no trailing
	whitespace could be produced.

2017-11-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/base/rfc2047.c (mu_rfc2047_encode): Fix
	compliance with RFC 2047, 4.3 (page 7). See FIXME, though.
	* libmailutils/tests/encode2047.at: Change expected output

2017-11-18  Sergey Poznyakoff  <gray@gnu.org>

	Fix AM_GNU_MAILUTILS.

	* mu-aux/mailutils.m4: Remove support for v. 1.2 and earlier.

2017-11-18  Sergey Poznyakoff  <gray@gnu.org>

	Fix the use of uninitialized memory.

	* mh/mh_alias_lex.l (push_source): Initialize locus range prior
	to copying to it.
	* libmailutils/cfg/parser.y (mu_cfg_tree_create_node):
	Likewise.
	* libmu_sieve/util.c: (mu_sieve_value_create): Likewise.

2017-11-10  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix in MH testsuite.

	Running fmtcheck without .mh_profile triggers mh_install, which
	surprises the testsuite with unexpected output "I'm going to
	create the standard MH path for you." Defining the MH envar to
	an existing file name suppresses it.

	* mh/tests/fmtcnd00.at: Always define MH prior to starting
	fmtcheck.
	* mh/tests/fmtcomp.at: Likewise.
	* mh/tests/fmtfunc.at: Likewise.

2017-11-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Pull wordsplit tests from grecs.

	* libmailutils/string/wordsplit.c (_wsplt_alloc_die): use %s
	format spec.
	(mu_wordsplit_init): Use MU_WRDSX_ constants instead of
	numerics.
	(expvar): Remove useless gettext.
	* libmailutils/tests/wordsplit.at: Update.

2017-11-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* mimeview/lexer.l (yyerror): Use explicit format spec.

2017-11-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve support of MU_IOCTL_TCPSTREAM.

	* libmailutils/stream/iostream.c (_iostream_ctl): Handle
	MU_IOCTL_TCPSTREAM
	* libmailutils/stream/logstream.c (_log_ctl): Propagate unknown
	codes to the transport stream.
	* libmailutils/stream/rdcache_stream.c (rdcache_ioctl):
	Likewise.
	* libmu_auth/tls.c (_tls_ioctl): Likewise.
	* libmu_auth/tlsiostr.c (_tls_io_ioctl): Likewise.

2017-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.4.

2017-11-01  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

2017-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve socket and SMTP client API.

	Split formatting functions into two distinct families.
	Functions prefixed with mu_sys_sockadrr deal with struct
	sockaddr, whereas those starting with mu_sockaddr deal with
	struct mu_sockaddr. Introduce special format for SMTP EHLO.

	When sending EHLO to the remote party, use IP address in square
	brackets if hostname is empty.

	* libmailutils/sockaddr/Makefile.am (libsockaddr_la_SOURCES):
	Add fromsock.c
	* libmailutils/sockaddr/fromsock.c: New function.
	* libmailutils/sockaddr/str.c (mu_sockaddr_format): Rewrite.
	(mu_sys_sockaddr_format,mu_sys_sockaddr_to_astr): New
	functions. 
	* include/mailutils/debug.h (mu_sockaddr_to_astr): Remove
	prototype.
	* include/mailutils/sockaddr.h (mu_sockaddr_format): New enum.
	(mu_sockaddr_format): change signature.
	(mu_sys_sockaddr_format,mu_sys_sockaddr_to_astr): New
	prototypes.
	(mu_sockaddr_from_socket): New prototype.
	* include/mailutils/stream.h (MU_IOCTL_TCPSTREAM): New ioctl
	family;
	(MU_IOCTL_TCP_GETSOCKNAME): New ioctl opcode. 
	* comsat/comsat.c: Use mu_sys_sockaddr_ interface to handle
	struct sockaddr.
	* lib/tcpwrap.c: Likewise.
	* libmailutils/server/ipsrv.c: Likewise.
	* libmailutils/server/msrv.c: Likewise. 
	* libmailutils/stream/tcp.c (_tcp_ioctl): Handle
	MU_IOCTL_TCPSTREAM.
	* libproto/mailer/smtp_ehlo.c (mu_smtp_ehlo): If hostname is
	empty, use IP address in square brackets.

2017-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/sockaddr/fromnode.c
	[!MAILUTILS_IPV6] (mu_sockaddr_from_node): Convert port to
	network order.

2017-10-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in AM_MAILUTILS macro.

	* mu-aux/mailutils.m4 (am_mu_vercmp): Ignore missing version
	parts.

2017-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.3.

	* NEWS: Update.
	* configure.ac: Update.
	* Makefile.am (dist-hook): Fix conditional.

2017-10-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

	* libmailutils/mailbox/msgsave.c (mu_message_save_to_mailbox):
	Open destination in append mode.

2017-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Reimplement control escapes in mh_format.

	This patch makes sure that (1) the value of the "num" register
	is not altered by evaluating the condition expressions and
	remains visible in the conditional branches, and (2) the value
	of the control escape is 1 or 0 depending on whether the last
	control condition succeeded or not.

	* mh/mh_format.h: Implement numeric stack in the vm.
	(mhop_pushn,mhop_popn,mhop_xchgn): New opcodes.
	(mh_fvm) <numstack,maxstack,tos>: New members.
	* mh/mh_fmtgram.y (ctx_stack): Reallocate as necessary.
	(yylex_cond): Handle backslash continuations.
	(format_parse): Initialize and free ctx_stack
	(codegen_node): Reimplement control escapes. See the comment
	for explanation
	* mh/mh_format.c (mh_fvm_run): Use mh_string_init to initialize
	registers. Initialize stack. Implement push, popn, and xchgn
	(extract_labels,mh_format_dump_disass): Handle new opcodes. 
	* mh/tests/fmtcnd00.at: New testcase.
	* mh/tests/Makefile.am: Add new testcase
	* mh/tests/testsuite.at: Likewise.
	* mh/tests/fmtcomp.at: Fix expected code dumps

2017-10-15  Sergey Poznyakoff  <gray@gnu.org>

	Fix memory leaks in amd and assoc.

2017-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.2.94.

2017-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use mu_prtstr to safely print string values.

2017-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Check for NULL return from mu_address_aget_ and
	mu_address_sget_ family functions.

	It is possible that these functions return success and place
	NULL in the result variable. Make sure this possibility is
	checked throughout the code.

	* libmailutils/base/usremail.c (mu_set_user_email): Check for
	NULL return value from mu_address_[as]get.
	* libmailutils/mailbox/msgenv.c (message_envelope_sender)
	* libmailutils/tests/addr.c (parse)
	* libmu_scm/mu_message.c (mu_scm_message_print):
	* libproto/mailer/prog.c (_expand_rcpt)
	* libproto/mailer/smtp.c (_rcpt_to_addr)
	(mu_address_sget_email)
	* maidag/lmtp.c (check_address):
	* mail/from.c (hdr_from):
	* mail/util.c (util_get_sender):
	* mh/mh_format.c (addr_cmp, builtin_proper) (builtin_addr,
	builtin_pers, builtin_note) (builtin_mbox, builtin_path,
	builtin_formataddr)
	* mh/mh_whom.c (scan_addrs):
	* libmu_sieve/util.c (mu_sieve_vlist_compare): Skip NULL
	returns from retr.
	* libmu_sieve/actions.c (check_redirect_loop): Error checking. 
	* include/mailutils/types.hin (mu_prstr): New function. 
	* libmu_cpp/address.cc: Use mu_prstr to ensure the printable
	representation of string.
	* python/libmu_py/address.c: Likewise.
	* libmu_scm/mu_address.c (_get_address_part): Likewise.
	* libmailutils/string/wordsplit.c (expvar): Treat NULL value as
	"".

2017-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in mh.

	* mh/mh_fmtgram.y (yylex_func): Accept negative numbers.

2017-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* libmailutils/mime/mimehdr.c (_mime_header_parse): Preserve
	charset no matter what lang setting is.

2017-10-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	bugfix in imap4d: INBOX name is case-insensitive.

2017-09-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Assume UTC for IMAP internaldate.

	* include/mailutils/datetime.h (mu_datetime_tz_utc): New proto.
	* libmailutils/datetime/tzutc.c: New file.
	* libmailutils/datetime/Makefile.am: Add tzutc.c 
	* imap4d/fetch.c (_frt_internaldate): Assume UTC for
	internaldate.
	* libproto/imap/fetch.c (_date_mapper): Likewise. 
	* mh/send.c: Improve diagnostics.

2017-09-27  Sergey Poznyakoff  <gray@gnu.org>

	Fix build without libtool.

	* libmu_sieve/load.c [!HAVE_LIBLTDL] (mu_sieve_unload_ext):
	Dummy function.
	[!HAVE_LIBLTDL] (mu_sieve_load_ext, mu_i_sv_load_add_dir): Set
	errno. Fix return value.
	* mu-aux/gylwrap (yysym): Add more symbols
	(dumpme): Skip old contents of the BOOTSTRAP section up to the
	next POD keyword.
	* mu/libexec/Makefile.am (MUTOOL_LIBRARIES_TAIL): Fix ordering
	of libraries.

2017-09-27  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

2017-07-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement new MH format primitives (for compatibility with
	nmh).

	* mh/etc/replcomps: Use localmbox instead of me.
	* mh/etc/replgroupcomps: Likewise.
	* mh/mh.h (mh_get_my_real_name)
	(mh_get_my_user_name,mh_my_host): New protos.
	(mh_my_email): Change prototype.
	* mh/mh_format.c (builtin_me): Use mh_get_my_user_name.
	(builtin_myhost,builtin_myname,builtin_localmbox): New
	functions.
	(builtin_formataddr): Preserve collected data if the address is
	not parseable.
	(builtin_tab): New functions: myhost, myname, localmbox.
	* mh/mh_init.c (mh_local_mailbox): New function.
	(mh_get_my_real_name)
	(mh_get_my_user_name,mh_my_host): New functions.
	* mh/repl.c (set_group): Don't overwrite any prior -form or
	-format options.

2017-07-14  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* mail/send.c (add_body): Increase reference counter of the
	copied stream.

2017-07-07  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes in MH format code generator.

	* mh/mh_fmtgram.y (mh_read_formfile): Remove only the last
	trailing newline.
	(codegen_node): Don't emit spurious clear register statements
	at the end of the "else" branch. Optimize if no "else" branch
	is present.
	* mh/mh_format.c (mh_fvm_run) <mhop_brzn, mhop_brzs>: Leave the
	result of condition evaluation in num.
	(builtin_tab): rcpt takes literal argument.
	* mh/scan.c (action): Remove unused argument.
	* mh/tests/fmtcomp.at: Update the "if-else" test.

2017-07-07  Sergey Poznyakoff  <gray@gnu.org>

	Simplify mh_fvm_run calling sequence.

	The commit 6b16ba19 (in its changes to mh/mh_format.c)
	inadvertently broke the operation of inc on folders with gaps
	in sequence (UID) numbering. It turns out that the msgno
	argument to mh_fvm_run (and msgno member in struct mh_fvm) can
	be disposed of. If the caller wants to supply an explicit UID
	number of the message, it should use mu_message_set_uid.

	* mh/mh.h (mh_fvm_run): Take only two arguments: fvm and
	message.
	* mh/mh_format.h (mh_fvm) <msgno>: Remove.
	* mh/fmtcheck.c (run): Set the uid accessor on the created
	message.
	* mh/mh_format.c (mh_format_str): Likewise.
	(builtin_msg, builtin_cur): Always call mh_message_number.
	* mh/inc.c: Update calls to mh_fvm_run
	* mh/repl.c: Likewise.
	* mh/scan.c: Likewise.
	* mh/sortm.c: Likewise.
	* mh/tests/inc.at: Check whether inc on folders with gaps in
	message UIDs produces the correct output.

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* mu-aux/gylwrap (filter): $yyrx is always defined after
	ce4b84ab. Use $yyrepl instead.

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Implement new opool function.

	* include/mailutils/opool.h (mu_opool_less): New function.
	* libmailutils/base/opool.c: Likewise.

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite rfc822 date parser.

	* include/mailutils/parse822.h (mu_parse822_day)
	(mu_parse822_date,mu_parse822_time): Remove protos.
	* libmailutils/address/parse822.c (mu_parse822_date_time):
	Rewrite via mu_scan_datetime.

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Start rewriting parse822.

	* include/mailutils/cctype.h (MU_CTYPE_IMSPC)
	(MU_CTYPE_NWCTL,MU_CTYPE_IMATM): New classes.
	(mu_isimspc,mu_isnwctl,mu_isimatm): New macros
	* libmailutils/string/muctype.c: Mark characters from the above
	classes.
	* include/mailutils/parse822.h (mu_parse822_is_char)
	(mu_parse822_is_digit,mu_parse822_is_ctl)
	(mu_parse822_is_space,mu_parse822_is_htab)
	(mu_parse822_is_lwsp_char,mu_parse822_is_special)
	(mu_parse822_is_atom_char,mu_parse822_is_q_text)
	(mu_parse822_is_d_text,mu_parse822_is_smtp_q): Rewrite as
	inline static functions, using macros from cctype.h
	* libmailutils/address/parse822.c: See above.
	(parse822_is_atom_char_ex): Remove.

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Bootstrap gylwrap.

	This removes the need for List::Regexp during development

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Improve gylwrap.

	This change allows the user to pre-compile the yyrx expression
	in gylwrap so that it no longer requires the List::Regexp
	module. Only supplying the --yysym module will require the
	module.

	* mu-aux/gylwrap: New options --reset and --dump

2017-07-06  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* am/flex.m4: Add missing 'fi'

2017-07-05  Sergey Poznyakoff  <gray@gnu.org>

	Fix VI_REVISION and VI_AGE in configure.ac.

2017-07-05  Sergey Poznyakoff  <gray@gnu.org>

	Fix the nohost MH format function.

2017-07-05  Sergey Poznyakoff  <gray@gnu.org>

	MH: Rewrite the mymbox function.

	* mh/mh_init.c (emailcmp): Rewrite.
	(email_match): New function.
	(mh_is_my_name): Cache Alternate-Mailboxes and mh_my_email in a
	static mu_address_t; use email_match to compare.
	* mh/tests/fmtfunc.at: Test mymbox function.

2017-07-04  Sergey Poznyakoff  <gray@gnu.org>

	Add more fmtfunc tests.

2017-07-04  Sergey Poznyakoff  <gray@gnu.org>

	Minor fixes.

	* mh/mh_fmtgram.y (yyerror): Cast * arguments to int
	* mh/mh_format.h (mh_instr_t)<size>: New member.
	* mh/tests/fmtfunc.at (FMTFUNC): Enforce Charset:auto.

2017-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	mu_parse_date_dtl: Minor fix.

	* libmailutils/datetime/parsedate.y (mu_parse_date_dtl): Set
	tm.tm_gmtoff and tm.tm_zone upon return (if present).

2017-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve parsedate & related MH formats.

	* libmailutils/datetime/parsedate.y (spec production): If a
	non-signed number is given, treat it as a (positive) timezone,
	unless tz is already set, or as a year number, unless a year is
	already set, or throw an error otherwise.
	(mu_parse_date_dtl): Revert sign of the returned utc_offset
	* mh/mh_format.c (builtin_tzone): Compatibility fix
	* mh/tests/fmtfunc.at: Test more functions.

2017-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revamp MH datetime format functions.

	* mh/mh_format.c (_parse_date): Use mu_parse_date_dtl instead
	of much stricter mu_parse822_date_time. Return more info. All
	callers changed
	(builtin_sday,builtin_szone): Implemented
	* mh/tests/fmtfunc.at: Comment out (temporarily) the tzone test

2017-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Move parsedate.y from base to datetime library.

2017-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve parsedate parser.

	* include/mailutils/datetime.h (MU_PD_MASK_*): New defines,
	taken from parsedate.y
	(mu_parse_date_dtl): New proto.
	* libmailutils/base/parsedate.y: Remove obsolete defines. Move
	PD_MASK_ defines to datetime.h; use functions from cctype.h and
	cstr.h
	(pd_date) <tzname>: New member
	(%union): New member tz
	(T_ZONE,T_DAYZONE): Change type to <tz>
	(zone productions): Set tzname.
	(mu_parse_date_dtl): New function. Returns detailed time
	information.
	(mu_parse_date): Rewrite as an entry point to mu_parse_date_dtl

2017-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Test mh format date functions.

	* mh/mh_format.c (builtin_sday, builtin_szone): Mark as not
	implemented
	(builtin_zone): Fix output
	(builtin_tzone): Fix output
	* mh/tests/fmtfunc.at: Test most date functions.

2017-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/address/parse822.c (mu_parse822_date_time): Set
	tm_yday

2017-07-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	fmtcheck: use symbolic label names by default.

	Actual program counters may differ between different
	architecture, so avoid using them in the testsuite.

	* mh/fmtcheck.c: New option -pc requires printing program
	counters. Unless this option is used, -disass prints only
	labels where needed.
	* mh/mh.h (mh_format_dump_disass): Change signature.
	* mh/mh_format.c (mh_format_dump_disass): Take additional flag
	indicating whether to print program counters. Compute and print
	program labels, unless this flag is non-zero.
	* mh/tests/fmtcomp.at: Don't expect program counters in
	disassembled code.

2017-07-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH: fix formataddr.

	* mh/mh_fmtgram.y (emit_funcall): Emit mhop_movs acc, reg if
	MHA_ACC flag is set.
	* mh/mh_format.c (mh_fvm_run): Clear all registers.
	(builtin_formataddr): Get previously accumulated addresses from
	R_ACC
	(builtin_tab): Mark formataddr with MHA_ACC, remove MHA_OPTARG
	(mh_format_dump_disass): Account for the new register.
	(mh_fvm_destroy): Free all registers.
	* mh/mh_format.h: New register R_ACC. It is needed to implement
	proper formataddr and concataddr functionality. 
	* mh/tests/fmtcomp.at: Update.
	* mh/tests/fmtfunc.at: Update.

2017-07-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH: fix the nodate format function.

	* mh/mh_format.c (builtin_nodate): Call mu_parse822_date_time
	directly.
	(mh_format_dump_disass): Escape literal strings on output.
	* mh/tests/fmtfunc.at: Test nodate.

2017-07-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

2017-07-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH format: fix processing of special functions: putstrf,
	putnumf, lit, and num.

	* mh/mh_fmtgram.y (node): Replace noprint with printflag.
	(escape production): Consult printflag to decide whether to amd
	how to print
	(funcall production): Rewrite logic
	(yylex_func): Make a clear distinction between literals and
	inlined ctls, which require leading whitespace, and funcalls
	and components, that don't tolerate it.
	(emit_funcall): Process special functions separately
	* mh/mh_format.c (builtin_tab): Mark lit, num, putstrf, and
	putnumf as specials.
	* mh/mh_format.h: Revamp MHA_ flags 
	* mh/tests/fmtcomp.at: Update.
	* mh/tests/fmtfunc.at: Add tests for putstrf and putnumf

2017-07-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH: Fix mh_builtin field misnomer.

2017-07-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	More fixes in MH format parser.

	* mh/mh_fmtgram.y (codegen_node): Generate mhop_printlit
	instruction for fmtnode_print node with a literal or number
	argument.
	* mh/mh_format.c (mh_fvm_run): Handle mhop_printlit
	* mh/mh_format.h (mhop_printlit): New opcode.
	* mh/tests/fmtcomp.at: Update.
	* mh/tests/fmtfunc.at: Add more tests.

2017-06-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve MH format parser.

	* mh/fmtcheck.c (main): Assume -dump if no input message and no
	-disass is given.
	* mh/mh_fmtgram.y: Enable error-verbose mode
	(funcall production): Use MHA_OPTARG_NIL flag to provide 0 (or
	"") default argument.
	(yyerror): Improve location printer
	(yylex_initial): Correctly handle %%
	* mh/mh_format.c (mh_string_move): Rename to mh_string_copy
	(builtin_msg, builtin_cur): Try to obtain message number only
	if msgno is 0.
	(builtin_tab): Fix definitions of comp, lit, and num
	(mh_format_dump_disass): Print width.
	* mh/mh_format.h (MHA_OPTARG_NIL): New flag. 
	* mh/tests/fmtcomp.at: New file.
	* mh/tests/fmtfunc.at: New file.
	* mh/tests/Makefile.am: Add new files.
	* mh/tests/testsuite.at: Likewise.
	* mh/tests/atlocal.in (MHETCDIR): New variable.
	* mh/tests/scan.at: Test external formats.

2017-06-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Introduce explicit data type for MH format virtual machine.

	* mh/mh.h (mh_fvm_t): New typedef.
	(mh_format): Remove. (mh_fvm_create,mh_fvm_destroy)
	(mh_fvm_set_output,mh_fvm_set_width)
	(mh_fvm_set_format,mh_fvm_run): New protos.
	* mh/mh_format.c: Likewise.
	* mh/mh_format.h (mh_machine): Rename to mh_fvm 
	* mh/fmtcheck.c: Rewrite using mh_fvm_ functions.
	* mh/inc.c: Likewise.
	* mh/mh_list.c (print_header_value): Likewise.
	* mh/repl.c: Likewise.
	* mh/scan.c: Likewise.
	* mh/sortm.c: Likewise.

2017-06-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Restore version output expected by mh-e.

	* mh/mh_getopt.c (mh_version_hook): Print version in format
	expected by mh-e
	(process_std_options): Produce usual version output when
	responding to --version

2017-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add special flag for debugging MH format parser.

	* mh/mh.h (MH_FMT_PARSE_DEBUG): New flag.
	* mh/fmtcheck.c: Pass the MH_FMT_PARSE_DEBUG flag, if required.
	* mh/mh_fmtgram.y (mh_format_debug): Remove.
	(format_parse): Enable debugging if MH_FMT_PARSE_DEBUG flag is
	set

2017-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH: minor fix in format lexer.

	* mh/mh_fmtgram.y (yylex): Don't return empty strings

2017-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve mhl format parser.

	* mh/mh_list.c: Keep track of input locations

2017-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix wordsplit MU_WRDSF_INCREMENTAL | MU_WRDSF_NOSPLIT.

	* libmailutils/string/wordsplit.c (mu_wordsplit_process_list):
	Update wsp->ws_endp in nosplit mode
	* libmailutils/tests/wordsplit.at: Test incremental nosplit

2017-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in libdatetime.

	* libmailutils/datetime/utcoff.c (mu_utc_offset): Correct the
	difference if computed at the break of a day.

2017-06-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve format parser API.

	* mh/scanfmt.c: New file.
	* mh/Makefile.am: Add scanfmt.c
	* mh/mh.h (mh_list_format): Remove extern
	(mh_format_parse): Remove proto.
	(mh_format_string_parse,mh_format_file_parse)
	(mh_scan_format): New functions.
	(mh_audit_open, mh_audit_close): Operate on mu_stream_t,
	instead of FILE*.
	* mh/mh_fmtgram.y (mh_format_string_parse)
	(mh_format_file_parse): New functions.
	* mh/mh_format.c (print_fmt_string): Make sure trailing newline
	is output, even if it is the Nth character on the line
	(N=width).
	* mh/mh_getopt.c (mh_opt_parse_formfile)
	(mh_opt_parse_format): New functions.
	* mh/mh_getopt.h (mh_opt_parse_formfile)
	(mh_opt_parse_format): New protos.
	* mh/mh_init.c (mh_list_format): Remove.
	(mh_audit_open, mh_audit_close): Operate on mu_stream_t,
	instead of FILE*. 
	* mh/fmtcheck.c: Use new format parsing API.
	* mh/inc.c: Likewise.
	* mh/mh_list.c: Likewise.
	* mh/repl.c: Likewise.
	* mh/scan.c: Likewise.
	* mh/sortm.c: Likewise.

2017-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH: Fix repl formats.

	* mh/etc/replcomps: Replace calls to %(concat)
	* mh/etc/replgroupcomps: Likewise.
	* mh/repl.c: Fix embedded format.

2017-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH format: fix location tracking and error diagnostics.

	* mh/mh_fmtgram.y: Use mu_linetrack_t to keep track of input
	location. Handle %; comments.
	* mh/mh_format.c (mh_format): Change semantics of mhop_atoi and
	mhop_itoa.
	(builtin_tab): Fix returns types of trim, date2local, and
	date2gmt.
	* mh/mh_format.h: Document changes.
	* mh/mh_init.c (mh_read_formfile): Read entire file.

2017-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix mu_diag_at_locus_range and mu_vdiag_at_locus_range.

	* libmailutils/diag/diag.c (mu_vdiag_at_locus_range): Reset
	stream mode.

2017-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Further work on format vm.

	* mh/mh.h (mh_format): Change signature.
	(MH_FMT_FORCENL): New define.
	* mh/mh_format.h (MHA_OPT_CLEAR): Remove.
	(MHA_LITERAL,MHA_VOID): New flags.
	(mh_machine) <flags>: New member.
	* mh/mh_fmtgram.y (funcall production): Fix argument
	interpretation
	(else_part production): Allow for empty expression.
	(token_function): Use MU_CTYPE_IDENT instead of the more
	restrictive MU_CTYPE_ALPHA.
	* mh/mh_format.c (node_free): Accept NULL as argument
	(emit_funcall): Assign literal arguments to R_ARG registers
	(codegen_node): Fix coding the mhop_setn instruction. Clear
	both str and reg if the ELSE part of a conditional is empty.
	(mh_string_load): Fix size computation.
	(mh_string_move): Don't clear the source register.
	(mh_format): Reorder parameters, pass flags as 6th parameter.
	Emit final newline if MH_FMT_FORCENL is set, unless the last
	character output is newline.
	(mh_format_str): Rewrite function.
	(builtin_lit): Implement
	(builtin_friendly): Fix register assignment
	(builtin_addr): Pass R_ARG to R_REG verbatim, if it cannot be
	parsed as a RFC822 address.
	(builtin_decode): Don't clear str reg.
	(builtin_concat): Remove. The implementation contradicts the
	principles of the format VM; besides, the same functionality
	could be easily achieved by using ctls
	(builtin_tab): Put additional flags 
	* mh/fmtcheck.c (run): Update call to mh_format
	* mh/inc.c (list_message): Likewise. Emit warning about
	not-implemented audit feature.
	* mh/mh_list.c (_destroy_value): Remove spurious call to
	free().
	* mh/repl.c: Fix calls to mh_format and mh_format_parse.
	* mh/scan.c: Likewise.
	* mh/sortm.c: Likewise.

2017-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve cctype API.

	* include/mailutils/cctype.h (MU_CTYPE_IDENT)
	(MU_CTYPE_HEADR): New character classes.
	(mu_isident,mu_isheadr): New macros.
	* libmailutils/string/muctype.c: Mark valid identifier and
	header constituents as such.

2017-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix premature push.

2017-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Start rewriting MH format functions.

	* mh/fmtcheck.c: New option -disassemble
	* mh/mh.h: Move format-related declarations to mh_format.h
	(mh_format_parse): Change signature.
	(mh_format): Change signature. (mh_format_dump_code)
	(mh_format_dump_disass): New protos.
	(mh_decode_2047): Change signature.
	* mh/mh_fmtgram.y: Rewrite from scratch. First, build a parse
	tree, then use it to generate code.
	* mh/mh_format.c: Rewrite from scratch.
	* mh/mh_format.h: Move format-related declarations from mh.h
	* mh/mh_init.c (mh_decode_2047): Text is const.
	* mh/mh_list.c: Fix calls to mh_format_parse and related
	objects.

2017-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Start rewriting MH format functions.

	* mh/fmtcheck.c: New option -disassemble
	* mh/mh.h: Move format-related declarations to mh_format.h
	(mh_format_parse): Change signature.
	(mh_format): Change signature. (mh_format_dump_code)
	(mh_format_dump_disass): New protos.
	(mh_decode_2047): Change signature.
	* mh/mh_fmtgram.y: Rewrite from scratch. First, build a parse
	tree, then use it to generate code.
	* mh/mh_format.c: Rewrite from scratch.
	* mh/mh_format.h: Move format-related declarations from mh.h
	* mh/mh_init.c (mh_decode_2047): Text is const.
	* mh/mh_list.c: Fix calls to mh_format_parse and related
	objects.

2017-06-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	mh: determine output width automatically.

	* mh/fmtcheck.c: Take file name as optional argument. Run
	format on it, if supplied
	* mh/mh.h (mh_width): New proto.
	* mh/inc.c: Don't initialize width.
	* mh/mh_format.c (mh_format): Use mh_width, if width is 0.
	* mh/mh_list.c (mhl_format_run): Use mh_width, if width is 0.
	* mh/mh_init.c (mh_width): New function.
	* mh/repl.c: Likewise.
	* mh/scan.c: Likewise.
	* mh/sortm.c: Likewise. New option -width

2017-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revert previous commit.  Require gettext 0.19.

2017-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove gettext version requirement.

2017-06-20  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.2.93.

2017-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rework emitting source locations in sieve code.

	* include/mailutils/locus.h (mu_locus_point_eq): New function.
	* libmu_sieve/prog.c (mu_i_sv_code): Emit the
	_mu_i_sv_instr_locus if locus changed.
	(mu_i_sv_locus): Raise the changeloc flag and set the locus,
	instead of immediately emitting location change code.
	* libmu_sieve/runtime.c (_mu_i_sv_instr_locus): New function.
	(_mu_i_sv_instr_source,_mu_i_sv_instr_line)
	(_mu_i_sv_instr_col): Remove.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine) <changeloc>: New
	member.

2017-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in sieve library.

	* libmu_sieve/sieve-gram.y: Add missing assignment to $$ in
	testlist production. This fixes improper handling of anyof and
	allof

2017-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Commit missing file.

2017-06-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	API for formatting message sets on output.

	* libmailutils/msgset/print.c (mu_msgset_formats): New global.
	(mu_stream_msgset_format): New function.
	* include/mailutils/msgset.h (mu_msgset_format): New struct.
	(mu_msgset_fmt_imap, mu_msgset_fmt_mh): New defines.
	(MU_MSGSET_IGNORE_TRANSERR): New flag
	(mu_msgset_copy, mu_msgset_translate): New protos.
	(mu_stream_msgset_format, mu_msgset_imap_print): New protos.
	(mu_msgset_print): Deprecate.
	* libmailutils/imapio/sendmsgset.c: Use mu_msgset_imap_print
	instead of mu_msgset_print.
	* mu/libexec/imap.c: Likewise.
	* libmailutils/msgset/Makefile.am: Add copy.c
	* libmailutils/msgset/add.c (mu_msgset_add_range): Translate if
	message set mode doesn't match the requested one.
	* libmailutils/msgset/sub.c (mu_msgset_sub_range): Likewise.
	* libmailutils/msgset/trans.c (_mu_msgset_translate_pair): Act
	according to the mode argument.
	(mu_msgset_translate): New function.
	* libmailutils/tests/msgset.c: New option -mh
	* mh/mh_sequence.c (write_sequence): Rewrite.
	* testsuite/msgset.c: Optionally translate uids to msgnums and
	vice-versa.

2017-06-18  Sergey Poznyakoff  <gray@gnu.org>

	refile: eliminate refiled messages from all sequences.

	* mh/Makefile.am: Add seqelim.c
	* mh/mh.h (mh_sequences_elim): New proto.
	* mh/seqelim.c: New file.
	* mh/refile.c (main): Fixup sequences after refiling.
	* mh/rmm.c: Fixup sequences using mh_sequences_elim

2017-06-18  Sergey Poznyakoff  <gray@gnu.org>

	linetrack: handle #line directives without file name.

	* include/mailutils/diag.h (mu_vdiag_at_locus_range): New
	proto.
	* libmailutils/locus/linetrack.c (mu_linetrack_origin): accept
	locus point with mu_file==NULL. Reuse current file name in this
	case. This is to simplify handling of #line directives without
	file name.
	* libmailutils/tests/linetrack.c: Implement #line directive.
	* libmailutils/tests/linetrack.at: Add new test.

2017-06-18  Sergey Poznyakoff  <gray@gnu.org>

	Improve line tracker.

	The new version is able to hold input history from several
	source lines, which makes it easier to implement #line
	directives in lexers.

	* include/mailutils/locus.h (mu_linetrack_stat): Remove
	start_line
	(mu_linetrack_origin): New proto.
	* libmailutils/locus/linetrack.c: Improve indexing. Keep track
	of several input files.
	* libmailutils/tests/linetrack.at: Add new tests.
	* libmailutils/tests/linetrack.c: Improve command set. 
	* mimeview/grammar.y (make_node): Initialize locus

2017-06-17  Sergey Poznyakoff  <gray@gnu.org>

	Minor change in the testsuite.

	* mh/tests/send.at: Make expected text version-independent

2017-06-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.2.92.

2017-06-15  Sergey Poznyakoff  <gray@gnu.org>

	Make sure all loci are properly initialized before first use.

	Clean up semantics of initializers. Each locus type can be
	initialized either statically (by assigning the
	MU_LOCUS_*_INITIALIZER macro), or dynamically (by calling
	mu_locus_*_init function). Whatever method is used, it is
	important that it be initialized prior to using any other
	mu_locus_* function.

	* include/mailutils/locus.h (mu_locus_point_init): Takes single
	argument. Returns nothing.
	(mu_locus_range_init): New proto.
	* libmailutils/locus/locus.c (mu_locus_point_init): Rewrite.
	(mu_locus_range_init): New function.
	* libmailutils/cfg/parser.y (mu_cfg_alloc_node): Initialize
	locus.
	* libmailutils/tests/logstr.c: Fix printf argument types.
	* libmu_sieve/extensions/moderator.c
	(moderator_filter_message): Initialize locus.
	* libmu_sieve/sieve-gram.y (node_alloc): Likewise.
	* mu/libexec/logger.c (parse_locus_point, set_locus): Likewise.

2017-06-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix id reference counting.

	* include/mailutils/locus.h: Add copyleft.
	(mu_ident_stat): New proto.
	* include/mailutils/types.hin (mu_locus_DEPRECATED): Update
	commit. Include link to the wiki article.
	* include/mailutils/yyloc.h: Add copyleft.
	* libmailutils/locus/ident.c (mu_ident_stat): New function.
	* libmailutils/locus/locus.c (mu_locus_point_init)
	(mu_locus_point_copy): Don't touch destination unless setting
	mu_file member succeeds.
	(mu_locus_range_copy): deinitialize dest before assignment.
	* libmailutils/stream/logstream.c (_log_write): Use
	mu_locus_range_copy to save locus.
	(mu_ioctl_logstream_get_locus_deprecated)
	(mu_ioctl_logstream_set_locus_deprecated): Include link to the
	wiki article.
	* libmailutils/tests/linetrack.c (main): Destroy tracker before
	exiting.
	* libmailutils/tests/logstr.c: Make it possible to run selected
	tests.

2017-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Require bison and flex.

	These are needed only during development cycle, as the created
	sources are included in the tarball.

	* am/bison.m4: New file.
	* am/flex.m4: New file.
	* configure.ac: Use MU_PROG_BISON and MU_PROG_FLEX
	* mu-aux/gylwrap: Drop support for alternative command line
	syntax and the --stdout option.

2017-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Provide backward compatibility layer for deprecated functions.

	* include/mailutils/sieve.h (mu_sieve_compile_text): New proto.
	(mu_sieve_compile_buffer): Backward-compatible proto.
	* include/mailutils/stream.h
	((MU_IOCTL_LOGSTREAM_GET_LOCUS_DEPRECATED)
	(MU_IOCTL_LOGSTREAM_SET_LOCUS_DEPRECATED): New defines.
	(MU_IOCTL_LOGSTREAM_GET_LOCUS)
	(MU_IOCTL_LOGSTREAM_SET_LOCUS): Use external functions to make
	sure any references to these are marked as deprecated.
	* include/mailutils/types.hin (mu_locus_DEPRECATED): New
	struct.
	(mu_locus): Define to mu_locus_DEPRECATED
	* libmailutils/stream/logstream.c (_log_ctl): Handle the
	deprecated ctls.
	* libmu_sieve/extensions/moderator.c
	(moderator_filter_message): Use mu_sieve_compile_text.
	* libmu_sieve/sieve-gram.y (mu_sieve_compile_buffer): Rename to
	mu_sieve_compile_text. Re-introduce it as a
	backward-compatibility API.
	* sieve/sieve.c: Call mu_sieve_compile_text instead of
	mu_sieve_compile_buffer.

2017-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Lex-related fixes.

	* mu-aux/gylwrap (@yysym): Add more symbols from lex.
	* mh/mh_alias_lex.l (mh_alias_read): Return meaningful value.

2017-06-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* libmu_sieve/sieve-lex.l: Allocate new ctx structure (restore
	accidentally deleted file.
	* libmailutils/locus/debug.c: Add missing copyleft.
	* libmailutils/locus/genprloc.c: Likewise.
	* libmailutils/locus/ident.c: Likewise.
	* libmailutils/locus/linetrack.c: Likewise.
	* libmailutils/locus/locus.c: Likewise.
	* mu-aux/gencl: Likewise.
	* mu-aux/gitinfo: Likewise.
	* mu-aux/gylwrap: Likewise.

2017-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch mh_aliases to line tracker.

	* mh/mh.h (ali_parse_error): Remove.
	* mh/mh_alias_gram.y: Simplify parser. Use location tracking.
	* mh/mh_alias_lex.l: Switch to mu_linetrack facility
	* mh/tests/ali.at: Update expected location.

2017-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Try to display exact error locations in Sieve diagnostics.

	* include/mailutils/sieve.h (mu_sieve_value_t)<locus>: New
	field.
	* libmu_sieve/util.c (mu_sieve_value_create): Take a pointer to
	mu_locus_range. Use it to initialize the locus field.
	* libmu_sieve/sieve-gram.y: Pass loci in calls to
	mu_sieve_value_create.
	* libmu_sieve/actions.c: Use the most specific locus when
	displaying the message.
	* libmu_sieve/comparator.c: Likewise.
	* libmu_sieve/prog.c: Likewise.
	* libmu_sieve/variables.c: Likewise.
	* sieve/tests/i-numeric.at: Update the expected error location.

2017-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite Makefile rules for lex and bison.

	The aim is to get rid of the explicit rules and use the
	Automake framework as much as possible, without hurting the
	flexibility. To this effect, the gylwrap tool is rewritten from
	scratch (in Perl). In compatibility mode it takes the same
	arguments as the standard ylwrap. Additional configuration is
	supplied in the configuration file gylwrap.conf, located in the
	directory where the input file resides.

	* mu-aux/gylwrap: Rewrite from scratch.
	* configure.ac (MU_YLWRAP): New subst variable.
	* libmailutils/base/.gitignore: Update.
	* libmailutils/base/Makefile.am: Update.
	* libmailutils/base/gylwrap.conf: New file.
	* libmailutils/cfg/.gitignore: Update.
	* libmailutils/cfg/Makefile.am: Use new YLWRAP
	* libmailutils/cfg/cfg.h: Remove.
	* libmailutils/cfg/gylwrap.conf: New file.
	* libmailutils/cfg/lexer.l: Include mailutils/yyloc.h directly.
	* libmailutils/cfg/parser.y: Likewise.
	* libmu_sieve/Makefile.am: Use new YLWRAP
	* libmu_sieve/gylwrap.conf: New file.
	* libmu_sieve/sieve.y: Rename to libmu_sieve/sieve-gram.y
	* libmu_sieve/sieve.l: Rename to libmu_sieve/sieve-lex.l
	* mail/Makefile.am: Use new YLWRAP
	* mh/.gitignore: Update.
	* mh/Makefile.am: Use new YLWRAP
	* mh/gylwrap.conf: New file.
	* mh/mh_alias.y: Rename to mh/mh_alias_gram.y
	* mh/mh_alias.l: Rename to mh/mh_alias_lex.l
	* mh/pick.y: Rename to mh/pick-gram.y
	* mimeview/.gitignore: Update.
	* mimeview/Makefile.am: Use new YLWRAP
	* mimeview/mimetypes.y: Rename to mimeview/grammar.y
	* mimeview/gylwrap.conf: New file.
	* mimeview/mimetypes.l: Rename to mimeview/lexer.l
	* po/POTFILES.in: Update

2017-06-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to new locus types.

	* include/mailutils/types.hin (mu_locus): Remove. 
	* include/mailutils/diag.h (mu_diag_at_locus): Remove.
	(mu_diag_at_locus_point,mu_diag_at_locus_range): New protos.
	* include/mailutils/mailutils.h: Include locus.h 
	* include/mailutils/stream.h (MU_IOCTL_LOGSTREAM_GET_LOCUS)
	(MU_IOCTL_LOGSTREAM_SET_LOCUS): Remove.
	* libmailutils/stream/logstream.c (_log_ctl): Reflect this.
	* libmailutils/tests/logstr.at: Remove the related test.
	* libmailutils/tests/logstr.c: Ditto. 
	* libmailutils/cfg/Makefile.am: Add new header.
	* libmailutils/cfg/cfg.h: New file.
	* libmailutils/cfg/format.c: Use mu_locus_range
	* libmailutils/cfg/lexer.l: Use the mu_linetrack facility
	* libmailutils/cfg/parser.y: Likewise.
	* libmailutils/diag/diag.c (mu_diag_at_locus): Remove.
	(mu_diag_at_locus_point,mu_diag_at_locus_range): New protos. 
	* comsat/action.c: Use mu_locus_point and mu_locus_range
	instead of the removed mu_locus.
	* include/mailutils/auth.h: Likewise.
	* include/mailutils/cfg.h: Likewise.
	* include/mailutils/sieve.h: Likewise.
	* libmailutils/base/wicket.c: Likewise.
	* libmailutils/tests/wicket.c: Likewise.
	* libmu_auth/radius.c: Likewise.
	* libmu_sieve/actions.c: Likewise.
	* libmu_sieve/comparator.c: Likewise.
	* libmu_sieve/extensions/moderator.c: Likewise.
	* libmu_sieve/mem.c: Likewise.
	* libmu_sieve/prog.c: Likewise.
	* libmu_sieve/require.c: Likewise.
	* libmu_sieve/runtime.c: Likewise.
	* libmu_sieve/sieve-priv.h: Likewise.
	* libmu_sieve/sieve.l: Use the mu_linetrack facility.
	* libmu_sieve/sieve.y: Likewise.
	* libmu_sieve/util.c: Use mu_locus_point and mu_locus_range
	instead of the removed mu_locus
	* libmu_sieve/variables.c: Likewise.
	* mail/source.c: Likewise.
	* mu/libexec/dbm.c: Likewise.
	* mu/libexec/logger.c: Likewise.
	* mu/libexec/wicket.c: Likewise.
	* sieve/sieve.c: Likewise.
	* sieve/tests/i-numeric.at: Update expected locations

2017-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve linetrack interface.

	* include/mailutils/locus.h (mu_linetrack_rebase): New proto.
	* libmailutils/locus/linetrack.c (mu_linetrack_rebase): New
	function.
	* libmailutils/diag/diag.c (mu_diag_at_locus_range): New
	function.

2017-06-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch mimeview to new locus and linetracker.

	* include/mailutils/locus.h (mu_stream_print_locus_point): New
	proto.
	(mu_locus_range_copy): New proto.
	* include/mailutils/yyloc.h (mu_file_print_locus_point)
	(mu_file_print_locus_range): New protos.
	(YY_LOCATION_PRINT): Redo using mu_file_print_locus_range.
	* libmailutils/locus/filprloc.c: New file.
	* libmailutils/locus/genprloc.c: New file.
	* libmailutils/locus/strprloc.c: New file.
	* libmailutils/locus/Makefile.am: Add new files.
	* libmailutils/locus/debug.c (mu_stream_print_locus_range):
	Remove. Declared elsewhere.
	* libmailutils/locus/linetrack.c: use mu_locus_point_set_file,
	instead of mu_locus_point_init.
	* libmailutils/locus/locus.c: Likewise. (mu_locus_range_copy)P:
	New function.
	* mimeview/mimetypes.l: Provide rule for \n in ARGSTRING Always
	print diagnostics before returning BOGUS
	(lex_next_rule): Rewrite. Print verbose diagnostics if
	app.trace6 is set.
	(mimetypes_close): Deinitialize yylloc.
	* mimeview/mimetypes.y: Catch the BOGUS token. Adjust conflict
	expectation. Properly reference assigned loci.
	(mimetypes_parse): Return 1 if any errors detected.
	* mimeview/mimeview.c: Use debug category app instead of mime.
	* mimeview/tests/testsuite.at: Add new tests.
	* libmailutils/stream/logstream.c (_log_done): Deinitialize
	locus range.

2017-06-12  Sergey Poznyakoff  <gray@gnu.org>

	Start switching lexers to the new line tracker facility.

	* include/mailutils/locus.h (MU_LOCUS_POINT_INITIALIZER): New
	define
	(MU_LOCUS_RANGE_INITIALIZER): New define
	(mu_locus_point_set_file, mu_locus_point_init)
	(mu_locus_point_deinit, mu_locus_point_copy)
	(mu_locus_range_deinit): New protos
	* libmailutils/locus/locus.c: New file.
	* libmailutils/locus/Makefile.am: Add new file.
	* libmailutils/locus/linetrack.c (mu_linetrack_at_bol): New
	function.
	(mu_linetrack_locus): New function.
	(mu_linetrack_advance): Use mu_locus_point_set_file to set the
	mu_file field.
	* libmailutils/tests/linetrack.c: Initialize and deinitialize
	locus range.
	* mimeview/mimetypes.l: switch to line tracker
	* mimeview/mimeview.h: Use defines from yyloc.h

2017-06-11  Sergey Poznyakoff  <gray@gnu.org>

	Fix the -nodraftfolder and -nowhatnowproc options.

	The commit 744c4a9c didn't take into account the -nodraftfolder
	and -nowhatnowproc options, which can be used to cancel the
	effect of the corresponding facilities. This commit fixes it.

	* mh/mh_getopt.c (mh_getopt_ext): New function.
	* mh/mh_getopt.h (mh_getopt_ext): New prototype.
	(mh_optinit): New struct. 
	* mh/tests/comp.at: Test the use of Draft-Folder
	* mh/tests/forw.at: Likewise.
	* mh/tests/repl.at: Likewise. 
	* mh/comp.c (main): use mh_getopt_ext to properly process
	draftfolder and whatnowproc.
	* mh/forw.c: Likewise.
	* mh/repl.c: Likewise. 
	* mh/mh.h (mh_whom): Remove.
	(mh_whom_header, mh_whom_file, mh_whom_message): New protos.
	* mh/mh_alias.y (mh_read_aliases): Don't read aliases twice.
	* mh/mh_whatnow.c (whom): Use mh_whom_file.
	* mh/mh_whom.c (mh_whom): Rewrite and rename to mh_whom_file.
	(mh_whom_header, mh_whom_message): New functions. 
	* mh/whom.c: Use mh_getopt_ext. Interpret command line
	arguments, depending on whether the draftfile facility is in
	use.

2017-06-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix processing of abbreviated negated boolean options.

	It was noted that "mhn -nohead" did not suppress the output of
	headers as "mhn -noheaders" did. It turned out that the
	negation marker was overwritten while scanning options for
	possible matching alternatives. This patch fixes it.

	* libmailutils/opt/opt.c (find_long_option): Don't overwrite
	the negation attribute of the last found option. 
	* libmailutils/tests/parseopt.c: New option --headers, to test
	the fix.
	* libmailutils/tests/parseopt28.at: New testcase.
	* libmailutils/tests/Makefile.am: Add new testcase.
	* libmailutils/tests/testsuite.at: Include new testcase. 
	* libmailutils/tests/parseopt*.at: Trivial changes

2017-06-08  Sergey Poznyakoff  <gray@gnu.org>

	Re-use last invoked editor in MH whatnow.

	This fixes a bug introduced in d30e5a07

	* mh/mh.h (mh_whatnow_env) <last_ed>: New member
	* mh/mh_whatnow.c (_whatnow): Initialize reedit and last_ed
	members Free last_ed before returning
	(edit): Prefer wh->last_ed over wh->editor

2017-06-08  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix in mh_whatnow.

	* mh/mh_whatnow.c (edit): Disable command expansion in
	wordsplit. See also 491bec23.

2017-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rename mu_locus_tracker to mu_linetrack.

2017-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Silence remaining *.[yl] rules in Makefiles.

2017-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Include new headers to the distribution.

2017-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve locus tracker; provide a testsuite.

	* include/mailutils/locus.h (mu_locus_track_stat): New struct.
	(mu_locus_tracker_stat): New proto.
	(mu_locus_tracker_retreat): Change return type.
	* libmailutils/locus/debug.c (mu_stream_vlprintf): Don't print
	spurious \n.
	(mu_lrange_debug): Fix incorrect call.
	* libmailutils/locus/tracker.c (mu_locus_track_create):
	Allocate storage for at least two lines of text.
	(mu_locus_tracker_stat): New function.
	(mu_locus_tracker_advance): Handle empty lines
	(mu_locus_tracker_retreat): Add error handling.
	* libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add
	locktrack.
	* libmailutils/tests/tracker.c: Rename to loctrack.c
	* libmailutils/tests/testsuite.at: Add new testcase.
	* libmailutils/tests/loctrack.at: New test case.

2017-06-08  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix in mh_whatnow.

2017-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix logstream to support mu_locus_range.

	* include/mailutils/locus.h (mu_stream_print_locus_range)
	(mu_stream_vlprintf, mu_stream_lprintf, mu_lrange_debug): New
	protos.
	* include/mailutils/stream.h
	(MU_IOCTL_LOGSTREAM_GET_LOCUS_RANGE)
	(MU_IOCTL_LOGSTREAM_SET_LOCUS_RANGE): New ioctls.
	* include/mailutils/sys/logstream.h (_mu_log_stream): Replace
	locus with struct mu_locus_range locrange.
	* libmailutils/locus/debug.c: Rewrite.
	* libmailutils/locus/ident.c (mu_ident_ref): Accept NULL
	argument. Fix initialization.
	(mu_ident_deref): Accept NULL argument.
	* libmailutils/stream/logstream.c: Rewrite.
	* libmailutils/tests/.gitignore: Update.
	* libmailutils/tests/Makefile.am: Add new tests.
	* libmailutils/tests/testsuite.at: Likewise.
	* libmailutils/tests/logstr.at: New testcase.
	* libmailutils/tests/logstr.c: New file.
	* libmailutils/tests/xscript.at: Minor change.
	* sieve/tests/i-numeric.at: Minor change.

2017-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix tests when logical and physical CWD differ.

	MH testsuite produced false negatives when run in a directory
	accessed by its logical name (symlink). To fix this, avoiding
	at the same time the use of non-portable "pwd -P" & "pwd -L",
	this commit adds a filter utility that replaces both logical
	and physical cwd with a dot on output. The MH testsuite is
	updated to use this utility.

	* testsuite/cwdrepl.c: New utility
	* testsuite/Makefile.am: Build cwdrepl
	* testsuite/.gitignore: Update.
	* testsuite/cwdrepl.at: New test.
	* testsuite/testsuite.at: Include new test. 
	* mh/tests/atlocal.in (PATH): Add testsuite
	(remove_curdir): Remove function.
	* mh/tests/comp.at: Use cwdrepl, fix expected output.
	* mh/tests/forw.at: Likewise.
	* mh/tests/mhn.at: Likewise.
	* mh/tests/mhpath.at: Likewise.
	* mh/tests/repl.at: Likewise.

2017-06-07  Sergey Poznyakoff  <gray@gnu.org>

	Begin implementing liblocus.

	Liblocus is a part of libmailutils that will provide functions
	for manipulating source file locations, for use in lexers,
	grammars, etc. This will expand the functionality of the
	mu_locus type and logstreams.

	* configure.ac: add libmailutils/locus/
	* include/mailutils/assoc.h (mu_assoc_install_ref2): New proto.
	* libmailutils/base/assoc.c (mu_assoc_install_ref2): New entry
	point.
	* libmailutils/base/copyfile.c (copy_regular_file): Add
	typecasts.
	* libmailutils/Makefile.am: Build liblocus
	* libmailutils/locus/Makefile.am: New file.
	* libmailutils/locus/debug.c: New file.
	* libmailutils/locus/ident.c: New file.
	* libmailutils/locus/tracker.c: New file.
	* libmailutils/tests/Makefile.am: New file.
	* libmailutils/tests/tracker.c: New file.

2017-06-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* mh/mh_whatnow.c (edit): Initialize ws.ws_env

2017-06-03  Sergey Poznyakoff  <gray@gnu.org>

	mimeview: improve parser error recovery.

	* mimeview/Makefile.am: Silent rules
	* mimeview/mimetypes.l (lex_reset): Remove.
	(lex_next_rule): New function.
	* mimeview/mimetypes.y: Expect 12 shift/reduce conflicts.
	Rewrite the error rule
	(yyprint): Print TYPE token correctly
	* mimeview/mimeview.h (lex_next_rule): New proto.

2017-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	mh whatnow: allow for arguments in the editor profile value.

	* mh/mh_whatnow.c (edit): Make sure ed is always initialized.
	Accept command line arguments in the "editor" and "*-next"
	values.

2017-06-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	New wordsplit call: mu_worsplit_append.

	* include/mailutils/wordsplit.h (mu_wordsplit_append): New
	proto.
	* libmailutils/string/wordsplit.c (mu_wordsplit_append): New
	function.
	* libmailutils/tests/wordsplit.at: Two more tests cases for
	mu_wordsplit_append.
	* libmailutils/tests/wsp.c: Accept extra arguments to append
	using the new function.

2017-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revise the mime.types lexer; provide the testsuite.

	* am/testsuite.m4: New file.
	* configure.ac: Use the MU_CONFIG_TESTSUITE macro.
	* mimeview/Makefile.am (SUBDIRS): Add tests
	* mimeview/mimetypes.l: Rewrite in three exclusive states.
	* mimeview/mimetypes.y: Simplify grammar.
	* mimeview/mimeview.c: New option --identify (-i).
	* mimeview/mimeview.h: Update. 
	* mimeview/tests/Makefile.am: New file.
	* mimeview/tests/atlocal.in: New file.
	* mimeview/tests/bf.c: New file.
	* mimeview/tests/testsuite.at: New file. 
	* README: Update.
	* doc/texinfo/programs.texi

2017-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* mimeview/mimetypes.y (compare_bytes): Fix improper read size

2017-05-31  Sergey Poznyakoff  <gray@gnu.org>

	Fix whatnow edit command.

	In whatnow shell, edit [program [parameters]] now calls program
	with supplied parameters plus the name of the file to edit.

	* mh/mh.h (mh_whatnow_env) <reedit>: New member.
	* mh/mh_whatnow.c (edit): Rewrite.
	* mh/whatnow.c (main): Properly handle argv[1]
	* NEWS: Update.

2017-05-31  Sergey Poznyakoff  <gray@gnu.org>

	mh: check Local-Mailbox setting.

	* mh/mh_init.c (mh_my_email): If Local-Mailbox is set, use its
	value.
	* mh/tests/scan.at: Add test for Local-Mailbox.

2017-05-31  Sergey Poznyakoff  <gray@gnu.org>

	Fix MH initialization order.

	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.

2017-05-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve mimeview.

	Old short option '-t' renamed to '-f' for consistency (-f
	stands for --file in most other utilities). Thus, 'mimeview -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.*

2017-05-26  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes in MH show.

	* 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

2017-05-26  Sergey Poznyakoff  <gray@gnu.org>

	Implement mu_msgset_first and mu_msgset_last.

	* 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.

2017-04-22  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* mh/etc/Makefile.am (bindir): Override. Reported by Ken Brown
	<kbrown@cornell.edu>

2017-04-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Functions for formatting RFC-2231-compliant mail headers
	fields.

	* 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.

2017-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

	* mail/mail.h: Remove unneeded extern qualifiers.

2017-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Automatically handle native character sets on input to the mail
	utility.

	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.

2017-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	mail: use mailvar_is_true to test boolean values.

2017-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	New option --mime.

	* 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.

2017-04-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes.

	* 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

2017-04-18  Sergey Poznyakoff  <gray@gnu.org>

	fix a typo.

2017-04-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix semantics of mu_header_set_value and creation of
	multipart/alternative MIME.

	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.

2017-04-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/base/assoc.c (merge_sort): Fix last argument in
	call to cmp.

2017-04-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Send multipart/alternative messages using mail.

	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.

2017-04-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite the mailutils tool.

	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.

2017-04-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/cfg/parser.y (mu_cfg_find_node): Fix spurious
	error diagnostics when the node is not found.

2017-04-09  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.2.91.

2017-04-09  Sergey Poznyakoff  <gray@gnu.org>

	Remove the Scheme implementation of the Sieve language.

	* NEWS: Describe the change.
	* doc/texinfo/mailutils.texi: Remove description of sieve2scm
	* doc/texinfo/programs.texi: Likewise.
	* scheme/Makefile.am: Remove sieve2scm.
	* scheme/mimeheader.scm: Remove.
	* scheme/numaddr.scm: Remove.
	* scheme/redirect.scm: Remove.
	* scheme/reject.scm: Remove.
	* scheme/sieve-core.scm: Remove.
	* scheme/sieve2scm.scmi: Remove.
	* scheme/vacation.scm: Remove.

2017-04-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	movemail: implement --progress-meter option.

2017-04-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve generation of session identifiers for server programs.

	* 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.

2017-04-07  Sergey Poznyakoff  <gray@gnu.org>

	Fix links in HTML doc generator.

	* doc/texinfo/gendocs_template: Fix links.
	* doc/texinfo/html.init: Fix the Documentation link.

2017-04-06  Sergey Poznyakoff  <gray@gnu.org>

	Improve AM_GNU_MAILUTILS autoconf macro.

	* 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.

2017-04-06  Sergey Poznyakoff  <gray@gnu.org>

	Minor improvement in gitinfo.h production.

	* 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.

2017-04-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Ensure stability of merge sort in assoc.

	* libmailutils/base/assoc.c (merge): Fix comparison

2017-04-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Another improvement in gencl.

	* mu-aux/gencl: New option --email.
	* Makefile.am: Simplify the ChangeLog command. Use the --email
	option.

2017-04-03  Sergey Poznyakoff  <gray@gnu.org>

	Minor improvements in gencl.

	* mu-aux/gencl: Don't use Time::ParseDate. Work over bug in
	Text::Wrap 2012.0818. New option --ignore-errors (-i). Ensure
	consistent error code.
	* Makefile.am (dist-hook): Relax checking for intermediate
	releases.

2017-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite gencl as an enhanced replacement of
	gitlog-to-changelog.

	* mu-aux/gencl: Rewritten as a replacement for
	gitlog-to-changelog.
	* ChangeLog.amend: More spell fixes.
	* Makefile.am: Use gencl instead of gitlog-to-changelog.
	* doc/ChangeLog.CVS: Spell checking
	* gnulib.modules: Remove gitlog-to-changelog.

2017-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Test transcript streams.

	* 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.

2017-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Tiny fix.

	* include/mailutils/debug.h (MU_ASSERT): Prefix local variable
	name with two underscores to diminish the probability of
	shadowing.

2017-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Make sure ChangeLog is built by make.

	* 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.

2017-03-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/stream/xscript-stream.c (print_transcript):
	Print closing double-quote after user name in LOGIN statement.

2017-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve maintainer scripts.

	* Makefile.am (alpha,alphacheck): Update rules.
	* mu-aux/gitinfo.pl: Obtain more data.

2017-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

2017-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes in NLS code.

	* libmailutils/base/lcall.c (mu_lc_all_free): Use str->flags to
	determine what fields need to be freed.
	(mu_parse_lc_all): Force retrieving language and territory if
	charset is requested. Use this to provide a default value, in
	case charset cannot be determined. Deallocate the surplus data
	afterward
	* libmailutils/base/locale.c (mu_charset_lookup): Bugfix.
	* mail/util.c (util_rfc2047_decode): Avoid memory leak.

2017-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix imap4d testsuite.

	The tests failed if MU_DEFAULT_SCHEME were set to anything, but
	mbox.

	* imap4d/tests/atlocal.in (make_config): set
	.mailbox.mailbox-type=mbox.
	* imap4d/list.c (imap4d_list): Use %s as the format.

2017-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	More fixes to mu_cfg_field_map (see afbb33cf).

	* libmailutils/cfg/driver.c (mu_cfg_field_map): Use correct
	enumeration function depending on the element type. Return
	meaningful error.

2017-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Housekeeping: implement a tool for producing intermediate alpha
	tarballs.

	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.

2017-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix pop3d command parser (complement afda9ba4)

	* 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.

2017-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	New itrctl request: mu_itrctl_count.

	* 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.

2017-03-19  Sergey Poznyakoff  <gray@gnu.org>

	Fix a bug in field-map handling.

	* libmailutils/cfg/driver.c (parse_mapping): Fix expected value
	type.
	* libmu_auth/sql.c (get_field): Remove left-over mu_assoc_ref
	call (see 622bc770).

2017-03-18  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite TLS support.

	The new implementation allows for per-server certificates.

	* libmu_auth/Makefile.am: Build tls support depending on the
	value of MU_COND_GNUTLS.
	* libmu_auth/notls.c: New file.
	* libmu_auth/tls.c: Rewrite.
	* libmu_auth/tlsiostr.c: New file.
	* libmu_auth/tlsvar.c: New file.
	* libmu_auth/tlsconf.c: New file. 
	* include/mailutils/sys/tls-stream.h (_mu_tls_stream): New
	members: session_type, conf, cred.
	(mu_tls_io_stream_create): New proto.
	* include/mailutils/tls.h (mu_tls_module_config): Remove
	definition.
	(mu_tls_config): New structure.
	(mu_tls_server_stream_create): Remove proto.
	(mu_tls_cert_file_checks) (mu_tls_key_file_checksr)
	(mu_tls_ca_file_checks): New globals (MU_TLS_CERT_FILE_CHECKS)
	(MU_TLS_KEY_FILE_CHECKS)
	(MU_TLS_CA_FILE_CHECKS): New defines.
	(mu_tls_stream_create): New proto.
	(mu_tls_config_status): New constants.
	(mu_tls_check_config): Remove.
	(mu_tls_config_check): New function. 
	* include/mailutils/server.h (mu_m_server_preflight_fp): New
	typedef.
	(mu_m_server_set_preflight): New proto. 
	* libmailutils/diag/debcat (tls): New category.
	* libmailutils/server/ipsrv.c (mu_ip_server_get_data): New
	function.
	* libmailutils/server/msrv.c (_mu_m_server) <preflight>: New
	method.
	(mu_m_server_set_preflight): New function.
	(mu_m_server_destroy): Destroy the srvlist.
	(open_connection): New function.
	(mu_m_server_run): Remove from srvlist only those servers that
	failed to open. Run preflight check, if registered. 
	* include/mailutils/cfg.h (mu_cfg_section): New member: data.
	* libmailutils/cfg/driver.c (dup_container): Copy the "data"
	pointer.
	(mu_cfg_section_add_params): Preserve original pointer and
	offset when necessary.
	* libmailutils/cfg/parser.y (_scan_tree_helper): Use the
	section data pointer (if set) as data target. 
	* configure.ac (MU_COND_GNUTLS): New conditional.
	* imap4d/commands.c: Remove #ifdef WITH_TLS preprocessor
	conditional.
	* imap4d/imap4d.c (tls_mode): Remove variable.
	(imap4d_srv_config): Move definition to the header file. Remove
	#ifdef WITH_TLS preprocessor conditionals. Rename the tls
	configuration statement to tls-mode. Add new subsection
	.server.tls; Remove the legacy tls-required configuration
	statement.
	(imap4d_mainloop): Change signature: take a pointer to the
	struct imap4d_srv_config as the 3rd argument, Use the
	cfg->tls_mode member to decide on TLS state.
	(main): Call mu_tls_cfg_init. Install server preflight checker.
	* imap4d/imap4d.h: Remove #ifdef WITH_TLS preprocessor
	conditionals.
	(imap4d_srv_config): Moved from imap4d.c New member: tls_conf
	(imap4d_session): New member: tls_conf
	(global_tls_conf): New global.
	(io_setio, imap4d_init_tls_server): Change prototypes.
	* imap4d/io.c (io_setio): Change signature: take a pointer to
	the struct mu_tls_config as the 3rd argument. Rewrite TLS
	support.
	(imap4d_init_tls_server): Take a pointer to the struct
	mu_tls_config.
	* imap4d/starttls.c (tls_available, tls_done): Remove globals.
	(global_tls_conf): New global.
	(imap4d_starttls): Keep TLS state in the session.
	(tls_encryption_on): Likewise.
	(starttls_init): Rewrite as a mserver preflight check function. 
	* pop3d/capa.c: Remove #ifdef WITH_TLS preprocessor
	conditional.
	(capa_stls): Rewrite.
	* pop3d/cmd.c (global_tls_conf): New global.
	(stls_preflight): New function.
	(pop3d_error_string): Rewrite using char ** array.
	* pop3d/extra.c (pop3d_setio): Take a pointer to struct
	mu_tls_config as the 3rd argument. Decide on TLS using it.
	(pop3d_init_tls_server): Take a pointer to struct
	mu_tls_config.
	* pop3d/pop3d.c: Rename the tls configuration statement to
	tls-mode. Add new subsection .server.tls; Remove the legacy
	tls-required configuration statement. (pop3d_mainloop) Take a
	pointer to struct mu_tls_config as the 3rd argument. Decide on
	TLS using it.
	(main): Call mu_tls_cfg_init. Install server preflight check.
	* pop3d/pop3d.h (pop3d_session): New member tls_conf.
	(pop3d_srv_config): New definition.
	(global_tls_conf): New extern.
	* pop3d/stls.c: Rewrite TLS support. 
	* NEWS: Document new features.
	* configure.ac: Version 3.2.90.
	* doc/texinfo/programs.texi: Update.

2017-03-11  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes.

2017-03-11  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.2.

2017-03-06  Sergey Poznyakoff  <gray@gnu.org>

	Fix NULL dereference.

	* libmailutils/mime/mimehdr.c (mu_mime_param_free): Check if
	argument is NULL.

2017-02-18  Sergey Poznyakoff  <gray@gnu.org>

	'Q' encoding: encode question mark properly; limit length of
	encoded words.

	* libmailutils/base/rfc2047.c (mu_rfc2047_encode): Limit length
	of encoded word to 75 bytes.
	* libmailutils/filter/qpflt.c: Treat '?' as special character
	in Q encoder.
	* libmailutils/tests/encode2047.at: Add more tests.
	* libmailutils/tests/encode2047.c: Use mailutils string I/O

2017-02-17  Sergey Poznyakoff  <gray@gnu.org>

	Fix memory leak in mu_stream_destroy.

	* libmailutils/stream/stream.c (mu_stream_destroy): Free buffer
	space.
	(mu_stream_set_buffer,mu_stream_getdelim): Use stdlib
	allocation functions instead of mu wrappers.

2017-02-17  Sergey Poznyakoff  <gray@gnu.org>

	Fix handling of ambiguous command line options.

	The approach used so far failed to recognize ambiguous
	abbreviations located in different groups. It also didn't work
	when MU_PARSEOPT_NO_SORT was requested. This commit fixes it by
	keeping an additional array of indices to long options. The
	array is sorted so that its elements produce a
	lexicographically ascending list of long options.

	* include/mailutils/opt.h (mu_parseopt): New members
	po_longcnt, po_longidx keep a sorted array of indices to
	po_optv with long options.
	* libmailutils/opt/opt.c (find_long_option): Iterate over
	po_longidx.
	(parseopt_init): Initialize and sort po_longidx.
	(mu_parseopt_free): Free po_longidx. 
	* libmailutils/tests/parseopt.c: Add three more potentially
	ambiguous options
	* libmailutils/tests/parseopt26.at: New testcase.
	* libmailutils/tests/parseopt27.at: New testcase.
	* libmailutils/tests/Makefile.am: Add new testcases.
	* libmailutils/tests/testsuite.at: Likewise.

2017-02-05  Sergey Poznyakoff  <gray@gnu.org>

	Remove unneeded file.

	* sieve/examples/.gitignore: Remove.

2017-01-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: add a locus indicating end of input.

	The new node type mu_sieve_node_end is introduced to explicitly
	mark end of the parse tree. When generating code, this node
	triggers insertion of _mu_i_sv_instr_source/_mu_i_sv_instr_line
	before the end of code marker. This, in turn, ensures that a
	correct location is reported for implicit keep, if logging is
	enabled.

	* libmu_sieve/sieve-priv.h (mu_sieve_node_end): New node type.
	(mu_sieve_node_list): New type (from struct node_list in
	sieve.y)
	* libmu_sieve/sieve.y (node_list_add): New function.
	(input production): Add mu_sieve_node_end at the end of the
	tree.

2017-01-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Log sieve source location in maidag.

	* lib/sieve.c (_sieve_action_log): Log source location

2017-01-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix sieve logging in maidag.

	* maidag/maidag.c (sieve_debug_flags)
	(sieve_enable_log): Remove.
	* maidag/script.c (apply_script): Check for
	mu_script_sieve_log.

2017-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Allow for "INBOX." namespace.

	* imap4d/imap4d.h (io_send_astring): New proto.
	* imap4d/io.c (io_send_astring): New function.
	* imap4d/list.c (list_fun): Use io_send_astring.
	(list_ref): Special handling for empty wcard
	(imap4d_list): Remove special handling for empty wcard and
	INBOX. Leave that to list_ref. This makes it possible to
	declare namespaces like "INBOX." ("." being the delimiter).
	* imap4d/lsub.c (imap4d_lsub): Use io_send_astring.
	* imap4d/namespace.c (namespace_translate_name): Check for
	declared namespace first.

2017-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

2017-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve description of variables useful in namespace directory
	statements.

2017-01-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* imap4d/list.c (list_ref): Use mu_imap_wildmatch_ci to check
	for a request matching INBOX.
	* include/mailutils/imaputil.h (mu_imap_wildmatch_ci): New
	prototype.
	* libmailutils/imapio/wildmatch.c (mu_imap_wildmatch_ci): New
	function.

2017-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Further improvements of IMAP LIST functionality.

	* imap4d/list.c (list_fun): Ignore names that contain delimiter
	as part of their name (untranslatable names); Don't insert
	spurious separators.
	(list_ref): Make sure a pathnames are properly separated from
	namespace prefixes.
	(imap4d_list): Fix eventual use of uninitialized pfx.
	* imap4d/namespace.c (prefix_translate_name): Allow for
	NS_OTHER prefixes ending with a delimiter.
	(extract_username): Return NULL if prefix without trailing
	delimiter was used.
	* imap4d/tests/atlocal.in (make_config): Add more namespace
	prefixes.
	* imap4d/tests/list.at: Add more tests.
	* libmailutils/string/expvar.c (exp_getvar): Return
	MU_WRDSE_UNDEF if the variable is defined, but has NULL value.

2017-01-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	imap4d: forbid to treat namespace root as a mailbox.

	* imap4d/namespace.c (namespace_get_name): Return NULL if name
	is the same as the returned prefix

2017-01-24  Sergey Poznyakoff  <gray@gnu.org>

	Simplify the namespace interface.

	* imap4d/namespace.c (prefix_translate_name): Remove the url
	parameter. All uses changed.
	(namespace_translate_name): Likewise.
	(i_translate_name): Rename to translate_name. Remove the url
	and ns parameters. All uses changed.
	* imap4d/imap4d.h (namespace_translate_name): Change signature.

2017-01-24  Sergey Poznyakoff  <gray@gnu.org>

	imap4d: uniformly use mailbox name and record for opening
	mailboxes.

	This avoids problems with escaping pathnames that contain
	characters specific for URLs

	* imap4d/select.c (imap4d_select0): Don't use mailbox URL.
	* lib/manlock.c (manlock_open_mailbox_from_record): New
	function.
	* lib/muaux.h (manlock_open_mailbox_from_record): New proto.

2017-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix memory allocation.

2017-01-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	imap4d: fix list.

	* imap4d/list.c (refinfo) <refptr>: const pointer.
	(list_fun): Don't insert spurious delimiter between the prefix
	and the value.
	(list_ref): New static function. Actually list a normalized
	ref/wcard pair.
	(imap4d_list): Correctly handle wildcard part starting with
	namespace prefixes
	* imap4d/namespace.c (prefix_translate_name): If a prefix ends
	with a delimiter, allow its use without trailing delimiter in
	ref. E.g. 
	 LIST "~" "%"

	for prefix "~/" is quite OK.
	* imap4d/tests/atlocal.in: Fix prefix declaration.

2017-01-23  Sergey Poznyakoff  <gray@gnu.org>

	Fix listing names with escapable characters.

	* imap4d/io.c (io_send_qstring): Fix condition
	* imap4d/list.c (list_fun): Use io_send_qstring to print names.
	* imap4d/lsub.c (imap4d_lsub): Likewise.

2017-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* imap4d/namespace.c (namespace_init): Provide record for
	default "" prefix.

2017-01-22  Sergey Poznyakoff  <gray@gnu.org>

	imap4d: revamp namespace translation.

	Instead of translating names to full mailbox URLs, translate
	them to the filesystem pathname and record (mu_record_t) that
	should be used when creating the mailbox. Never use
	mu_mailbox_create_default.

	This patch also fixes memory leaks in some functions (the
	return value from namespace_get_url was never freed).

	* imap4d/imap4d.h (namespace_get_url): Remove.
	(namespace_get_name): New proto.
	* imap4d/namespace.c (namespace_init): Always initialize the
	pfx->record member. This requires that the default record be
	initialized.
	(namespace_get_url): Remove.
	(namespace_get_name): New function. 
	* imap4d/create.c: Use namespace_get_name and
	mu_mailbox_create_from_record to create mailboxes. Fix folder
	creation.
	* imap4d/append.c: Use namespace_get_name and
	mu_mailbox_create_from_record to create mailboxes.
	* imap4d/copy.c: Likewise.
	* imap4d/delete.c: Likewise.
	* imap4d/quota.c: Likewise.
	* imap4d/rename.c: Likewise.
	* imap4d/status.c: Likewise.

2017-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix in IMAP LIST.

	* imap4d/list.c (list_fun): List matching directories.

2017-01-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmu_auth/ldap.c (_construct_attr_array)
	(_mu_entry_to_auth_data): Fix types of iterator return values.

2017-01-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update README-alpha.

2017-01-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update documentation.  Use the namespace name "personal",
	instead of "private".

2017-01-19  Sergey Poznyakoff  <gray@gnu.org>

	Add tests for mu_str_expand and mu_str_vexpand functions.

	* libmailutils/string/expvar.c (exp_shell): Fix out-of-buffer
	read when used without arguments.
	(mu_str_expand): Improve error handling.
	* libmailutils/tests/testsuite.at (MU_GENERIC_TEST_CMD): New
	macro. Include exp.at
	* libmailutils/tests/vexp.c: New file.
	* libmailutils/tests/Makefile.am: Build vexp. Add exp.at
	* libmailutils/tests/exp.at: New file.

2017-01-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Provide functions for expanding string using mu_assoc_t table.

	The functions are used wherever variables can be expected, most
	notably in configuration statements, such as ldap, namespace
	(imap4d), etc. Apart from expanding variables it also provides
	command expansion $(command args...)

	The commands currently available are:

	 domainpart ARG splits its argument on the first occurrence of
	@
	 and returns the part after it.
	 localpart ARG splits its argument on the first occurrence of @
	 and returns the part before it.
	 shell CMD ARG... runs shell command CMD and returns its output 
	* include/mailutils/cstr.h (mu_str_expand, mu_str_vexpand): New
	protos.
	* libmailutils/string/expvar.c: New file.
	* libmailutils/string/Makefile.am: Add expvar.c 
	* libmailutils/tests/exp.c: New file.
	* libmailutils/tests/Makefile.am: Add exp.c 
	* imap4d/imap4d.c (namespace_cfg_init): Fix docstring.
	* imap4d/namespace.c (namespace_translate_name): Use
	mu_str_expand. 
	* libmailutils/mailbox/mbx_default.c
	(mu_construct_user_mailbox_url): Use mu_str_vexpand.
	* libmu_auth/ldap.c (_mu_ldap_search): Likewise.
	* libmu_auth/radius.c (_expand_query): Likewise.
	* libmu_auth/sql.c (mu_sql_expand_query): Likewise. 
	* mu/shell.c (mutool_prompt_env): Remove.
	(shell_prompt): Rewrite
	(input_line_interactive): Use mu_str_expand.
	(mutool_shell_prompt_assoc): New function.
	* mu/mu.h (mutool_shell_prompt_assoc): New proto.
	* mu/imap.c (imap_prompt_env): Use mutool_shell_prompt_assoc.
	* mu/pop.c (pop_prompt_env): Likewise.
	* mu/smtp.c (smtp_prompt_env): Likewise.

2017-01-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

	* libmailutils/mime/mime.c: Fix formatting

2017-01-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove unnecessary mu_message_t flag (MESSAGE_MIME_OWNER)

2017-01-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes.

	* configure.ac: Set version 3.1.91
	* NEWS: Update.
	* doc/texinfo/programs.texi: Minor change.
	* libmailutils/mime/mime.c (_mime_part_size)
	(_mime_body_lines): Fix counting. Return 0 if MIME is empty.

2017-01-16  Sergey Poznyakoff  <gray@gnu.org>

	Improve mu_attachment_copy_ interface.

	* libmailutils/mime/attachment.c
	(mu_attachment_copy_from_stream)
	(mu_attachment_copy_from_file): Remove the encoding parameter.
	Take the encoding to use from the value of the
	Content-Transfer-Encoding header. Return EINVAL if it is not
	present.
	* include/mailutils/message.h (mu_attachment_copy_from_stream)
	(mu_attachment_copy_from_file): Change signature. All uses
	changed.

2017-01-16  Sergey Poznyakoff  <gray@gnu.org>

	Improve the --skip-empty-attachment functionality.

	This also includes small bugfixes in the MIME library code.

	The --skip-empty-attachment option now affects the original
	body as well. If the option is in effect, and the body is
	empty, it will not be included to the composed message.

	* libmailutils/mime/mime.c (_mime_body_stream_read): Return EOF
	if there are no parts in the message.
	(mu_mime_get_num_parts): If message is not multipart, report 1
	part without setting mime->nmtp_parts. Setting it caused
	coredump in other MIME functions (namely, in mu_mime_add_part.
	* mail/send.c (add_body): New function. Adds original body to
	the MIME, honoring the --skip-empty-attachment option.
	* doc/texinfo/programs.texi: Update.

2017-01-16  Sergey Poznyakoff  <gray@gnu.org>

	imap4d: log client identity.

	* imap4d/id.c (eat_args): Log the client identity using the
	info channel.
	* imap4d/list.c: tiny change

2017-01-16  Sergey Poznyakoff  <gray@gnu.org>

	mail: new option --skip-empty-attachments.

	* libmailutils/cli/cli.c (mu_cli): Use "no-" prefix to indicate
	negation
	* mail/mail.c (skip_empty_attachments): New global.
	(mail_options): New option --skip-empty-attachments
	* mail/mail.h (skip_empty_attachments): New extern.
	* mail/send.c (atchinfo) <skip_empty>: New field.
	(send_attach_file): Initialize skip_empty
	(saveatt): Optionally skip empty attachments 
	* NEWS: Mention the new option.
	* doc/texinfo/programs.texi: Document the new option.

2017-01-14  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* libmu_sieve/load.c [!HAVE_LIBLTDL] (mu_sieve_load_ext): Fix
	declaration.

2017-01-14  Sergey Poznyakoff  <gray@gnu.org>

	Fix typos.

2017-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	docs: improve the attachment section.

	* doc/texinfo/programs.texi: provide an example script
	illustrating how to use mail from another programs.

2017-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Re-introduce the --HANG hidden option.

	* libmailutils/cli/cli.c (mu_common_options): Declare the
	--HANG option.
	(hangproc): New function.

2017-01-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	mail: new options to read attachments from file descriptors.

	* mail/mail.c (default_encoding,default_content_type)
	(content_name,content_filename): New statics.
	(cli_attach): Use the value of --content-name option as the
	content-type name parameter. The "-" argument instructs the
	program to read attachment from stdin (eqv --attach-fd=0)
	(cli_attach_fd): New function.
	(mail_options): New options: --content-name,
	--content-filename, --attach-fd
	* mail/mail.h (send_attach_file_default): Remove.
	(send_attach_file): New proto.
	* mail/send.c (atchinfo): New fields: id, name, source.
	(atchinfo_free): Update.
	(default_encoding,default_content_type): Remove globals.
	(send_attach_file): Rewrite.
	(send_attach_file_default): Remove.
	(escape_list_attachments): Print attachment identifier instead
	of the file name, which can be NULL.
	(saveatt): Use mu_attachment_create and
	mu_attachment_copy_from_stream. 
	* NEWS: Update.
	* doc/texinfo/programs.texi: Document the new options.

2017-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix default nullstream read mode.

	* libmailutils/stream/nullstream.c (_nullstream_free_pattern):
	Always reset pattern and patsize.
	(mu_nullstream_create): Fix patsize.

2017-01-04  Sergey Poznyakoff  <gray@gnu.org>

	Improve handling of namespace references.

	* imap4d/list.c (refinfo) <pfxlen>: Remove.
	(list_fun): Change the algorithm for restoring the printable
	reference name.
	(imap4d_list): Use actual reference, not the prefix value.
	* imap4d/namespace.c: Fix handling of NS_OTHER prefixes.
	* imap4d/tests/list.at: Change the testcase.

2017-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Tiny fix in c++ code.

2017-01-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite namespace support.

	* imap4d/imap4d.c (imap4d_homedir)
	(modify_homedir, mailbox_mode): Remove.
	(imap4d_srv_param): New configuration statement "namespace"
	Remove statements: homedir, personal-namespace,
	shared-namespace, other-mailbox-mode, shared-mailbox-mode.
	* imap4d/imap4d.h (imap4d_homedir, modify_homedir)
	(mailbox_mode): Remove. (namespace, namespace_init_session,
	util_getfullpath)
	(namespace_getfullpath, namespace_checkfullpath): Remove.
	(namespace_prefix, namespace): New structs. (namespace_lookup,
	namespace_translate_name)
	(namespace_get_url, translate_delim): New protos.
	* imap4d/list.c (refinfo): Revamp.
	(list_fun): Rewrite.
	* imap4d/namespace.c: Rewrite from scratch.
	* imap4d/append.c: Use new namespace functions.
	* imap4d/util.c (util_getfullpath): Remove. 
	* imap4d/copy.c: Likewise.
	* imap4d/create.c: Likewise.
	* imap4d/delete.c: Likewise.
	* imap4d/quota.c: Likewise.
	* imap4d/rename.c: Likewise.
	* imap4d/select.c: Likewise.
	* imap4d/status.c: Likewise. 
	* imap4d/tests/atlocal.in (make_config): New function.
	* imap4d/tests/testsuite.at (IMAP4D_CONFIG)
	(IMAP4D_RUN): New functions.
	* imap4d/tests/list.at: Update tests 16, 17, 18, 19 
	* imap4d/tests/IDEF0955.at: Use IMAP4D_RUN.
	* imap4d/tests/IDEF0956.at: Likewise.
	* imap4d/tests/append00.at: Likewise.
	* imap4d/tests/append01.at: Likewise.
	* imap4d/tests/create01.at: Likewise.
	* imap4d/tests/create02.at: Likewise.

2017-01-02  Sergey Poznyakoff  <gray@gnu.org>

	Tiny fix.

	* libmailutils/sockaddr/str.c: Add missing include. Reported by
	Felix Janda

2017-01-01  Sergey Poznyakoff  <gray@gnu.org>

	Happy GNU Year.

2016-12-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Provide a way to discern between erroneous return and
	user-induced break condition in foreach iterator functions.

	* libmailutils/diag/errors (MU_ERR_USER0-MU_ERR_USER7): New
	error constants. Reserved for user's purposes, such as breaking
	from foreach iterators.
	* libmaildutils/list/foreach.c (mu_list_foreach): Treat NULL
	list as a list of 0 elements.
	* libmailutils/list/foreachdir.c (mu_list_foreach_dir):
	Likewise.
	* imap4d/imap4d.h (imap4d_auth_result): Remap constants to
	MU_ERR_USER[0-2]
	* libmu_sieve/prog.c (mu_i_sv_lint_command): Use mu_list_locate
	with the default comparator.
	* mh/mh_list.c (_comp_name): Rewrite to match the definition of
	mu_list_comparator_t
	(mhl_format_run): Set _comp_name as comparator for the
	env.printed_fields list.
	(header_is_printed): Use mu_list_locate. 
	* imap4d/authenticate.c: Use MU_ERR_USER0-MU_ERR_USER7 to
	indicate normal break condition in foreach iterators.
	* imap4d/imap4d.c: Likewise.
	* imap4d/namespace.c: Likewise.
	* libmailutils/auth/auth.c: Likewise.
	* libmailutils/cfg/driver.c: Likewise.
	* libmailutils/cfg/parser.y: Likewise.
	* libmailutils/server/acl.c: Likewise.
	* libmailutils/server/msrv.c: Likewise.
	* libmu_sieve/conf.c: Likewise.
	* libmu_sieve/load.c: Likewise.
	* libmu_sieve/sieve.l: Likewise.
	* libmu_sieve/strexp.c: Likewise.
	* libproto/imap/mbox.c: Likewise.
	* libproto/imap/search.c: Likewise.
	* mh/mh_format.c: Likewise.
	* mh/send.c: Likewise.
	* mh/sortm.c: Likewise.
	* mimeview/mimetypes.y: Likewise.
	* movemail/movemail.c: Likewise.

2016-12-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Provide sort function for associative arrays.

	The mu_assoc_sort_r call sorts the elements of mu_assoc_t for
	subsequent iterative access. Random access facilities remain
	undisturbed.

	* include/mailutils/assoc.h (mu_assoc_comparator_t): New
	typedef.
	(mu_assoc_sort_r): New proto.
	* libmailutils/base/assoc.c (mu_assoc_sort_r): New function.
	* libmailutils/tests/mimehdr.c: Sort assoc elements prior to
	iteration.

2016-12-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix parsing of Content-Type and Content-Disposition headers.

	Correctly handle character set and language info embedded in
	parameter values, and eventual parameter value continuations as
	per RFC 2231, Section 3.

	* include/mailutils/assoc.h (mu_assoc_is_empty): New proto.
	* libmailutils/base/assoc.c (mu_assoc_is_empty): New function. 
	* include/mailutils/mime.h (mu_mime_header_parse): Output
	charset is char const *.
	* libmailutils/mime/mimehdr.c (mu_mime_header_parse): Likewise. 
	* include/mailutils/util.h (mu_content_type) <param>: Change
	type to mu_assoc_t
	(mu_param): Remove structure declaration.
	(mu_content_type_parse): Take an optional output charset.
	* libmailutils/base/ctparse.c (mu_content_type_parse): Rewrite
	using mu_mime_header_parse. 
	* imap4d/fetch.c (send_parameter_list): Rewrite using
	mu_mime_header_parse.
	(format_param): Use base64 for parameter values with explicit
	charsets. 
	* libmailutils/tests/conttype.c: Reflect the changes to struct
	mu_content_type

2016-12-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement mu_assoc_foreach function.

	* include/mailutils/assoc.h (mu_assoc_action_t): New typedef.
	(mu_assoc_foreach): New function.
	* libmailutils/base/assoc.c (mu_assoc_foreach): New function.

2016-12-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revise associative array API.

	* configure.ac (VI_REVISION): Increase.
	* include/mailutils/assoc.h (mu_assoc_create): Change
	prototype. (mu_assoc_ref,mu_assoc_ref_install)
	(mu_assoc_remove_ref): Remove.
	(mu_assoc_get): New proto.
	(mu_assoc_lookup,mu_assoc_lookup_ref): New proto.
	(mu_assoc_install_ref): New proto.
	(mu_assoc_set_free): Remove.
	(mu_assoc_set_destroy_item): Set proto.
	* include/mailutils/types.hin (mu_deallocator_t): New typedef.
	* include/mailutils/list.h (mu_list_destroy_item_t): Change
	definition.
	* libmailutils/base/assoc.c: Rewrite. Link all entries in a
	doubly-linked list to preserve natural ordering during
	iterations.
	* libmailutils/base/mutil.c (mutil_parse_field_map): Update
	calls to assoc API.
	* libmailutils/cfg/driver.c (alloc_section_tab)
	(mu_create_canned_section,mu_create_canned_param)
	(mu_get_canned_container,parse_mapping)
	(mu_cfg_field_map): Likewise.
	* libmailutils/mime/mimehdr.c (_mu_mime_param_free): Free the
	pointer itself. (flush_param,mu_mime_param_assoc_create)
	(mu_mime_param_assoc_add) (_mime_header_parse)
	(mu_mimehdr_aget_decoded_param): Update calls to assoc API.
	(mu_mime_param_free): New function.
	* libmailutils/property/assocprop.c: Likewise.
	* libmu_sieve/environment.c: Likewise.
	* libmu_sieve/variables.c: Likewise.
	* libproto/imap/id.c: Likewise.
	* mail/alias.c: Likewise.
	* mail/testsuite/mail/alias.exp: Update ordering of expected
	output.
	* mu/imap.c (com_id): Update. 
	* include/mailutils/mime.h (mu_rfc2047_decode_param): Change
	prototype.
	* libmailutils/base/rfc2047.c (mu_rfc2047_decode_param):
	Allocate returned value, instead of filling an already
	allocated structure.
	* libproto/imap/fetch.c: Reflect changes.

2016-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typecasts in sieve.

	* libmu_sieve/sieve.y (sieve_parse): Make sure 0 is properly
	promoted to sieve_instr_t.

2016-12-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve attachment creation API.

	* include/mailutils/message.h (mu_attachment_create)
	(mu_attachment_copy_from_stream)
	(mu_attachment_copy_from_file): New functions.
	* libmailutils/mime/attachment.c: Likewise.
	(mu_message_create_attachment): Rewrite using the three
	functions above.

2016-12-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	New string functions.

	* libmailutils/string/strcount.c (mu_str_count): Take an array
	of (ASCII) characters to count occurrences of. Optionally store
	individual counts in an array passed as the 3rd argument.
	* include/mailutils/cstr.h (mu_str_count): Change proto.
	(mu_c_str_escape, mu_c_str_escape_trans)
	(mu_c_str_unescape_inplace, mu_c_str_unescape)
	(mu_c_str_unescape_trans): New protos.
	* libmailutils/string/cstrescape.c: New file.
	* libmailutils/string/cstrunescape.c: New file.
	* libmailutils/string/Makefile.am: Add new files.

2016-12-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	New command: mailutils stat.

	* include/mailutils/util.h (mu_c_storage_t): New data type.
	* mu/stat.c: New file.
	* mu/Makefile.am: Add stat
	* doc/texinfo/programs.texi: Document mailutils stat

2016-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes in imap client code.

	* libproto/imap/mbox.c (_imap_message_unseen): Fix type of
	pointer returned by mu_list_head
	* libproto/imap/resproc.c (parse_response_code): Fix parser

2016-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	imap: fix LIST "" "mbox"

	* imap4d/list.c (imap4d_list): Move the longest directory
	prefix to the reference.
	* imap4d/tests/list.at: New testcase.
	* libmu_sieve/tests.c: Fix bug introduced by previous commit

2016-12-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: improve address tests.

	* libmu_sieve/tests.c (retrieve_address): Treat
	MU_ERR_EMPTY_ADDRESS as MU_ERR_NOENT. This complements
	678d93678

2016-12-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* libmu_sieve/sieve.y (mu_sieve_machine_clone): Fix memory
	allocation.
	* mh/pick.c: Remove unused functions.

2016-12-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix fb84d1e3.

	The commit didn't take into account all possible
	option/argument combinations.

	* mh/pick.c (main): Preprocess command line prior to parsing
	it, expanding --COMP NAME in -component COMP -pattern NAME.
	* mh/mh_getopt.c: Revert fb84d1e3
	* mh/mh_getopt.h: Likewise.

2016-12-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes to configure.

	* configure.ac: Assume tokyo|kyoto cabinet will pull the
	necessary dependencies. Add GINT_LDADD if necessary
	* gint: Upgrade

2016-12-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	New example.

	* configure.ac (MU_PRI_OFF_T): Define to the printf format spec
	suitable for printing mu_off_t. Don't use [ ] instead of test.
	* include/mailutils/types.hin (MU_PRI_OFF_T): New define.
	* include/mailutils/Makefile.am (type.h): Pass MU_PRI_OFF_T 
	* examples/mboxsize.c: New file.
	* examples/Makefile.am: Build mboxsize

2016-12-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix size calculation for MH and Maildir mailboxes.

	Exclude from calculation any eventual nested mailboxes.

	* libproto/maildir/mbox.c: Provide the mailbox_size method.
	* libproto/mh/mbox.c: Likewise.

2016-12-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* configure.ac: Fallback to guile installation prefix, if
	'guile-config info bindir' returns empty string.
	* doc/texinfo/programs.texi: Minor fix.
	* mail/mailline.c (ml_readline_init): Don't use obsolete
	CPPFunction type.
	* mu/shell.c (mutool_initialize_readline): Likewise.
	* scheme/sieve2scm.scmi: Fix typo.
	* sieve/sieve.c (main): Fix initialization of Sieve environment
	variables "location" and "post".

2016-12-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.1.90.

2016-12-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve rename/copy/reomove API.

	* examples/rename.c: Remove.
	* examples/fcopy.c: New file.
	* examples/fremove.c: New file.
	* examples/frename.c: New file.
	* examples/Makefile.am: Update. 
	* include/mailutils/util.h (mu_rename_file): Add flags.
	(mu_remove_file): New function.
	(MU_COPY_OVERWRITE): New flag.
	* libmailutils/base/renamefile.c: New file.
	* libmailutils/base/Makefile.am: Add new file.
	* libmailutils/base/copyfile.c: Fix error handling.
	* libmailutils/base/renamefile.c (mu_rename_file): Refuse to
	proceed if the destination file exists and MU_COPY_OVERWRITE
	flag is not set
	* libmailutils/diag/errors (MU_ERR_REMOVE_SOURCE)
	(MU_ERR_RESTORE_META): New errors 
	* imap4d/rename.c (imap4d_rename): Use mu_rename_file
	* mh/forw.c: Likewise.
	* mh/mh_whatnow.c: Likewise.
	* mh/mhn.c: Likewise.
	* mh/send.c: Likewise. 
	* include/mailutils/cstr.h (mu_str_count): New proto.
	* include/mailutils/util.h (mu_file_name_is_safe): New proto.
	* libmailutils/string/safefilename.c: New file.
	* libmailutils/string/strcount.c: New file.
	* libmailutils/string/Makefile.am: Update.

2016-12-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add functions for safe renaming and copying of files.

	* libmailutils/base/copyfile.c: New file.
	* libmailutils/base/renamefile.c: New file. 
	* include/mailutils/util.h (mu_copy_file)
	(mu_rename_file): New protos. 
	* libmailutils/base/Makefile.am: Add new files.
	* examples/rename.c: New file.
	* examples/Makefile.am: Add new files. 
	* NEWS: Update.

2016-12-16  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.1.1 released.

2016-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Export mu-mailer guile variable.

	* libmu_scm/mu_scm.c: Export mu-mailer.
	* libmu_scm/mu_message.c (scm_mu_message_send): Fix a typo.

2016-12-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Swap precedences of MH and Maildir to help in format
	autodetection.

	* include/mailutils/registrar.h: Swap MU_MAILDIR_PRIO and
	MU_MH_PRIO (mu_record_is_local)
	(mu_registrar_apply_filter): New protos.
	* libmailutils/base/registrar.c
	(mu_registrar_set_default_scheme): Use
	mu_registrar_set_default_record.
	(mu_record_is_local): New function.
	(mu_record_get_url): Use it.
	(mu_registrar_apply_filter): New function.

2016-12-15  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.1.1.

2016-12-14  Sergey Poznyakoff  <gray@gnu.org>

	Fix pick --component NAME.

	* mh/mh_getopt.c (mh_getopt0): New function.
	(mh_getopt): Rewrite as alternative entry point to .
	* mh/mh_getopt.h (mh_getopt0): New proto.
	* mh/pick.c: Use mh_getopt0
	* mh/tests/pick.at: Add new testcase.

2016-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* libproto/imap/tag.c: Initialize allocated slot to 0
	* mu/imap.c: Fix number of elements to allocate

2016-12-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Restore prematurely deleted header.

	* include/mailutils/argcv.h: Restore
	* include/mailutils/Makefile.am: Add back argcv.h

2016-12-13  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes in sieve.

	* libmu_sieve/runtime.c (mu_sieve_abort): Jump with code
	MU_ERR_FAILURE.
	* libmu_sieve/tests.c (retrieve_address): Tolerate empty
	addresses.
	(retrieve_header): Return reasonable error code.
	* maidag/script.c (script_apply): If the script failed, return
	0.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.1.

	* configure.ac: version 3.1
	* NEWS: Likewise. 
	* libmu_sieve/comparator.c: Attend to FIXMEs.
	* libmu_sieve/conf.c: Likewise.
	* libmu_sieve/prog.c: Likewise.
	* libmu_sieve/runtime.c: Likewise.
	* libmu_sieve/sieve.y: Likewise.
	* libmu_sieve/util.c: Likewise.
	* libmu_sieve/variables.c: Likewise. 
	* po/POTFILES.in: Add new files.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org>

	libmu_sieve: minor fix.

	* libmu_sieve/util.c (mu_sieve_value_get): Treat actual string
	and expected string list as equivalent types.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Pacify a paranoid compiler warning.

	* libmailutils/string/wordsplit.c (mu_wordsplit_perror): Use %s
	format specifier

2016-12-13  Jordi Mallach  <jordi@debian.org>

	Fix spelling errors.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* libmu_sieve/sieve.y: Fix compilation of chained elsif
	conditions.
	* sieve/sieve.c: Define the location environment item.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Document changes to Sieve.

	* NEWS: Update.
	* doc/texinfo/libmu_sieve.texi: Update.
	* doc/texinfo/sieve.texi: Document extensions 
	* libmu_sieve/comparator.c (mu_sieve_match_part_checker): Check
	the type of the 2nd argument.
	* sieve/sieve.c: Define "location" and "phase" environment
	items.
	* sieve/tests/pipetest.at: Use "pipe" as the capability string.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	New sieve machine accessor functions.

	* include/mailutils/sieve.h (mu_sieve_get_mailbox)
	(mu_sieve_get_argc): New protos.
	* libmu_sieve/runtime.c: New functions.

2016-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix command expansion in wordsplit.

	* libmailutils/string/wordsplit.c: Change ordering of
	expansions so that command expansion occurs first. This fixes
	nested expansions and command expansions occurring after
	variable expansions.
	* libmailutils/tests/wordsplit.at: Add more tests.

2016-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	mhn: allow for whitespace in edit commands.

2016-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix -nowhatnow proc in mh.

	* mh/mh.h (mh_whatnow_env) <nowhatnowproc>: New member.
	* mh/compcommon.c (check_draft_disposition): Return
	DISP_REPLACE if nowhatnowproc is set.
	* mh/mh_whatnow.c (mh_whatnowproc): Return 0 if nowhatnowproc
	is set.
	* mh/comp.c: Fix -nowhatnowproc
	* mh/forw.c: Likewise.
	* mh/repl.c: Likewise.

2016-12-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/base/ctparse.c (parse_type)
	(parse_subtype): Fix memory allocation

2016-12-12  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

2016-12-12  Sergey Poznyakoff  <gray@gnu.org>

	Add tests for sieve environment.  Initialize environment in
	maidag and inc.

	* sieve/tests/environment.at: New testcase.
	* sieve/tests/Makefile.am: Add new file.
	* sieve/tests/testsuite.at: Include new file. 
	* lib/muscript.h (mu_script_init): Change signature.
	* lib/muscript_priv.h (mu_script_fun) <script_init>: Likewise.
	* lib/guile.c (scheme_init): Update.
	* lib/python.c (python_init): Update.
	* lib/script.c (mu_script_init): Pass environment to the
	script_init method.
	* lib/sieve.c (sieve_init): Set sieve environment.
	* maidag/script.c (apply_script): Set environment.
	* mh/inc.c: Likewise.

2016-12-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Support for environment extension (RFC 5183).

	* include/mailutils/sieve.h (mu_sieve_require_environment): New
	proto.
	* libmu_sieve/Makefile.am: Add environment.c
	* libmu_sieve/environment.c: New file.
	* libmu_sieve/require.c: Handle "environment" keyword.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine) <exenv>: New
	member.
	* libmu_sieve/sieve.l: Bugfixes
	* libmu_sieve/variables.c: Add missing static qualifiers
	* sieve/sieve.c: New option --environment

2016-12-10  Sergey Poznyakoff  <gray@gnu.org>

	Remove libmu_compat.

2016-12-10  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite stream flushing code.

	* libmailutils/stream/stream.c (_stream_flush_buffer): Rewrite.

2016-12-09  Sergey Poznyakoff  <gray@gnu.org>

	Fix minor inconsistencies.

2016-12-09  Sergey Poznyakoff  <gray@gnu.org>

	Provide function for parsing the Content-Type header (RFC
	2045).

	* include/mailutils/util.h (mu_content_type, mu_param): New
	structs.
	(mu_content_type_t): New typedef.
	(mu_content_type_parse, mu_content_type_destroy): New protos.
	* libmailutils/base/ctparse.c: New file.
	* libmailutils/base/Makefile.am: Add new file. 
	* imap4d/fetch.c: Use mu_content_type_parse to parse the
	header. 
	* libmailutils/tests/conttype.c: New file.
	* libmailutils/tests/Makefile.am: Add new file.

2016-12-08  Sergey Poznyakoff  <gray@gnu.org>

	Fix eventual dangling pointers.

	Don't set mu_log_tag, leave that to the caller.

	* libmailutils/cli/cli.c (mu_cli_ext): Don't set mu_log_tag.
	* libmailutils/stdstream/strerr.c: Use MU_LOG_TAG macro from
	syslog.h
	* sieve/sieve.c: Redo --no-program-name support

2016-12-08  Sergey Poznyakoff  <gray@gnu.org>

	sieve: fix the mu_sieve_vlist_compare API.

	* libmu_sieve/util.c (mu_sieve_vlist_compare): Rewrite.
	* include/mailutils/sieve.h (mu_sieve_retrieve_t): Change
	signature. All uses changed.
	(mu_sieve_relational_count): Remove.
	(mu_sieve_vlist_compare): Change signature.
	* libmu_sieve/extensions/list.c (list_retrieve_header): Always
	return meaningful status.
	* libmu_sieve/tests.c (mu_sieve_relational_count): Remove.
	(retrieve_address,retrieve_envelope): Return meaningful status.
	(retrieve_header): Iterate over all mime parts, if required.
	(sieve_test_address,sieve_test_header): Rewrite.
	* libmu_sieve/variables.c (sieve_test_string): Rewrite using
	mu_sieve_vlist_compare.

2016-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Version 3.0.90.

2016-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add missing file.

	* include/mailutils/glob.h: File was missing in df608ed0
	* include/mailutils/Makefile.am: Add glob.h

2016-12-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement the "variables" Sieve extension (RFC 5229)

	* include/mailutils/sieve.h (mu_sieve_string): New fields
	"constant" and "changed".
	(mu_sieve_match_part_tags): New extern.
	(mu_sieve_relational_count) (mu_sieve_require_variables)
	(mu_sieve_has_variables)
	(mu_sieve_string_get): New functions.
	* libmu_sieve/variables.c: New file.
	* libmu_sieve/Makefile.am: Add variables.c
	* libmu_sieve/comparator.c: Use mu_sieve_string_get to obtain
	the actual value of the string.
	* libmu_sieve/require.c: Support the "variables" extension.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine): New fields
	vartab, match_string, match_buf, match_count, match_max.
	(mu_i_sv_copy_variables)
	(mu_i_sv_expand_variables): New protos.
	* libmu_sieve/sieve.l (line_add): zero length means add entire
	asciiz string.
	* libmu_sieve/sieve.y (mu_sieve_machine_reset): Reset the new
	fields.
	(mu_sieve_machine_clone): Copy variables and initialize new
	fields.
	(string_rescan): New function.
	(sieve_parse): Rescan string to determine their properties.
	* libmu_sieve/strexp.c (update_len): Allow for NULL replacement
	values.
	* libmu_sieve/string.c (mu_sieve_string_get): New function.
	(mu_sieve_string): Use it.
	* libmu_sieve/tests.c (do_count): Rename to
	mu_sieve_relational_count, make global. All uses changed.
	(match_part_tags): Rename to mu_sieve_match_part_tags, make
	global. All uses changed. 
	* sieve/tests/variables.at: New file.
	* sieve/tests/Makefile.am: Add new testcases.
	* sieve/tests/testsuite.at: Likewise.

2016-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use glob API in sieve.

	* libmu_sieve/comparator.c: Use mu_glob_compile instead of
	fnmatch.

2016-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	New API for converting globbing patterns to extended POSIX
	regex.

	* include/mailutils/opool.h (mu_nonlocal_jmp_t): New type.
	(mu_opool_setjmp,mu_opool_clrjmp): New functions.
	(mu_opool_setup_nonlocal_jump): New macro.
	* libmailutils/base/opool.c (_mu_opool)<jmp>: New field.
	(alloc_bucket): Do a non-local jump on out of memory condition,
	if jmp is not NULL.
	(mu_opool_setjmp,mu_opool_clrjmp): New functions. 
	* libmailutils/base/glob.c: New file.
	* libmailutils/base/Makefile.am: Add glob.c 
	* include/mailutils/glob.h: New file.
	* include/mailutils/mailutils.h: Include glob.h 
	* libmailutils/tests/globtest.c: New file.
	* libmailutils/tests/globtest.at: New test.
	* libmailutils/tests/Makefile.am: Add new files.
	* libmailutils/tests/testsuite.at: Include new test.

2016-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/stream/stream.c (mu_stream_ioctl): Don't flush
	read buffer.

2016-12-05  Sergey Poznyakoff  <gray@gnu.org>

	Improve opool.

	* include/mailutils/opool.h (mu_opool_detach): New proto.
	* libmailutils/base/opool.c (mu_opool_bucket): Redo as union to
	ensure proper alignment. All uses changed.
	(mu_opool_detach): New function.

2016-12-04  Sergey Poznyakoff  <gray@gnu.org>

	sieve: redo symbol registry support.

	The purpose is to simplify the machine structure and to ensure
	its clones are completely independent of the master instance.

	* include/mailutils/sieve.h (mu_sieve_command): New struct.
	(mu_sieve_record): New enum
	(mu_sieve_registry_t): Generalize for storing various types of
	objects. (mu_sieve_test_lookup,mu_sieve_action_lookup)
	(mu_sieve_require_action,mu_sieve_require_test)
	(mu_sieve_require_comparator): Remove.
	(mu_sieve_register_test_ext,mu_sieve_register_test)
	(mu_sieve_register_action_ext,mu_sieve_register_action)
	(mu_sieve_register_comparator)
	(mu_sieve_load_ext): Change return type.
	(mu_sieve_registry_require,mu_sieve_unload_ext): New functions.
	(mu_sieve_machine_inherit): Rename to mu_sieve_machine_clone.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine): Remove
	source_list, test_list, action_list, and comp_list. Add a
	single registry list instead. Add space for file and command
	(action and test) names: idspace, idcount, idmax. Remove unused
	field "stack";
	(mu_i_sv_lex_finish): Change prototype.
	(_mu_i_sv_instr_push,_mu_i_sv_instr_pop): Remove protos.
	(mu_i_sv_id_canon,mu_i_sv_id_num)
	(mu_i_sv_id_str,mu_i_sv_free_idspace): New protos.
	* libmu_sieve/register.c: Rename to registry.c
	* libmu_sieve/registry.c (mu_sieve_test_lookup)
	(mu_sieve_action_lookup): Remove.
	(mu_sieve_require_test,mu_sieve_require_action): Remove.
	(mu_sieve_registry_require): New function.
	(mu_sieve_registry_add,mu_sieve_registry_lookup): New
	functions.
	* libmu_sieve/Makefile.am: Update.
	* libmu_sieve/comparator.c: Rewrite using new registry
	functions.
	* libmu_sieve/load.c (mu_sieve_load_ext): Return module handle.
	(mu_sieve_unload_ext): New function.
	* libmu_sieve/mem.c (mu_sieve_free): Gracefully handle NULL
	argument.
	(mu_i_sv_id_canon,mu_i_sv_id_num,mu_i_sv_id_str): New
	functions.
	* libmu_sieve/prog.c (mu_i_sv_locus): Store index of the file
	name in the id space, instead of pointer to the name itself. 
	* libmu_sieve/require.c (mu_sieve_require): Rewrite.
	* libmu_sieve/runtime.c (_mu_i_sv_instr_source): Expect ID
	index as argument. (_mu_i_sv_instr_push)
	(_mu_i_sv_instr_pop): Remove unused instructions. 
	* libmu_sieve/sieve.l (file_names): Remove. Use
	mu_sieve_machine idspace instead.
	* libmu_sieve/sieve.y (mu_sieve_machine_clone)
	(mu_sieve_machine_dup): Rewrite.
	(mu_sieve_machine_destroy): Free idspace and registry 
	* examples/numaddr.c: Reflect changes.
	* libmu_sieve/extensions/editheader.c: Likewise.
	* libmu_sieve/extensions/list.c: Likewise.
	* libmu_sieve/extensions/moderator.c: Likewise.
	* libmu_sieve/extensions/pipe.c: Likewise.
	* libmu_sieve/extensions/spamd.c: Likewise.
	* libmu_sieve/extensions/timestamp.c: Likewise.
	* libmu_sieve/extensions/vacation.c: Likewise.

2016-12-03  Sergey Poznyakoff  <gray@gnu.org>

	Rename mu_sieve_machine_init to mu_sieve_machine_create.

2016-12-03  Sergey Poznyakoff  <gray@gnu.org>

	Cleanup.

	* include/mailutils/sieve.h (SVT_IDENT): Remove.
	* libmu_sieve/comparator.c (mu_sieve_match_part_checker):
	Remove unused variable.
	* libmu_sieve/mem.c (mu_sieve_reclaim_list): Remove function.
	* libmu_sieve/sieve.y: Remove leftover uses of SVT_IDENT.
	* libmu_sieve/util.c: Likewise.
	* libmu_sieve/sieve-priv.h: Remove useless prototypes.

2016-12-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: change string allocation and argument passing
	convention.

	Strings are allocated in a per-machine string space. String and
	argument lists form contiguous arrays of structures. Regular
	expressions are compiled when they are needed. Compiled
	expressions are cached for eventual reuse.

2016-12-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix delivery to MH and Maildir mailboxes.

	After successful delivery, maidag would switch back to root
	privileges too early, due to which the mailbox would be closed
	when running with root UID. I the property file (.mu-prop) did
	not exist, it would therefore be created by root. Subsequent
	attempts to open it by user would fail. One of consequences is
	that the UIDVALIDITY value would be recalculated each time the
	mailbox is opened. This would force imap4 clients to rescan
	mailboxes infinitely, as each scan would change the UIDVALIDITY
	again.

	This patch fixes the initialization of UIDVALIDITY and fixes
	maidag to switch back to root privileges only after closing the
	mailbox. It also makes sure MH and Maildir mailboxes write
	.mu-prop upon closing, not upon destroying the mailbox.

	* libmailutils/base/amd.c (amd_close): Save property.
	(_amd_scan0): Use mailbox modification time as initial
	uidvalidity value.
	* maidag/deliver.c (deliver_to_mailbox): Remove useless UID/GID
	transitions.

2016-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: improve memory allocation.

	* include/mailutils/sieve.h (mu_sieve_alloc)
	(mu_sieve_palloc,mu_sieve_prealloc)
	(mu_sieve_pfree,mu_sieve_pstrdup): Remove.
	(mu_sieve_mstrdup,mu_sieve_mrealloc)
	(mu_sieve_mfree): Remove. 
	(mu_sieve_reclaim_t): New typedef.
	(mu_sieve_calloc,mu_sieve_strdup) (mu_sieve_realloc)
	(mu_sieve_reclaim_default,mu_sieve_reclaim_list)
	(mu_sieve_reclaim_value,mu_sieve_reclaim_tag): New functions
	(mu_sieve_value_create): Change prototype (take
	mu_sieve_machine_t as first argument)
	* libmu_sieve/mem.c: New file.
	* libmu_sieve/Makefile.am: Add new file. 
	* libmu_sieve/comparator.c: Use new allocation functions.
	* libmu_sieve/prog.c: Likewise.
	* libmu_sieve/register.c: Likewise.
	* libmu_sieve/sieve.l: Likewise.
	* libmu_sieve/sieve.y: Likewise.
	* libmu_sieve/util.c: Likewise. 
	* doc/texinfo/libmu_sieve.texi: Update (needs revision).

2016-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change.

	* include/mailutils/list.h (mu_list_remove)
	(mu_list_remove_nd): Second arg is const.
	* libmailutils/list/remove.c: Likewise.

2016-11-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove compatibility support for obsolete .mu-size.

2016-11-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: more improvements to the argument/tag runtime access
	API.

	* include/mailutils/sieve.h (mu_sieve_handler_t): Change
	signature: remove args and tags arguments, they are contained
	in struct mu_sieve_machine now. (mu_sieve_get_comparator)
	(mu_sieve_relcmpn_t): Change signature.
	(mu_sieve_tag_lookup,mu_sieve_tag_lookup_untyped): Remove
	(mu_sieve_get_tag,mu_sieve_get_tag_untyped): New protos.
	(mu_sieve_value_get_optional): Replace by
	mu_sieve_get_arg_optional.
	(mu_sieve_value_get_untyped): Replace by
	mu_sieve_get_arg_untyped.
	(mu_sieve_value_get): Replace by mu_sieve_get_arg. All uses
	changed.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine): New members:
	arg_list and tag_list
	* libmu_sieve/runtime.c (instr_run): Set up identifier,
	arg_list, and tag_list in mu_sieve_machine_t before calling the
	handler. Reset them afterward.
	* libmu_sieve/util.c (mu_sieve_value_get_optional): Replace by
	mu_sieve_get_arg_optional.
	(mu_sieve_value_get_untyped): Replace by
	mu_sieve_get_arg_untyped.
	(mu_sieve_value_get): Replace by mu_sieve_get_arg.
	(mu_sieve_tag_lookup): Replace by mu_sieve_get_tag
	(mu_sieve_tag_lookup_untyped): Replace by
	mu_sieve_get_tag_untyped

2016-11-26  Sergey Poznyakoff  <gray@gnu.org>

	sieve: improve argument/tag runtime access API.

	* include/mailutils/sieve.h (mu_sieve_data_type): Remove
	SVT_VALUE_LIST.
	(mu_sieve_value_storage): Named union for use in
	mu_sieve_value_t; remove the tag field.
	(mu_sieve_tag_lookup): Change prototype.
	(mu_sieve_value_get): Change prototype.
	(mu_sieve_value_get_optional)
	(mu_sieve_value_get_untyped): New functions.
	(mu_sieve_arg_error): Removed proto. 
	* libmu_sieve/sieve.y: Remove SVT_VALUE_LIST support.
	* libmu_sieve/util.c (mu_sieve_value_create)
	(mu_sieve_type_str,mu_sieve_vlist_do): Remove SVT_VALUE_LIST
	support.
	(mu_sieve_value_get): Rewrite. (mu_sieve_value_get_untyped)
	(mu_sieve_value_get_optional): New functions.
	(mu_sieve_arg_error): Remove.
	(mu_sieve_tag_lookup): Rewrite.
	(mu_sieve_tag_lookup_untyped): New function. 
	* doc/texinfo/libmu_sieve.texi: Update.

	libmu_sieve/tests.c libmu_sieve/actions.c
	libmu_sieve/extensions/editheader.c
	libmu_sieve/extensions/list.c
	libmu_sieve/extensions/moderator.c
	libmu_sieve/extensions/pipe.c libmu_sieve/extensions/spamd.c
	libmu_sieve/extensions/timestamp.c
	libmu_sieve/extensions/vacation.c libmu_sieve/relational.c

	examples/numaddr.c

2016-11-26  Sergey Poznyakoff  <gray@gnu.org>

	Minor fixes.

	* libmu_sieve/sieve-priv.h (sieve_op_t) <unum>: New field.
	* libmu_sieve/sieve.l: Leave one string interpreter slot.

2016-11-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve list sorting API.

	* libmailutils/list/sort.c (mu_list_sort_r): New function.
	* include/mailutils/list.h: Provide prototype.

2016-11-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement RFC 5228, 2.4.2.4 (Encoding Characters Using
	"encoded-character")

	* libmu_sieve/encoded.c: New file.
	* libmu_sieve/strexp.c: New file.
	* libmu_sieve/Makefile.am: Add new files.
	* libmu_sieve/require.c (mu_sieve_require): Understand
	"encoded-character".
	* libmu_sieve/sieve-priv.h (mu_i_sv_interp_t): New typedef.
	(mu_i_sv_expand_encoded_char): New proto.
	(mu_sieve_require_encoded_character): New proto.
	* libmu_sieve/sieve.l (string): Rewrite via line_.* functions.
	This fixes memory leaks on mu_sieve_machine_destroy.
	(line_finish): Expand ${} sequences before returning.
	(mu_sieve_require_encoded_character): New function.
	* sieve/tests/enc-char.at: New file.
	* sieve/tests/Makefile.am: Add enc-char.at
	* sieve/tests/testsuite.at: Likewise.

2016-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: simplify action logging API.

	* include/mailutils/sieve.h (mu_sieve_action_log_t): Change
	proto.
	* lib/sieve.c (_sieve_action_log): Rewrite.
	* libmu_sieve/util.c (mu_sieve_log_action): Rewrite.
	* python/libmu_py/sieve.c (_sieve_action_printer): Rewrite.
	* sieve/sieve.c (_sieve_action_log): Rewrite.

2016-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	sieve: provide a separate stream for debugging output.

	* include/mailutils/sieve.h (MU_SIEVE_DEBUG_TRACE)
	(MU_SIEVE_DEBUG_INSTR,MU_SIEVE_DEBUG_DISAS)
	(MU_SIEVE_DRY_RUN): Remove.
	(mu_sieve_machine_init_ex): Remove proto.
	(mu_sieve_set_dbg_stream,mu_sieve_get_dbg_stream)
	(mu_sieve_stream_save)
	(mu_sieve_stream_restore): New protos.
	* libmu_sieve/runtime.c (INSTR_DISASS,INSTR_DEBUG):
	Reimplement.
	* libmu_sieve/sieve-priv.h (MU_SV_SAVED_ERR_STATE)
	(MU_SV_SAVED_DBG_STATE,MU_SV_SAVED_STATE): New bitflags.
	(mu_sieve_state_disass): New constant.
	(mu_sieve_machine)<state_flags, err_mode>
	<err_locus,dbg_mode,dbg_locus>: New members.
	<dbgstream>: New member.
	* libmu_sieve/sieve.y (mu_sieve_machine_init_ex): Remove.
	(mu_sieve_machine_dup, mu_sieve_machine_inherit): Fix.
	(mu_sieve_set_dbg_stream)
	(mu_sieve_get_dbg_stream): New functions.
	(mu_sieve_machine_destroy): Destroy dbgstream.
	(with_machine): Preserve stream state (mode & locus).
	* libmu_sieve/util.c (mu_i_sv_debug,mu_i_sv_debug_command): Use
	ioctl instead of format strings.
	(mu_sieve_stream_save, mu_sieve_stream_restore): New functions.
	* python/libmu_py/sieve.c (api_sieve_machine_init): Use
	mu_sieve_machine_init.
	* sieve/sieve.c: Improve help output.
	(main): Dump disassembled code to standard output.

2016-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Sieve: remove unused opcode.

	* libmu_sieve/runtime.c (_mu_i_sv_instr_nop): Remove.
	* libmu_sieve/sieve-priv.h: Likewise.

2016-11-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revamp debugging/tracing support.

	* bootstrap.conf (mu_sieve_debug, mu_sieve_trace): Remove.
	* include/mailutils/sieve.h (mu_sieve_debug): Remove. 
	* examples/numaddr.c: Remove calls to mu_sieve_trace.
	* libmu_sieve/extensions/list.c: Likewise.
	* libmu_sieve/extensions/moderator.c: Likewise.
	* libmu_sieve/extensions/pipe.c: Likewise.
	* libmu_sieve/extensions/spamd.c: Likewise.
	* libmu_sieve/extensions/timestamp.c: Likewise.
	* libmu_sieve/extensions/vacation.c: Likewise.
	* libmu_sieve/tests.c: Likewise. 
	* libmu_sieve/runtime.c: Use new debugging/tracing functions.
	* libmu_sieve/sieve-priv.h (mu_i_sv_debug, mu_i_sv_trace)
	(mu_i_sv_debug_command)
	(mu_i_sv_argf, mu_i_sv_valf): New prototypes.
	* libmu_sieve/sieve.y (mu_i_sv_valf, mu_i_sv_argf): New
	functions.
	* libmu_sieve/util.c (mu_sieve_debug): Remove.
	(mu_i_sv_print_value_list): Remove.
	(mu_i_sv_print_tag_list): Remove.
	(mu_sieve_trace): Remove.
	(mu_i_sv_tagf): New function.
	(mu_i_sv_debug): New function.
	(mu_i_sv_trace): New function.
	(mu_i_sv_debug_command): New function.

2016-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typo.

2016-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Redo sieve debugging support.

	Instead of keeping individual debug flags for each Sieve
	machine, use global debugging mechanism, category "sieve". The
	following levels are defined:

	 trace1 - print parse tree before optimization
	 trace2 - print parse tree after optimization
	 trace3 - print parser traces
	 trace4 - print tests and actions being executed
	 trace8 - print disassembled code, don't run
	 trace9 - print each Sieve instruction being executed 
	* include/mailutils/sieve.h (mu_sieve_get_debug_level)
	(mu_sieve_set_debug_level): Remove.
	(mu_sieve_is_dry_run,mu_sieve_set_dry_run
	* lib/script.c (mu_script_debug_flags): Redo.
	* lib/sieve.c (sieve_init): Remove call to obsoleted
	mu_sieve_set_debug_level. 
	* examples/numaddr.c: Use mu_sieve_trace
	* libmu_sieve/extensions/list.c: Likewise.
	* libmu_sieve/extensions/moderator.c: Likewise.
	* libmu_sieve/extensions/pipe.c: Likewise.
	* libmu_sieve/extensions/spamd.c: Likewise.
	* libmu_sieve/extensions/timestamp.c: Likewise.
	* libmu_sieve/extensions/vacation.c: Likewise.
	* libmu_sieve/tests.c: Likewise. 
	* libmu_sieve/runtime.c (INSTR_DEBUG,INSTR_DISASS): Rewrite.
	(mu_sieve_get_debug_level): Remove. (mu_sieve_is_dry_run_:
	Rewrite.
	(mu_sieve_set_dry_run): New function.
	(mu_sieve_disass): Rewrite.
	* libmu_sieve/sieve-priv.h (mu_sieve_machine) <debug_level>:
	Remove.
	<dry_run>: New field.
	* libmu_sieve/sieve.y (mu_sieve_set_debug_level): Remove.
	* libmu_sieve/util.c (mu_sieve_trace): New function.
	* sieve/sieve.c: Rewrite support for --dry-run and --debug. 
	* sieve/tests/ext.at: Use --libdir-prefix instead of -L

2016-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Further cleanup of sieve namespace.

	Prefix internal function names with mu_i_

2016-11-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite sieve parser.

	Three objectives:

	1. Simplify code. 2. Produce optimized sieve code. 3. Improve
	error reporting. 4. Prepare for further extensions

	* include/mailutils/sieve.h (mu_sieve_tag_checker_t): Change
	signature (take mu_sieve_machine_t as the first arg). All uses
	changed.
	(mu_sieve_require): Likewise.
	(mu_sieve_yydebug): Remove global. 
	* libmu_sieve/sieve-priv.h (mu_locus_range): New struct.
	(YYLTYPE): New define
	(mu_sieve_state): New enum.
	(mu_sieve_machine): New members: string_pool, state.
	(mu_sieve_node_type): New enum.
	(mu_sieve_node): New struct. Remove unused prototypes. 
	* libmu_sieve/sieve.l: Keep track of code locations. Use opool
	for constructing string values.
	* libmu_sieve/sieve.y: Rewrite. First build the parse tree.
	Then optimize it. Finally, generate code.
	* libmu_sieve/tests.c (sieve_test_true,sieve_test_false):
	Remove. True and false tests are always optimized away.
	* libmu_sieve/util.c (mu_sv_compile_error): Remove. 
	* libmu_sieve/actions.c: Use mu_diag_at_locus to report errors
	and mu_i_sv_error to mark sieve machine as being in error
	state.
	* libmu_sieve/comparator.c: Likewise.
	* libmu_sieve/prog.c (mu_sv_code): Replace with mu_i_sv_code.
	(mu_sv_code_instr,mu_sv_code_handler)
	(mu_sv_code_list,mu_sv_code_number)
	(mu_sv_code_string,mu_sv_code_source)
	(mu_sv_code_line,mu_sv_change_source)
	(mu_sv_code_action,mu_sv_code_test)
	(mu_sv_code_anyof,mu_sv_code_allof): Remove.
	(mu_i_sv_locus,mu_i_sv_code_action)
	(mu_i_sv_code_test): New function.
	(mu_sv_code_command): Replace with a static function.
	* libmu_sieve/require.c (mu_sieve_require): Take ptr to machine
	as the first arg.
	* libmu_sieve/runtime.c (mu_sieve_mailbox)
	(mu_sieve_message): Refuse to run if the machine is in error
	state. 
	* sieve/sieve.c: Update.
	* sieve/tests/i-numeric.at: Update expected error message. 
	* libmailutils/diag/diag.c (mu_diag_at_locus): Don't pass locus
	if mu_file is NULL.
	* libmu_auth/ldap.c (_mu_entry_to_auth_data): Remove leftover
	mu_error.

2016-11-14  Sergey Poznyakoff  <gray@gnu.org>

	Fix expansion of #, &, %, etc. in mail copy and file commands.

	This was accidentally broken by commit eea2c4aa.

	* include/mailutils/mailbox.h (mu_mailbox_expand_name): New
	proto.
	* libmailutils/mailbox/mbx_default.c (mu_mailbox_expand_name):
	New function.
	(mu_mailbox_create_default): Use it.
	(mu_set_folder_directory): Accept NULL as argument.
	(mu_folder_directory): Reset default value after assigning it.
	This way the folder directory still defaults to the same value
	as earlier, but can be reset to NULL, if so desired.
	(plus_expand): Return a copy of the input string if folder is
	NULL. 
	* mail/copy.c (append_to_mailbox): Use mu_mailbox_create, as
	the mailbox name has already been expanded.
	* mail/file.c (mail_expand_name): Use mu_mailbox_expand_name.
	(mail_file): Use mu_mailbox_create, as the mailbox name has
	already been expanded.
	* mail/mailvar.c (mailvar_cmd): New enum.
	(mailvar_symbol) <handler>: Change signature and return type.
	(mailvar_set): Rewrite. Take care not to modify the variable if
	the handler (if any) returns non-null or if the memory can't be
	allocated.
	(set_folder): Handler for the "folder" variable. 
	* mail/tests/copy01.at: New testcase.
	* mail/tests/copy02.at: New testcase.
	* mail/tests/copy03.at: New testcase.
	* mail/tests/copy04.at: New testcase.
	* mail/tests/Makefile.am: Add new tests.
	* mail/tests/testsuite.at (MUT_MAIL_CMD): Set MAILRC to
	/dev/null. Add new tests.

2016-11-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	mhn: restore -compose mode as default.

2016-11-10  Sergey Poznyakoff  <gray@gnu.org>

	Fix program name duplicate in the output of "mailutils help
	COMMAND"

2016-11-07  Sergey Poznyakoff  <gray@gnu.org>

	Version 3.0.

2016-11-05  Sergey Poznyakoff  <gray@gnu.org>

	Fix option sorting.

	* libmailutils/opt/opt.c (sort_group): Don't assume stability
	of the sort. Use auxiliary data structure to sort array of
	options that contain aliases.
	* libmailutils/tests/parseopt.c (set_prog_args): Fix delimiter.
	* libmailutils/tests/strtoc.c (v_cidr_format): Error checking.
	* maidag/Makefile.am (maidag_LDADD): Reorder libraries to make
	sure maidag uses freshly built libraries (not the ones already
	installed in the system).
	* mh/pick.c (options): Bugfix.

2016-11-05  Sergey Poznyakoff  <gray@gnu.org>

	Add missing documentation.

2016-11-05  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes.

2016-11-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix operation of mail -t; some other minor fixes.

	* mail/escape.c (parse_headers): Moved to send.c
	(check_headers): New function.
	(escape_continue): Use check_headers.
	* mail/mail.c (read_recipients): New variable. The -t option
	sets read_recipients and editheaders
	* mail/mail.h (parse_headers): New proto.
	* mail/send.c: Special handling for -t option.
	(parse_headers): New function.
	* movemail/movemail.c (onerror statement): Accept a list as
	argument. 
	* doc/texinfo/mailutils.texi: Update.
	* doc/texinfo/programs.texi: Update.

2016-11-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix docs. Change argument of the field-map configuration
	statement.

	The field-map statement (.ldap.field-map & .sql.field-map)
	takes a list of mappings as argument. For compatibility and for
	internal purposes, a string is still allowed.

	* doc/texinfo/programs.texi: Update.
	* include/mailutils/cfg.h (mu_cfg_field_map): New proto.
	* include/mailutils/sql.h (mu_password_type): Rename.
	(mu_sql_module_config) <positional>: Remove.
	(mu_sql_decode_password_type): Remove prototype.
	* libmailutils/base/mutil.c (mu_sql_decode_password_type):
	Remove function.
	* libmailutils/cfg/driver.c (mu_cfg_field_map): New function.
	* libmu_auth/ldap.c (cb_field_map): Use mu_cfg_field_map.
	(module_init): Fix default filter.
	* libmu_auth/sql.c (cb_field_map): Use mu_cfg_field_map.
	(mu_sql_param): Rename "password-type" statement to
	"password-encryption". Remove the "positional" statement.

2016-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/cfg/parser.y (mu_cfg_parse_config): Silently
	ignore ENOENT

2016-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rename default configuration file.

	The default configuration file name is "mailutils.conf". Legacy
	configuration file "mailutils.rc" is processed if necessary.

	* libmailutils/cli/cli.c: Rename main configuration file to
	mailutils.conf Remove 'rcfile' option aliases.
	(mu_cli_ext): Special handling for legacy configuration file.
	* NEWS: Update.
	* doc/texinfo/mailutils.texi: Update.
	* doc/texinfo/programs.texi: Update.

2016-11-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve configuration file handling.

	* include/mailutils/cfg.h (mu_cfg_parse_hints): Rename
	site_rcfile to site_file, custom_rcfile to custom_file. Remove
	append_tree and data fields.
	(MU_PARSE_CONFIG_GLOBAL,MU_CFG_PARSE_PROGRAM): Remove.
	(MU_PARSE_CONFIG_VERBOSE): Rename to MU_CF_VERBOSE.
	(MU_PARSE_CONFIG_DUMP): Rename to MU_CF_DUMP.
	(MU_CFG_FMT_LOCUS): Rename to MU_CF_FMT_LOCUS.
	(MU_CFG_FMT_VALUE_ONLY): Rename to MU_CF_FMT_VALUE_ONLY.
	(MU_CFG_FMT_PARAM_PATH): Rename to MU_CF_FMT_PARAM_PATH. 
	(MU_CFG_COMPATIBILITY,MU_CFG_DEPRECATED): Remove.
	(mu_parse_config, mu_get_config): Remove deprecated functions. 
	* libmailutils/cli/cli.c (mu_general_help_text): New global.
	(app_data): New struct.
	(init_options): Construct configuration option group depending
	on which configuration files are in use.
	(mu_cli_ext): Don't use per-user configuration files for
	servers. Pass pointer to app_data structure as po.po_data
	(mu_cli): Set MU_CFHINT_PER_USER_FILE flag by default. 
	* mail/testsuite/lib/mail.exp: Rewrite invocation of the
	mu_init command.
	* include/mailutils/cli.h (mu_cli_setup) <server>: New field. 
	* comsat/comsat.c (cli): Mark as server.
	(main): Bugfix: pass pointer to server to mu_cli.
	* imap4d/imap4d.c (cli): Mark as server.
	* pop3d/pop3d.c: Likewise. 
	* comsat/tests/testsuite.at: Use the --no-site-config option.
	* imap4d/tests/testsuite.at: Likewise. 
	* libmailutils/cfg/driver.c: Update.
	* libmailutils/cfg/format.c: Update.
	* libmailutils/cfg/lexer.l: Update.
	* libmailutils/cfg/parser.y: Update.
	* mu/acl.c: Update. 
	* pop3d/testsuite/lib/pop3d.exp: Likewise. 
	* mu/mu.c: Don't read configuration files.
	* mu/query.c: Fix args_doc 
	* testsuite/lib/mailutils.exp (mu_init): Change option
	handling. Set --no-config option by default.

2016-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix in logstream.

	* libmailutils/stream/logstream.c (_log_write): Force
	MU_LOG_LOCUS mode if the locus is given explicitly.

2016-11-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes in MH.

	* mh/mh_getopt.c (mh_opt_notimpl_warning): For boolean options,
	don't emit warning if the value would be set to false.
	* mh/anno.c: Fix the type of boolean unimplemented options.
	* mh/refile.c: Likewise.
	* mh/repl.c: Likewise.
	* mh/send.c: Likewise.

2016-10-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

2016-10-30  Sergey Poznyakoff  <gray@gnu.org>

	Improve opool API.

	* configure.ac: Version 2.99.993
	* NEWS: Update. 
	* include/mailutils/opool.h (MU_OPOOL_DEFAULT)
	(MU_OPOOL_ENOMEMABRT): New defines.
	(mu_opool_create): Change meaning of the 2nd argument. All uses
	updated.
	(mu_opool_free, mu_opool_dup): New proto.
	* libmailutils/base/opool.c (_mu_opool) <memerr>: Replace with
	flags.
	<head,tail,free>: Rename.
	(mu_opool_free, mu_opool_dup): New functions.
	(mu_opool_head): Bugfix.

2016-10-29  Sergey Poznyakoff  <gray@gnu.org>

	Remove old compatibility quirks.

2016-10-29  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes.

2016-10-29  Sergey Poznyakoff  <gray@gnu.org>

	Remove left over references to argp; other bugfixes.

2016-10-28  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* configure.ac: Version 2.99.992
	* NEWS: Update.
	* libmailutils/opt/opt.c (add_option_cache): Use opt_default if
	no argument is given.

2016-10-24  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

2016-10-24  Sergey Poznyakoff  <gray@gnu.org>

	Improve program usage output.

	* include/mailutils/opt.h (MU_PARSEOPT_SPECIAL_ARGS): New flag.
	(mu_parseopt)<po_special_args>: New field.
	* libmailutils/opt/help.c (option_summary)
	(print_program_usage): Print po_special_args, if defined.
	* libmailutils/opt/opt.c (parseopt_init): Initialize
	po_special_args unless MU_PARSEOPT_SPECIAL_ARGS is set.

	MH: Advertise [+FOLDER] special argument if the -folder option
	is declared. 
	* mh/mh_getopt.c (folder_option): Bugfix: -folder takes
	argument.
	(mh_getopt): Set po_special_args if the -folder option is
	declared.
	* mh/inc.c: Fix arg_doc.
	* mh/mhpath.c: Likewise.
	* mh/repl.c: Likewise.
	* mh/rmf.c: Likewise.
	* mh/rmm.c: Likewise.
	* mh/scan.c: Likewise.
	* mh/show.c: Likewise.

2016-10-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

2016-10-22  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes.

	* libmailutils/cli/cli.c (mu_cli_ext): Initialize hints.data
	(accidentally deleted).
	* libmailutils/opt/help.c (mu_option_describe_options): Don't
	display dup_args_note in single-dash mode.
	* libmailutils/opt/progname.c (mu_set_program_name): Free the
	old value after allocating new copy. This allows to pass
	mu_full_program_name as argument. Set mu_program_name to point
	to a segment of mu_full_program_name, not the original arg.
	* mh/mh_getopt.c: Remove duplicate version option.
	* po/POTFILES.in: Add missing files.

2016-10-22  Sergey Poznyakoff  <gray@gnu.org>

	Provide extended interface to mu_cli.

	* include/mailutils/cfg.h (MU_CFG_APPEND_TREE): New flag.
	* include/mailutils/cli.h (mu_version_copyright): New extern.
	(mu_cli_ext): New proto.
	* libmailutils/cfg/parser.y (mu_cfg_parse_config): Check for
	MU_CFG_APPEND_TREE bit set before accessing hints->append_tree.
	* libmailutils/cli/cli.c (param_set): Likewise.
	(mu_cli_ext): New function.
	(mu_cli): Rewrite as an entry point to mu_cli_ext. 
	* comsat/comsat.c: Remove inclusion of obsolete headers.
	* mu/help.c: Likewise.
	* pop3d/extra.c: Likewise.

2016-10-22  Sergey Poznyakoff  <gray@gnu.org>

	Bugfixes.

	* libmu_auth/ldap.c: Fix compilation without ldap
	* mh/mh_getopt.c: Fix version output to match what MH-E expects

2016-10-22  Sergey Poznyakoff  <gray@gnu.org>

	MH: Fix MH-E compatibility.

	* include/mailutils/cli.h (mu_version_func): Rename to
	mu_version_hook.
	* libmailutils/cli/cli.c: Likewise.
	* pop3d/popauth.c: Likewise.
	* mh/mh_getopt.c: (mh_getopt): Initialize NLS support. Install
	standard version hook (needed for mh-e autodetect feature). 
	* mh/ali.c: Update prog_doc. Remove NLS initialization.
	* 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/mhseq.c: Likewise
	* mh/msgchk.c: Likewise
	* mh/pick.c: Likewise
	* mh/prompter.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/show.c: Likewise
	* mh/sortm.c: Likewise
	* mh/whatnow.c: Likewise
	* mh/whom.c: Likewise

2016-10-22  Sergey Poznyakoff  <gray@gnu.org>

	Finish conversion of MH utilities to mh_parseopt.

	This finishes work started at commit bc73fc65.

	* include/mailutils/opt.h (mu_option_cache) <cache_arg>: Made
	const.
	* libmailutils/opt/opt.c (mu_option_cache_destroy): Don't free
	cache_arg.
	* doc/texinfo/mu-mh.texi: Update. 
	* po/POTFILES.in: Remove obsolete files.
	* mh/tests/refile.at: Don't use double-dash options. 
	* mh/mh_getopt.c (mh_opt_set_folder): New function.
	* mh/mh_getopt.h: Likewise. 
	* mh/mhn.c: Convert to mh_getopt.
	* mh/mhparam.c: Likewise.
	* mh/mhpath.c: Likewise.
	* mh/mhseq.c: Likewise.
	* mh/msgchk.c: Likewise.
	* mh/pick.c: Likewise.
	* mh/pick.h: Likewise.
	* mh/pick.y: Likewise.
	* mh/prompter.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/show.c: Likewise.
	* mh/sortm.c: Likewise.
	* mh/whatnow.c: Likewise.
	* mh/whom.c: Likewise.

2016-10-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Begin rewriting MH to get rid of argp stuff.

	MH utilities will use only single-dash long options.

	* include/mailutils/opt.h (mu_option) <opt_default>: New
	member.
	* libmailutils/opt/opt.c (find_long_option): Improve detection
	of ambiguous options.
	(mu_option_set_value): Use default value (opt_default), if
	supplied.
	* mh/mh_argp.c: Delete.
	* mh/Makefile.am (libmh_a_SOURCES): Remove mh_argp.c
	* mh/mh_getopt.c: Rewrite from scratch using mailutils/opt
	* mh/mh_getopt.h: Likewise.
	* mh/mh.h: Add missing includes
	(mh_read_formfile, mh_alias_read): Change signatures.
	* mh/mh_alias.l (mh_alias_read): Name is const
	* mh/mh_init.c (mh_read_formfile): Name is const. 
	* mh/ali.c: Convert to mh_getopt.
	* 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/scan.c: Likewise. 
	* mh/tests/burst.at: Don't use double-dash options
	* mh/tests/folder.at: Likewise.

2016-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Support for single-dash long options (as in MH) and negation
	for boolean options.

	* include/mailutils/opt.h (MU_PARSEOPT_SINGLE_DASH)
	(MU_PARSEOPT_NEGATION): New flags.
	(mu_parseopt) <po_negation, po_long_opt_start>: New fields.
	(mu_option_describe_options): Change signature.
	* libmailutils/opt/help.c (init_usage_vars): Initialize
	long_opt_col depending on the value of MU_PARSEOPT_SINGLE_DASH
	bit.
	(print_option): Handle single-dash long options and boolean
	options with negations.
	(option_summary): Likewise.
	(mu_option_describe_options): Take struct mu_parseopt * as its
	second parameter.
	* libmailutils/opt/opt.c (find_long_option): Handle boolean
	options with negations. Return also a pointer to the mu_option
	describing the originally used option (as opposed to the
	canonical one returned by the function).
	(parse): Handle single-dash long options.
	(parseopt_init): Initialize po_negation and po_long_opt_start.
	* libmailutils/tests/parseopt.c (parseopt_param): Handle
	MU_PARSEOPT_SINGLE_DASH and MU_PARSEOPT_NEGATION.

2016-10-20  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix in wordwrapper stream.

	* libmailutils/stream/wordwrap.c (set_margin): Flush the stream
	if the new margin equals the current offset.
	(_wordwrap_write): Fix conditional

2016-10-20  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

	* mu/ldflags.c: Ignore "cfg" and "argp" keywords.

2016-10-19  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

2016-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rename MU_APP_NEW_LIBRARIES back to MU_APP_LIBRARIES. Version
	2.99.991.

2016-10-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Convert remaining utilities (except mh) to mu_cli.

	* Makefile.am: Remove libmu_argp and libmu_cfg
	* configure.ac: Likewise.
	* libmu_argp/: Remove.
	* libmu_cfg/: Remove.
	* include/mailutils/Makefile.am (pkginclude_HEADERS): Remove
	gocs.h, libargp.h, libcfg.h 
	* frm/frm.c: Register tls auth module
	* frm/from.c: Likewise.
	* maidag/maidag.c: Likewise.
	* mail/mail.c: Likewise.
	* messages/messages.c: Likewise.
	* movemail/movemail.c: Likewise.
	* readmsg/readmsg.c: Likewise.
	* sieve/sieve.c: Likewise.
	* frm/frm.h: Remove obsolete includes 
	* imap4d/Makefile.am: Update.
	* imap4d/imap4d.c: Use mu_cli for command line and
	configuration parsing.
	* imap4d/imap4d.h: Update. 
	* include/mailutils/gocs.h: Remove.
	* libmailutils/cfg/gocs.c: Remove.
	* libmailutils/cfg/Makefile.am: Remove gocs.c 
	* include/mailutils/cli.h (mu_cli_capa_apply): Rename to
	mu_cli_capa_extend_settings
	(mu_cli_setup) <inorder, prog_doc_hook>: New fields.
	* include/mailutils/daemon.h: Remove obsolete includes.
	* include/mailutils/gsasl.h: Likewise.
	* include/mailutils/mailutils.h: Update.
	* include/mailutils/mu_auth.h (mu_auth_mode): New enum
	(mu_auth_module): Redo structure.
	* include/mailutils/opt.h (mu_parseopt) <po_prog_doc_hook>: New
	field.
	* include/mailutils/sql.h (mu_sql_module_config): New extern.
	(mu_sql_interface_index): Change proto.
	* libmailutils/auth/mu_auth.c: Rewrite.
	* libmailutils/auth/system.c (mu_auth_system_module): Update
	structure
	* libmailutils/cli/capa.c (mu_cli_capa_apply): Rename to
	mu_cli_capa_extend_settings
	* libmailutils/cli/cli.c: Extend settings from auth modules as
	well.
	* libmailutils/opt/help.c (mu_program_help): Invoke
	po_prog_doc_hook if defined.
	* libmailutils/opt/opt.c (parseopt_init): Check the
	MU_PARSEOPT_PROG_DOC_HOOK flag.
	(find_long_option): Fix recognition of ambiguous options in
	case of exact match.
	* libmu_auth/gsasl.c: Add configuration.
	* libmu_auth/ldap.c: Likewise.
	* libmu_auth/pam.c: Likewise.
	* libmu_auth/radius.c: Likewise.
	* libmu_auth/sql.c: Likewise.
	* libmu_auth/tls.c: Likewise.
	* libmu_auth/virtual.c: Likewise. 
	* mu/Makefile.am: Update.
	* mu/mu.c: Rewrite using mu_cli
	* mu/mu.h: Likewise.
	* mu/acl.c: Likewise.
	* mu/cflags.c: Likewise.
	* mu/dbm.c: Likewise.
	* mu/dispatch.c: Likewise.
	* mu/filter.c: Likewise.
	* mu/flt2047.c: Likewise.
	* mu/getans.c: Likewise.
	* mu/getarg.c: Likewise.
	* mu/getyn.c: Likewise.
	* mu/help.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/shell.c: Likewise.
	* mu/smtp.c: Likewise.
	* mu/util.c: Likewise.
	* mu/verbose.c: Likewise.
	* mu/wicket.c: Likewise. 
	* pop3d/Makefile.am: Update.
	* pop3d/pop3d.c: Convert to mu_cli interface.
	* pop3d/pop3d.h: Likewise. 
	* sql/sql.c (mu_sql_interface_index): Change argument
	qualifiers.

2016-10-17  Sergey Poznyakoff  <gray@gnu.org>

	Convert pop3d to mu_cli.

2016-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Convert popauth to mu_cli.

2016-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Convert maidag to mu_cli.

2016-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Convert comsat to mu_cli.

2016-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Convert examples to mu_cli.

2016-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix in help output.

	Print "[OPTION...]", instead of "[OPTION]..."

2016-10-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Convert mail to mu_cli.

2016-10-16  Sergey Poznyakoff  <gray@gnu.org>

	Allow for multiple argument sets in help output.

	Alternative invocations follow the main one, each on a separate
	line, preceded by " or: ".

	* include/mailutils/cli.h (mu_cli_setup) <prog_alt_args>: New
	member.
	* include/mailutils/opt.h (mu_parseopt) <po_prog_args>: Change
	type.
	(mu_program_usage): Change signature.
	* include/mailutils/stream.h (MU_IOCTL_WORDWRAP_GET_OFFSET):
	Rename to MU_IOCTL_WORDWRAP_GET_COLUMN. All uses changed.
	* libmailutils/cli/cli.c (mu_cli): Construct po.po_prog_args
	from prog_args and prog_alt_args.
	* libmailutils/opt/help.c (move_margin): Remove.
	(print_program_usage): New static function.
	(mu_program_usage): Second argument instructs how to display
	options. Main work is done by print_program_usage.
	(mu_program_help): Call print_program_usage.
	* libmailutils/opt/opt.c: Update.
	* libmailutils/stream/wordwrap.c (set_margin): Avoid
	unnecessary flushes. 
	* libmailutils/tests/parseopt.c (MU_PARSEOPT_PROG_ARGS):
	Alternative argument sets are separated by the pipe sign.
	* libmailutils/tests/Makefile.am: Add new testcase.
	* libmailutils/tests/testsuite.at: Likewise.
	* libmailutils/tests/parseopt_help04.at: Add
	MU_PARSEOPT_PROG_ARGS to keywords.
	* libmailutils/tests/parseopt_help12.at: New file. 
	* libmailutils/tests/tcli.c (cli): Add alternative arguments. 
	* dotlock/dotlock.c: Update.
	* mimeview/mimeview.c: Likewise.
	* sieve/sieve.c: Likewise.

2016-10-15  Sergey Poznyakoff  <gray@gnu.org>

	Rewrite parseopt help routines using wordwrap streams.

	* include/mailutils/stream.h
	(MU_IOCTL_WORDWRAP_SET_NEXT_MARGIN)
	(MU_IOCTL_WORDWRAP_GET_OFFSET): New opcodes.
	* libmailutils/stream/wordwrap.c (_wordwrap_flush_line):
	Replace whitespace-only lines with single newline on output.
	(_wordwrap_flush): Fix condition.
	(set_margin): Bugfix.
	(_wordwrap_ctl): Handle new opcodes. 
	* include/mailutils/cli.h (mu_version_func): Change signature.
	* include/mailutils/opt.h (mu_parseopt) <po_help_hook>
	<po_version_hook>: Change signature.
	(mu_parseopt_fmt_text): Remove. (mu_option_describe_options,
	mu_program_help)
	(mu_program_usage): Change signature.
	(mu_program_version): New prototype.
	* libmailutils/cli/cli.c (mu_version_func): Take mu_stream_t as
	2nd argument. Use mu_stream_printf for output.
	(extra_help_hook): Likewise.
	* libmailutils/opt/help.c: Rewrite using wordwrap streams.
	* libmailutils/opt/opt.c (fn_help, fn_usage, fn_version):
	Update.
	* libmailutils/tests/parseopt.c (version_hook): Write to
	mu_stream_t. 
	* libmailutils/tests/parseopt_help00.at: Fix expected output.
	* libmailutils/tests/parseopt_help01.at: Likewise.
	* libmailutils/tests/parseopt_help02.at: Likewise.
	* libmailutils/tests/parseopt_help03.at: Likewise.
	* libmailutils/tests/parseopt_help04.at: Likewise.
	* libmailutils/tests/parseopt_help05.at: Likewise.
	* libmailutils/tests/parseopt_help06.at: Likewise.
	* libmailutils/tests/parseopt_help07.at: Likewise.
	* libmailutils/tests/parseopt_help08.at: Likewise.
	* libmailutils/tests/parseopt_help09.at: Likewise.
	* libmailutils/tests/parseopt_help10.at: Likewise.
	* libmailutils/tests/parseopt_help11.at: Likewise.

2016-10-14  Sergey Poznyakoff  <gray@gnu.org>

	Implement simple word-wrapping stream.

	* include/mailutils/stream.h (MU_IOCTL_WORDWRAPSTREAM): New
	ioctl.
	(mu_wordwrap_stream_create): New proto.
	* libmailutils/stream/Makefile.am: add wordwrap.c
	* libmailutils/stream/wordwrap.c: New file.
	* libmailutils/tests/Makefile.am: Add new testcases.
	* libmailutils/tests/testsuite.at: Include new testcases.
	* libmailutils/tests/wordwrap.c: New file.
	* libmailutils/tests/wordwrap00.at: New file.
	* libmailutils/tests/wordwrap01.at: New file.
	* libmailutils/tests/wordwrap02.at: New file.
	* libmailutils/tests/wordwrap03.at: New file.

2016-10-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes in libmailutils/opt/opt.c.

2016-10-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix some incompatibilities in the previous commit.

	* dotlock/dotlock.c (force): Change type to unsigned. Provide
	default value for --force.
	(cli): Set exit codes and extra docstring. 
	* include/mailutils/cli.h (mu_cli_setup): New members:
	prog_extra_doc, ex_usage, ex_config.
	* include/mailutils/opt.h (mu_parseopt_getcolumn)
	(mu_parseopt_fmt_text): New prototypes.
	* libmailutils/cli/cli.c (extra_help_hook): New hook.
	(mu_cli): Set up customized exit codes. Pass pointer to struct
	mu_cli_setup in hints.data. All uses changed. Set up help hook
	if setup->prog_extra_doc is defined. 
	* libmailutils/opt/help.c (mu_parseopt_getcolumn): New
	function.
	(print_option_descr): Honor explicit newlines.
	(mu_parseopt_fmt_text): New function. 
	* mimeview/mimeview.c (cli): Provide extra docs.
	* sieve/sieve.c: Likewise.

2016-10-12  Sergey Poznyakoff  <gray@gnu.org>

	Convert to mu_cli: frm, from, messages, mimeview, movemail,
	readmsg, sieve.

	* configure.ac (MU_APP_NEW_LIBRARIES): New temp variable. 
	* include/mailutils/sieve.h (mu_cli_capa_sieve): New extern.
	* include/mailutils/tls.h (mu_cli_capa_tls): New extern. 
	* libmailutils/cli/cli.c: Minor change.
	* libmailutils/cli/stdcapa.c: Add "auth" capability. 
	* libmu_auth/tls.c: provide mu_cli_capa_tls 
	* dotlock/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* dotlock/dotlock.c 
	* frm/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* frm/frm.h: Fix includes.
	* frm/frm.c: Use mu_cli for option & config parsing.
	* frm/from.c: Likewise. 
	* messages/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* messages/messages.c: Use mu_cli for option & config parsing. 
	* mimeview/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* mimeview/mimeview.c: Use mu_cli for option & config parsing. 
	* movemail/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* movemail/movemail.c: Use mu_cli for option & config parsing. 
	* readmsg/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* readmsg/readmsg.c: Use mu_cli for option & config parsing. 
	* sieve/Makefile.am: Link with MU_APP_NEW_LIBRARIES
	* sieve/sieve.c: Use mu_cli for option & config parsing.

2016-10-11  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* libmailutils/opt/opt.c (find_long_option): Don't mark
	ambiguity if the matching option unaliases to the same option
	as the found one.

2016-10-11  Sergey Poznyakoff  <gray@gnu.org>

	Introduce new CLI/configuration code for mailutils
	applications.

	The new API is to replace libmu_cfg and libmu_argp. A smooth
	transition is scheduled, during which the two APIs will
	coexist,

	* configure.ac: Build libmailutils/cli/Makefile
	* include/mailutils/cli.h: New file.
	* include/mailutils/Makefile.am: Add cli.h
	* libmailutils/cli/Makefile.am: New file.
	* libmailutils/cli/capa.c: New file.
	* libmailutils/cli/cli.c: New file.
	* libmailutils/cli/stdcapa.c: New file.
	* libmailutils/Makefile.am (SUBDIRS): Add cli. 
	* include/mailutils/cfg.h (mu_cfg_parse_hints): New members:
	append_tree and data.
	(MU_PARSE_CONFIG_LINT): New flag.
	* include/mailutils/diag.h (mu_program_name)
	(mu_full_program_name): Remove const qualifier.
	* include/mailutils/locker.h
	(mu_locker_set_default_external_program): Argument is const.
	* libmailutils/base/locker.c: Likewise. 
	* include/mailutils/opt.h (mu_progname, mu_absprogname):
	Replace with mu_program_name and mu_full_program_name.
	(mu_set_progname): Rename to mu_set_program_name.
	(mu_parseopt) <po_data>: Change type to void *.
	(po_help_hook, po_version_hook): Change signatures.
	(mu_parseopt_error): New function.
	* libmailutils/opt/progname.c (mu_progname, mu_absprogname):
	Replace with mu_program_name and mu_full_program_name.
	(mu_set_progname): Rename to mu_set_program_name.
	* libmailutils/opt/help.c: Minor changes
	* libmailutils/opt/opt.c (parse_error): Rename to
	mu_parse_error (extern).
	(next_opt): Fix permutations.
	* libmailutils/tests/parseopt.c: Reflect changes.
	* libmailutils/tests/parseopt17.at: Improve test case
	* libmailutils/tests/parseopt_help05.at: Reflect changes.
	* libmailutils/tests/parseopt_help07.at: Reflect changes. 
	* include/mailutils/stdstream.h (mu_program_name): Remove
	qualifier. 
	* libmailutils/cfg/driver.c (mu_cfg_tree_reduce): Remove
	useless condition 
	* libmailutils/cfg/lexer.l (mu_cfg_parse_file): Additional info
	messages.
	* libmailutils/cfg/parser.y (mu_cfg_parse_config): Join in the
	append_tree.
	* libmailutils/diag/diag.c (mu_program_name,
	mu_full_program_name)
	(mu_set_program_name): Remove. Declared elsewhere.
	* libmu_sieve/conf.c: Add new configuration code. Mark old text
	for removal.
	* libmailutils/tests/tcli.c: New program.
	* libmailutils/tests/Makefile.am: Add tcli.c

2016-10-10  Sergey Poznyakoff  <gray@gnu.org>

	Raise shared library version number.

	* configure.ac (VI_CURRENT): Set to 5 Don't link intprops.h
	* gnulib: Upgrade.
	* gnulib.modules (intprops) Remove.
	* libmailutils/cfg/parser.y: Don't include intprops.h
	* po/POTFILES.in: Add new files.

2016-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add missing test.

2016-10-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix help output.  Test it.

	* include/mailutils/opt.h (MU_PARSEOPT_EXTRA_INFO)
	(MU_PARSEOPT_EXIT_ERROR): New flags.
	(struct mu_parseopt) <po_extra_info>: New member.
	<po_exit_error>: New member.
	* libmailutils/opt/help.c: Fix help output formatting.
	Implement support for ARGP_HELP_FMT envvar.
	* libmailutils/opt/opt.c (add_option_cache): Honor
	MU_PARSEOPT_IMMEDIATE.
	(parseopt_init): Initialize each member separately. 
	* libmailutils/tests/parseopt.c: Rewrite envvar handling.
	* libmailutils/tests/Makefile.am: Add new tests.
	* libmailutils/tests/testsuite.at (PARSEOPT_DEFAULT): New
	define.
	* libmailutils/tests/parseopt00.at: Use PARSEOPT_DEFAULT.
	* libmailutils/tests/parseopt01.at: Likewise.
	* libmailutils/tests/parseopt02.at: Likewise.
	* libmailutils/tests/parseopt03.at: Likewise.
	* libmailutils/tests/parseopt04.at: Likewise.
	* libmailutils/tests/parseopt05.at: Likewise.
	* libmailutils/tests/parseopt06.at: Likewise.
	* libmailutils/tests/parseopt07.at: Likewise.
	* libmailutils/tests/parseopt08.at: Likewise.
	* libmailutils/tests/parseopt09.at: Likewise.
	* libmailutils/tests/parseopt10.at: Likewise.
	* libmailutils/tests/parseopt11.at: Likewise.
	* libmailutils/tests/parseopt12.at: Likewise.
	* libmailutils/tests/parseopt13.at: Likewise.
	* libmailutils/tests/parseopt14.at: Likewise.
	* libmailutils/tests/parseopt15.at: Likewise.
	* libmailutils/tests/parseopt16.at: Likewise.
	* libmailutils/tests/parseopt17.at: Likewise.
	* libmailutils/tests/parseopt18.at: Likewise.
	* libmailutils/tests/parseopt19.at: Likewise.
	* libmailutils/tests/parseopt20.at: Likewise.
	* libmailutils/tests/parseopt21.at: Likewise.
	* libmailutils/tests/parseopt22.at: Likewise.
	* libmailutils/tests/parseopt23.at: New test.
	* libmailutils/tests/parseopt24.at: New test.
	* libmailutils/tests/parseopt25.at: New test.
	* libmailutils/tests/parseopt_help00.at: New test.
	* libmailutils/tests/parseopt_help01.at: New test.
	* libmailutils/tests/parseopt_help02.at: New test.
	* libmailutils/tests/parseopt_help03.at: New test.
	* libmailutils/tests/parseopt_help04.at: New test.
	* libmailutils/tests/parseopt_help05.at: New test.
	* libmailutils/tests/parseopt_help06.at: New test.
	* libmailutils/tests/parseopt_help07.at: New test.
	* libmailutils/tests/parseopt_help08.at: New test.
	* libmailutils/tests/parseopt_help09.at: New test.
	* libmailutils/tests/parseopt_help10.at: New test.
	* libmailutils/tests/parseopt_help11.at: New test.

2016-10-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix mu_parseopt. Add testsuite for it.

	* include/mailutils/opt.h (mu_parseopt) <po_permuted>: New
	member.
	* libmailutils/opt/help.c (print_option): Fix display of
	optional arguments.
	* libmailutils/opt/opt.c (next_opt,parse): Fix
	start-of-arguments index. Move permutation into a separate
	function.
	* libmailutils/opt/progname.c (mu_set_progname): Remove
	eventual lt- prefix.
	* libmailutils/tests/Makefile.am: Add new tests.
	* libmailutils/tests/parseopt.c: Use environment to control
	mu_parseopt flags.
	* libmailutils/tests/testsuite.at: Add new tests.
	* libmailutils/tests/strtoc.at: Update. 
	* libmailutils/tests/parseopt00.at: New file.
	* libmailutils/tests/parseopt01.at: New file.
	* libmailutils/tests/parseopt02.at: New file.
	* libmailutils/tests/parseopt03.at: New file.
	* libmailutils/tests/parseopt04.at: New file.
	* libmailutils/tests/parseopt05.at: New file.
	* libmailutils/tests/parseopt06.at: New file.
	* libmailutils/tests/parseopt07.at: New file.
	* libmailutils/tests/parseopt08.at: New file.
	* libmailutils/tests/parseopt09.at: New file.
	* libmailutils/tests/parseopt10.at: New file.
	* libmailutils/tests/parseopt11.at: New file.
	* libmailutils/tests/parseopt12.at: New file.
	* libmailutils/tests/parseopt13.at: New file.
	* libmailutils/tests/parseopt14.at: New file.
	* libmailutils/tests/parseopt15.at: New file.
	* libmailutils/tests/parseopt16.at: New file.
	* libmailutils/tests/parseopt17.at: New file.
	* libmailutils/tests/parseopt18.at: New file.
	* libmailutils/tests/parseopt19.at: New file.
	* libmailutils/tests/parseopt20.at: New file.
	* libmailutils/tests/parseopt21.at: New file.
	* libmailutils/tests/parseopt22.at: New file.

2016-10-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use mu_c_type_t throughout the code.  Get rid of
	mu_cfg_param_data_type.

	* include/mailutils/cfg.h (mu_cfg_param_data_type): Remove.
	(mu_cfg_param_type): New enum.
	(mu_cfg_param) <type>: Change type to int.
	(mu_cfg_cidr): Remove.
	(mu_cfg_parse_boolean): Remove. All uses updated.
	* include/mailutils/util.h (mu_c_void): New constant.
	(mu_c_type_str): New extern/
	* libmailutils/string/str_to_c.c (mu_c_type_str): New global.
	* libmailutils/cfg/format.c (mu_cfg_data_type_string): Rename
	to mu_c_type_string; change argument type. All uses updated.
	* libmailutils/cfg/parser.y: Use mu_str_to_c for value
	conversion. 
	* libmailutils/tests/.gitignore: Update.
	* libmailutils/tests/Makefile.am: Add strtoc.at; build strtoc
	* libmailutils/tests/strtoc.at: New file.
	* libmailutils/tests/strtoc.c: New file.
	* libmailutils/tests/testsuite.at: Include strtoc.at 
	* comsat/comsat.c: Use mu_c_type_t types.
	* dotlock/dotlock.c: Likewise.
	* imap4d/imap4d.c: Likewise.
	* lib/manlock.c: Likewise.
	* lib/tcpwrap.c: Likewise.
	* libmailutils/server/msrv.c: Likewise.
	* libmu_argp/muinit.c: Likewise.
	* libmu_cfg/common.c: Likewise.
	* libmu_cfg/gsasl.c: Likewise.
	* libmu_cfg/ldap.c: Likewise.
	* libmu_cfg/pam.c: Likewise.
	* libmu_cfg/radius.c: Likewise.
	* libmu_cfg/sieve.c: Likewise.
	* libmu_cfg/sql.c: Likewise.
	* libmu_cfg/tls.c: Likewise.
	* libmu_cfg/virtdomain.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.

2016-10-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add generic library for option parsing.

	* configure.ac: Build libmailutils/opt
	* include/mailutils/Makefile.am: Add opt.h
	* include/mailutils/opt.h: New file.
	* include/mailutils/util.h (mu_c_type_t): New datatype.
	(mu_str_to_c): New proto.
	* libmailutils/Makefile.am: Add opt to subdirs. 
	* libmailutils/opt/Makefile.am: New file.
	* libmailutils/opt/help.c: New file.
	* libmailutils/opt/opt.c: New file.
	* libmailutils/opt/progname.c: New file. 
	* libmailutils/string/Makefile.am: Add new files.
	* libmailutils/string/str_to_c.c: New file.
	* libmailutils/string/to_sn.c: New file.
	* libmailutils/string/to_un.c: New file. 
	* libmailutils/tests/.gitignore: Update.
	* libmailutils/tests/Makefile.am: Update.
	* libmailutils/tests/parseopt.c: New file.

2016-10-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* mh/rmf.c (current_folder_path): Treat name as folder while
	expanding.
	* mail/unset.c (mail_unset): Fix the behavior when no arguments
	were given.

2016-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Allow to configure the length of the backlog queue for TCP
	servers.

	New statement backlog is provided in the server block.

	* include/mailutils/server.h (mu_m_server_cfg_init): Pass
	mu_m_server_t as first argument.
	* libmailutils/server/msrv.c (mu_m_server_cfg_init): Pass
	mu_m_server_t as first argument. Customize available statements
	depending on the type of server (tcp vs udp). New statement
	"backlog" available for tcp servers. 
	* comsat/comsat.c: Update call to mu_m_server_cfg_init
	* imap4d/imap4d.c: Likewise.
	* pop3d/pop3d.c: Likewise.
	* maidag/maidag.c: Likewise.

2016-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* libmailutils/tests/modtofsaf.c (main): Trivial fix.
	* mail/mail.c: Support "address" capability.
	* mu/shell.c: Trivial fixes

2016-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Force using gnu-mh in Emacs after loading mailutils-mh.

	* mh/etc/mailutils-mh.eli: Force using gnu-mh

2016-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix docstrings for -nowhatnowproc.

2016-08-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	mh: fix the -nowhatnowproc option.

	The -nowhatnowproc option inhibits the invocation of whatnow,
	and consequently, prevents the editing of the draft from
	occurring.

2016-07-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix memory allocation in libmu_imap.

	* libproto/imap/tag.c (_mu_imap_tag_incr): Fix size calculation
	when reallocating tag_buf
	(_mu_imap_tag_clr): Re-initialize members on error.

2016-06-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revert changes to msgset test utility.

	The changes would be nice, if it weren't for the fact that
	libproto is not yet built by the time libmailutils/tests are
	compiled.

2016-06-15  Sergey Poznyakoff  <gray@gnu.org>

	Gracefully handle empty mailboxes in mu_msgset_parse_imap.

	* libmailutils/msgset/parse.c (MU_MSGSET_EMPTY): New constant.
	(parse_msgrange): Don't add any ranges if mode is set to
	MU_MSGSET_EMPTY.
	(mu_msgset_parse_imap): Force MU_MSGSET_EMPTY mode if the
	mailbox is empty.
	* libmailutils/msgset/print.c (mu_msgset_print): Handle empty
	message sets.
	* libmailutils/msgset/trans.c (_mu_msgset_translate_pair):
	Initialize variable.
	* libmailutils/tests/Makefile.am (msgset_LDADD): New variable.
	* libmailutils/tests/msgset.c (parse_msgset): Take mailbox as
	first argument.
	(main): New option -mailbox

2016-02-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* mu/smtp.c(com_list_param): Report if the connection has not
	been established yet.

2016-01-22  Sergey Poznyakoff  <gray@gnu.org>

	Fix build without tcpwrappers.

	* configure.ac (MU_TCPWRAP_LIBRARIES): New subst variable.
	Always includes lib/libmutcpwrap.a. If libwrap is present on
	the system and required, it is included as well
	* imap4d/Makefile.am (TCPWRAP_LIBRARIES): Replace with
	MU_TCPWRAP_LIBRARIES.
	* maidag/Makefile.am: Likewise.
	* pop3d/Makefile.am: Likewise.

2016-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update copyright years.

2015-12-19  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix in wordsplit test program.

	* libmailutils/tests/wsp.c (make_env_kv): Fix array size.

2015-11-11  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

	* bootstrap.conf: Don't try to download anything if --help is
	given

2015-11-10  Sergey Poznyakoff  <gray@gnu.org>

	Minor changes.

	* libmu_argp/mailutils.c: Include argp-namefrob.h
	* libproto/mailer/smtp_auth.c (get_ticket)
	 (_mu_smtp_fixup_params): Protect with WITH_GSASL

2015-11-10  Sergey Poznyakoff  <gray@gnu.org>

	Fix linking.

	* configure.ac (MU_APP_LIBRARIES): Add libmuaux.la. This
	complements a41e62b9 and fixes linking on systems that are
	unable to track dynamic library dependencies.

2015-10-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Document Sieve extensions.

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	vacation: read message body from the file.

	* doc/texinfo/sieve.texi: Document recent changes to vacation.
	* libmu_sieve/extensions/vacation.c (vacation_reply): Handle
	the "rfc2822" tag: if set together with :file, treat the file
	as the RFC2822 message. Otherwise, read message body from it.
	* sieve/tests/vacation.at: Add test for :rfc2822

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	User-defined headers in vacation extension.

	New tag :header allows to set headers in the reply message
	generated by the vacation extension.

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* libproto/mailer/sendmail.c: Fix typo in debugging message.
	* po/.gitignore: Update.

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Maidag: avoid using auth_by_uid when delivering message.

	When delivering message, the library may need to know the email
	address of the user on behalf of whom maidag is called. In
	particular, that happens when using the vacation extension. In
	that case the library would construct the email by
	concatenating user name, obtained as a result of
	mu_get_auth_by_uid, and current domain name. Avoid this by
	remembering email address the message is being delivered to.

	* libmailutils/base/usremail.c (mu_set_user_email): NULL
	argument clears email.
	(mu_get_user_email): Use EUID instead of UID.
	* maidag/deliver.c (do_delivery): Set user email prior to
	delivery.
	* maidag/maidag.c (default_domain): New variable.
	(maidag_cfg_param): New setting "domain".
	* maidag/maidag.h (default_domain): New extern.

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve debugging.

	* libmailutils/diag/debug.c (mu_debug_log): Account for
	eventual newlines in the generated message string.
	* imap4d/io.c (imap4d_init_tls_server): Use mu_stream_strerror.

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libproto/mailer/prog.c (url_to_argv): Free ws only if it was
	initialized.

2015-10-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes in Makefiles.

	* include/mailutils/Makefile.am (errno.h): Use explicit file
	names instead of implicit variables.
	* include/mailutils/sys/Makefile.am (debcat.h): Likewise.
	* libmailutils/diag/Makefile.am (muerrno.c): Likewise.
	* libmu_argp/Makefile.am (libmu_argp_la_LIBADD): Use relative
	path to .la,

2015-10-26  Sergey Poznyakoff  <gray@gnu.org>

	Vacation: improve compatibility with the Sendmail utility.

	* libmu_sieve/extensions/vacation.c (match_addresses): Change
	arguments: take primary email address as well as a list of
	aliases.
	(vacation_reply): Reply if the primary email or one of alias
	emails are listed in recipient list of the original message.
	New tag "always_reply" reverts to the old behavior: reply
	regardless of whether the message is destined for us. Use the
	current user email as the sender address of the vacation
	message. New tag "return_address" sets the sender address
	explicitly.
	* sieve/tests/vacation.at: Add new tests.

2015-10-25  Sergey Poznyakoff  <gray@gnu.org>

	Fixes in sieve vacation extension.

	* libmu_sieve/extensions/vacation.c (build_mime): Fix memory
	leak. This also flushes the message body stream, so its content
	becomes visible for the mailer.
	(noreply_address_p): Rename "addresses" tag to "noreply".
	(check_db): The "database" tag provides vacation database name.
	(vacation_reply): Always set message headers.
	(vacation_tags): Rename "addresses" tag to "noreply". New tag:
	"database" 
	* sieve/tests/vacation.at: New file.
	* sieve/tests/Makefile.am (TESTSUITE_AT): Add vacation.at.
	* sieve/tests/testsuite.at: Include vacation.at. 
	* doc/texinfo/programs.texi: Minor change.

2015-09-20  Sergey Poznyakoff  <gray@gnu.org>

	Document mailbox types, variable extension, etc.

2015-09-19  Sergey Poznyakoff  <gray@gnu.org>

	Complement f160ca75.

	* include/mailutils/wordsplit.h (MU_WRDSX_WORD)
	(MU_WRDSX_QUOTE): New constants.
	(mu_wordsplit_getwords): Rename to mu_wordsplit_get_words.
	* libmailutils/string/wordsplit.c (mu_wordsplit_getwords):
	Rename to mu_wordsplit_get_words. 
	* libmailutils/base/userprivs.c (mu_switch_to_privs): Fix
	memory overrun when retrieving the current pointer. 
	* examples/header.c (main): Use mu_wordsplit_get_words
	* imap4d/preauth.c (preauth_getvar): Rewrite according to the
	new API.
	* libmailutils/imapio/create.c (mu_imapio_create): Use
	MU_WRDSX_ constants to address ws_escape.
	* libmailutils/imapio/qstring.c: Likewise.
	* libmailutils/mailbox/mbx_default.c: Minor fix.
	* libmailutils/server/acl.c (acl_getvar): Rewrite according to
	the new API.
	* libmailutils/tests/wsp.c: Minor fix.
	* libmailutils/url/create.c (_mu_url_create_internal): Bugfix:
	alloc url->path.
	* libmu_sieve/extensions/list.c (retrieve_next_header): Use
	mu_wordsplit_get_words
	* libproto/mailer/prog.c (prog_getvar): Rewrite according to
	the new API.
	* libproto/mailer/smtp_gsasl.c (get_implemented_mechs): Remove
	unneeded assignment to ws.ws_wordv.
	* mh/folder.c: Use mu_wordsplit_get_words.
	* mh/mhn.c: Likewise.
	* movemail/movemail.c (movemail_getvar): Rewrite according to
	the new API.

2015-09-16  Sergey Poznyakoff  <gray@gnu.org>

	Port wordsplit from grecs 20616b88.

	The updated version supports tilde and pathname expansion,
	command substitution and standard shell-like replacement
	constructs in variable substitution, such as ${X:-V} etc.

	* include/mailutils/wordsplit.h: Update.
	* libmailutils/string/wordsplit.c: Update.
	* libmailutils/tests/wsp.c: Update.
	* libmailutils/tests/wordsplit.at: Update unescape test. 
	* libmailutils/imapio/create.c (mu_imapio_create): Initialize
	ws_escape array.
	* libmailutils/mime/mimehdr.c (_mime_header_parse): Likewise.
	* libmailutils/tests/modmesg.c: Use mu_wordsplit with
	MU_WRDSF_NOSPLIT to run expansions on the string.
	* mu/shell.c (shell_prompt): Likewise.

2015-08-24  Sergey Poznyakoff  <gray@gnu.org>

	Fix typos.

2015-08-04  Sergey Poznyakoff  <gray@gnu.org>

	Spelling fixes in ChangeLog.

2015-08-04  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* pop3d/bulletin.c (read_bulletin_db): Fix memory/descriptor
	leak.

2015-07-11  Sergey Poznyakoff  <gray@gnu.org>

	Update NEWS.

2015-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Log ciphersuite info after successful initiation of TLS
	connection.

	* include/mailutils/stream.h (MU_IOCTL_TLSSTREAM): New ioctl
	code.
	(MU_IOCTL_TLS_GET_CIPHER_INFO): New ioctl opcode.
	* libmailutils/property/assocprop.c (_assoc_prop_fill)
	(_assoc_prop_save): allow for NULL stream pointer.
	* libmu_auth/tls.c (_tls_io_ioctl,_tls_ioctl): Handle
	MU_IOCTL_TLSSTREAM/MU_IOCTL_TLS_GET_CIPHER_INFO ioctl. 
	* imap4d/io.c (log_cipher): New function.
	(io_setio, imap4d_init_tls_server): Call log_cipher after
	successfully establishing the TLS connection.
	* imap4d/starttls.c (tls_encryption_on): Remove diagnostic
	output.
	* pop3d/extra.c (log_cipher): New function.
	(pop3d_setio,pop3d_init_tls_server): Call log_cipher after
	successfully establishing the TLS connection.

2015-07-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* libmailutils/mailbox/mbx_default.c
	(mu_normalize_mailbox_url): don't place / in front of the
	username.
	(plus_expand): Use mu_make_file_name and mu_asprintf. Check for
	errors.
	(mu_mailbox_create_default): Check for errors.

2015-07-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix TLS streams.

	Avoid calling gnutls_global_init (via mu_tls_module_init) prior
	to forking. gnutls_global_init opens at least one file
	descriptor (/dev/urandom), and closing it will disrupt its
	operation. Current stable libgnutls (3.3.15) is able to cope
	with it, but there are plenty of systems running much older
	versions.

	* libmailutils/server/msrv.c (mu_m_server_begin): Reset onexit
	list after forking.
	* libmu_auth/tls.c (mu_tls_module_init): Don't call
	mu_init_tls_libs.
	(_tls_server_open, _tls_client_open): Check return value from
	mu_init_tls_libs.
	* imap4d/auth_gsasl.c (auth_gsasl): Use mu_onexit to register
	onexit functions.
	* imap4d/imap4d.h (util_atexit): Remove prototype.
	* imap4d/starttls.c (imap4d_starttls): Don't register
	mu_deinit_tls_libs: now done by tls library.
	(starttls_init): Don't call mu_init_tls_libs.
	* imap4d/util.c (util_atexit): Remove.
	(util_bye): Update accordingly.
	* pop3d/extra.c (pop3d_setio): Print informational message
	after establishing TLS.
	(pop3d_bye): Don't call mu_deinit_tls_libs: that's done by the
	library.
	* pop3d/pop3d.c (main): Don't call mu_init_tls_libs.

2015-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix make check if MU_DEFAULT_SCHEME value is other than mbox.

	* testsuite/testsuite.inc (MUT_DEFAULT_OPTIONS): New define.
	* maidag/tests/testsuite.at: Add MUT_DEFAULT_OPTIONS to the
	options passed to maidag
	* mail/tests/cols00.at: Use MUT_MAIL_CMD
	* mail/tests/cols01.at: Likewise.
	* mail/tests/copy00.at: Likewise.
	* mail/tests/nohome.at: Likewise.
	* mail/tests/testsuite.at (MUT_MAIL_CMD): New define. Pass
	MUT_DEFAULT_OPTIONS to mail.
	* sieve/tests/testsuite.at: Pass MUT_DEFAULT_OPTIONS to sieve.

2015-07-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Compatibility fix.

	* libmailutils/mailbox/mbx_default.c
	(mu_normalize_mailbox_url): Append ${user} if URL ends with
	"user=". Fixes 131ddb25a.

2015-07-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes.

	* lib/Makefile.am: Add -version-info to LDFLAGS
	* libmu_cfg/Makefile.am: Likewise.
	* libmu_argp/Makefile.am: Use LIBADD to add library dependency
	Pass -version-info to LDFLAGS

2015-07-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/cfg/gocs.c (mu_gocs_register): Avoid registering
	same capability twice.

2015-07-02  Sergey Poznyakoff  <gray@gnu.org>

	Version 2.99.99.

	* configure.ac: Version 2.99.99
	* NEWS: Update.
	* libmu_argp/mailutils.c: New file.
	* libmu_argp/Makefile.am: Add mailutils.c
	* libmu_argp/cmdline.c (all_cmdline_capa): Add
	mu_mailutils_cmdline.
	(mu_libargp_init): Register modflags function.
	* libmu_argp/mu_argp.c (mu_build_argp): Retain negative group
	numbers.
	(argp_capa): New member: modflags.
	(mu_register_argp_capa): Take pointer to modflags function as
	3rd parameter.
	(mu_build_argp): Use modflags member to alter argp flags.
	(mu_argp_build): Take pointer to flags as its third argument.
	* libmu_argp/muinit.c (mu_app_init): Pass pointer to flags to
	mu_argp_build.
	* libmu_cfg/init.c (mu_libcfg_init): Silently ignore unknown
	groups 
	* include/mailutils/libargp.h (mu_mailutils_cmdline): New
	extern.
	(mu_cmdline_capa): New member: modflags.
	(mu_argp_build): Change signature.
	(mu_register_argp_capa): Change signature.
	* libmailutils/cfg/gocs.c (std_gocs_table): Add dummy entry for
	"mailutils" 
	* mu/Makefile.am (bin_PROGRAMS): Rename to "mailutils".
	* mu/dispatch.c (dispatch_docstring): Use mu_program_name
	instead of the hardcoded name.
	* mu/mu.c: Use "mailutils" capability.
	* mu/mailutils-config.in: Rename to mu/mailutils-config 
	* comsat/comsat.c: Use "mailutils" capability.
	* dotlock/dotlock.c: Likewise.
	* examples/muauth.c: Likewise.
	* examples/muemail.c: Likewise.
	* frm/frm.c: Likewise.
	* frm/from.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.

2015-07-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* mh/prompter.c (main): Use mu_stream_printf instead of printf

2015-06-29  Sergey Poznyakoff  <gray@gnu.org>

	Bugfix.

	* libproto/maildir/mbox.c (maildir_msg_finish_delivery): Don't
	complain if trying to unlink a nonexistent file.

2015-06-28  Sergey Poznyakoff  <gray@gnu.org>

	Fix compilation warnings.

	* configure.ac: Check for intptr_t
	* comsat/action.c (need_crlf): Use intermediate cast to
	intptr_t.
	* imap4d/imap4d.c (cb2_group, mu_get_user_groups): Likewise.
	* libmailutils/stream/file_stream.c (fd_ioctl): Likewise.
	* libmailutils/stream/mapfile_stream.c (_mapfile_ioctl):
	Likewise.
	* libmailutils/stream/tcp.c (_tcp_ioctl): Likewise.
	* maidag/maidag.c (cb2_group): Likewise. 
	* frm/common.c (puts_bidi): Fix the type of 3rd parameter to
	fribidi_log2vis 
	* include/mailutils/body.h: Use MU_DEPRECATED instead of
	__attribute__ ((deprecated)).
	* include/mailutils/cfg.h: Likewise.
	* include/mailutils/header.h: Likewise.
	* include/mailutils/libargp.h: Likewise.
	* include/mailutils/mailbox.h: Likewise.
	* include/mailutils/mailer.h: Likewise.
	* include/mailutils/registrar.h: Likewise.
	* include/mailutils/message.h: Likewise.
	(mu_message_set_stream): Remove deprecation marker.

2015-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	python: cleanup.

	* python/libmu_py/libmu_py.c (_ro): Remove inline qualifier.
	* python/libmu_py/libmu_py.h: Likewise.

2015-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	python: fix returning size_t values.

	* python/libmu_py/address.c: Use PyInt_FromSize_t to return
	size_t and similar values.
	* python/libmu_py/auth.c: Likewise.
	* python/libmu_py/body.c: Likewise.
	* python/libmu_py/header.c: Likewise.
	* python/libmu_py/mailbox.c: Likewise.
	* python/libmu_py/mailcap.c: Likewise.
	* python/libmu_py/message.c: Likewise.
	* python/libmu_py/mime.c: Likewise.
	* python/libmu_py/sieve.c: Likewise.
	* python/libmu_py/stream.c: Likewise.

2015-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	python: fix passing size_t values on 64-bit architectures.

	* lib/python.c (python_proc): Pass a copy of mu_program_name as
	argv[0].
	* python/libmu_py/libmu_py.h (ASSERT_INDEX_RANGE): New macro.
	* python/libmu_py/address.c: Use Py_ssize_t and check returned
	value range when getting size_t arguments.
	* python/libmu_py/auth.c: Likewise.
	* python/libmu_py/folder.c: Likewise.
	* python/libmu_py/header.c: Likewise.
	* python/libmu_py/mailbox.c: Likewise.
	* python/libmu_py/mailcap.c: Likewise.
	* python/libmu_py/message.c: Likewise.
	* python/libmu_py/mime.c: Likewise.
	* python/libmu_py/secret.c: Likewise.
	* python/libmu_py/stream.c: Likewise.

2015-06-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix double-inclusion of config.h in some sources.

	* lib/muscript.h: Don't include config.h: the caller is
	responsible for that.
	* lib/guile.c: Include config.h
	* lib/python.c: Likewise.
	* lib/script.c: Likewise.
	* lib/sieve.c: Likewise.

2015-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* mh/prompter-tty.c: include signal.h

2015-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix segfault when destroying mu_body_t under certain
	conditions.

	That's a temporary solution until reference counters are
	implemented for mu_body_t

	* libmailutils/mailbox/body.c (bstr_close, bstr_done): Don't
	close streams.

2015-06-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* configure.ac: Fix checks for readline. If it is not present -
	bail out if it was explicitly requested and silently disable it
	otherwise. Check for dbm_dirfno and dbm_pagfno (see
	libmu_dbm/ndbm.c, below).
	* examples/mboxidx.c (set_charset_filter): Fix array
	dimensions.
	* lib/python.c (python_done): add missing return statement.
	* libmailutils/address/address.c (mu_address_union): Fix size
	argument to memset.
	* libmailutils/server/msrv.c (mu_m_server_get_hints): Likewise.
	* libmu_compat/vartab.c (vardefn_free): Likewise.
	* libmailutils/cfg/parser.y (_set_fun): cast enum to size_t
	before comparison
	* libmailutils/diag/wd.c (mu_wd): fix while loop.
	* libmailutils/tests/url-parse.c (main): Fix printf format.
	* libmu_dbm/ndbm.c (_ndbm_get_fd): One of dbm_dirfno or
	dbm_pagfno may be missing (on FreeBSD, dbm_pagfno expands to a
	non-defined macro, which produces compilation error.
	* mail/mailvar.c (mailvar_varptr_comp): Remove.
	(mailvar_list_copy): Use mailvar_variable_comp instead of the
	removed mailvar_varptr_comp.

2015-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add gnulib as a module.

2015-06-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Make libmuaux installable shared library.

	This commit converts libmuaux into installable shared library
	that includes selected modules from gnulib. Correspondingly,
	libmu_argp is also converted into installable shared library,
	which is the main purpose of these changes. This should allow
	other packages which depend on Mailutils to link against
	libmu_argp even on systems that for some reason choose not to
	include static libraries in their distribution (vide Debian).
	Another side effect is that such packages won't need to bother
	about argp being present on the system, as it is now included
	in libmuaux.so.

	* bootstrap.conf: Don't create Makefile.am Build gnulib using
	libtool and use mu_am_flags custom module
	* lib/local/modules/mu_am_flags: New file.
	* configure.ac (MU_APP_LIBRARIES): Use libmu_argp.la
	(TCPWRAP_LIBRARIES): Add libmutcpwrap.a
	* lib/Makefile.am: Make libmuaux installable shared library New
	static library libmutcpwrap.a
	* libmu_argp/Makefile.am: Make libmu_argp installable shared
	library
	* examples/Makefile.am: Use libmu_argp.la
	* examples/cpp/Makefile.am: Likewise.
	* imap4d/Makefile.am: Likewise.
	* mapi/Makefile.am: Likewise.
	* mh/Makefile.am: Likewise,
	* pop3d/Makefile.am: Likewise.

2015-06-23  Sergey Poznyakoff  <gray@gnu.org>

	Minor fixes in Scheme scripts.

	* scheme/Makefile.am: set executable bit on guimb (fix a typo)
	Override the installcheck-binSCRIPTS rule to avoid spurious
	output from guile 2.0 when running the program.
	* scheme/guimb.scmi: Remove flags specific to guile 1.8

2015-06-23  Sergey Poznyakoff  <gray@gnu.org>

	Fix improper padding in B encoding.

	* libmailutils/stream/fltstream.c: stop encoding when no more
	input is available.
	* libmailutils/tests/encode2047.at: add new tests.
	* libmailutils/filter/base64.c (_base64_encoder): detect eof

2015-05-05  Sergey Poznyakoff  <gray@gnu.org>

	Minor fix.

2015-05-05  Sergey Poznyakoff  <gray@gnu.org>

	mail: add tests in a non-interactive mode.

	* configure.ac: Configure mail/tests subdirectory.
	* mail/Makefile.am (SUBDIRS): Add tests.
	* mail/tests/testsuite.at: New file.
	* mail/tests/Makefile.am: New file.
	* mail/tests/.gitignore: New file.
	* mail/tests/atlocal.in: New file.
	* mail/tests/cols00.at: New file.
	* mail/tests/cols01.at: New file.
	* mail/tests/copy00.at: New file.
	* mail/tests/nohome.at: New file.
	* mail/tests/version.at: New file.

2015-05-04  Sergey Poznyakoff  <gray@gnu.org>

	mail: the "copy" command operates on files by default.

	Last argument is treated as a mailbox only if it begins with a
	mailbox scheme (mbox://, maildir://, etc).

	* mail/copy.c (append_to_mailbox)
	(append_to_file): New functions.
	(mail_copy0): Depending on whether mailbox scheme is specified,
	call one of the above functions.
	* doc/texinfo/programs.texi (mail): Fix documentation of the
	copy command.
	* mail/testsuite/mail/write.exp: Update line/character counts
	for [Ss]ave commands.

2015-05-03  Sergey Poznyakoff  <gray@gnu.org>

	Minor change.

	* doc/texinfo/programs.texi: Fix description of mail --print

2015-05-03  Sergey Poznyakoff  <gray@gnu.org>

	readmsg: minor fix.

	* readmsg/readmsg.c: Bail out unless arguments are present.
	* doc/texinfo/programs.texi: Update.

2015-05-03  Sergey Poznyakoff  <gray@gnu.org>

	Fix doc generation.

	The Config file applies to all output formats, which is wrong.
	Use a dedicated configuration file for html output formats, and
	default settings for the rest.

	* doc/texinfo/Makefile.am (GENDOCS): Add html-specific
	configuration file.
	* doc/texinfo/Config: Rename to doc/texinfo/html.init (with
	changes).
	* doc/texinfo/programs.texi: Fix sectioning.

2015-05-03  Sergey Poznyakoff  <gray@gnu.org>

	mail: honor columns/screen variables.

	* mail/util.c (util_command_list): Use util_screen_columns
	instead of util_getcols.
	(util_getcols): Don't use COLUMNS.
	(util_getlines): Don't use LINES.
	* mail/mail.c: Don't force COLUMNS and LINES (they are normally
	not exported, so setting them will cause util_getcols and
	util_getlines to return wrong results). Set variable "columns"
	from envvar COLUMNS, if set to a numeric value. Set variable
	"screen" from envvar LINES, if set to a numeric value.
	* mail/from.c (format_headline): Use util_screen_columns
	instead of util_getcols.
	* mail/mailvar.c (mailvar_print,mail_variable): Likewise.
	* mail/print.c (mail_print_msg): Likewise.

2015-05-03  Sergey Poznyakoff  <gray@gnu.org>

	Honor MAIL and FOLDER envars if _mu_mailbox_pattern is not set.

	The _mu_mailbox_pattern variable is supposed to be set only
	from configuration file. However, the mu_mailbox_url function
	would also set it as a side effect. This produced strange
	results; in particular unsetting HOME variable caused mail
	utilities to ignore MAIL variable as well (as reported by Dan
	Jacobson on 2015-04-30, <87vbgemcc7.fsf@jidanni.org>).

	* configure.ac (MU_PATH_MAILDIR): Don't end with a slash.
	* libmailutils/mailbox/mbx_default.c
	(mu_normalize_mailbox_url): Use mu_make_file_name.
	(mu_mailbox_url): Don't set _mu_mailbox_pattern.

2015-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	Setting non-existing variable in bin/mail at the start of the
	session caused further calls to set (without arguments) to
	malfunction. This revealed bugs in list mapping functions.

	On the other hand, invoking completion after "set var=" caused
	bin/mail to coredump.

	* libmailutils/list/gmap.c (mu_list_gmap): Initialize rc.
	* libmailutils/list/map.c: Always initialize *res.
	* mail/mailvar.c (mailvar_list_copy): The call to mu_list_map
	does not necessarily create the list. Create it, if it doesn't.
	(mailvar_iterate_next): Redo the loop: check if there are items
	to iterate over.

2015-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Switch to Texinfo 5.0.

	* doc/texinfo/Config: Rewrite.
	* doc/texinfo/Makefile.am: Use Makeinfo 5 instead of texi2htm
	* doc/texinfo/gendocs_template: Remove ps
	* doc/imprimatur: Upgrade.
	* doc/texinfo/gendocs.sh: New file.
	* doc/texinfo/rendition.texi: Remove.
	* doc/texinfo/programs.texi: Bugfixes

2015-03-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update copyright years.

2014-12-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix alignment issues in mu_fgetpwent_r.

	* libmailutils/base/fgetpwent.c: Place struct passwd at the
	beginning of the buffer. Account for eventual missing newline
	at the end of file.

2014-12-07  Sergey Poznyakoff  <gray@gnu.org>

	New function mu_fgetpwent_r.

	* libmailutils/base/fgetpwent.c: Rewrite from scratch.
	* ChangeLog.amend: Update.

2014-12-06  Sergey Poznyakoff  <gray@gnu.org>

	Improve diagnostics in maildir.

	* libmailutils/mailbox/fsfolder.c: Fix debugging categories
	* libproto/maildir/mbox.c (maildir_opendir)
	(maildir_msg_finish_delivery)
	(maildir_scan0): Log errors.
	(maildir_flush,maildir_deliver_new): Return EACCES if the
	mailbox is read-only.

2014-12-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix the use of read-only maildir folders. Imap4d improvements.

	New imap4d statement "retain-groups" instructs it to retain the
	named supplementary user groups when switching to the user
	privileges (previously, imap4d just switched to <user>:mail).
	Read-only mailboxes are handled graciously: SELECT succeeds on
	such mailboxes, bug marks them explicitly as read-only.

	* imap4d/imap4d.c (user_retain_groups): New global. New config
	statement "retain-groups".
	(mu_get_user_groups): New function.
	(imap4d_session_setup0): Use mu_switch_to_privs instead of just
	setuid.
	* imap4d/list.c (imap4d_list): Fix handling of
	 LIST "" "/path/to/mbox"
	* imap4d/select.c (imap4d_select0): Retry opening in read-only
	mode if failed to open for read-write.
	* libproto/maildir/mbox.c (maildir_mkfilename)
	(mk_info_filename): Change return value and signature. All uses
	changed.
	(maildir_scan0): Don't shuffle messages if mailbox is opened
	read-only.
	* libproto/maildir/folder.c: Update call to maildir_mkfilename.
	* libproto/maildir/maildir.h (maildir_mkfilename): Change
	prototype.

2014-12-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix eventual memory overrun.

	* mail/mail.c (mail_mainloop): Check command length before
	trying to access its last byte.

2014-08-14  Sergey Poznyakoff  <gray@gnu.org>

	Fix possible coredump in stream library.

	* libmailutils/stream/stream.c (mu_stream_strerror): stream can
	be NULL.

2014-08-10  Sergey Poznyakoff  <gray@gnu.org>

	imap-related bugfixes.

	* imap4d/search.c (imap4d_search0): Use parsebuf.err_mesg if
	defined, otherwise fall back to the general "parse error"
	message.
	* include/mailutils/datetime.h (MU_DATETIME_INTERNALDATE): Use
	%e for day. Day can be one-digit decimal.
	* libmailutils/datetime/scantime.c (mu_scan_datetime): Skip
	initial ws for %e.
	* mu/imap.c (com_search): Print newline after the "no matches"
	message.

2014-07-28  Sergey Poznyakoff  <gray@gnu.org>

	Add scripting capability to mh/inc.

	This patch adds a convenience library libmuscript that provides
	scripting capability easy to use in MU applications. Currently
	used by maidag and inc.

	* include/mailutils/util.h (mu_stpcpy): 2nd arg is const.
	* libmailutils/string/stpcpy.c: Likewise. 
	* lib/.gitignore: Update.
	* lib/Makefile.am: New library libmuscript.a
	* lib/muscript.h: New file.
	* lib/muscript_priv.h: New file.
	* lib/script.c: New file.
	* maidag/guile.c: Rename to ...
	* lib/guile.c: ... this
	* maidag/python.c: Rename to ...
	* lib/python.c: ... this
	* maidag/sieve.c: Rename to ...
	* lib/sieve.c: ... this 
	* maidag/Makefile.am (maidag_LDADD): Add libmuscript.a
	(maidag_SOURCES): Update.
	* maidag/maidag.c (script_handler): Change type to mu_script_t.
	* maidag/maidag.h: Include muscript.h
	* maidag/script.c: Rewrite via libmuscript 
	* mh/Makefile.am (inc_LDADD): New variable.
	* mh/inc.c (options): New options --language and --script.
	(mh_option): New options -language and -script.
	(incdat) <handler,descr>: New members.
	(incmbx): Optionally process each message through a script. If
	it is marked as deleted upon return, don't incorporate it.
	(main): Set mh as the default mailbox scheme. Initialize
	scripting subsystem and deallocate it when finished.
	* mh/mh_getopt.h (ARG_LANG, ARG_SCRIPT): New constants.

2014-07-26  Sergey Poznyakoff  <gray@gnu.org>

	Move gnulib into a subdir.

	* bootstrap.conf: Create and populate lib/gnu, if necessary.
	* configure.ac (MU_APP_COMMON_INCLUDES): Update.
	(AC_CONFIG_FILES): Build lib/gnu/Makefile
	* lib/Makefile.am (libmuaux_a_SOURCES): Add all objects from
	gnu/
	* po/POTFILES.in: Update. 
	* examples/.gitignore: Update.

2014-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* examples/echosrv.c: Fix typo.
	* libmailutils/sockaddr/url.c: Likewise.
	* mh/mhn.c: Likewise.
	* mh/folder.c (roll_back): Fix conditional.
	* THANKS: Update.

2014-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/filter/iconvflt.c: Fix silly errors.

2014-07-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Push missing files.

2014-07-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	New example: mboxidx.

	* examples/mboxidx.c: New file
	* examples/Makefile.am: Add mboxidx

2014-07-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix memory overrun in iconv filter.

	* libmailutils/filter/iconvflt.c (format_octal): New function.
	(_icvt_decoder): Fix size calculations before returning
	mu_filter_moreoutput. Use format_octal instead of sprintf to
	avoid memory overwrite with the terminating nul character.

2014-07-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement the xml filter.

	* libmailutils/filter/xml.c: New file.
	* include/mailutils/filter.h (mu_xml_filter): New extern.
	* libmailutils/filter/Makefile.am (libfilter_la_SOURCES): Add
	xml.c
	* libmailutils/filter/filter.c (mu_filter_get_list): Register
	mu_xml_filter. 
	* libmailutils/tests/xml.at: New file.
	* libmailutils/tests/Makefile.am: Add xml.at
	* libmailutils/tests/testsuite.at: Likewise.

2014-07-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	New filter: htmlent.

	* include/mailutils/filter.h (mu_htmlent_filter): New extern.
	* libmailutils/filter/Makefile.am: Add htmlent.c
	* libmailutils/filter/filter.c (mu_filter_get_list): Register
	mu_htmlent_filter.
	* libmailutils/filter/htmlent.c: New file.
	* libmailutils/tests/htmlent.at: New testcase.
	* libmailutils/tests/Makefile.am: Add new testcase.
	* libmailutils/tests/testsuite.at: Likewise.

2014-06-17  Damien Diederen  <dd@crosstwine.com>

	maildir: Keep trailing comma even when no flags are set.

	Without this, `mk_info_filename' generates filenames of the
	following form when the flag set is empty:

	 1402217787.M664911P5957Q143.hostname:2

	The original Maildir spec (http://cr.yp.to/proto/maildir.html),
	however, mandates that filenames must be of the form
	`uniq:info', with `info' starting with "2,"--including a comma.

	This patch removes the "cleanup" performed by
	`mk_info_filename' as that there is no rationale for it in
	mailutils' source code history, and as it breaks Gnus'
	"nnmaildir" backend (Cf. `nnmaildir--add-flag'). 
	* libproto/maildir/mbox.c (mk_info_filename): Keep comma at the
	end of filename when the flags suffix is empty.

2014-05-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* libmailutils/mailbox/attribute.c (mu_attribute_is_equal): Fix
	comparison.
	* libmailutils/mailbox/biffnotify.c: Add missing includes.

2014-04-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	frm: fix counters when given multiple mailboxes.

	* frm/frm.c (frm): Initialize counters.
	* frm/tests/testsuite.at: Test multiple mailboxes.

2014-02-26  Sergey Poznyakoff  <gray@gnu.org>

	Fix compilation without gnutls.

	* imap4d/imap4d.c [WITH_TLS] (cb_tls_required): Conditional
	compilation.
	* imap4d/imap4d.h [!WITH_TLS] (tls_encryption_on): Empty
	define.
	* pop3d/pop3d.c [!WITH_TLS] (tls_available): Empty define.
	* libmu_scm/mu_mailbox.c (mu_scm_mailbox_print): Fix format
	string.

2014-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	imap client: fix handling of ID response without untagged part.

	* libproto/imap/id.c: Make sure returned mu_assoc_t is valid
	even if no untagged response was received (equivalent to NIL).

2014-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve tls support.

	Remove deprecated types and function calls. Make cipher, mac,
	and other priorities configurable.

	* include/mailutils/sys/tls-stream.h (_mu_tls_stream): Use
	gnutls_session_t.
	* include/mailutils/tls.h (mu_tls_module_config): New member:
	priorities.
	* libmu_auth/tls.c: Remove deprecated types.
	(initialize_tls_session): Make priorities configurable.
	(prepare_client_session): Set default priorities.
	* libmu_cfg/tls.c: New configuration statement: ssl-priorities.

2014-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Clean up unused variables.

2014-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use AM_CPPFLAGS instead of INCLUDES; upgrade gint.

2014-02-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Accept single-dash notify option to inc.

	* mh/mh_getopt.c (mh_getopt): Correctly handle traditional
	options that begin with "no" (e.g. "notify").
	* mh/inc.c (mh_option): Accept -notify (single-dash).

2014-02-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Move biff notification to the library.	Implement it in inc and
	movemail.

	* include/mailutils/mailbox.h (mu_mailbox_set_notify)
	(mu_mailbox_unset_notify): New protos.
	* include/mailutils/sys/mailbox.h (_mu_mailbox) <notify_user>
	<notify_fd,notify_sa>: New members.
	* libmailutils/mailbox/Makefile.am (libmailbox_la_SOURCES): Add
	biffnotify.c
	* libmailutils/mailbox/biffnotify.c: New file.
	* libmailutils/mailbox/mailbox.c (_mailbox_create_from_record):
	Initialize notify_fd.
	(mu_mailbox_destroy): Free notify_sa.
	(mu_mailbox_close): Close notify_fd.
	(mu_mailbox_flush): Rewrite to handle append-only mailboxes
	effectively.
	* libmailutils/server/msrv.c (server_cfg_param): Fix docstring.
	* libmailutils/stream/file_stream.c (fd_open): Open fd
	read-write if both MU_STREAM_APPEND and MU_STREAM_READ are
	requested.
	* libproto/mbox/mbox.c (mbox_expunge0): Rescan the mailbox if
	messages_count == 0. Special handling for append-only
	mailboxes.
	* maidag/deliver.c: Use library notification mechanism.
	* mh/inc.c: New option --notify.
	* movemail/movemail.c: Likewise.

2014-02-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update copyright years.

2014-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use global TLS setting in inetd mode (bug #40891)

	* imap4d/imap4d.c (imap4d_connection): Use global TLS setting
	if no local one was supplied.
	(main): Use global TLS setting in inetd mode.
	* pop3d/pop3d.c (main): Use global TLS setting in inetd mode.

2014-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix coredump if crypt returns NULL.

	* libmailutils/auth/system.c: Check return from crypt before
	passing it to strcmp.
	* libmu_auth/sql.c: Likewise.

2014-02-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Issue a deprecation warning if tls-required is used in pop3d or
	imap4d config.

2013-12-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix bug in handling AUTHENTICATE command (imap4d). Add
	user/group ACLs.

	The bug was introduced in commit 6e2a3758.

	The ACLs allow administrators to limit access to IMAP services
	to particular users or users belonging to particular groups.

	* imap4d/authenticate.c (imap4d_auth_capability): Take session
	pointer as argument. Don't report authentication capabilities
	if tls is required.
	(imap4d_authenticate): Fix conditional.
	* imap4d/capability.c (imap4d_capability): Update call to
	imap4d_auth_capability.
	* imap4d/imap4d.c (cb_tls_required): Set tls_mode.
	(auth_deny_user_list,auth_allow_user_list)
	(auth_deny_group_list,auth_allow_group_list): New statics.
	(check_user_groups,imap_check_group_list): New static
	functions. (imap4d_cfg_param) <allow-users,deny-users>
	<allow-groups,deny-groups>: New configuration statements.
	(imap4d_session_setup0): Check allow/deny lists.
	* imap4d/imap4d.h (imap4d_auth_capability): Change signature. 
	* pop3d/pop3d.c (cb_tls_required): Set tls_mode. 
	* bootstrap (gnulib_extra_files): Update.

2013-12-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix in mh/inc.

	* mh/inc.c (main): Update the unseen sequence only if some new
	messages were incorporated.

2013-11-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix appending to IMAP[S] mailboxes.

	* libproto/imap/appmsg.c (mu_imap_append_message): Fix
	conditional.
	* libproto/imap/mbox.c (_imap_mbx_append_message): Fix error
	checking.
	* libproto/imap/url.c (_mu_imap_url_init)
	(_mu_imaps_url_init): Set _get_path member. This allows the
	user to specify an URL without explicit path, implying INBOX.

2013-10-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* imap4d/io.c (io_copy_out): Switch to full buffering before
	sending data.
	* libmailutils/stream/stream.c (_stream_skip_input_bytes):
	Bugfix.

2013-08-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix tls_required functionality in imap4d.

	* imap4d/imap4d.c (imap4d_mainloop): Add missing break.

2013-08-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in LDAP code.

	* libmu_auth/ldap.c (_mu_conn_setup): Set protocol version
	number before trying to initialize TLS. Provide a detailed
	diagnostics.

2013-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Support for RFC 3206.

	* pop3d/pop3d.h (ERR_SYS_LOGIN): New error code.
	* pop3d/capa.c (pop3d_session_init): Advertise the
	AUTH-RESP-CODE capability.
	* pop3d/cmd.c (error_table) <ERR_BAD_LOGIN>: Mark with the AUTH
	response code.
	<ERR_SYS_LOGIN>: New entry.
	* pop3d/user.c (pop3d_user): Use mu_get_auth to obtain the
	user's identity. On error, the error code is ERR_BAD_LOGIN or
	ERR_SYS_LOGIN, depending on its return and return from
	mu_authenticate.

2013-06-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	One more fix.

	* libmailutils/server/ipsrv.c (mu_ip_tcp_accept): Handle
	connection aborted error as well.

2013-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* imap4d/io.c (imap4d_tokbuf_decrlf): Rewrite to run in O(n).
	* libmailutils/server/ipsrv.c (mu_ip_tcp_accept): Return 0 on
	EINTR (unless srv->f_intr tells otherwise) and EAGAIN. The
	caller will retry.
	(mu_ip_server_accept): output a diagnostic message before
	returning error.

2013-05-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* mu/Makefile.am (mailutils-config): Fix sed expression
	* mu/mailutils-config.in: Replace MUNAME once and assign it to
	the variable.

2013-04-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement MH show utility.

	* mh/show.c: New file.
	* NEWS: Document changes.
	* libmailutils/stream/message_stream.c (copy_trimmed_value):
	Fix string length calculation to allow for empty lines.
	* mh/.gitignore: Update.
	* mh/Makefile.am: Build show.
	* mh/TODO: Document show.
	* mh/mh_getopt.h: Add new option codes.
	* mh/mh_init.c (mh_expand_name): Change handling of the last
	argument. All callers updated.
	(mh_draft_name): Remove.

2013-04-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix MH sequence parser.

	* mh/mh_msgset.c (parse_range): Fix resolving non-existing
	UIDs.
	* mh/tests/mhseq.at: Add more test cases.

2013-04-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add support for Unseen-Sequence in inc.

	* mh/inc.c (main): Append the numbers of incorporated messages
	to Unseen-Sequence, if defined in .mh_profile.

2013-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH send: improve compatibility with MH/nmh.

2013-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Rewrite mu_utc_offset in a more portable (hopefully) way.

2013-04-02  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix in docs.

2013-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	MH: Synchronize sequences after removal of messages.

	* include/mailutils/msgset.h (mu_msgset_sget_mailbox): New
	proto.
	* include/mailutils/sys/msgset.h (_MU_MSGSET_MODE): New macro.
	* libmailutils/msgset/Makefile.am: Add getmbox.c
	* libmailutils/msgset/getmbox.c: New file.
	* libmailutils/msgset/addset.c: Use _MU_MSGSET_MODE.
	* libmailutils/msgset/create.c: Likewise.
	* libmailutils/msgset/foreachmsg.c: Likewise.
	* libmailutils/msgset/foreachnum.c: Likewise.
	* libmailutils/msgset/negate.c: Likewise.
	* libmailutils/msgset/subset.c: Likewise.
	* libmailutils/msgset/trans.c: Likewise. 
	* mh/mh.h (mh_private_sequences_iterate): New proto.
	* mh/mh_sequence.c (format_closure) <delim>: New member.
	(format_sequence): Use delim to avoid outputting leading space.
	(save_sequence): Initialize delim.
	(mh_private_sequences_iterate): New function.
	* mh/rmm.c (main): Remove message numbers from sequences.
	* mh/tests/rmm.at: Update.

2013-04-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/base/amd.c (_amd_update_message): Return
	immediately if the message is not modified. Always use
	initialized value of flg.

2013-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	msgchk: assume -date by default.

2013-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* mh/msgchk.c (checkmail): take into account various possible
	return codes.

2013-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement IMAP SEARCH. New function mu_mailbox_access_time.

	* include/mailutils/imap.h (mu_imap_search): New proto.
	* libproto/imap/search.c: New file.
	* include/mailutils/sys/imap.h (MU_IMAP_CLIENT_SEARCH_RX): New
	state.
	* libproto/imap/fetch.c: Fix debugging categories
	* libproto/imap/mbox.c (_imap_messages_recent)
	(_imap_message_unseen): Use search if information is not
	readily available.
	* libproto/imap/status.c (_mu_imap_status_name_table): Comment
	out UNSEEN: its semantics is entirely different from what we
	need.
	* libproto/imap/Makefile.am: Add new file.
	* mu/imap.c: Implement search. 
	* include/mailutils/sys/mailbox.h (_mu_mailbox) <_get_atime>:
	New method.
	* include/mailutils/mailbox.h (mu_mailbox_access_time): New
	proto.
	* libproto/mbox/mbox.c (_mailbox_mbox_init): Initialize
	>_get_atime.
	* libmailutils/mailbox/mailbox.c (mu_mailbox_access_time): New
	function. 
	* libmailutils/datetime/utcoff.c (mu_utc_offset): Rewrite using
	tzset. 
	* mh/msgchk.c: Implement --date. Check for new mail using both
	recent and unseen messages.

2013-03-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement msgchk.

	* mh/msgchk.c: New file.
	* mh/Makefile.am: Build msgchk.
	* mh/mh_getopt.h: Update.
	* mh/.gitignore: Update.
	* mh/TODO: Update.

2013-03-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix the use of localname and localdomain in ~/.mtstailor.

	* mh/send.c (read_mts_profile): Fix the handling of localname
	vs. localdomain. The localname setting used alone overrides the
	hostname as returned by mu_hostname. The value of localdomain,
	if set, is appended to the hostname (eventually modified by
	localname), with a "." as a separator.

2013-03-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Do not ask for ESMTP credentials if unable to handle them.

	* libproto/mailer/smtp.c (smtp_open): Disable ESTMP AUTH if
	GSASL support is not compiled.
	* libproto/mailer/smtp_auth.c (mu_smtp_auth): If compiled
	without GSASL, don't attempt to obtain user credentials.

2013-03-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix interaction with POP3 servers that do not support the CAPA
	command.

	* libproto/pop/mbox.c (pop_open): Do not bail out if the CAPA
	command returns -ERR. Assume a pre-RFC2449 server.
	* include/mailutils/pop3.h (mu_pop3_strresp)
	(mu_pop3_sget_response,mu_pop3_aget_response)
	(mu_pop3_get_response): New protos.
	* libproto/pop/pop3_response.c (mu_pop3_response): Don't make
	out a fake response in case of a I/O error. (mu_pop3_strresp)
	(mu_pop3_sget_response,mu_pop3_aget_response)
	(mu_pop3_get_response): New functions.

2013-03-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmu_auth/ldap.c (_mu_ldap_search): Fix improper addressing
	of env.

2013-03-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Raise version number.

2013-02-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	ali: executable file inclusion.

	The "< file" construct tests if file is executable and begins
	with the shell interpreter magic (#!/ or #! /). If so, this
	file is executed and its output is collected. This provides a
	way for building aliases on the fly.

	* mh/mh_alias.l (buffer_ctx) <exec_p>: New member.
	(exec_p): New static variable.
	(push_source): If the file is executable and begins with the
	"#!/" magic, run it and collect its output.
	(pop_source): Use exec_p to decide how to close the file.
	* mh/tests/ali.at: Test executable file inclusion.
	* NEWS: Update.

2013-01-03  Sergey Poznyakoff  <gray@gnu.org.ua>

	Make sure modifications to a message or its parts become
	visible in the message stream.

	* include/mailutils/sys/body.h (_mu_body)<rawstream>: New
	member.
	* include/mailutils/sys/message.h (_mu_message)<rawstream>: New
	member.
	* libmailutils/mailbox/body.c: Rewrite. Return the specially
	crafted "body-stream" for user I/O operations. Writes to that
	stream trigger creation of a temporary stream (write-through
	mode) which will be used for subsequent I/O.
	* libmailutils/mailbox/msgbody.c (mu_message_get_body): Use
	msg->rawstream.
	* libmailutils/mailbox/msgheader.c (message_header_fill): Do
	not call mu_message_get_streamref, as that can result in
	endless recursion. Use msg->rawstream instead.
	* libmailutils/mailbox/msgref.c (_mu_message_free): Destroy
	both rawstream and outstream.
	* libmailutils/mailbox/msgstream.c (mu_message_set_stream): Set
	rawstream.
	(mu_message_get_stream): Create outstream as needed.
	(mu_message_get_streamref): If the message has been modified,
	create the outstream and return it to the caller. This way, the
	modifications become visible via the stream interface.
	* libmailutils/tests/Makefile.am: Add new testcases.
	* libmailutils/tests/testsuite.at: Likewise.
	* libmailutils/tests/modmesg.c: New file.
	* libmailutils/tests/modmesg00.at: New file.
	* libmailutils/tests/modmesg01.at: New file.
	* libmailutils/tests/modmesg02.at: New file.
	* libmailutils/tests/modmesg03.at: New file.
	* mh/mhn.c: Fix message reference counting.

2012-12-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* mh/folder.c (_fixup): Pass a pointer to mailbox to
	mu_msgset_create.

2012-11-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* imap4d/imap4d.c: Avoid gcc warnings.
	* libmailutils/tests/imapio.c (main): Fix format specifier.
	* maidag/mailquota.c (dbm_retrieve_quota): Likewise.
	* mail/quit.c (mail_mbox_close): Likewise.
	* mail/mail.c (options): Fix improper initialization.
	* mu/mu.h (mu_getans): Add proto.
	* mu/util.c: Include netinet/in.h

2012-11-12  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement editheader sieve extension (RFC 5293).

	Also fix iterator synchronization after removing an element and
	improve Sieve API.

	* include/mailutils/header.h (mu_header_get_itemptr): New
	proto.
	* include/mailutils/iterator.h (mu_iterator_advance): Remove.
	(mu_iterator_delitem): New proto.
	(mu_iterator_set_delitem): New proto.
	* include/mailutils/sieve.h (mu_sieve_register_t) <opt_args>:
	New member. (mu_sieve_register_test_ext)
	(mu_sieve_register_action_ext): New protos.
	* include/mailutils/sys/iterator.h (_mu_iterator) <curitem_p>:
	Remove.
	<delitem>: New member. All uses updated. 
	* libmailutils/base/iterator.c (mu_iterator_set_delitem): New
	function. 
	* libmailutils/mailbox/hdritr.c: Implement bidirectional
	iteration. Implement itrctl method.
	* libmailutils/mailbox/header.c: Likewise. 
	* libmailutils/base/assoc.c: Use delitem method instead of
	curitem_p.
	(mu_iterator_delitem): New function.
	* libmailutils/base/opool.c
	* libmailutils/diag/debug.c
	* libmailutils/list/iterator.c
	* libmailutils/list/pop.c
	* libmailutils/list/remove.c
	* libmailutils/list/removenth.c
	* libmailutils/mailbox/imapenv.c
	* libmailutils/mailbox/mbxitr.c
	* libproto/pop/pop3_iterator.c 
	* libmu_sieve/extensions/Makefile.am: Add editheader.c
	* libmu_sieve/extensions/editheader.c: New file. 
	* libmu_sieve/prog.c (mu_sv_code_command): Allow for optional
	positional arguments.
	* libmu_sieve/register.c (mu_sieve_test_lookup)
	(mu_sieve_action_lookup): Return NULL if a record with empty
	(NULL) handler is found. (mu_sieve_register_test_ext)
	(mu_sieve_register_action_ext): New functions.
	(mu_sieve_register_test)
	(mu_sieve_register_action): Rewrite as wrappers to the above.
	* libmu_sieve/util.c (mu_sieve_vlist_do): Allow for SVT_STRING
	argument.
	* sieve/tests/Makefile.am: Add new testcases.
	* sieve/tests/testsuite.at: Include new testcases.
	* sieve/tests/addheader.at: New testcase.
	* sieve/tests/delheader.at: New testcase. 
	* NEWS: Update.
	* doc/rfc/README: Update.

2012-08-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve header stream write method.

	* libmailutils/mailbox/header.c (HEADER_STREAMMOD): New flag.
	(mu_header_fill): Read data back from mstream if it was
	modified.
	(mu_header_destroy): Destroy mstream.
	(header_write): Rewrite from scratch. Allow for writing at
	arbitrary offsets.
	* examples/header.c: New commands: "overwrite" and "append",
	for testing the new functionality.

2012-08-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	mail: provide a way to set return address.

	* mail/mail.c: New option -r (--return-address).
	* mail/mailvar.c: New variable "return-address".
	* mail/send.c (send_message): Obtain the return mail address
	from the "return-address" variable (if set). 
	* NEWS: Update.
	* doc/texinfo/programs.texi: Update.

2012-08-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix a typo.

2012-08-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	mailutils-config: reflect eventual rename of mu, so that
	AM_GNU_MAILUTILS works.

	* mu/.gitignore: Update.
	* mu/Makefile.am: Build mailutils-config
	* mu/mailutils-config.in: New file.
	* mu/mailutils-config: Remove.

2012-08-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Ensure consistent stream state before calling its ctl method.

	Prior to calling ctl method, mu_stream_ioctl flushes stream
	buffer.

	* libmailutils/stream/fltstream.c (filter_ctl)
	<MU_IOCTL_FILTER_SET_DISABLED>: Flush internal buffer prior to
	setting the flag.
	* libmailutils/stream/stream.c (mu_stream_ioctl): Flush stream
	buffer.

2012-07-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Port 0b1e16bea to imap4d.

	* imap4d/imap4d.c (tls_required): Remove.
	(tls_mode): New variable.
	(imap4d_srv_config) <tls>: Remove.
	(imap4d_srv_config) <tls_mode>: New member.
	(imap4d_srv_param): Change the definition of the "tls"
	statement. Mark "tls-required" as deprecated.
	(imap4d_mainloop): Change type of the tls argument. Initialize
	session and pass it to each handler.
	* imap4d/imap4d.h (imap4d_session): New struct.
	(imap4d_command) <func>: Change signature. All uses changed.
	(tls_mode): New enum.
	(tls_required): Remove.
	(tls_available): New global.
	* imap4d/io.c (io_setio): Don't call tls_encryption_on, leave
	it to the caller.
	* imap4d/login.c (imap4d_login): Use session.
	* imap4d/starttls.c (tls_available): Global. Present even if
	!WITH_TLS
	(tls_encryption_on): Change signature. All callers updated.

2012-07-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement SMTP shell in mu.

	* include/mailutils/smtp.h (mu_smtp_get_reply_iterator)
	(mu_smtp_cmd,mu_smtp_test_param): New protos.
	* libproto/mailer/Makefile.am (libmu_mailer_la_SOURCES): Add
	smtp_cmd.c
	* libproto/mailer/smtp_cmd.c: New file.
	* libproto/mailer/smtp_io.c (mu_smtp_get_reply_iterator): New
	function.
	* libproto/mailer/smtp_param.c (mu_smtp_set_param): Accept NULL
	parameter value.
	(mu_smtp_test_param): New function.
	* mu/Makefile.am [MU_COND_SUPPORT_SMTP]: Add smtp.c to MODULES.
	(mu_SOURCES): Add getans.c, getyn.c and util.c
	* mu/getans.c: New file.
	* mu/getyn.c: New file.
	* mu/smtp.c: New file.
	* mu/util.c: New file.
	* mu/mu.h (port_from_sa): New proto.
	* mu/pop.c (port_from_sa): Move to util.c

2012-07-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	Drop a superfluous dependency on libgcrypt.

	* am/tls.m4 (MU_CHECK_GNUTLS): Newer GNU TLS does not require
	libgcrypt. It is required only for v. 2.11 and prior versions.

2012-07-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes in SMTP and URL code.

	* include/mailutils/smtp.h (mu_smtp_replcode)
	(mu_smtp_sget_reply)
	(mu_smtp_capa_iterator): New protos.
	* libmailutils/url/dup.c (mu_url_dup): Bugfix. Obtain the name
	using mu_url_sget_name, which will create it if necessary.
	* libproto/mailer/Makefile.am (libmu_mailer_la_SOURCES): Add
	smtp_capa_itr.c
	* libproto/mailer/smtp_capa_itr.c: New file.
	* libproto/mailer/smtp_io.c (mu_smtp_response): Fix filling of
	smtp->flbuf.
	(mu_smtp_replcode,mu_smtp_sget_reply): New functions.

2012-07-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	pop3d: make tls more configurable.

	The "tls" statement can be used both within a server
	declaration and in the global scope, the former overriding the
	latter. Its argument can be one of the following:

	 no TLS is not used. The STLS command won't be available even
	 if the tls configuration is otherwise complete.
	 ondemand TLS is initiated when the user issues the STLS
	command.
	 This is the default when TLS is configured.
	 required Same as above, but the use of STLS is mandatory. The
	 authentication state is entered only after TLS negotiation
	 has succeeded.
	 connection TLS is always forced when the connection is
	established (pops).

	For compatibility with prior versions the tls-required
	statement is retained, but is considered deprecated. It is
	synonymous with "tls required". The "tls" statement allows for
	the following alias values: 
	 false, off, 0 same as no
	 stls same as ondemand
	 yes, true, on, 1 same as connection

	Internally, all handler functions receive a pointer to the POP
	session structure, which configures the current session. In
	particular, it contains the TLS mode and capability list. 
	* pop3d/capa.c (pop3d_capa): Traverse the capability list,
	outputting each of its elements. (pop3d_session_init)
	(pop3d_session_free): New functions.
	* pop3d/logindelay.c (login_delay_capa): Change signature.
	* pop3d/pop3d.c (tls_required): Remove.
	(tls_mode): New variable.
	(pop3d_srv_config) <tls>: Remove.
	(pop3d_srv_config) <tls_mode>: New member.
	(pop3d_srv_param): Change definition of the "tls" statement.
	(pop3d_cfg_param): New statement "tls". Mark "tls-required" as
	deprecated.
	(pop3d_mainloop): Change type of the tls argument. Initialize
	session and pass it to each handler.
	(pop3d_connection): Decide whether and how to use TLS using
	global and per-session settings, the latter overriding the
	former.
	* pop3d/pop3d.h (login_delay_capa): Change signature.
	(tls_mode): New enum.
	(pop3d_capa_type): New enum.
	(pop3d_capa, pop3d_session): New structs. (pop3d_session_init)
	(pop3d_session_free): New protos.
	(pop3d_command_handler_t): Change signature. All handlers and
	their uses are changed accordingly.
	* pop3d/stls.c (pop3d_stls): Return error if session does not
	allow tls.

2012-07-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

2012-07-19  Sergey Poznyakoff  <gray@gnu.org.ua>

	mail: provide mechanism for listing and editing attachments
	from the shell.

	* NEWS: Update.
	* mail/escape.c (escape_check_args): Take two additional
	arguments specifying minimum and maximum number of parameters
	to expect. All uses updated. Remove static qualifier.
	* mail/mail.h (send_attach_file): Rename to
	send_attach_file_default
	(escape_check_args,escape_list_attachments)
	(escape_attach,escape_remove_attachment): New protos.
	* mail/send.c (send_attach_file): Take encoding and content
	type as arguments.
	(send_attach_file_default): New function.
	(escape_list_attachments)
	(escape_attach,escape_remove_attachment): New functions.
	* mail/table.c: New escapes: l, +, ^ 
	* include/mailutils/list.h (mu_list_remove_nth)
	(mu_list_remove_nth_nd): New protos.
	* libmailutils/list/Makefile.am (liblist_la_SOURCES): Add
	removenth.c
	* libmailutils/list/removenth.c: New file.

2012-07-18  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement --attach option in mail; fix dead.letter
	functionality.

	* NEWS: Update.
	* doc/imprimatur: Upgrade.
	* libmailutils/mime/attachment.c
	(mu_message_create_attachment): Bugfixes.
	* mail/mail.c: New options --attach, --content-type and
	--encoding.
	* mail/mail.h (default_encoding, default_content_type): New
	externs.
	(send_attach_file): New proto.
	* mail/send.c (send_attach_file): New function.
	(save_dead_message_env): New function.
	(save_dead_message): Rewrite.
	(mail_send0): Attach files, if requested.

2012-07-17  Wojciech Polak  <polak@gnu.org>

	Update C++ and Python interfaces.

	* include/mailutils/prog.h: Add extern "C".
	* include/mailutils/wordsplit.h: Likewise.
	* libmu_cpp/address.cc (Address::to_string): Use
	mu_address_sget_printable.
	* libmu_cpp/filter.cc (FilterIconvStream): Use
	mu_filter_create_args.
	* python/mailutils/folder.py (get_stream, set_stream): Remove.

2012-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Spelling fixes.

2012-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Upgrade imprimatur module.

	* doc/imprimatur: Upgrade.

2012-07-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve configuration options.

	* am/enable.m4 (MU_ENABLE_BUILD): Change handling of
	additional-cond
	($4): the --{enable|disable}-build-* argument value overrides
	it. This allows to use such configuration shortcuts as: 
	 --disable-build-clients --enable-build-mail

	which will build only mail, but no other client. 
	* configure.ac: New option --with-dbm can be used to
	enable/disable building of all available DBM interfaces. It can
	be used in conjunction with implementation-specific options in
	the same way as described above, e.g.: 
	 --without-dbm --with-gdbm

	New option --with-mailbindir allows for overriding the
	installation directory for mail[x] only. 
	* mail/Makefile.am (mailbindir): New variable.
	(bin_PROGRAMS): Rename to mailbin_PROGRAMS.

2012-07-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove dependency on obstack. Use mu_opool_t instead.

	* include/mailutils/opool.h (mu_opool_alloc): New proto.
	* libmailutils/base/opool.c (mu_opool_alloc): New function.
	(mu_opool_appendz): Do not append trailing null character.
	* libmailutils/cfg/parser.y (mu_cfg_tree_create_node): Reflect
	the change in mu_opool_appendz.
	* comsat/action.c: Use mu_opool_t instead of struct obstack.
	* lib/mailcap.c: Likewise.
	* libmailutils/url/urlstr.c: Likewise.
	* mh/burst.c: Likewise.
	* mh/mh_fmtgram.y: Likewise.
	* mh/mh_format.c: Likewise.
	* mh/mh_format.h: Likewise.
	* mh/mhn.c: Likewise.
	* mh/repl.c: Likewise.
	* mh/whatnowenv.c: Likewise.
	* mimeview/mimetypes.l: Likewise.
	* mimeview/mimeview.h: Likewise. 
	* gnulib.modules: Remove obstack.

2012-07-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove dependency on getline.

	* gnulib.modules: Remove getline.
	* pop3d/apop.c [!ENABLE_DBM] Use mu_stream API instead of FILE.

2012-07-16  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	Imap4d would fail to select a nonexistent maildir INBOX,
	because the mu_mailbox_uidvalidity would return MU_ERR_NOENT.

	* libmailutils/base/amd.c (_amd_scan0): Recompute uidvalidity
	if the mailbox is empty.

2012-06-15  Sergey Poznyakoff  <gray@gnu.org.ua>

	inc: bugfix.

	* mh/inc.c (incmbx): Fix typos.

2012-06-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix a typo.

	* imap4d/copy.c (imap4d_copy0): Invert condition.

2012-06-10  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix in configuration reduction routines.

	* libmailutils/cfg/parser.y (mu_cfg_preorder): Accept null node
	lists.

2012-06-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix bug in mh testsuite.

	We cannot assume that $HOME points to existing directory.

	* mh/tests/testsuite.at (MH_SETUP): Override HOME environment
	variable. Use it instead of curdir.
	* mh/tests/atlocal.in (remove_curdir): Likewise.
	* mh/tests/mhn.at: Likewise.

2012-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* imap4d/imap4d.c Include mailutils/gsasl.h unconditionally.

2012-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fixes: port cfg statement, listen cfg statement in maidag,
	final dot recognition in maidag.

	* include/mailutils/server.h (mu_m_server_listen)
	(mu_m_server_parse_url): New protos.
	* libmailutils/server/msrv.c (add_server): Rename to
	mu_m_server_listen (now extern). All uses updated.
	(get_port): Bugfix: return port in server byte order. This
	fixes the use of the "port" configuration statement.
	* maidag/lmtp.c (cfun_data): Don't switch to full buffering.
	This makes it impossible to note the final dot in time.
	* maidag/maidag.c (cb_listen): New callback.
	(maidag_cfg_param): Attach cb_listen to the "listen" statement.

2012-06-07  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement two new Scheme functions.

	* NEWS: Update.
	* configure.ac: Version 2.99.97
	* libmu_scm/mu_mailbox.c (mu-mailbox-sync)
	(mu-mailbox-flush): New functions.

2012-06-06  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix comsat testsuite.

	* comsat/tests/atlocal.in (MH_SUPPORT)
	(MAILDIR_SUPPORT): New variables.
	* comsat/tests/testsuite.at: Disable test cases if their
	prerequisite features are not compiled in.

2012-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Don't use disabled features in mailutils.scm.

	* libmu_scm/mailutils/Makefile.am (DISTCLEANFILES): Rename to
	CLEANFILES: mailutils.scm should be cleaned as a usual object
	file.
	(MU_FEATURES): New variable, constructed depending on MU_COND_
	variables.
	(mailutils.scm goal): Use the value of MU_FEATURES as m4
	command line.
	* libmu_scm/mailutils/mailutils.scm.in: Include only supported
	libraries.

2012-06-04  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/base/symlink.c (mu_readlink): Fix initialization
	of size.

2012-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update root ignore list.

2012-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix typos in the generated ChangeLog.

	* ChangeLog.amend: New file.
	* Makefile.am: Apply corrections from ChangeLog.amend when
	generating ChangeLog file.

2012-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update ignore lists.

2012-06-01  Sergey Poznyakoff  <gray@gnu.org.ua>

	inc: accept mail from multiple source mailboxes.

	* doc/texinfo/mu-mh.texi: Document changes to inc.
	* NEWS: Likewise.
	* mh/inc.c: Accept multiple source mailboxes.
	(input_file): Remove.
	(input_file_list): New variable.
	(opt_handler): Multiple -file options augment input_file_list.
	(incmbox): New function.
	(main): Iterate over input_file_list, incorporating mail from
	each mailbox in it.

	Bugfix: 
	* libproto/imap/mbox.c (_imap_env_date): Return a 0-terminated
	string.

	Fix MH test suite.

	The ali-everybody tests fails on machines with user database
	kept in a non-standard storage (e.g. LDAP or NIS). This patch
	attempts to fix it. 
	* mh/tests/lu.c: New file.
	* mh/tests/.gitignore: Add lu.
	* mh/tests/Makefile.am (noinst_PROGRAMS): New variable.
	* mh/tests/ali.at: Use lu instead of scanning /etc/passwd
	directly.

2012-05-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in imap4d testsuite.

	Reportedly, the test command on 64-bit boxes is unable to
	handle unsigned long integers. Install a work over.

	* imap4d/tests/IDEF0955.at: Use string comparison in the
	invocation of test.
	* imap4d/tests/IDEF0956.at: Likewise.

2012-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor change in bootstrap.

	* bootstrap.conf: Avoid downloading radius.m4 if it is already
	here.

2012-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix SMTP STARTTLS and SMTPS.

	* libproto/mailer/smtp.c (smtp_open): Do not use mu_tls_enable,
	rely on TLS stream functions to do the right thing. This
	complements 325c864eb1b88ac73c39ca3681a02f5194021806.

2012-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix handling of URL authentication credentials in SMTP AUTH.

	Provide special functions for storing and retrieving URL from
	mu_smtp_t object, instead of using MU_SMTP_PARAM_URL. The major
	drawback of the latter is that URLs in textual form can contain
	obfuscated access credentials, which makes them unusable for
	authentication.

	* include/mailutils/smtp.h (mu_smtp_set_url) (mu_smtp_get_url)
	(mu_smtp_set_secret,mu_smtp_get_secret): New protos.
	* include/mailutils/sys/smtp.h (_mu_smtp) <url>: New member.
	* libproto/mailer/smtp_secret.c: New file.
	* libproto/mailer/smtp_url.c: New file.
	* libproto/mailer/Makefile.am (libmu_mailer_la_SOURCES): Add
	new files.
	* libproto/mailer/smtp.c (smtp_open): Use mu_smtp_set_url to
	preserve URL credentials.
	* libproto/mailer/smtp_auth.c (_mu_smtp_fixup_params): Use
	smtp->url.
	* libproto/mailer/smtp_create.c (mu_smtp_destroy): Destroy
	smtp->url.
	* libproto/mailer/smtp_param.c (mu_smtp_set_param): Special
	handling for MU_SMTP_PARAM_URL.
	(mu_smtp_get_param): Likewise.

2012-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix quoted-printable and Q encodings.

	The Q encoding in RFC 2047 is not exactly the same as
	Quoted-Printable encoding: it differs in its handling of space
	characters (ASCII 32), which are encoded as underscores.

	* libmailutils/filter/qpflt.c (_qp_decoder): Use xd parameter
	to determine whether to treat underscores specially.
	(_qp_encoder): Likewise.
	(_qp_filter,_Q_filter): Allocate and initialize filter data
	accordingly to the kind of encoding.

2012-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Remove get_stream methods from folder and mailbox.

	* doc/texinfo/folder.texi: Update
	* include/mailutils/cpp/folder.h (Folder) <set_stream>
	<get_stream>: Remove.
	* include/mailutils/folder.h (mu_folder_get_stream)
	(mu_folder_get_streamref)
	(mu_folder_set_stream): Remove.
	* include/mailutils/mailbox.h (mu_folder_get_stream)
	(mu_folder_get_streamref)
	(mu_folder_set_stream): Remove protos.
	* include/mailutils/sys/folder.h (_mu_folder)<stream>: Remove.
	All uses updated.
	* libmailutils/mailbox/folder.c (mu_folder_set_stream)
	(mu_folder_get_stream,mu_folder_get_streamref): Remove.
	* libmailutils/mailbox/mailbox.c (mu_mailbox_get_stream)
	(mu_mailbox_get_streamref): Remove.
	* libmu_cpp/folder.cc (get_stream, set_stream): Remove.
	* libmu_scm/mu_mailbox.c (mu-mailbox-get-port): Remove.
	* python/libmu_py/folder.c (get_stream): Remove.

2012-05-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* configure.ac: Fix quoting in FriBidi test.

2012-04-29  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement a copy method in mailbox.

	This method copies given messages (indicated by their sequence
	or UID numbers) to the given mailbox. So far this is
	implemented only in IMAP[S] folders.

	The mh/inc utility uses this method to optionally move
	incorporated messages to other folder (mailbox) instead of
	simply deleting them.

	* include/mailutils/imap.h (mu_imap_response)
	(mu_imap_response_code): New protos.
	(MU_IMAP_CB_TAGGED_OK,MU_IMAP_CB_TAGGED_NO)
	(MU_IMAP_CB_TAGGED_BAD): New callback codes.
	* include/mailutils/mailbox.h (MU_MAILBOX_COPY_UID)
	(MU_MAILBOX_COPY_CREAT): New constants.
	(mu_mailbox_msgset_copy)
	(mu_mailbox_message_copy): New protos.
	* include/mailutils/sys/imap.h (resp_code): Rename to response
	to avoid confusion. All uses updated.
	(response_code): New member.
	(_mu_imap_process_tagged_response): New proto.
	* include/mailutils/sys/mailbox.h (_mu_mailbox) <_copy>: New
	member.
	* libmailutils/mailbox/Makefile.am (libmailbox_la_SOURCES): Add
	copy.c
	* libmailutils/mailbox/copy.c: New file.
	* libproto/imap/err.c (mu_imap_response): New function.
	(mu_imap_response_code): New function.
	* libproto/imap/mbox.c (_imap_copy_to_mailbox)
	(_mu_imap_mailbox_init): Implement _copy method.
	* libproto/imap/resplist.c (IS_LBRACE,IS_RBRACE): Fix macros.
	* libproto/imap/response.c (_mu_imap_response): Call
	_mu_imap_process_tagged_response to process tagged responses.
	* libproto/imap/resproc.c (parse_response_code): Bugfix:
	expected ']' was set off by one.
	(resptab)<code>: New member.
	(_mu_imap_process_tagged_response): New function. 
	* mh/inc.c (options, mh_option, opt_handler): New option
	--moveto.
	(move_to_mailbox): New variable.
	(main): If move_to_mailbox is set, move messages to that
	mailbox instead of deleting them.
	* mh/mh_getopt.h (mh_arg)<ARG_MOVETO>: New constant. 
	* NEWS: Update. 
	* include/mailutils/folder.h: Add a comment.
	* libmailutils/mailbox/folder.c: Minor formatting change.

2012-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* po/POTFILES.in: Remove xmalloc.c

2012-04-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Avoid using expr in tests with ulong as its argument.

	* configure.ac (MU_ULONG_MAX): Rename to MU_ULONG_MAX_1,
	decrease by one accordingly.
	* imap4d/tests/IDEF0955.at: Use MU_ULONG_MAX_1 instead of
	calling expr.
	* imap4d/tests/IDEF0956.at: Likewise.
	* imap4d/tests/atlocal.in: Define MU_ULONG_MAX_1.

2012-04-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* libproto/mailer/smtp.c (_smtp_set_rcpt): Assign rcpt_to a
	copy of the recipient address.
	* mail/util.c (util_header_expand): Make sure exp is always
	initialized.
	* mh/send.c (main): Process mtstailor before checking input
	files, so its settings affect creation of additional headers
	and addresses. In particular, this allows for setting the
	sender address in mtstailor.

2012-04-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix SMTP test on machines with IPv6 enabled.

	* testsuite/smtpsend.c: New assignment option `family=' to
	force using a specified interface family.
	* testsuite/smtp-msg.at: Force IPv4.
	* testsuite/smtp-str.at: Likewise.

2012-03-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	Revise some memory allocation routines.

	* examples/aclck.c: Check return values from strdup.
	* libmailutils/base/usremail.c: Likewise.
	* libmailutils/mailbox/bodystruct.c: Likewise.
	* lib/mailcap.c: Likewise.
	* libmailutils/mailbox/mbx_default.c: Likewise.
	* libmailutils/server/acl.c: Likewise.
	* libmailutils/stream/logstream.c: Likewise.
	* libmailutils/stream/message_stream.c: Likewise.
	* libmu_argp/mu_argp.c: Likewise.
	* libmu_auth/ldap.c: Likewise.
	* libmu_auth/pam.c: Likewise.
	* libmu_auth/sql.c: Likewise.
	* libmu_sieve/comparator.c: Likewise.
	* libmu_sieve/conf.c: Likewise.
	* libmu_sieve/extensions/list.c: Likewise.
	* libmu_sieve/extensions/vacation.c: Likewise.
	* libproto/mailer/prog.c: Likewise.
	* libproto/mailer/smtp_io.c: Likewise.
	* maidag/lmtp.c: Likewise.
	* python/libmu_py/address.c: Likewise.
	* sql/odbc.c 
	* examples/sfrom.c (main): Avoid unnecessary memory allocation.
	* libmailutils/mailbox/mailbox.c: Likewise. 
	* frm/frm.h: Include mailutils/alloc.h, remove xalloc.h
	* mh/mh.h: Likewise. 
	* imap4d/imap4d.h: Remove xalloc.h
	* mail/mail.h: Likewise.
	* mimeview/mimeview.h: Likewise.
	* mu/acl.c: Likewise.
	* readmsg/readmsg.c: Likewise. 
	* include/mailutils/locker.h
	(mu_locker_set_default_external_program): Change returned type.
	* include/mailutils/mailbox.h (mu_set_folder_directory): Change
	returned type.
	* libmailutils/base/locker.c
	(mu_locker_set_default_external_program): Return int (error
	code).
	* libmailutils/base/tilde.c: Add extra checks
	* libmailutils/mime/mimehdr.c (_mime_header_parse): Bugfix.
	* mail/folders.c: Don't use alloca, use mu_alloc instead. It
	was the only use of that function in Mailutils, so this change
	allows to withdraw the alloca module. 
	* gnulib.modules (alloca, malloc)
	(realloc, xalloc): Remove. 
	* frm/common.c: Use mu_alloc and friends instead of xmalloc.
	* frm/from.c: Likewise.
	* imap4d/append.c: Likewise.
	* imap4d/auth_gsasl.c: Likewise.
	* imap4d/authenticate.c: Likewise.
	* imap4d/fetch.c: Likewise.
	* imap4d/imap4d.c: Likewise.
	* imap4d/io.c: Likewise.
	* imap4d/list.c: Likewise.
	* imap4d/namespace.c: Likewise.
	* imap4d/parsebuf.c: Likewise.
	* imap4d/preauth.c: Likewise.
	* imap4d/rename.c: Likewise.
	* imap4d/search.c: Likewise.
	* imap4d/util.c: Likewise.
	* libmu_argp/muinit.c: Likewise.
	* mail/alias.c: Likewise.
	* mail/alt.c: Likewise.
	* mail/copy.c: Likewise.
	* mail/decode.c: Likewise.
	* mail/escape.c: Likewise.
	* mail/file.c: Likewise.
	* mail/from.c: Likewise.
	* mail/mail.c: Likewise.
	* mail/mailline.c: Likewise
	* mail/mailvar.c: Likewise
	* mail/msgset.y: Likewise
	* mail/page.c: Likewise
	* mail/send.c: Likewise
	* mail/shell.c: Likewise
	* mail/unset.c: Likewise
	* mail/util.c: Likewise
	* mh/folder.c: Likewise
	* mh/mh_alias.l: Likewise
	* mh/mh_alias.y: Likewise
	* mh/mh_fmtgram.y: Likewise
	* mh/mh_format.c: Likewise
	* mh/mh_global.c: Likewise
	* mh/mh_init.c: Likewise
	* mh/mh_list.c: Likewise
	* mh/mh_whatnow.c: Likewise
	* mh/mh_whom.c: Likewise
	* mh/mhn.c: Likewise
	* mh/pick.y: Likewise
	* mh/prompter-rl.c: Likewise
	* mh/refile.c: Likewise
	* mh/repl.c: Likewise
	* mh/send.c: Likewise
	* mh/sortm.c: Likewise
	* mimeview/mimetypes.y: Likewise
	* mu/dbm.c: Likewise
	* mu/dispatch.c: Likewise
	* mu/imap.c: Likewise
	* mu/pop.c: Likewise
	* mu/shell.c: Likewise
	* pop3d/apop.c: Likewise
	* pop3d/bulletin.c: Likewise
	* pop3d/popauth.c: Likewise
	* pop3d/user.c: Likewise

2012-03-24  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor changes.

2012-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix semantics of MU_IOCTL_SUBSTREAM.

	This also fixes e75e9123, which broke TLS support in daemons.

	* include/mailutils/stream.h (MU_IOCTL_TOPSTREAM): New ioctl.
	* imap4d/imap4d.c (set_strerr_flt)
	(clr_strerr_flt): Use MU_IOCTL_TOPSTREAM.
	* pop3d/pop3d.c: Likewise.
	* libmailutils/stream/fltstream.c (filter_ctl): Handle both
	MU_IOCTL_SUBSTREAM and MU_IOCTL_TOPSTREAM.
	* libmailutils/stream/iostream.c (_iostream_ctl): Likewise.
	* libmailutils/stream/logstream.c (_log_ctl): Likewise.
	* libmailutils/stream/xscript-stream.c (_xscript_ctl):
	Likewise.

2012-03-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes.

	* libmailutils/mime/mimehdr.c (free_param_continuation): Change
	return type to void.
	* mu/shell.c: Include muaux.h
	* libproto/imap/logout.c (mu_imap_logout): Logout is valid in
	any state, except MU_IMAP_SESSION_INIT.

2012-03-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve conversion between file mode and safety criteria and
	vice versa.

	* include/mailutils/util.h (mu_file_safety_code_to_name): New
	proto.
	* libmailutils/base/filesafety.c: Remove static functions which
	checked file mode bits. Use safety_checker.mode for that
	directly.
	(mu_file_safety_code_to_name): New function.
	(mu_file_mode_to_safety_criteria): Bugfix.
	(mu_safety_criteria_to_file_mode): Change algorithm.
	* libmailutils/tests/.gitignore: Update
	* libmailutils/tests/fsaftomod.at: New file.
	* libmailutils/tests/fsaftomod.c: New file.
	* libmailutils/tests/modtofsaf.at: New file.
	* libmailutils/tests/modtofsaf.c: New file.
	* libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add
	fsaftomod and modtofsaf.
	(TESTSUITE_AT): Add fsaftomod.at and modtofsaf.at
	* libmailutils/tests/testsuite.at: Include fsaftomod.at and
	modtofsaf.at

2012-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmu_dbm/berkeley.c (do_bdb_open): Fix typo.

2012-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add missing includes.

2012-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	mh: minor fix in reply formats.

	* mh/etc/replcomps: Format Fcc only if coming from myself.
	* mh/etc/replgroupcomps: Likewise.

2012-03-17  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement session ID for TCP/UDP servers.

	* imap4d/imap4d.c (set_strerr_flt,clr_strerr_flt): New
	functions.
	(imap4d_connection): Setup session prefix in strerr if
	mu_log_session_id is set.
	* imap4d/io.c (io_setio): Bugfix: unref debug stream.
	* pop3d/extra.c (pop3d_setio): Likewise.
	* pop3d/pop3d.c (set_strerr_flt,clr_strerr_flt): New functions.
	(pop3d_connection): Setup session prefix in strerr if
	mu_log_session_id is set. 
	* include/mailutils/acl.h (mu_acl_setenv)
	(mu_acl_getenv,mu_acl_set_session_id): New functions.
	* include/mailutils/server.h (mu_session_id): New extern.
	(mu_m_server_configured_count): Fix signature.
	* include/mailutils/syslog.h (mu_log_session_id): New extern.
	* libmailutils/diag/syslog.c (mu_log_session_id): New global. 
	* libmailutils/server/acl.c (_mu_acl) <envv,envc,envn>: New
	members.
	(run_closure) <env>: New member.
	(mu_acl_destroy): Free environment.
	(_acl_match): Handle "family" variable.
	(expand_arg): Propagate ACL environment to wordsplit.
	(mu_acl_check_sockaddr): Propagate ACL environment.
	(mu_acl_setenv)
	(mu_acl_getenv,mu_acl_set_session_id): New functions. 
	* libmailutils/server/ipsrv.c (mu_ip_tcp_accept): Store session
	ID in the ACL.
	(mu_ip_udp_accept): Likewise.
	* libmailutils/server/msrv.c (mu_m_server_configured_count):
	Fix signature.
	(mu_m_server_check_acl): Store session ID in the ACL.
	* libmailutils/server/server.c (mu_session_id): New global
	variable.
	(connection_loop): Increment session ID
	(mu_acl_set_session_id): New function.
	* libmailutils/stream/fltstream.c (filter_ctl): Handle
	MU_IOCTL_SUBSTREAM.
	* libmailutils/stream/logstream.c (_log_ctl): Likewise.
	* libmu_cfg/common.c (mu_logging_param) <session-id>: New
	statement.

2012-03-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix in smtp transport.

	* libproto/mailer/smtp.c (smtp_send_message): Filter out Fcc
	and Bcc headers.

2012-03-14  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix creation of Berkeley db files.

	* include/mailutils/util.h (mu_file_mode_to_safety_criteria)
	(mu_safety_criteria_to_file_mode): New protos.
	* libmailutils/base/filesafety.c (safety_checker) <mode>: New
	member.
	(file_safety_check_tab): Update.
	(mu_file_mode_to_safety_criteria)
	(mu_safety_criteria_to_file_mode): New functions.
	* libmu_dbm/berkeley.c (do_bdb_open): Create file prior to
	locking it.

2012-03-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	mail: Implement folder completion in "save"

	* mail/mailline.c (file_compl_internal): New function (from
	file_compl);
	(file_compl): Call file_compl_internal.
	(msglist_file_compl): Call file_compl_internal.

2012-03-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix the use of struct utmp/utmpx in comsatd.

	* am/utmp.m4: Check if struct utmp has ut_user or ut_name
	members.
	* comsat/comsat.c [HAVE_UTMPX_H]: Define UTMP as a typedef of
	struct utmpx. Define ut_user, if necessary.
	(find_user): Use ut_user instead of (backward-compatible)
	ut_name.

2012-03-09  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix compilation of pop3d and maidag without DBM.

	* maidag/Makefile.am: Load libmu_dbm.la if MU_COND_DBM is true.
	* pop3d/apop.c (pop3d_apopuser): Set owner, if specified in the
	config.
	* pop3d/pop3d.c (apop_database_owner)
	(apop_database_owner_set): New globals.
	(pop3d_cfg_param) <apop-database-owner>: New keyword.
	* pop3d/pop3d.h (apop_database_owner)
	(apop_database_owner_set): New declarations.

2012-03-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* mu/dbm.c: Include conditionally, depending on ENABLE_DBM.

2012-02-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix locking of Berkeley databases.

	* include/mailutils/locker.h (mu_locker_lock_mode): New proto.
	* libmailutils/base/locker.c (_mu_locker_lock): Rename to
	mu_locker_lock_mode. All callers updated.
	* libmu_dbm/berkeley.c (bdb_file) <locker>: New member.
	(do_bdb_open): New function. Lock the database file before
	opening it. Drop support for version 2.
	(_bdb_open): Rewrite as a wrapper over do_bdb_open.
	* mu/dbm.c (dbm_doc): Document the "dump" subcommand. 
	* NEWS: Version 2.99.96
	* configure.ac: Likewise.

2012-02-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix parsing local URLs.

	* include/mailutils/url.h (MU_URL_PARSE_LOCAL): New flag.
	* libmailutils/tests/url-parse.c (parse_kwtab): New flag
	"local".
	* libmailutils/tests/url.at: Add new tests
	* libmailutils/url/create.c (_mu_url_ctx_parse_host): Skip
	parsing host part if MU_URL_PARSE_LOCAL is set.
	(_mu_url_create_internal): Initialize rc. If MU_URL_PARSE_SLASH
	is set and URL begins with "./" assume it is file. If either
	MU_URL_PARSE_SLASH or MU_URL_PARSE_PIPE are given and the URL
	is diagnosed as file or pipe, prefer the scheme from hints.

2012-02-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes.

	* include/mailutils/Makefile.am: Add types to
	pkginclude_HEADERS.
	* libmailutils/tests/url-comp.at: Add missing dnl.

2012-02-20  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* mh/mhn.c (mhn_edit): Destroy output prior to unreferencing
	msg, because it may have been taken from it.

2012-01-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fix.

	* libproto/mailer/smtp.c (smtp_send_message): Fix typo.

2012-01-13  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in the testsuite.

	* testsuite/smtp-msg.at: Ignore output from kill.
	* testsuite/smtp-str.at: Likewise.

2012-01-11  Sergey Poznyakoff  <gray@gnu.org.ua>

	Assorted fixes.

	* libmailutils/mailer/mailer.c (mu_mailer_send_fragments): Fix
	3rd argument to _set_to.
	* libproto/mailer/smtp.c (smtp_send_message): SIZE capability
	can appear alone, without specifying maximum size.
	* mh/mh_whom.c (mh_alias_expand): Recreate domain part for
	addresses missing it.

2012-01-08  Sergey Poznyakoff  <gray@gnu.org.ua>

	Restore extra quoting in test mhn-store-pipe of
	mh/tests/mhn.at.

	Extra quoting is necessary because the argument includes
	unbalanced parentheses. It was first implemented in commit
	1b5098c9 on 2011-05-05, but was accidentally removed in commit
	1e33c774 on 2011-10-16.

2012-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix in the testsuite.

	* libmailutils/tests/url-comp.c (main): Initialize URL.

2012-01-05  Sergey Poznyakoff  <gray@gnu.org.ua>

	Happy GNU Year.

2011-12-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement SMTPS.

	* NEWS: Update.
	* include/mailutils/registrar.h (mu_smtps_record): New extern.
	(mu_register_all_mailer_formats): Register mu_smtps_record.
	* include/mailutils/sys/registrar.h (MU_SMTPS_SCHEME)
	(MU_SMTPS_SCHEME_LEN,MU_SMTPS_PORT): New defines.
	* libmailutils/address/address.c (mu_address_get_count): Don't
	count parts with NULL emails.
	(mu_address_contains_email): Validate email before comparison.
	(mu_list_copy): New static.
	(mu_address_union): Reuse last subaddress if its email is NULL.
	* libmailutils/base/nullrec.c (mu_smtps_record): New
	placeholder.
	* libproto/mailer/smtp.c (mu_smtps_record): New global.
	(smtp_open): Implement SMTPS 
	* mu/send.c: New file.
	* mu/Makefile.am (MODULES): Add send.c

2011-12-31  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add SMTP test.

	* examples/mta.c: Handle -bD option. Detach from the
	controlling terminal if -bd is given. Print pid and port number
	in this case.
	* testsuite/smtpsend.c: Fix handling of the trace= option.
	* testsuite/Makefile.am: Add new tests.
	* testsuite/smtp-msg.at: New test case.
	* testsuite/smtp-str.at: New test case.
	* testsuite/testsuite.at: Include new test cases.

2011-12-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix a bug in DOT decoder.

2011-12-30  Sergey Poznyakoff  <gray@gnu.org.ua>

	Improve msgset interface.  Use it in MH.

	* libmailutils/msgset/Makefile.am (libmsgset_la_SOURCES): Add
	new files.
	* libmailutils/msgset/addset.c: New file.
	* libmailutils/msgset/count.c: New file.
	* libmailutils/msgset/foreachmsgno.c: New file.
	* libmailutils/msgset/foreachuid.c: New file.
	* libmailutils/msgset/isempty.c: New file.
	* libmailutils/msgset/subset.c: New file.
	* libmailutils/msgset/trans.c: New file.
	* libmailutils/msgset/add.c (mu_msgset_add_range): Take fourth
	argument specifying the conversion mode. Translate numbers as
	necessary.
	* libmailutils/msgset/foreachmsg.c: Translate numbers as
	necessary.
	* libmailutils/msgset/foreachnum.c: Rewrite.
	* libmailutils/msgset/negate.c (_invert_range)
	(mu_msgset_add_range): Update calls to mu_msgset_add_range.
	* libmailutils/msgset/parse.c (parse_msgnum_env)<mode>: New
	member.
	(parse_msgrange): Update calls to mu_msgset_add_range.
	(mu_msgset_parse_imap): Change signature. All callers updated.
	* libmailutils/msgset/sub.c (mu_msgset_sub_range): Take fourth
	argument specifying the conversion mode. Translate numbers as
	necessary. 
	* imap4d/copy.c (imap4d_copy0): Update calls to
	mu_msgset_create and mu_msgset_parse_imap.
	* imap4d/fetch.c (fetch_thunk): Likewise.
	* imap4d/search.c (parse_simple_key): Likewise.
	* imap4d/store.c (store_thunk): Likewise.
	* include/mailutils/msgset.h (MU_MSGSET_NUM,MU_MSGSET_UID): New
	defines.
	(mu_msgset_add,mu_msgset_sub): New protos.
	(mu_msgset_add_range,mu_msgset_sub_range): Take 4 arguments.
	All callers changed.
	* include/mailutils/sys/msgset.h (_mu_msgset_translate_pair)
	(_mu_msgset_translate_range): New protos. 
	* libmailutils/tests/msgset.c: Reflect the above changes.
	* testsuite/msgset.c: Likewise.
	* libproto/imap/mbox.c: Update calls to mu_msgset functions. 
	* mh/mh.h (mh_msgset_t): Remove.
	(mh_iterator_fp): Remove typedef.
	(mh_msgset_parse): Change signature.
	(mh_msgset_member,mh_msgset_reverse,mh_msgset_negate)
	(mh_msgset_current,mh_msgset_free,mh_msgset_uids): Remove
	protos.
	(mh_msgset_parse_string): New proto.
	(mh_msgset_first_current,mh_msgset_first): New proto.
	(mh_iterate: Remove proto. Use mu_msgset_foreach* functions
	instead.
	(mh_seq_add,mh_seq_delete): Change signatures.
	* mh/mh_init.c (mh_iterate): Remove.
	* mh/mh_msgset.c: Rewrite using mu_msgset_t.
	* mh/mh_sequence.c: Likewise. 
	* mh/anno.c: Use new msgset functions.
	* mh/burst.c: Likewise.
	* mh/comp.c: Likewise.
	* mh/folder.c: Likewise.
	* mh/forw.c: Likewise.
	* mh/mark.c: Likewise.
	* mh/mhn.c: Likewise.
	* mh/mhpath.c: Likewise.
	* mh/mhseq.c: Likewise.
	* mh/pick.c: Likewise.
	* mh/refile.c: Likewise.
	* mh/repl.c: Likewise.
	* mh/rmm.c: Likewise.
	* mh/scan.c: Likewise.
	* mh/send.c: Likewise.
	* mh/sortm.c: Likewise.
	* mh/whatnowenv.c: Likewise.
	* mh/tests/mark.at: Reflect changes in the format of the saved
	sequences, which may contain ranges now. 
	* mu/imap.c: Update calls to mu_msgset functions.

2011-12-28  Sergey Poznyakoff  <gray@gnu.org.ua>

	msgset: implement "foreach" calls.

	* imap4d/copy.c (copy_env) <src>: Remove. Not needed now.
	(size_sum,do_copy): Change to a mu_msgset_message_action_t.
	(try_copy,safe_copy): Change signature; use
	mu_msgset_foreach_message.
	* imap4d/fetch.c (_fetch_from_message): Change to a
	mu_msgset_message_action_t.
	(imap4d_fetch0): Use mu_msgset_foreach_message.
	* imap4d/imap4d.h (imap4d_message_action_t): Remove typedef.
	(util_foreach_message): Remove. Use mu_msgset_foreach_message.
	* imap4d/store.c (_do_store): Change to a
	mu_msgset_message_action_t.
	(imap4d_store0): Use mu_msgset_foreach_message.
	* imap4d/util.c (util_foreach_message): Remove.
	* include/mailutils/list.h (mu_list_foreach_dir): New proto.
	* include/mailutils/msgset.h (mu_msgset_msgno_action_t)
	(mu_msgset_message_action_t): New typedefs.
	(mu_msgset_negate,mu_msgset_foreach_dir_msgno)
	(mu_msgset_foreach_msgno,mu_msgset_foreach_dir_message)
	(mu_msgset_foreach_message): New protos.
	* libmailutils/list/foreachdir.c: New file.
	* libmailutils/list/Makefile.am (liblist_la_SOURCES): Add
	foreachdir.c.
	* libmailutils/list/head.c (mu_list_head): Fix conditional.
	* libmailutils/list/tail.c (mu_list_tail): Likewise.
	* libmailutils/msgset/foreachmsg.c: New file.
	* libmailutils/msgset/foreachnum.c: New file.
	* libmailutils/msgset/negate.c: New file.
	* libmailutils/msgset/Makefile.am (libmsgset_la_SOURCES): Add
	new files.
	* libmailutils/msgset/getitr.c (mu_msgset_get_iterator): Call
	mu_msgset_aggregate before doing anything.
	* libmailutils/msgset/getlist.c (mu_msgset_get_list): Likewise.
	* libmailutils/msgset/locate.c (mu_msgset_locate): Likewise.
	* libmailutils/msgset/parse.c (parse_msgrange): Remove
	duplicated code.
	* testsuite/msgset.c: Implement -neg option.

2011-12-27  Sergey Poznyakoff  <gray@gnu.org.ua>

	Update TODO.

2011-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use mu_msgset_t in imap4d.

	* imap4d/util.c (util_parse_msgset): Remove. Use
	mu_msgset_parse_imap. All uses changed.
	(util_foreach_message): Change first argument to mu_msgset_t.
	All uses changed.
	* imap4d/imap4d.h: Likewise. 
	* imap4d/copy.c: Use mu_msgset_t
	* imap4d/fetch.c: Likewise.
	* imap4d/search.c: Likewise.
	* imap4d/store.c: Likewise.

2011-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Use mu_msgset_t in imap client for FETCH, STORE and COPY.

	* include/mailutils/imap.h (mu_imap_fetch,mu_imap_store)
	(mu_imap_store_flags,mu_imap_copy): Take mu_msgset_t as the
	message set parameter.
	* include/mailutils/imapio.h (mu_imapio_send_msgset): New
	proto. (mu_imapio_send_command_v,mu_imapio_send_command)
	(mu_imapio_send_command_e): Take additional mu_msgset_t
	parameter. All uses changed.
	* include/mailutils/msgset.h (mu_msgset_parse_imap): Input
	string is const.
	* include/mailutils/sys/imap.h (imap_command) <msgset>: New
	member.
	* libmailutils/imapio/sendmsgset.c: New file.
	* libmailutils/imapio/Makefile.am (libimapio_la_SOURCES): Add
	sendmsgset.c.
	* libmailutils/imapio/sendcmd.c (mu_imapio_send_command): Take
	additional mu_msgset_t parameter.
	* libmailutils/imapio/sendcmde.c (mu_imapio_send_command_e):
	Likewise.
	* libmailutils/imapio/sendcmdv.c (mu_imapio_send_command_v):
	Likewise.
	* libmailutils/msgset/parse.c (mu_msgset_parse_imap): Input
	string is const.
	* libproto/imap/copy.c (mu_imap_copy): Take mu_msgset_t as the
	message set parameter.
	* libproto/imap/fetch.c (mu_imap_fetch): Likewise.
	* libproto/imap/store.c (mu_imap_store): Likewise.
	* libproto/imap/storeflg.c (mu_imap_store_flags): Likewise.
	* libproto/imap/gencom.c (mu_imap_gencom): Send cmd->msgset.

2011-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfix.

	* libmailutils/mailbox/mailbox.c (_MBOX_CHECK_FLAGS): Fix
	return code.

2011-12-26  Sergey Poznyakoff  <gray@gnu.org.ua>

	Add functions for operations on message sets.

	* configure.ac: Build libmailutils/msgset/Makefile
	* include/mailutils/msgset.h: New file.
	* include/mailutils/Makefile.am (pkginclude_HEADERS): Add
	msgset.h
	* include/mailutils/mailutils.h: Include mailutils/msgset.h
	* include/mailutils/sys/msgset.h: New file.
	* include/mailutils/sys/Makefile.am (sysinclude_HEADERS): Add
	msgset.h
	* include/mailutils/types.hin (mu_msgset_t): New type.
	* libmailutils/Makefile.am (SUBDIRS): Add msgset.
	(libmailutils_la_LIBADD): Add libmsgset.la
	* libmailutils/msgset/Makefile.am: New file.
	* libmailutils/msgset/add.c: New file.
	* libmailutils/msgset/aggr.c: New file.
	* libmailutils/msgset/clear.c: New file.
	* libmailutils/msgset/create.c: New file.
	* libmailutils/msgset/free.c: New file.
	* libmailutils/msgset/getitr.c: New file.
	* libmailutils/msgset/getlist.c: New file.
	* libmailutils/msgset/locate.c: New file.
	* libmailutils/msgset/parse.c: New file.
	* libmailutils/msgset/print.c: New file.
	* libmailutils/msgset/sub.c: New file.
	* libmailutils/tests/msgset.at: New file.
	* libmailutils/tests/msgset.c: New file.
	* libmailutils/tests/Makefile.am (noinst_PROGRAMS): Add msgset.
	(TESTSUITE_AT): Add msgset.at.
	* libmailutils/tests/testsuite.at: Include msgset.at.
	* testsuite/msgset.c: New file.
	* testsuite/Makefile.am (noinst_PROGRAMS): Add msgset.

2011-12-25  Sergey Poznyakoff  <gray@gnu.org.ua>

	imap mbox: minor improvements.

	* libproto/imap/mbox.c: Add some debugging messages.
	(_imap_mbx_gensync): New function shared among _imap_mbx_sync
	and _imap_mbx_expunge. It aggregates message numbers with same
	flags to separate message sets, thereby reducing the number of
	STORE commands sent to the server.

2011-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Minor fixes in imap.

	* include/mailutils/imap.h (MU_IMAP_RESPONSE_UNKNOWN)
	(MU_IMAP_RESPONSE_TAGGED): New defines.
	* libproto/imap/mbox.c (_imap_mbx_open): Fix callback ID.
	* libproto/imap/response.c (_mu_imap_response): Call
	MU_IMAP_CB_BAD callback on tagged BAD responses as well.
	* libproto/imap/storeflg.c (mu_imap_store_flags): Insert space
	after item name.

2011-12-23  Wojciech Polak  <polak@gnu.org>

	Update the NEWS file.

2011-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Finish imap mailbox implementation.

	Some features are missing (notably, quick access), but overall
	the implementation offers all necessary features and performs a
	lot better than 2.x.

	Additionally, this commit fixes a minor bug in the imap4d
	implementation: the STORE command did not accept empty flag
	list.

	* NEWS: Update.
	* imap4d/store.c (store_thunk): Accept empty list as "items"
	argument. 
	* include/mailutils/imap.h (mu_imap_store_flags): New proto.
	* include/mailutils/imaputil.h (mu_imap_format_flags): Add new
	argument.
	* include/mailutils/sys/imap.h (_MU_IMAP_MSG_ATTRCHG): New
	flag.
	* libmailutils/imapio/flags.c: Accept three arguments, last one
	being a boolean flag specifying whether we want \Recent in the
	output.
	* libproto/imap/storeflg.c: New flag.
	* libproto/imap/Makefile.am (libmu_imap_la_SOURCES): Add
	storeflg.c.
	* libproto/imap/mbox.c: Finish the basic implementation. 
	* imap4d/sync.c: Update calls to mu_imap_format_flags.
	* imap4d/util.c: Likewise.
	* mu/imap.c: Likewise.
	* libmailutils/imapio/sendflg.c (mu_imapio_send_flags):
	Likewise.

2011-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement imap mailbox (read-only, so far).

	* include/mailutils/sys/imap.h (_mu_imap_mailbox_init): New
	proto.
	(_mu_imap_message,_mu_imap_mailbox): New structures.
	* libproto/imap/mbox.c: New file.
	* libproto/imap/Makefile.am (libmu_imap_la_SOURCES): Put back
	mbox.c
	* libproto/imap/fetch.c: Fix body/bodystructure parsing.
	* libproto/imap/folder.c (_mu_imap_folder_destroy): Close
	folder.
	(_mu_imap_folder_open): Implement STARTTLS.
	(_imap_record): Accept parameters in URL, use
	_mu_imap_mailbox_init to initialize mailbox.

2011-12-23  Sergey Poznyakoff  <gray@gnu.org.ua>

	Bugfixes in imap client.

	* libproto/imap/fetch.c (_fetch_fold): Fix parsing of BODY[].
	(_mu_imap_parse_fetch_response): Fix return value.

2011-12-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	mu imap: implement copy command.

	* mu/imap.c (com_copy): New function.
	(print_list_item): Treat 0 separator as '/' to avoid
	preliminary truncating the output.

2011-12-22  Sergey Poznyakoff  <gray@gnu.org.ua>

	Implement imap (client) bodystructure and envelope.

	* libmailutils/string/wordsplit.c (alloc_space): Fix
	reallocation calculations. 
	* imap4d/fetch.c (bodystructure): Output number of lines for
	any TEXT part, not only TEXT/PLAIN. 
	* include/mailutils/header.h (MU_HEADER_CONTENT_LOCATION): New
	define.
	* include/mailutils/imap.h (mu_imap_fetch_bodystructure):
	Implement.
	(mu_imap_fetch_envelope): Replace data fields with a single
	pointer to struct mu_imapenvelope.
	* include/mailutils/message.h: Include datetime.h
	(mu_imapenvelope, mu_bodystructure): New structs.
	(mu_message_type): New type.
	(mu_message_get_imapenvelope,mu_message_imapenvelope_free)
	(mu_message_set_imapenvelope)
	(mu_bodystructure_free,mu_list_free_bodystructure)
	(mu_message_get_bodystructure)
	(mu_message_set_bodystructure): New protos.
	* include/mailutils/mime.h (mu_mime_param_assoc_create)
	(mu_mime_param_assoc_add): New protos.
	* include/mailutils/sys/message.h (_mu_message)<_imapenvelope>
	<_bodystructure>: New methods.
	* libmailutils/mailbox/bodystruct.c: New file.
	* libmailutils/mailbox/imapenv.c: New file.
	* libmailutils/mailbox/Makefile.am (libmailbox_la_SOURCES): Add
	new sources. 
	* libproto/imap/fetch.c: Implement bodystructure.
	* mu/imap.c: Likewise. 
	* testsuite/bs.c: New file.
	* testsuite/Makefile.am (noinst_PROGRAMS): Add bs.

2011-12-21  Sergey Poznyakoff  <gray@gnu.org.ua>

	Fix API for obtaining full email address.

	Old API relied on passing a pointer to the buffer string and
	its size, which is defective. The new API, in addition to that,
	provides functions for obtaining a pointer to the statically
	allocated original value, a pointer to dynamically allocated
	copy, and a function for formatting the address directly to a